![]() |
Forum Index : Microcontroller and PC projects : Micromite V4.5D for the MX150 and MX170
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
G8JCF![]() Guru ![]() Joined: 15/05/2014 Location: United KingdomPosts: 676 |
What actual chip are you running MMBasic on ? Try this on your uMite Print "MMBasic version=";MM.ver print "Platform=";MM.device$ print "Device ID="; for I=3 to 0 step -1 print hex$(peek(&hbf80,&hf220+i)); next Print "Memory" memory when run on a 28 pin 170F the output is > RUN MMBasic version= 4.0504 Platform=Micromite Device ID=2661053 Memory Flash: 0K ( 0% of 58K) Program (9 lines) 0b ( 0% of 1536b) 0 Saved Variables RAM: 0K ( 0%) 1 Variables 0K ( 0%) General 54K (100%) Free > when run on a standard 28 pin 150F the output is RUN MMBasic version= 4.0503 Platform=Micromite Device ID=14D06053 Memory Flash: 0K ( 0% of 20K) Program (9 lines) 0b ( 0% of 1536b) 0 Saved Variables RAM: 0K ( 0%) 1 Variables 0K ( 0%) General 22K (100%) Free > 73 Peter The only Konstant is Change |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3303 |
Thanks Peter and Rob (who emailed me) for confirming that the MX170 28-pin chip works. I will post the upgrade on my website ASAP. No, it is still 32. Because so many people were waiting on the 170 version my intention was just to get it out the door with the minimum of delay. I now plan to go through the interpreter and tweak it to take more advantage of the 170's increased memory and add some new features. I have quite a few items on my todo list including 64 bit integers (but no guarantees there). This will take at least a couple of months and then I can release the new 170 version as V4.6. Geoff Geoff Graham - http://geoffg.net |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9641 |
Does that mean you have to re-write for Harmony or do you have another clever idea up your sleeve to get around that? Smoke makes things work. When the smoke gets out, it stops! |
||||
G8JCF![]() Guru ![]() Joined: 15/05/2014 Location: United KingdomPosts: 676 |
@Geoff ![]() Thanks for getting 4.5D released so quickly despite the (Microchip) obstacles ! Peter The only Konstant is Change |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4071 |
A quick note to anyone still worried about damaging a PIC32 during programming. Unlike earlier PICs, PIC32 are flashed using only low voltages. There's no Vpp at 13V or the like. It's all 3V3 logic levels. The danger of damage would be using an old-style circuit - so don't. ICSP is a variant of JTAG / EJTAG, and just drives a number of state machines. Unless you're using an OTP part (who is?), if programming fails you just erase & do it again. John |
||||
ajkw Senior Member ![]() Joined: 29/06/2011 Location: AustraliaPosts: 290 |
re DS18B20 & 4.5D Geoff, Why does a connection error with a DS18B20 have to cause a inglorious return to the command prompt? I would have thought a returned value of -127 (or other out of range number) can be discretely tested for and dealt with within a running program instead to having to try catch and somehow deal with with a watchdog. Anthony. |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Would it be hard to have a ON ERROR NEXT available in MMBasic? I used that a lot in (GW)Basic when working with floppy files (like current SD card access), serial communication (Network) etc. Every error that occurs is then captured and execution continues on the next statement. An Err variable then holds an Error code so you would be able to decide what to do. Dropping into command mode has only one choice and that is using a watchdog to restart the program. Often errors can be handled more gracefully. What do you think Geoff, would that be possible? Microblocks. Build with logic. |
||||
G8JCF![]() Guru ![]() Joined: 15/05/2014 Location: United KingdomPosts: 676 |
Option Error Resume | Break The only Konstant is Change |
||||
kiiid Guru ![]() Joined: 11/05/2013 Location: United KingdomPosts: 671 |
I am going to put some ice in the hot water. Don't jump too enthusiastically into buying lot 170s. There is a 190 (and respectively 290) coming out. In general those are the same crystal as 370/470 with reduced number of pins... http://rittle.org -------------- |
||||
mindrobots Newbie ![]() Joined: 21/05/2014 Location: United StatesPosts: 32 |
The good news is, none of the old ones stop working just because a new chip comes out! |
||||
G8JCF![]() Guru ![]() Joined: 15/05/2014 Location: United KingdomPosts: 676 |
@kiiid Any links to the info about the 190's please ? Peter The only Konstant is Change |
||||
viscomjim Guru ![]() Joined: 08/01/2014 Location: United StatesPosts: 925 |
@mindrobots... I agree, I'm still using those "old" 150 chips... They still work great!!!! |
||||
Oldbitcollector![]() Senior Member ![]() Joined: 16/05/2014 Location: United StatesPosts: 172 |
Geoff, I'm using the I2C protocol pretty extensively in my current project. Would you take a moment to expand on what issues affect the I2C protocol and what effects the fixes will have on them? I'm not sure if I have encountered flaws or not, as I might have simply accepted a bug as normal behaviour from the Micromite being that I have control over the slave side of the connection as well. Should I expected surprises here? Thanks Jeff My Propeller/Micromite mini-computer project. |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3303 |
This is what I have in my "bugs database". I have not verified the issue(s): http://www.thebackshed.com/forum/forum_posts.asp?TID=6527&PN =1&TPN=2 If you stop the slave with ctrl+C without issuing the I2C SLAVE CLOSE, the master does not receive an error. MM.I2C = 0. If you do issue the I2C SLAVE CLOSE command, the master will correctly see an error. MM.I2C = 1. If you stop the slave from listening with I2C SLAVE CLOSE and then restart listening with I2C SLAVE OPEN, there is 'garbage' in the slave buffer. This will happen even if you stop the master, pause the slave listening, restart listening and then restart the master. The buffer gets out of step without any I2C activity on the bus. See also: http://www.thebackshed.com/forum/forum_posts.asp?TID=6599&PN =1 Geoff Geoff Graham - http://geoffg.net |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3303 |
This has some issues and needs thinking through. For a start, when an error is encountered the interpreter is often deep in some logic tree with no obvious answer or way out... this is why the error is thrown. How can the interpreter continue when it is in a non logical state? It would be better if ON ERROR NEXT only applied to I/O commands/functions but I can still see issues. The DISTANCE command and PULSEIN function do not abort on an error so the only others that this might apply to are the DS18B20 function and RTC command (all the others cannot detect if the hardware is missing). In the case of the DS18B20() function I would have thought that not having the sensor connected would be a serious sort of error. Why would you want to ignore it? What about the RTC command - should it pretend as if nothing happened if the PCF8563 is not found? I will add ON ERROR NEXT (or something similar) to my list of possible enhancements but I am really searching for a logical and sensible way of handling the issue. I am beginning to think that the original suggestion of DS18B20() returning a non valid reading would be the simplest approach. Geoff Geoff Graham - http://geoffg.net |
||||
ajkw Senior Member ![]() Joined: 29/06/2011 Location: AustraliaPosts: 290 |
Geoff, In my case am not saying I would ignore the error, if I can test the result of a DS18B20 read and find the value is indicating a error then I can make an alert or take other action instead of staring at a command prompt. Perhaps let me put it this way, if a temp sender in the car engine goes bad the car computer doesn't shut itself and the engine down, it changes the fuel injection mapping to a default safe mode and displays a light on the dash. Cheers, Anthony. |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2447 |
this could break some existing code that expects all returned values to be valid. how about instead expanding the function to include an optional error flag: DS18B20( pin [, error] ) where 'error' is returned set to 0 if the function has found the sensor and extracted the temperature from it, and returned set to 1 if there was an error. if the second parameter is not present and an error occurs, then as with earlier versions terminate the program. in applications like dataloggers, there may be occasions where it is desirable to carry on when sensors drop out, are destroyed, or are simply not plugged in. rob :-) |
||||
ajkw Senior Member ![]() Joined: 29/06/2011 Location: AustraliaPosts: 290 |
Rob, The change in 4.5D did itself break existing code. Anthony. |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6302 |
I have a monitoring system with 5 DS18B20's on long(ish) leads. If a mouse chews through on of the leads (a strong possibility), I want the system to keep monitoring the remaining sensors and report an error on the faulty one. A non-valid return value would be the easiest for me to live with and is consistent with other types of sensor. The RTC is not so critical as it should be there all the time once the hardware is completed. Jim VK7JH MMedit |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3303 |
OK, I agree. In the next release I will change the DS18B20() function to return a non valid reading on an error. The RTC comand can stay the way it is. Geoff Geoff Graham - http://geoffg.net |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |