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 : Updating E100 program with an
Author | Message | ||||
LouisG Senior Member Joined: 19/03/2016 Location: AustraliaPosts: 121 |
|
||||
LouisG Senior Member Joined: 19/03/2016 Location: AustraliaPosts: 121 |
Am trying to update a MMBasic program for an E100 by using an SD card. The Micromite Plus and the Getting Started manuals state this can be done (and it's easy) but to me the explanation is a bit vague. I have two programs, MAIN.bas and TEST.bas. I wanted TEST to be resident in non-volatile program memory for occasional use and MAIN to be on the SD card to permit periodic updating. Both programs work fine separately. I had hoped to run TEST by removing the SD card and to run MAIN by inserting it. Is this possible? How can I achieve this? I didn't want the user to have to mess with a laptop, just to insert an SD card, as required. PS Please excuse the incomplete title! - |
||||
vegipete Guru Joined: 29/01/2013 Location: CanadaPosts: 1082 |
A few times I've thought it would be useful if an SD card could auto-run on power on. If a (perhaps) specially named file were on the card, it would automatically run, otherwise, the device would start as set by the options. Visit Vegipete's *Mite Library for cool programs. |
||||
LouisG Senior Member Joined: 19/03/2016 Location: AustraliaPosts: 121 |
Even if each program needed to be on a separate SD card that would be OK too. I included the command LOAD "MAIN.bas",R at the beginning of the resident TEST.bas file. It loaded and ran MAIN correctly but seemed to overwrite TEST, thereby making MAIN the new resident program. There was no way to get back to TEST. |
||||
phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 1781 |
As I understand the manual programs won't run directly from SD. To prevent TEST.BAS being overwritten turn it into SUB TEST then use LIBRARY SAVE. Then create SUB MM.STARTUP to automatically choose which runs at startup by calling TEST if FILES gives an error. Then save this to the library. This assumes there is enough program memory to hold both programs, as you have seen LOAD copies the file from SD to program memory. Another option is to just put the code for TEST.BAS in MM.STARTUP and save to the library, as I imagine that already tests for the presence of the SD card. . Edited 2022-06-24 09:22 by phil99 |
||||
Print this page |