![]() |
Forum Index : Microcontroller and PC projects : MM - Getting MMBasic Edits to the PIC
Author | Message | ||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 871 |
Hi. I only discovered MMBasic a few weeks ago and have just got it running. Congratulations to all involved. I joined TBS minutes ago and I have a fairly simple 1st query: I have a 28pin Micromite running "Super Clock.bas" , connected via a console to Tera Term. (I have a GPS providing the "$GPRMC" input). If I >List the program it is read from the PIC (Yes/no?). If I >Edit the program and, say, change Title(2) from "SYDNEY" to "MELB." and press F1 to save it, then >Run I'd hope/expect to see the LCD Backpack display to change (from "SYDNEY" to "MELB.") - it doesn't (I assume that the edit is not getting to the PIC). (I've tried resetting it etc.) If I then enter >print Title(2) I get "SYDNEY". If I again enter >Edit I see "MELB.". If I enter >List I see "MELB." (I would have thought that the listing was off the PIC and therefore it had made its way there??) If I enter >Title(2) = "MELB." and then >print Title(2) I get "MELB." (very strange!) All the while the LCD shows "SYDNEY". How do I get edits to the PIC? (The only way I can see to do it now is to use the PICKit3 to erase the chip, reprogram the original firmware, use Tera Term to transfer the ...fonts.bas file, set that to Library SAVE then transfer the amended "Super Clock v2.BAS" to the PIC). What am I missing? Many thanks, Andrew |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6269 |
Hi and welcome to the forum. It looks like you are editing the BAS file using the built-in editor so the amended file is definitely on the micromite. You shouldn't have to reprogram the pic to erase the BAS program. typing NEW you can also clear the library area if desired. You can edit the BAS file on your PC using any text editor (or MMedit) Sorry I can't tell you why your edits don't seem to work. Jim VK7JH MMedit |
||||
disco4now![]() Guru ![]() Joined: 18/12/2014 Location: AustraliaPosts: 1000 |
Hi Andrew, Do you edit line 67 i.e. Dim String Title(maxclocks) Length 14 = ("UTC/GMT","PERTH (WST)","SYDNEY (EST)","NEW YORK","PARIS","#6","#7","#8","#9","#10","#11","#12","#13","#14","#15","#16","#17","#18","#19","#20") or are you doing title(2)="Melbourne" You would need to edit the DIM statement to change the program. Regards Gerry Latest F4 Latest H7 FotS |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2932 |
Just to clarify: When you say List the program, and then Edit the program, are you editing the 'Listed' output? You need to go to the Editor (Type EDIT at the command prompt). Then change from Sydney to Melb within the editor. It maybe a 'silly' mistake of you changing the 'List'ing and assuming F1 will save the changes. You can only change the program from the editor (and then use F1 or F2). Hope this makes sense - and just need to clarify. . . . . ![]() PS Welcome onboard WW EDIT: I just tried the above in TT and it is not possible to 'change' the listing - hence this is probably not your issue. Some Console programs allow you to reposition the cursor and edit the screen content - but not TT settings on default. |
||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 871 |
Thanks Jim - it helps for it to be confirmed that it is not doing what it should. Now I can keep looking! Gerry, Thanks. I'm editing the line "Dim String Title( . . . #20") to change the value of Title(2) from "SYDNEY (EST)" to "MELB." , so there are no new variables just a different value for one string array entry. Thanks WW - I'm working on the program by entering "Edit" or "List" at the > prompt in Tera Term. In a very old thread there was reference to typing ? at the > prompt. I get nothing back - is this a clue? Thanks for your help, Andrew |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2932 |
Typing ? at the prompt is a 'quick' way of typing PRINT Just ? by itself will return 'nothing' However, type ? TIME$ will show the duration that the MM has been on (or since reset). |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9588 |
Hello and welcome. ![]() "Edit" and "List" are two totally different commands. "Edit" will invoke the internal code editor, where you can make your changes, then press F1 to save the changes and ESC to exit back to the command prompt - or press F2 to save AND run the changed code. "List" only lists the code on the screen, but does NOT let you change any of it. This was what WW was getting at above - if you are just using LIST to show the code on the screen, moving up with the arrow keys and making the changes, then coming back down again and typing RUN will no nothing and acheive nothing, as all you are changing, is what is LISTed on the screen. ![]() If you are using the editor by typing "Edit" then making your changes etc, then that should be working fine. Like any new platform, it takes time to learn it, and if you are very new to the MM, expect to trip over a few times at the start. ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 871 |
Hi Grogster (et al) - thanks for your support. It is sorted now but I don't yet know why - see below). Firstly, yes I was using EDIT to change the program, I LISTed it to show that the edit was there on the PIC (but I still can't see why it wasn't executing the amended title). Can someone please confirm that NEW deletes the program but not the core MMBasic or LIBRARY (with all the fonts on it) - this seems to be the case. This morning, spurred on by your support, I "NEW"ed the chip and played with the "Hello World" and LED examples on pages 11&12 - all good. I then XMODEMed the original Superclock.BAS file and "Edit"ed and saved it as before and it worked (i.e. displayed the amendments backwards and forwards). I don't believe that anything was different from all my efforts over the last 2 days. Whilst I'd like to know why - I am sort of happy to move on - my guess is that somehow the chip was slightly corrupted and that this was fixed by the NEW and reloading. Thanks for your welcomes and support. Andrew |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6269 |
Glad to see it working for you at last. Re NEW The library is safe. See page 44 of the manual "Special Functions and the Library" Jim VK7JH MMedit |
||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 871 |
Thanks Jim, Andrew. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |