![]() |
Forum Index : Microcontroller and PC projects : Micromite and Micromite Plus Beta 30
Page 1 of 3 ![]() ![]() |
|||||
Author | Message | ||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3292 |
Another beta (B30) for both the standard Micromite (MX170) and the Micromite Plus (MX470) is out. It can be downloaded from: http://geoffg.net/Downloads/Micromite/Micromite_4.7_Beta.zip (clear your browser cache first). The changes are listed in the file Changes.txt but the important ones are: - The LIBRARY feature has been modified to automatically run the code in the library space before the program in the main memory is run. This can be used to set constants and I/O pins which are normally cleared before a program is run. It will NOT be run at first startup as in the previous beta. The manual has been updated to reflect this behaviour. - At startup or reset MMBasic will now look for a subroutine with the name MM.STARTUP and, if found, the code in the subroutine will be run before the command prompt is displayed. This subroutine can be in the library space and can be used to replace the old LIBRARY functionality. The manual has been updated to document this feature (page 21). - OPTION LIST can be used to list all options that have been changed from their defaults and saved in flash. With these betas I have been concentrating on fixing the MX170 version and any important new features that it required - and I believe that with this beta it is mostly there. These changes have flowed through to the MX470 version (Micromite Plus) but now I plan to concentrate on the MX470 specific bug and feature list - so future betas should see improvements particular to that chip (such as the 100-pin version and the USB/Win10 issue). As before, please add comments to this thread if you find a bug. Geoff Geoff Graham - http://geoffg.net |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2944 |
Liking the OPTION LIST feature ![]() . . . and TEMPR ![]() |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2944 |
@Geoff Is there a way of MMBasic knowing when the COMMAND PROMPT is initiated (either after a program 'ends' OR when the EDITOR is exited? If so, then can there be a LIBRARY sub that gets called so that code can be run in this instance. Main purpose is to define pins with names that can be used at anytime from the command prompt. Likewise, a sub for when the editor is initiated. This way certain things can be set such as colours and font sizes. This is not a priority request - just an enquiry as to if it is possible and/or easy with near zero impact on memory/token limitations. WW EDIT: I always consider the MM as having three modes: 1>Command Prompt 2>Editor 3>Run mode. The above is just seeing if Library subs could be created for the initiation of the first two modes - obviously the Run mode can have user code to setup anything so no Library sub required for this one! |
||||
Chris Roper Senior Member ![]() Joined: 19/05/2015 Location: South AfricaPosts: 280 |
It was inevitable that someone would do this so I decided to jump in first ![]() [code] > list Sub mm.startup Print "Hello World!" End Sub > library save > Micromite MKII MMBasic Ver 4.7 Beta 30 Copyright 2011-2015 Geoff Graham Hello World! > [/code] I like it, thanks Geoff Cheers Chris http://caroper.blogspot.com/ |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2944 |
@Geoff, I have set OPTION SDCARD 12,14,33. However, OPTION LIST only shows SDCARD 12,14 Would you not expect to see 33 listed for the WP pin too? WW |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2944 |
@Geoff, If you have a library startup where you define COLOUR x,y to try and set foreground and background colours to something different than the default white on black, then upon MM starting up the colours revert back to white on black (I used CLS in start to effectively observe this). This implies that the MM.Startup sub is run prior to some firmware start-up things. Is there any reason why the MM.Startup can not run after the firmware stuff so that things like colours can be changed? You may have a 'technical' reason in which case ignore the above. However, if there was no reason, then I see the users MM.Startup being more beneficial if run 'last' i.e. just prior to the prompt showing (or program auto-running) |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2944 |
@Geoff, Sorry - I don't want to be seen as asking thousands of questions - but I am busy testing B30. Out of curiosity, with OPTION LIST, what sequence are you using to display them? I see it isn't the order they were set, nor alphabetical. No problem - just curious ![]() WW |
||||
Chris Roper Senior Member ![]() Joined: 19/05/2015 Location: South AfricaPosts: 280 |
not sure if it is me or if there is a bug in the EDITOR: if I edit I get this as soon as I press any key: ![]() I did try re-flashing with Beta 30 just in case I had corrupted anything but the problem persists with or without a library loaded and on any program I try to edit. The second issue is if I run it: ![]() Cheers, Chris http://caroper.blogspot.com/ |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2944 |
Chris, If you reboot and then type ? ds1 Does it show 7 or 0? Also - should be pin(ds1)=1 i.e. normal brackets! ![]() WW |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2944 |
@Geoff, With LIBRARY LIST, is it possible to add a 'press any key' message whenever the listing extends beyond the number of text-lines on the screen? Thanks |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2944 |
@Geoff Just used LIBRARY DELETE in B30 and got XMODEM RECEIVE message (then timed out). This was on the first time using LIBRARY DELETE. Second time worked ok |
||||
Chris Roper Senior Member ![]() Joined: 19/05/2015 Location: South AfricaPosts: 280 |
[code] > XMODEM RECEIVE Saved 226 bytes > library save > Micromite MKII MMBasic Ver 4.7 Beta 30 Copyright 2011-2015 Geoff Graham LPCDB Edition > ? ds1 0 > [/code] [quote] Also - should be pin(ds1)=1 i.e. normal brackets! ![]() WW[/quote] They are normal brackets, just the low res screen capture makes them look weird ![]() Basically the code runs as the message appears on reset but the constants are being cleared before the prompt loads. If I include pin(ds1) = 1 inside the mm.startup then the LED lights. Cheers Chris http://caroper.blogspot.com/ |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2944 |
@Chris, I get the same as you if CONSTs declared in MM.Startup i.e. they equal zero at command prompt after a re-boot. This must be a bug surely?? I am trying to get constants declared (for pin names) so that in Command prompt at any time, or in a user program, I can refer to the pin by a name rather than a number. If I don't use CONST (but just say ds=7) then I can get a solution apart from at the command prompt AFTER the editor is trigger. Hence my post above asking if other LIBRARY Subs could be created to trigger when Command prompt entered, or editor entered. WW EDIT: Could be the sequence of things as I also mention in an earlier post - would be better if MM.Startup runs AFTER the firmware has done it's stuff (i.e. just before the command prompt appears) |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10310 |
AFAIK this has always been the case, nothing to do with libraries or the new code, just the way Geoff designed it to work. CONST declared in a subroutine or function only have scope inside that function. For this reason when developing the early display drivers things that I wanted as constants but I also wanted to define in an initialisation subroutine had to be defined as DIM and not CONST |
||||
CFLY![]() Regular Member ![]() Joined: 20/05/2015 Location: FrancePosts: 41 |
Geoff, Jim With MMbasic V4.7 B30, MMEdit 3.6.4 and Micromite+ Explore64 (just received) connected by the USB: When I make: PUSH RESET SWITCH => card disconnected CPU RESTART => card disconnected OPTION LIST => card disconnected After, I disconnect the card, I restart MMEdit, and I redo the connection. Pb known? |
||||
Chris Roper Senior Member ![]() Joined: 19/05/2015 Location: South AfricaPosts: 280 |
That makes sense so I tried this: [code] Const ds4 = 4 Const ds3 = 5 Const ds2 = 6 Const ds1 = 7 Const sw1 = 16 Const rp1 = 26 Sub mm.startup Print "LPCDB Edition" setpin ds4, dout setpin ds3, dout setpin ds2, dout setpin ds1, dout setpin sw1, din setpin rp1, ain End Sub [/code] and the result is: > RUN > ? ds1 7 > library save > Micromite MKII MMBasic Ver 4.7 Beta 30 Copyright 2011-2015 Geoff Graham LPCDB Edition [LIBRARY] SetPin ds4, dout Error: Pin 0 is invalid > I must be misreading Geoff's notes but I certainly can't see a way of using Const and then setting up predefined pins at this stage. I have built a tray for the MicroMite that plugs into the Low Pin Count Demo Board and am trying to use this to define the LED's etc. in place of the #include file that I use for the PIC/12/16/18 devices in the same board. Cheers Chris p.s. anybody else having editor issues? I am having to edit external and then send the file which also hampers testing slightly ![]() http://caroper.blogspot.com/ |
||||
Chris Roper Senior Member ![]() Joined: 19/05/2015 Location: South AfricaPosts: 280 |
Tried this to get around the scoping issue: [code] ' LPCDB Include file Sub mm.startup Print "LPCDB Edition" setpin 4, dout setpin 5, dout setpin 6, dout setpin 7, dout setpin 16, din setpin 26, ain End Sub Const ds4 = 4 Const ds3 = 5 Const ds2 = 6 Const ds1 = 7 Const sw1 = 16 Const rp1 = 26 [/code] But the result is the same, even if I put the constants before or after mm.startup Cheers Chris http://caroper.blogspot.com/ |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2944 |
@Chris, We're both trying to do the same thing (naming pins). If you don't mind using DIM as opposed to CONST (or simply dropping the CONST prefix) then there is a 'partial' solution as I keep mentioning. Let's wait to see if Geoff (or someone else) can propose a method other than what we have posted/requested so far . . . ![]() |
||||
Chris Roper Senior Member ![]() Joined: 19/05/2015 Location: South AfricaPosts: 280 |
Thanks WW, I am also happy to wait, was just curious as Geoff specifically says to use Const in the MM Reference manual. I am stuck till the Editor works anyway :) Cheers Chris http://caroper.blogspot.com/ |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
Geoff may well be saying to use CONST as that is correct, but there might be a bug here - he will let us know. Watching this thread with interest. ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
Page 1 of 3 ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |