![]() |
Forum Index : Microcontroller and PC projects : Micromite and Micromite Plus Beta 36
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3292 |
John, I will send you an email direct and see if we can sort it out. Geoff Graham - http://geoffg.net |
||||
sc05027 Newbie ![]() Joined: 01/01/2015 Location: Hong KongPosts: 10 |
I tested beta 36 for uM170, after I used "library save" to save some code (about 200 lines long) as library, I found about half of the code disappeared by viewing it using "library list". It looks like a bug, would Geoffg take a look please. |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3292 |
You did not say what went missing but the LIBRARY SAVE command is designed to remove extraneous spaces, blank lines, comments and the contents of CFunctions. It does this because they are not needed in the library and removing them saves on program flash. Geoff Geoff Graham - http://geoffg.net |
||||
sc05027 Newbie ![]() Joined: 01/01/2015 Location: Hong KongPosts: 10 |
Sorry I didn't state it clear. The code disappeared is not only the comment. The lower part of the code was cut as well. SC |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3292 |
Can you post a short example of the code and what happens to it? Geoff Graham - http://geoffg.net |
||||
sc05027 Newbie ![]() Joined: 01/01/2015 Location: Hong KongPosts: 10 |
Hi Geoff, Below is the copy of Tera Term VT screen. The code at the end was disappeared after "library save". I test some other code and the result was similar. This problem does not exist on Beta 32. Micromite MKII MMBasic Ver 4.7 Beta 36
Copyright 2011-2015 Geoff Graham > list ' scwong 20150726 ' micromite mk2 4.7 beta 23 ' ___ _ ___ ' RST(3v3)-|1 \_/ 28|-(3v3) ' Dig/Int/Ana-|2 M 27|-(Gnd) ' SPI Out/Dig/Int/Ana-|3 i 26|-Ana/Dig/PWM2A ' PWM1A/Dig/Int/Ana-|4 c 25|-Ana/Dig/SPI Clk ' PWM1B/Dig/Int/Ana-|5 r 24|-Ana/Dig/PWM2B ' PWM1C/Dig/Int/Ana-|6 o 23|-Ana/Dig ' Com1:En/Dig/Int/Ana-|7 m 22|-Dig/5V/Com1:Rx ' (Gnd)-|8 i 21|-Dig/5V/Com1:Tx # ' Com2:Tx/Int/Dig-|9 t 20|-(47uF Tant +) ' Com2:Rx/Int/Dig-|10 e 19|-(Gnd) ' 38400bps Console Tx-|11 18|-Dig/5V/Count/SDA # ' " Console Rx-|12 m 17|-Dig/5V/Count/SCL # ' (3v3 ie. 2.3V-3.6V)-|13 k 16|-Dig/5V/Count/Wakeup/IR ' SPI In/5V/Dig-|14 2 15|-Dig/5V/Count ' --------- ' CPU 10 Option explicit Dim integer setcoloron = 1 'set to 0 to disable color Dim integer mode = 0 Dim integer count = 0 Dim integer pattern(9) = (&h6f,1,2,3,4,5,&h42,7,8,&h71) ' 0-9 of sparkfun LED display SetTick 1 * 60 * 60 * 1000, refreshtime, 1 'every hour SetTick 500, everyhalfsec, 2 SetTick 50, chkinkey, 3 Dim key As string Open "COM1:9600" As #5 '7seg display using com mode refreshtime Do ' do nothing Loop Sub chkinkey Local string key = Inkey$ If key = "c" Or key = "C" Then setcoloron = 1 - setcoloron 'toggle 1, 0 EndIf If key = "f" Or key = "F" Then refreshtime EndIf End Sub Sub everyhalfsec Select Case mode Case 0 wholesec Case 1 halfsec Case Else 'do nothing End Select mode = (mode + 1) Mod 2 '0-1-2-3-0-1-... WatchDog 600 End Sub Sub refreshtime Local string oldtime = Date$ + " " + Time$ RTC gettime Print "Time refreshed! From " oldtime " to " Date$ + " " + Time$ Print Chr$(7); 'make some noise End Sub Sub halfsec Print #5, Chr$(&h77); 'decimal control Print #5, Chr$(&b00000000); 'clear colon End Sub Sub wholesec Local string t = Time$ setcolor count Mod 7 Print "color" count Mod 7 " "; setcolor 0 Print Time$ "," count Print #5, Chr$(&h79) + Chr$(0); 'cursor control, 0 = left most t = Left$(t,2) + Mid$(t,4,2) Local i As integer For i = 1 To 4 Print #5, Chr$(pattern(Val(Mid$(t,i,1)))); Next Print #5, Chr$(&h77); 'decimal control Print #5, Chr$(&b00010000); 'colon count = count + 1 End Sub Sub setcolor (i As integer) i = i Mod 8 Local code As string code = Chr$(27) + "[3" + Str$(i) + "m" 'escape code for VT100 If setcoloron Then Print code; EndIf End Sub Function DSGettemp() As float Local add11 As float Local add12 As float RTC getreg &h11, add11 RTC getreg &h12, add12 dsgettemp = add11 + add12/256 End Function > library save > library list CPU 10 Option explicit Dim integer setcoloron = 1 Dim integer mode = 0 Dim integer count = 0 Dim integer pattern(9) = (&h6f,1,2,3,4,5,&h42,7,8,&h71) SetTick 500, everyhalfsec, 2 SetTick 50, chkinkey, 3 Dim key As string Open "COM1:9600" As #5 refreshtime Do Loop Sub chkinkey Local string key = Inkey$ If key = "c" Or key = "C" Then setcoloron = 1 - setcoloron EndIf If key = "f" Or key = "F" Then refreshtime EndIf End Sub Sub everyhalfsec Select Case mode Case 0 wholesec Case 1 halfsec Case Else End Select mode = (mode + 1) Mod 2 WatchDog 600 End Sub Sub refreshtime Local string oldtime = Date$ + " " + Time$ RTC gettime Print "Time refreshed! From " oldtime " to " Date$ + " " + Time$ Print Chr$(7); End Sub Sub halfsec Print #5, Chr$(&h77); Print #5, Chr$(&b00000000); End Sub Sub wholesec Local string t = Time$ setcolor count Mod 7 Print "color" count Mod 7 " "; setcolor 0 Print Time$ "," count Print #5, Chr$(&h79) + Chr$(0); t = Left$(t,2) + Mid$(t,4,2) > SC |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3292 |
Thanks Stephen, that was a great help. This bug can easily screw up library code so I will put out a new version in a couple of days with this fix and a few others. I keep saying this but great thanks to everyone who is playing with the code - bug reports like this are a wonderful help. My test programs find a lot of them but there always seems to be the extra few that escaped. Geoff Geoff Graham - http://geoffg.net |
||||
kiiid Guru ![]() Joined: 11/05/2013 Location: United KingdomPosts: 671 |
Geoff, this is probably a funny one, but I wanted to ask anyway. Would it be too hard for you to implement a way for multi-line commentaries in the source? A well commented source is very important, especially for learners and building their style, and having the ' as only option is not really welcoming that practice. I have felt it myself with my own sources. Thanks http://rittle.org -------------- |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3292 |
OK, that is an interesting one. When I am working in C I almost always use comments that comment out one line (ie, //) even though C has multi-line comments. So I never thought about multi-line comments for BASIC. There are a few hurdles; the first is that Bill Gates never set a standard for this type of feature (for example, the apostrophe (') as a comment character came from him) and BASIC is very line orientated which makes multi-line structures difficult. This will require some thought. Geoff Graham - http://geoffg.net |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2442 |
hi geoff, given that the 4.7 code is getting close to being 'final', is there any chance that we might see a way (on the MX170 in particular) to switch over to using the internal bandgap reference (instead of AVcc) in analog reads? being able to do this while at the same time returning unscaled values in the 0 - 1023 range (only when internal bandgap is selected) would be brilliant for a set of applications i have in mind. cheers, rob :-) |
||||
disco4now![]() Guru ![]() Joined: 18/12/2014 Location: AustraliaPosts: 1003 |
Hi Geoff, Just a revisit about the possibility to use an interrupt on the touchdown for LCD on the MX170. I am working around it by tying the T_IRQ pin to another pin (say T_IRQ2) and issuing the interrupt against that pin .e.g. setpin T_IRQ2,INTL,readtouch
This allows you to only scan for a touch when one is there. Another use is where you want to reduce power by turning the back light off and setting CPU to say 5 MHz. This is OK as long as you get back to 20MHz before you try to talk to the LCD or Touch.If you have an interrupt you can get back to speed before reading the touch. It would be good to be able to use the interrupt and save the use of the additional pin. regards Gerry The quote below is from discussions after the initial Beta release. Latest F4 Latest H7 FotS |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Geoff, I remembered you were thinking about making more of a division between an embedded version and a computer version. Maybe that time arrived. If it were up to me i would remove the editor from the 150/170 version as there is a perfectly good editor for it on most pc platforms (MMEdit). This could free up more space for functionalities that enhance the capabilities. The more i use the 170 version of the chip the less i use the internal editor. Once programs getting bigger then 2-3 pages of code i find the internal editor slowing me down a lot, so much so that i not use it anymore because of that. What i do use is the command line. Very easy to just set a pin or do a quick for next loop in a single line of code. Instead of the full screen editor maybe a single line editor is a good compromise. With up/down arrow to go through the last commands. Starting from scratch on a pc i even found that people get MMEdit to work quicker then TeraTerm (Less setup). And as you at least need one of those to work with the micromite i now instruct people to start with MMEdit. Microblocks. Build with logic. |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2944 |
Personally I would ask if Geoff would supply two versions, one with the editor, and one without. This is off course assuming it is reasonably easy to maintain the two versions. Or can the one including the Editor be the 'master' which is maintained, and then on each release he then strips it out to create the 'non-editor' version? I think from history that there are as many people wanting the editor left in, as there are people not wanting it included. At the end of the day, the editor is useful in certain situations (i.e. quick field repair) so to totally remove it would upset some people! WW |
||||
jman![]() Guru ![]() Joined: 12/06/2011 Location: New ZealandPosts: 711 |
Hi Jim I for one would not agree I use the internal editor most of the time and losing it would take away a feature that puts the Mites far ahead of the rest Regards Jman |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2944 |
@jman - Nice Avatar! ![]() |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
To use the internal editor you need a PC running a terminal program. As such it would just as easy to start MMEdit. There is no advantage. he difference is only you double click the teraterm icon on your pc or the MMedit icon. With the MM+ however the LCD will/can be the 'monitor'. Same as with the Maximite and ColorMaximite. But that is the distinction between the 'embedded' and 'computer'. On those having the internal editor is great! I only bring it up because flash is running out and very use full features can not be added. The choice is either have those extra features that can have no alternative or remove the editor and use an alternative like MMEdit/Notepad/Xmodem etc. Microblocks. Build with logic. |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2944 |
Or a VT100 terminal (i.e. not a PC)! ![]() This is just one feature that makes it so powerful to many people. I agree with you about the space; it just has to be accepted that you can't satisfy everyone's needs with just one solution. . . . WW |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Or a VT100 terminal (i.e. not a PC)! ![]() This is just one feature that makes it so powerful to many people. WW I have been known to use my phone as a terminal. (No I am not going to produce MMEdit for Android) Jim VK7JH MMedit |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2944 |
How about iOS then ![]() ![]() |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
I would expect that if you want more features, you use the MM+ in either 64 or 100 pin flavours. The 28's will be for less intensive tasks. I would not expect that Geoff would be adding much more to the 170 series for exactly the reasons you indicate - lack of flash. The 470 does not have the same problems there. Perhaps as simple as: "You need the advanced features? Use the MM+." ![]() You might have space constraint reasons for wanting the 28's. In that case, you might be stuck or in need of a PCB redesign.... ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |