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 : Micromite MMBasic V5.2 Beta 1
Page 1 of 3 | |||||
Author | Message | ||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3165 |
I have a new test version (V5.2 Beta 1) of the firmware for the Micromite and Micromite Plus. I believe that it is very close to the final V5.2 version but, because I have a couple of weeks before formally releasing, it I thought it worthwhile posting it here for anyone who would like to give it a try. It contains mostly bug fixes but there are a number of new features: - You can use the ON ERROR command to trap and manage errors including incorrect arguments, syntax errors, etc. - There are a number of extra features for CFunction authors. - On the Micromite Plus your program can use the MSGBOX() function to display a dialog box with customisable buttons. This is useful for error messages and the like. - On the Micromite Plus you can use the GUI PAGE command to quickly and easily switch between up to 32 different screen layouts, each with their own set of GUI controls. - Also on the Micromite Plus you can now disable, hide or even delete a control while it is active (ie, from within the touch down interrupt). Grogster should be happy Both the standard Micromite and the Micromite Plus versions can be downloaded from: http://geoffg.net/Downloads/Micromite/Micromite_5.2_Beta_1.zip Please report any bugs. Thanks. Geoff Geoff Graham - http://geoffg.net |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9070 |
Grogster IS happy - nice one. Above and beyond, Geoff, as you had already stated that I was technically doing things wrong, so I was quite prepared to change my code to comply. I was not expecting you to write a code-fix for my mistake.... I already have plans for the GUI PAGE command - that should be extremely handy for me, as I do need to have several different LCD layouts depending on menu choices etc, so that command sounds like it will make life much easier for me right from the off. I will ram the new beta into a spare MM+ and try some of the new features out! Smoke makes things work. When the smoke gets out, it stops! |
||||
kiiid Guru Joined: 11/05/2013 Location: United KingdomPosts: 671 |
That's great! I am particularly happy with the plus additions. Just wondering, have you kept the servo command from the latest test revision 5.1A which you sent me some time ago, because the one from 5.1 was not working properly? http://rittle.org -------------- |
||||
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2292 |
excellent work geoff just loaded the new version using pic32prog and it works well. i have spotted a few errors in the manual, should these be reported to this thread? they are small ones! a couple of ideas (do feel free to ignore): 1. remove TRON and TROFF as these are well and truely redundant, which would free up a couple of symbols. 2. it would be nice if ATAN() were added as an alias for ATN(), this largely for beginners and in teaching environments to keep consistency with ASIN() and ACOS(). the basic used by sharp in their pocket computers (PC1211, etc) used ATAN() and a couple of questions: how practical would it be for a custom function to be built that works similarly to VAL(), but that accepts an expression as the argument? that is, it effectively calls the command line with the expression passed in and returns the resultant string? such an expression might be "1+2" and would return 3. and a useful text file to provide for each version would be simply a list of ALL keywords, generated directly from the source code of mmbasic. if not too difficult to do, this would be both a useful check, as well as a guide for those wanting to investigate the language without needing to read through the whole user manual (plus i'd rather like to use such a list in creating an alternative help system). cheers, rob :-) |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1136 |
Thanks a lot Geoff! That's great! Especially the ON ERROR feature makes it more valuable. Strange: I hope this is a false alarm! I'm on it ... Uploading FontTweak.exe to Virus Total --> seems to be safe! Regards Michael |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3165 |
Yes Kon, the SERVO command in this is the same as the fixed version for you. Geoff Graham - http://geoffg.net |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3165 |
Rob, Yes, pls report any manual errors here. TRON and TROFF are targeted for destruction when I need the tokens. I will look at ATAN(). I'm not sure though that it is that important. Why would you want to resolve an expression in a string? I had on my todo list a similar request for a command that would execute code in a string and I could not see a need for that either. Remember MMBasic is about ease of use and neither sound easy. Actually it is very hard to extract all the keywords. I had to do it some time ago for someone and it took about a day - so I might pass on that one. Geoff Geoff Graham - http://geoffg.net |
||||
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2292 |
resolving an expression would be useful if one wished to use the micromite to create a calculator (pocket calculator or pocket computer), as one could leverage off the parser within the interpreter. it is something that is quite esoteric - i might be the only person who would use it - hence something best suited to a custom function. one neat use is to ask the user to enter an equation, and then produce a graph of it on the graphic LCD screen, much like a graphics calculator can. ATAN() would just be a nicety, something that would need to be near-zero cost to implement. just as TEMPR() is an alias for DS18B20(). i did fear extracting the list of keywords would be difficult. if it would be ok with you, i may request the source code at some time and do it myself, perhaps adding in some markers (as C comments) so an automated process could repeat the task? cheers, rob :-) |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3165 |
Rob, I have had a think about using string expressions and it would be very hard to do. The reason is that the execution engine only accepts a program that has been tokenised. So, your string would need functions, etc to be replaced with tokens. Not easy as the tokeniser routines are not geared to that task. Yes, please feel free to request the source and have a shot at it. Geoff Geoff Graham - http://geoffg.net |
||||
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2292 |
1. when referring to the colour LCD panel, the terms 'C/D' and 'D/C' are intermixed. one or other should be used consistently. my suggestion would be to instead use the term 'command pin' as this is more meaningful. 2. MM.ERRNO, under predefined variables (pg 51), should list all 3 means of clearing this: IGNORE, SKIP, and CLEAR (CLEAR is not mentioned here). (suggested possible syntax change: ON ERROR CLEAR could be replaced with CLEAR ERROR as ERROR is already a defined token). 3. (pg 65) replace: "'T_CS pin' and 'T_IRQ pin' are the Micromite I/O pins to be used for chip select and touch interrupt respectively (any free pins can be used)." with: "'T_CS pin' and 'T_IRQ pin' are the Micromite I/O pins to be used for the touch chip select and touch interrupt respectively (any free pins can be used)." (this just makes it a little clearer that the LCD and touch panel have different CS pins). btw, is the accuracy of CPU SLEEP n also improved on the 28-pin MX170 version? cheers, rob :-) |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3165 |
Yes it is. Geoff Graham - http://geoffg.net |
||||
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2292 |
excellent! by how much? this probably also wants updating in the user manual. the problem of evaluating an expression can, of course, be fixed by connecting two micromites together and using the second one as a co-processor. it is an idea i have mulled over before and may well re-visit. cheers, rob :-) |
||||
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2292 |
i've whipped up a small delphi program that does the following: 1. scans through the 'Source' directory tree for all *.h files 2. searches these .h files for lines containing -> a. an opening curly bracket, "{", and, -> b. a closing curly bracket, "}", and, -> c. one or more of T_INV, T_NA, T_CMD, T_OPER, T_FUN, T_FNA this is the result: 2016-05-14_163311_tokens.zip does this look like the complete list? is there anything else that should be included or excluded? cheers, rob :-) |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3673 |
Or use find ../Source -name '*.h' | xargs egrep '{.*T_(INV|NA|CMD|OPER|FUN|FNA).*}' John |
||||
Justplayin Guru Joined: 31/01/2014 Location: United StatesPosts: 309 |
5.2 seems to have significantly less RAM available... Anyway to get some of that back? Same exact code running on 5.1 and 5.2 with a MEMORY check at the same location: RAM: 47K (89%) 97 Variables 0K ( 0%) General 6K (11%) Free --------------------------- Firmware 5.2 Beta 1 RAM: 47K (94%) 97 Variables 0K ( 0%) General 3K ( 6%) Free [693] Function LTrim$(s$, c$) Error: Not enough memory I just spent a considerable amount of time squeezing the data into the arrays to insure the Mik-Matrix software will run on the Micromite170 with room to spare. Firmware 5.2 erases that effor by having at least 3K less RAM available. --Curtis I am not a Mad Scientist... It makes me happy inventing new ways to take over the world!! |
||||
redrok Senior Member Joined: 15/09/2014 Location: United StatesPosts: 209 |
Hi geoffg; I hope I'm not to late to make a suggestion. I followed a thread about the use of the internal Vref. I really would like to use External Vref for use with Diode type Temperature sensing. First, this type of measurement doesn't work well with a 3.3V reference range as the best resolution is like 2.5 deg C or so. Second, it is handy to have the reference voltages somewhere between gnd and 3.3V. The use of external reference voltages are restricted to only 2 pins on each chip type. I almost always use the 28pin chips which would be pins 2 & 3. I have been thinking of how to implement this and still have Legacy instructions work. This is the legacy instruction for the pins. SETPIN pin, cfg [, option] SETPIN pin, AIN Which is used for reading the voltage on this pin. There is no option for this and assumes the reference is 3.3V. My first suggestion would be: SETPIN pin, AIN [[[, B], M], N] As in Y=B + M*X + N*X^2 My second suggestion would have AIN select the External Vref pins: SETPIN pin, AINP [[[, B], M], N] As in Y=B + M*X + N*X^2 This selects the use of ExtVref pin 2 (on my 28 pin chip) SETPIN pin, AINN [[[, B], M], N] As in Y=B + M*X + N*X^2 This selects the use of ExtVref pin 3 (on my 28 pin chip) SETPIN pin, AINPN [[[, B], M], N] As in Y=B + M*X + N*X^2 This selects the use of ExtVref pins 2 & 3 (on my 28 pin chip) OK this might be pushing this to far. So How about just: SETPIN pin, AINP [, M] As in Y=M*X This selects the use of ExtVref pin 2 (on my 28 pin chip) SETPIN pin, AINN [, M] As in Y=M*X This selects the use of ExtVref pin 3 (on my 28 pin chip) SETPIN pin, AINPN [, M] As in Y=M*X This selects the use of ExtVref pins 2 & 3 (on my 28 pin chip) Or just leave the 3.3V factor in and I do the math afterwords: SETPIN pin, AINP This selects the use of ExtVref pin 2 (on my 28 pin chip) SETPIN pin, AINN This selects the use of ExtVref pin 3 (on my 28 pin chip) SETPIN pin, AINPN This selects the use of ExtVref pins 2 & 3 (on my 28 pin chip) And Lastly if we want to just use the internal 1.2V reference: SETPIN pin, AINI Duane |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8600 |
Duane I published a simple CFunction to do this in this thread. I assume it still works on 5.2 but if not let me know. As has also been previously discussed you cannot use the 1.2V reference to drive the ADC. The silicon does not have this capability; see page 203 of the PIC32MX170 reference manual |
||||
f1fco Senior Member Joined: 18/03/2012 Location: FrancePosts: 154 |
and also, I say a prayer to have the "option" 7 bits in the SERIAL command !!! thank you if it is possible, Geoff Pierre. 73s de F1FCO |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8600 |
Again not supported by the hardware; see page 181 of the manual referenced abov |
||||
piclover Senior Member Joined: 14/06/2015 Location: FrancePosts: 134 |
Wow, that v5.2 beta is GREAT ! Thanks a bunch, Geoff ! EDIT: Mmm... Again a "Error: Not enabled" during an I2C command issued after a RTC command got issued on an open I2C channel... Are you sure you fixed that bug ? This version also doesn't seem to allow pull up/down for FIN/PIN/CIN pins (and my trick of not resetting the pull up/down flag on SETPIN FIN/PIN/CIN invocation doesn't seem to be implemented either). Any way to get the sources so that I could patch those and use them for more tests ? |
||||
Page 1 of 3 |
Print this page |