![]() |
Forum Index : Microcontroller and PC projects : Micromite MMBasic Ver 5.04.10 Beta
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
Azure![]() Guru ![]() Joined: 09/11/2017 Location: AustraliaPosts: 446 |
Not sure if you have seen it or if this SC Project is of any use (you will only be able to see a preview of it). |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5091 |
Dear Geoff, This is basically a feature request. For this MMBasic release could you think of a fix for te command line problem with defines in a library. I currently use a 170. 5.04.09. In MMBasic the chip pin no's are used to define the IO pin. In Maximite Basic the header pin no's are used to define an IO pin. If I want to put the 170 on a board, I will route the chip pins to header pins. My question is a possibility to translate the header pin number (i.e. H1) to the chip pin number (i.e. 26) that works in RUN mode, but aso in command line mode. I usually do a lot of prototyping on command line, try out things before I start writing the program. I would like to store these "translations" in a library, so they are available at cold boot. Regards, Volhout PicomiteVGA PETSCII ROBOTS |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2442 |
is this a bug, or just a case of GIGO (garbage in, garbage out): > Input "1) X10"+Chr$(13)+Chr$(10)+"2) VT200", a$ 1) X10"º†13)º†10)º"2) VT200 cheers, rob :-) |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2944 |
Check out the MicroMite User Manual and look at Library and especially read about MM.StartUp within the 'Special Functions and the Library' section (Pages 45 & 46 in v5.4 manual). This was something I needed in the very early development days of the Library feature and it seemed to work just fine (both at RUN time and at Command Prompt ![]() I do however remember that the Library feature was developed further after my initial tests so I hope this will still perform in the same way for you. WW |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5091 |
Hi WhiteWizzard, I tried with a little code in MM.STARTUP Sub MM.STARTUP Const H1=26 End Sub Did a library save (after deleting all libraries, so this is the only one in the library), checked with memory that there is actually a library (1k size) added, and rebooted the mx170. Then typed > print H1 0 That did not result in H1 getting a value in either commandline or in program run mode. Then I read the note in the MM.STARTUP section: So that is not an option. PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
Try this in the library Sub MM.STARTUP DIM INTEGER H1=26 End Sub |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5091 |
Hi matherp, When I try Sub MM.STARTUP DIM INTEGER H1=26 End Sub library save, and reboot then the result is commandline: print H1 gives 26 run a program: print H1 gives 0 library delete Sub MM.STARTUP CONST H1=26 End Sub library save, and reboot then the result is commandline: print H1 gives 0 run a program: print H1 gives 0 library delete Sub MM.STARTUP H1=26 End Sub library save, and reboot then the result is commandline: print H1 gives 26 run a program: print H1 gives 0 Using Micromite MKII MMBasic Ver 5.04.10 Beta 9 Copyright 2011-2018 Geoff Graham The latest.... PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
Just add a call to MM.STARTUP at the top of your program then H1 will be set after reset and in a program |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5091 |
you are correct, that works. The thing I do not understand is that it does not work with CONST H1=26 Using a CONST was great because it cannot be changed afterwards. It gives robustness and prevents double use of variables especially in larger programs. Remember, once it is saved in the library, the variables existence is invisible to the outside world (meaning commandline and the running program). Anyway, a solution is found.... Thanks you Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
Constants only have scope within the subroutine in which they are defined. Global constants are defined in the main program but that doesn't work with MM.STARTUP Use OPTION EXPLICIT and LOCAL and this protects you properly |
||||
PicFan Senior Member ![]() Joined: 18/03/2014 Location: AustriaPosts: 133 |
Try this: CONST H1 = 25 . . . Library save Rem main prog. print H1 reboot run Wolfgang |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5091 |
Result is the same. Works in the running program, But not from commandline... Volhout PicomiteVGA PETSCII ROBOTS |
||||
Azure![]() Guru ![]() Joined: 09/11/2017 Location: AustraliaPosts: 446 |
@Volhout What you are trying to do is not a part of the 5.04.10 Beta. It is the way MM Basic (and most other basic interpreters) normally work. This thread is supposed to be about new releases to beta 10 and testing the new features and changes in 5.04.10 Beta or if something is broken in this version that worked in previous verions. I think it would be better if you continued any new posts about this in a new thread as it relates to all versions and is a feature request. That way it can continue the discussion without taking this thread off topic. |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5091 |
Dear Azure, You are correct. Apologies. It started out as a feature request for this beta to Geoff. And resulted in a lot of well meant good advise for work arounds. Geoff, sorry I hijacked your thread. Let's focus on the features of 5.04.10 beta..... Regards, Volhout. PicomiteVGA PETSCII ROBOTS |
||||
PicFan Senior Member ![]() Joined: 18/03/2014 Location: AustriaPosts: 133 |
Ctrl-C MM-Edit Command line: print H1 25 |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
Pleased to be able to report that everything seems to work fine in this beta. I must say that I LOVE the new textbox qwerty layout. Having the DEL key on both pages of keyboard makes for nice easy backspace when you type something wrong. Also rather like the new cancel(Can) key. That too will be useful to have.(although, dealing with wrong input was easy enough once you touched Ent, but this is a nicer way to do it.) Smoke makes things work. When the smoke gets out, it stops! |
||||
disco4now![]() Guru ![]() Joined: 18/12/2014 Location: AustraliaPosts: 1003 |
out of memory errors when a string was passed to a SUB or FUNCTION An error fixed in 5.04.08 now appears in 5.04.09 and 5.04.10 Beta9 with MX170 chip. Change log for Micromite MMBasic Ver 5.04.08 Bug Fixes: * Corrected a bug which caused EXIT DO to skip the first line after the LOOP command. * Corrected a bug which caused EXIT FOR to fail if the whole FOR loop was on a single line (with colons as command separators). * Fixed a bug which could cause out of memory errors when a string was passed to a SUB or FUNCTION. The code below loops forever on 5.04.08 Running on 5.04.09 or 5.04.10 beta9 it fails with Error: Not enough memory on the third iteration of the loop The error showed up when I upgraded a larger program, but this code is enough to reproduce it. An LCD is not required, just an MX170 chip with MMMbasic. Can someone confirm they get the same thing. Regards Gerry Latest F4 Latest H7 FotS |
||||
Vito Newbie ![]() Joined: 11/10/2016 Location: AustraliaPosts: 17 |
Yes on version 5.4.1 Something is not freeing RAM after executing SUB. Place a memory statement after x=x+1 in DO loop, will print whats happening to RAM. Option Explicit DIM STRING cleartext DIM integer gain1(4)=(257,247,225,180,22) DIM integer x do x=x+1 Memory DisplayValue 300,134,"CH1 "+str$(gain1(0))+" "+str$(gain1(1))+" "+str$(gain1(2))+" "+str$(gain1(3))+" "+str$(gain1(4)) print x loop SUB DisplayValue x As integer, y As integer, s As STRING 'TEXT x,y,cleartext,CM,fStandard,,RGB(blue),RGB(blue) 'TEXT x,y,s,CM,fStandard,,RGB(white),cBGnd cleartext=string$(len(s)," ") END SUB |
||||
disco4now![]() Guru ![]() Joined: 18/12/2014 Location: AustraliaPosts: 1003 |
Hi Geoff, Here is another code snippet that runs OK under 5.04.08 but fails under 5.04.09 and 5.04.10 beta 9. It is using the longstring Cfunctions.Not sure if it is connected to out of memory error above or something different. It gives the following error > RUN 1 - 254 2 - 508 3 - 762 4 - CPU exception #6 (bus error on ifetch) at address 0x58585858 Processor restarted It originally came to light here Regards Gerry Latest F4 Latest H7 FotS |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3292 |
Thanks guys, both examples fail for me also. This is half the battle - getting something simple that demonstrates the problem. Now that I have this I can start chasing the cause. I will get back to you. Geoff Geoff Graham - http://geoffg.net |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |