![]() |
Forum Index : Microcontroller and PC projects : Micromite with lcd backpack problem
Author | Message | ||||
Juri74![]() Senior Member ![]() Joined: 06/02/2012 Location: ItalyPosts: 162 |
Hello all! i need serious help here because after spent some time programming the micromite with it's backpack i can't let it autostart at power on!! what's wrong? i placed "option autorun on" at the beginning of the program, i tried even placing it in the mm.startup subroutine but it doesn't work.. i need to issue a "run" at the console to run the program! in this way my project is completely useless :'( can somebody help me please? thanks Juri |
||||
Justplayin![]() Guru ![]() Joined: 31/01/2014 Location: United StatesPosts: 327 |
OPTION AUTORUN ON is used only at the command prompt. Load your program into the Micromite, type OPTION AUTORUN ON, then cycle the power. Your program should start automatically. --Curtis I am not a Mad Scientist... It makes me happy inventing new ways to take over the world!! |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1573 |
@Curtis Sorry, this is not correct. ![]() Regards Michael causality ≠ correlation ≠ coincidence |
||||
Justplayin![]() Guru ![]() Joined: 31/01/2014 Location: United StatesPosts: 327 |
Perhaps "Should only be used at the command prompt" would be better phrasing. I don't like the idea of a program regularly writing to the same flash area of the Mite. Just my own personal over cautious fear of wearing out a chip. ![]() --Curtis I am not a Mad Scientist... It makes me happy inventing new ways to take over the world!! |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1573 |
Good point! ![]() Edit: AFAIK will the flash for Option Autorun not unnecessarily changed. @Juri I would try this steps: 1. save your program 2. make a reset to its original configuration (p 16 of User Manual MMBasic Ver 5.2 Beta 1) 3. write a small dummy program (do:i=i+1:Print i:loop) 4. set the Micromite into the Autorun mode ("Option Autorun On" at the cammand prompt) 5. enter CPU RESTART (or do a reset/make a disconnect-reconnect to the power) You should see 1 2 3 4 5 6 ... on the console output. causality ≠ correlation ≠ coincidence |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9590 |
I also agree that OPTION AUTORUN ON should be entered in at the command prompt and not in the code. While you CAN put it in the code, the normal procedure is to run that as a direct command in immediate mode at the command prompt. Please let us know how you get on! ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
Juri74![]() Senior Member ![]() Joined: 06/02/2012 Location: ItalyPosts: 162 |
ok removed from the code, thanks for the suggestion followed twofinger suggestion all worked perfectly until i reload my program. i doesn't autorun but i found the problem! issuing "RUN" from the console it work perfectly! but... it didn't autostart, after issuing "CPU RESTART" the program throw an error "variable not defined"!!!!!!! i use OPTION EXPLICIT and made some further testing: this program: DO A=0 print A LOOP work perfectly if "RUN" from the console but it doesn't run on autostart looks like the option explicit works at autorun and not when run program from console :) |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1573 |
Hi Juri, if you are usung the OPTION EXPLICIT then you should (explicit) declare your variables (eg "DIM A as integer" or "Local A as integer"). Micromite User Manual Page 35 If the OPTION EXPLICIT command was used as shown below the error would become obvious when the program was run: Generally it would be helpful to know which system you are using (MMBasic version and the specific chip, eg Mx170/28) and - if possible - your code or parts of it. Regards Michael causality ≠ correlation ≠ coincidence |
||||
Juri74![]() Senior Member ![]() Joined: 06/02/2012 Location: ItalyPosts: 162 |
hello the problem is not only the "option explicit" but something else too example the "rtc gettime" command! i spent half an hout trying to know why the minimite wouldn't set the pins to 0 at power cycle (i was debugging a board) the program was very simple: setpin 10,dout
pin(10)=0 setpin 16,dout pin(16)=0 do loop when running (connected to terminal) nothing show up and pin 10&16 were still at 3v!!! then i casually find the "RTC GETTIME" command in mm.startup subroutine when i issued the "CPU RESTART" command.. with that command the error "RTC clock not responding" (or similar i do not remember) appeared at the console!! i bought the kit minimite + lcd backpack actually i have another "backpack" at the opposite side of the lcd board, this is the daughterboard that have the clock on it. i have to disassemble it another time, but i wouldn't do it! now is working and installed. but i'm almost sure the chip is PIC32MX170F256B as included in the kit.. what version is running.. i do not know unfortunately :( |
||||
Juri74![]() Senior Member ![]() Joined: 06/02/2012 Location: ItalyPosts: 162 |
i found another strange behaviour, i do not know if it's normal or not but, when i enter the editor with "edit" command all Digital Out pins go to 1 state is it normal? |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3282 |
but, when i enter the editor with "edit" command all Digital Out pins go to 1 state is it normal? Yes it is. When the editor starts up it needs all the memory it can get so the firmware resets the interpreter which also resets all outputs. Geoff (still overseas) Geoff Graham - http://geoffg.net |
||||
LouisG Senior Member ![]() Joined: 19/03/2016 Location: AustraliaPosts: 129 |
@geoffg "Resets all outputs"? You mean that by exiting a running program into edit mode all digital outputs go to 1 state, as Juri74 wrote? This could switch on all external loads (e.g. valves, heaters, pumps, ...). |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3282 |
When a program starts, either on power up or by RUN, all outputs are reset so you cannot ever rely on I/O pins being set to some particular state. When a pin is reset it is set to high impedance so, if it is critical that an output be in a particular state, you should use a pullup or pulldown resistor to set that state so that it is correct during power up (or RUN or EDIT). Geoff Geoff Graham - http://geoffg.net |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |