Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 03:30 14 Apr 2021 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : ArmmiteF4 firmware V5.07.00b1 - major upgrade

     Page 1 of 10    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 4738
Posted: 07:48pm 21 Feb 2021
Copy link to clipboard 
Print this post

Please find attached a major new release for the ArmmiteF4 for testing


ArmmiteF407.zip

This makes the following changes:

New display driver for the OTM8009A 800x480 3.97" displays . This was written by Gerry Allardice (disco4now) who is also working on a manual for the F4 so is deserving of huge thanks

Options are now stored in the 80 bytes of battery backed RAM in the F4's RTC freeing 16Kbytes of flash memory for additional features
VAR save now saves to the 4096 bytes of the F4's battery backed RAM freeing another 16Kbytes of flash. As a result LOAD and SAVE NVM have been removed as has function MM.BACKUP.
VAR SAVE can now be used as frequently as required without any risk of wearing out the flash memory

CSUBs are now available on the F4 as per the CMM2. The relevant header file is attached.

ARMF4CFunctions.zip

Full MATH command and function a la CMM2 (NB the original FFT command is now MATH FFT)
INC and CAT commands a la CMM2
SAVE IMAGE and LOAD IMAGE now have the optional parameters like the CMM2 (LOAD IMAGE = LOAD BMP)
BOUND function a la CMM2
SORT command a la CMM2
LOAD DATA and SAVE DATA a la CMM2
MID$ command a la CMM2
POLYGON command a la CMM2 replacing previous syntax
CHOICE function a la CMM2
GPS now accepts $GNGGA and $GNRMC as well as $GPGGA and $GPRMC
LONGSTRING command and functions now the same as CMM2 (SETBYTE, RESIZE, LGETBYTE added)

As I've mentioned previously the ArmmiteF4 is my favourite MMbasic port: faster than the MM+;, available as a very cheap ready-built board with battery backed RTC, SDcard, lots of I/O and even a flash chip; support for a wide range of LCD displays including a parallel connect ILI9341 that plugs directly onto the main PCB.


 
William Leue
Senior Member

Joined: 03/07/2020
Location: United States
Posts: 211
Posted: 07:55pm 21 Feb 2021
Copy link to clipboard 
Print this post

This looks like a great board for dedicated applications such as weather monitoring!

-Bill
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 1265
Posted: 08:36pm 21 Feb 2021
Copy link to clipboard 
Print this post

This is a great update, especially the larger, fast, inexpensive LCD (thanks, Garry). Love seeing so many CMM2 capabilities.

Any chance of fitting in JSON$ and FIELD$?

  William Leue said  This looks like a great board for dedicated applications such as weather monitoring!

Did you catch this post: F4 Weather Station
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1478
Posted: 10:04pm 21 Feb 2021
Copy link to clipboard 
Print this post

... and SWAP var1,var2?

easy enough to do with MMBasic but the speed of doing it in the firmware would be nice

Thanks for this update Peter. Looks great
Edited 2021-02-22 08:09 by CaptainBoing
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 4738
Posted: 10:41pm 21 Feb 2021
Copy link to clipboard 
Print this post

  Quote  Any chance of fitting in JSON$ and FIELD$?


FIELD$ is there already

The issue with JSON$ is the amount of heap needed to parse which can be huge. The download that Lewis does needs over 3Mbyte which we don't have.

I could include it but then we can expect the usual "what does out of memory mean?" questions.

  Quote  ... and SWAP var1,var2?


WTF for?
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 1265
Posted: 11:47pm 21 Feb 2021
Copy link to clipboard 
Print this post

  matherp said  The issue with JSON$  . . .


Well, if in legal matters, "hard cases make bad law", perhaps in the tech arena, "hard cases make for sub-optimal design".

Still, to me, it would be worth it for the many instances in which the heap would not be overrun (though I don't know at what point it would tip over). Will it handle what you get back as a default from openweathermap.org? For example,


{"coord":{"lon":-64.7155,"lat":44.0335},"weather":[{"id":802,
"main":"Clouds","description":"scattered clouds","icon":"03d"}],
"base":"stations","main":{"temp":278.94,"feels_like":269.44,
"temp_min":278.71,"temp_max":279.15,"pressure":1008,"humidity":56},
"visibility":10000,"wind":{"speed":10.29,"deg":240,"gust":14.92},
"clouds":{"all":46},"dt":1612635812,"sys":{"type":1,"id":549,
"country":"CA","sunrise":1612611013,"sunset":1612647345},
"timezone":-14400,"id":6057856,"name":"Liverpool","cod":200}

Edited 2021-02-22 09:52 by lizby
 
bigfix
Regular Member

Joined: 20/02/2014
Location: Austria
Posts: 92
Posted: 09:13am 22 Feb 2021
Copy link to clipboard 
Print this post

Maybe it would be possible to use a scratchpad area in the SD Card to overcome the limited RAM for huge parsing jobs

There are some SD Cards for Dashcams or any high write ratio application
They are specified for 15k hrs of HD video recording

i.e. SanDisk Max Endurance microSD card

They are also recommended in Raspberry logging environments and seem to last

If we use a larger card and use only a relatively small area, loadlevelling would further extend the lifetime of the SD card

As the access will be much slower, we could use the SD Scratchpad as an extension only if the internal RAM gets full

A system variable to show RAM usage would allow tweaking of programs for speed
But I would guess parsing weatherdata is not really timecritical

To avoid overusing "normal" SD cards, this should be off by default
Edited 2021-02-22 19:17 by bigfix
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 4738
Posted: 09:20am 22 Feb 2021
Copy link to clipboard 
Print this post

b2 attached with the JSON function - please test and let me know if it works for you


ArmmiteF407.zip
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 1265
Posted: 02:47pm 22 Feb 2021
Copy link to clipboard 
Print this post

  matherp said  b2 attached with the JSON function - please test and let me know if it works for you

Looks good to me:

 Dim integer ls%(2000)
 Open "livr.jsn" For input As #2
 Do While NOT Eof(2)
   Line Input #2, a$: ' Print a$
   LongString append ls%(),a$
 Loop
 Close #2
  LongString print ls%(): Print

 a$="name": b$="sys.country": Print a$+" "+JSON$(ls%(),a$)", "+JSON$(ls%(),b$)
 a$="coord.lon": Print a$+" "+JSON$(ls%(),a$)
 a$="coord.lat": Print a$+" "+JSON$(ls%(),a$)
 a$="weather[0].main": Print a$+" "+JSON$(ls%(),a$)
 a$="weather[0].description": Print a$+" "+JSON$(ls%(),a$)
 a$="main.temp": Print a$+" "+Str$(Val(JSON$(ls%(),a$))-273.15)+"C"
 a$="main.feels_like": Print a$+" "+Str$(Val(JSON$(ls%(),a$))-273.15)+"C"
 a$="main.temp_min": Print a$+" "+Str$(Val(JSON$(ls%(),a$))-273.15)+"C"
 a$="main.temp_max": Print a$+" "+Str$(Val(JSON$(ls%(),a$))-273.15)+"C"
 a$="main.pressure": Print a$+" "+JSON$(ls%(),a$)+" millibars"
 a$="main.humidity": Print a$+" "+JSON$(ls%(),a$)+"%"
 a$="wind.speed": b$="wind.gust": Print a$+" "+JSON$(ls%(),a$)+" gusting to "+
JSON$(ls%(),b$)


> RUN
{"coord":{"lon":-64.7155,"lat":44.0335},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"base":"stations","main":{"temp":278.94,"feels_like":269.44,"temp_min":278.71,"temp_max":279.15,"pressure":1008,"humidity":56},"visibility":10000,"wind":{"speed":10.29,"deg":240,"gust":14.92},"clouds":{"all":46},"dt":1612635812,"sys":{"type":1,"id":549,"country":"CA","sunrise":1612611013,"sunset":1612647345},"timezone":-14400,"id":6057856,"name":"Liverpool","cod":200}

name Liverpool, CA
coord.lon -64.7155
coord.lat 44.0335
weather[0].main Clouds
weather[0].description scattered clouds
main.temp 5.79C
main.feels_like -3.71C
main.temp_min 5.56C
main.temp_max 6C
main.pressure 1008 millibars
main.humidity 56%
wind.speed 10.29 gusting to 14.92
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 4738
Posted: 03:10pm 22 Feb 2021
Copy link to clipboard 
Print this post

That's good but the problem is that there is no protection for the C heap killing the C stack (STM doesn't support a mechanism) so with more complex JSON you could see any sort of error and not know why. I'll leave it in but it is definitely "buyer beware"
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 1265
Posted: 04:44pm 22 Feb 2021
Copy link to clipboard 
Print this post

Ok, thanks. Personally I feel it's worth the risk, but I guess the caveat should be stated for the JSON command in the manual. To bad there's no way to detect the failure.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 4738
Posted: 05:35pm 22 Feb 2021
Copy link to clipboard 
Print this post

OK I found a way to put some protection in. If there is an issue the firmware will force a software reset and print a relevant error


ArmmiteF407.zip
 
circuit
Regular Member

Joined: 10/01/2016
Location: United Kingdom
Posts: 82
Posted: 08:36pm 22 Feb 2021
Copy link to clipboard 
Print this post

@Matherp

Peter, just a note to say how much I appreciate your work on this board.  I reflect fully your comments about the usefulness and comprehensive connections incorporated into this board.  I invested in a dozen of the things for a range of projects and I am following this thread with great interest and even greater appreciation for the time that you are putting in.

I also await Gerry Alardice's  work on the supporting manual with much enthusiastic anticipation.  

Lots of thanks to both firmware originator and collaborating author.
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1354
Posted: 09:38pm 22 Feb 2021
Copy link to clipboard 
Print this post

Are there schematics for this board somewhere?
Micromites and Maximites! - Beginning Maximite
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 2354
Posted: 10:06pm 22 Feb 2021
Copy link to clipboard 
Print this post

Try schematic

aka

schematic actual

from
TBS page

John
Edited 2021-02-23 08:09 by JohnS
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 706
Posted: 03:30am 23 Feb 2021
Copy link to clipboard 
Print this post

@ matherp

I echo the thoughts of circuit. Thankyou

I updated an existing working project but it no longer likes MM.INFO$(SDCARD)
I get an Error : Syntax on this line Print "SDCard ";MM.Info$(SDCARD)

OA47
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1428
Posted: 08:07am 23 Feb 2021
Copy link to clipboard 
Print this post

If anyone wants to test a large data dump using json try this
it's the weather forecast for the next 10 days at my location and includes daily and hourly data
You'll need to do     Dim As integer a(16000) 'array a - this needs a large buffer because of the amount of data to be parsed   or similar as the data is huge

http://swd.weatherflow.com/swd/rest/better_forecast?api_key=20c70eae-e62f-4d3b-b3a4-8586e90f3ac8&station_id=10170&lat=53.439&lon=-2.106
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 4738
Posted: 08:12am 23 Feb 2021
Copy link to clipboard 
Print this post

Lewis

Won't work - first the array is bigger than the F4s memory, 2nd the amount of heap needed for parsing is vastly greater.

I used your test data to develop the code for the json parsing to die gracefully
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 4738
Posted: 10:16am 23 Feb 2021
Copy link to clipboard 
Print this post

  Quote  I get an Error : Syntax on this line Print "SDCard ";MM.Info$(SDCARD)


I removed it because the code wasn't really correct but I've put something back. Now you will get one of two status "Not present" or Ready"


ArmmiteF407.zip
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 838
Posted: 11:10pm 23 Feb 2021
Copy link to clipboard 
Print this post

An english version of the schematic


STM32F407VET6_schematic-english.pdf
... all the Maximites, almost all of the MicromMites, all the MM Extremes, all the ArmMites, and loving it!
 
     Page 1 of 10    
Print this page
© JAQ Software 2021