![]() |
Forum Index : Microcontroller and PC projects : Armmite F4: programming the firmware
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
Plasmamac![]() Guru ![]() Joined: 31/01/2019 Location: GermanyPosts: 570 |
Hi, sry its a typo . its PA4 ! But is the Routine working for you and what about the 'interrupt'? Plasma |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6210 |
I have had a closer look. Pin PA4 is sending out a nice 50Hz sine wave. There does seem to be a problem with the TRIGGER. If you leave the test signal permanently connected to the ADC, it never triggers. You have to physically open circuit the connection. When the connection is re-made, the trigger occurs but it is difficult to see what level causes the trigger. Hope that makes sense... Jim VK7JH MMedit |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 9999 |
There are now two known issues with the latest release: FLAC files play but the command prompt never comes back Triggering of the ADC is not set up correctly Hopefully I'll get to these over the next week or so |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 9999 |
Please find attached V5.05.09 This fixes the Triggering of the ADC and the problem with FLAC files playing ArmmiteF4.zip My test file for the ADC - connect PA4 to PC0 initProg readv End ' Sub InitProg NumSamples = 128 Freq = 50 * NumSamples Print "Frequency is ",freq,"Hz" Dim Volt_Raw!(NumSamples - 1) ' 'create a sine wave with 4 times the frequency of the ADC sampling frequency 'this ensures the value will move between samples under all circumstances ' Dim d%(NumSamples*4-1) For i=0 To (Numsamples*4-1) d%(i)=2048+1800*Sin(Rad(i*360/(Numsamples*4))) Next i DAC start freq*4,d%(),d%() End Sub ' Sub ReadV Local i ADC OPEN Freq,15 ADC trigger 1,-1.65 ADC START Volt_Raw!() Print "Idx";Tab(8);"Volts(Idx)";Tab(24);"Delta" For i = 1 To (NumSamples - 1) Print i;Tab(8);Str$(Volt_Raw!(i-1));Tab(24);Str$(Volt_Raw!(i)-Volt_Raw!(i-1)) Next i Print i;Tab(8);Str$(Volt_Raw!(i-1)) ADC CLOSE End Sub |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3299 |
Thanks. Could you also include the hex file? PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 9999 |
You don't need the hex file. All normal ways of programming can work with the .bin unless you know different? |
||||
Chopperp![]() Guru ![]() Joined: 03/01/2018 Location: AustraliaPosts: 1088 |
Had a bit of a play with one of my F4's. Worked well after a couple of attempts to upgrade the firmware. (Eventually took the display off) Bit more to learn about the F4 sometime. Thanks matherp ChopperP |
||||
Plasmamac![]() Guru ![]() Joined: 31/01/2019 Location: GermanyPosts: 570 |
Hi, Flac play works fine . ADC Trigger voltage is working also but i have a Problem with. i need the raw ADC data without triggering because i will sample unknown Data in realtime . Even the interrupt isnt working. maybe someone can me help here. mfg Plasma |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 9999 |
Duh.... Sorry - broke the interrupt Try this: ArmmiteF4.zip Test code, just remove the trigger line if you don't need it initProg readv End ' Sub InitProg NumSamples = 128 Freq = 50 * NumSamples Print "Frequency is ",freq,"Hz" Dim Volt_Raw!(NumSamples - 1) ' 'create a sine wave with 4 times the frequency of the ADC sampling frequency 'this ensures the value will move between samples under all circumstances ' Dim d%(NumSamples*4-1) For i=0 To (Numsamples*4-1) d%(i)=2048+1800*Sin(Rad(i*360/(Numsamples*4))) Next i DAC start freq*4,d%(),d%() End Sub ' Sub ReadV Local i ADC OPEN Freq,15,,,done ADC trigger 1,-1.65 ADC START Volt_Raw!() Do Loop While f%=0 ADC CLOSE End Sub Sub done Print "Idx";Tab(8);"Volts(Idx)";Tab(24);"Delta" For i = 1 To (NumSamples - 1) Print i;Tab(8);Str$(Volt_Raw!(i-1));Tab(24);Str$(Volt_Raw!(i)-Volt_Raw!(i-1)) Next i Print i;Tab(8);Str$(Volt_Raw!(i-1)) f%=1 End Sub |
||||
Plasmamac![]() Guru ![]() Joined: 31/01/2019 Location: GermanyPosts: 570 |
hi, thx Matherp ![]() ![]() btw : thx again :) MINI DEMO Edited 2019-11-06 06:26 by Plasmamac Plasma |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 9999 |
Nice demo ![]() Thanks for posting |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 9999 |
Minor update to include cursor positioning in the editor with a mouse as per the MM+ ArmmiteF4.zip |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 9999 |
Another small update I've enabled the 4096 bytes of RAM that the F407 has in the RTC domain and that can be kept alive by the RTC battery. This is proper RAM so can be written and read as many times as you want and as quickly as you want and the values are still there on power up (assuming you have a battery installed) ArmmiteF4V5.05.10.zip New function MM.BACKUP – this just returns the address of the battery backed RAM to avoid remembering it - &H40024000 Then just use PEEK AND POKE, remember peek and poke now support INTEGER and FLOAT (8 bytes each and must be on 8 byte boundary) as well as WORD (4-byte boundary) and BYTE Example: POKE FLOAT MM.BACKUP+16, 72.345 Power off, then power on ? PEEK(FLOAT MM.BACKUP+16) 72.345 > In addition another change that gives access to the 80 bytes of battery backed memory in the RTC. This has two new sub commands: SAVE NVM string$ LOAD NVM string$ These commands read and write a string up to 80 bytes in length to battery backed memory in the RTC e.g. A$="1234567890" save nvm a$ power off, then power on load nvm a$ ‘a$ created if not already defined print a$ You can of course use BIN2STR$ and STR2BIN to format numbers for saving and restoring. The data is saved in the battery backed memory as long as VBAT is powered. 80 bytes is the total size of the RTC battery backed memory, attempting to save a string longer than 80 bytes will give an error |
||||
Plasmamac![]() Guru ![]() Joined: 31/01/2019 Location: GermanyPosts: 570 |
Hi , Matherp s it possible to implement a new Command ala : SHA dir,start,length Shift Array direction,startposition,lenght or endposition? I playing a lot with the ws2812 LED command and need speed up this to move the colours faster. also is where any code for the nrf by using the onbord socket on the f4 board. and my last whish : a software serial for small baudrates :300,1200 or universal. and a mod player routine and mp3 play routine and and and ...... ![]() thx for reading Edited 2019-11-10 06:45 by Plasmamac Plasma |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 9999 |
Use the ArmmiteH7 ArmmiteF4 flash is full so no chance of MOD, MP3 or other enhancements |
||||
Chopperp![]() Guru ![]() Joined: 03/01/2018 Location: AustraliaPosts: 1088 |
MM Edit Chat Problem with above version (ArmmiteF4V5.05.10) Jim / Peter Basic programs load OK from the main MMEdit program & stops OK from the Chat window but > prompt does not come up. If I set the time (from Chat) I get the time & date & the > prompt back but ? D is missing from ? DATE etc "Run" works but no prompt then I end up with the error shown below Error: 9 Subscript out of rang:-996, VTscreen$() Everything appears to work OK in Tera Term. Reverting back to the previous version brings the Chat window back to normal operation. Also, when I first fired it up after the upgrade, I found that the TIME$ command was giving milli-seconds as well. This has since reverted back to the normal format. Also the following additional OPTIONS were listed but have subsequently disappeared with reloading the firmware. OPTION CONTROLS -2 OPTION USBKEYBOARD, -1 OPTION RTC CALIBRATE -1 Any clues?? Brian ChopperP |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 9999 |
All options are reset after flashing. You should see OPTION LCDPANEL ILI9341_16, RLANDSCAPE OPTION TOUCH PB12, PC5 Sounds like it may not have flashed properly. Try re-flashing the latest version but do a full chip erase first and make sure the screen is not mounted (or anything else connected) when you flash the chip. |
||||
Chopperp![]() Guru ![]() Joined: 03/01/2018 Location: AustraliaPosts: 1088 |
Just did an erase & reflash as suggested. Options OK but still have the MM Chat problems. ChopperP |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6210 |
I will look at the MMEdit problems when I get back home in a couple of days. I expect that it is a timing issue. Jim VK7JH MMedit |
||||
Chopperp![]() Guru ![]() Joined: 03/01/2018 Location: AustraliaPosts: 1088 |
Thanks Jim Brian ChopperP |
||||
![]() ![]() ![]() ![]() |
![]() |