![]() |
Forum Index : Microcontroller and PC projects : MM2: Slow start up....(that I don't want)
Author | Message | ||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
Hi all. The very first line of the code in the MM2 is: SetPin 16,DOUT:Pin(16)=1 This drives a transistor, that operates a reed-relay. This IS working, but it is taking about 2-seconds from power-on, till when the pin goes high, and I am sure that the MM2 does not need 2-seconds to start up - I am sure that once powered, pin 16 should go high almost instantly, cos the MM2 is so fast. Have reflowed all the pins, have replaced Vcap just in case. No change. As I say - always works, but I have to hold the button down for two seconds till the MM2 code runs and can bypass the button with the reed relay. If I don't do that, then the unit never transmits. 3v3 rail comes up to 3v3 instantly, so there is 3v3 on the chip, but it does not start executing the code for two seconds. Standard 100uF/100n on input and output of 1703 LDO regulator. Circuit fed from 9v alkaline battery(Energizer Industrial) Confusing. Other units I have built like this don't do this - they power up and run immediately. Does anyone have any ideas as to what might be causing that? Checked that 10k pull-up to MCLR is there and soldered correctly and correct value. I am going to build another unit now and see if it also has the same issue - perhaps there is just something wrong with this one, but I cannot work out what so far. I might try reflashing MMBASIC. I noted on this chip, I could not gain control of the console following flashing. I had to cycle power to the chip. You don't normally need to do that, cos once flashed, the chip is usually reset by the programmer as the very last step, and you just get the startup message on the console when you connect to it. As I say yet again - it IS working fine, but it just takes two seconds to start to run which is the bit I can't understand. ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
Ignore. It seemed I had a SLIGHTLY corrupted MMBASIC download. I reflashed the chip, this time I could talk to the console right away without having to cycle power, and now it runs the code immediately. I wonder what was going on there? Perhaps PGC or PGD were a little loose or something, and it corrupted a few bytes of the MMBASIC download or something..... Smoke makes things work. When the smoke gets out, it stops! |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
deleted 'cos you fixed it... Jim Edited 2021-08-05 15:32 by TassyJim VK7JH MMedit |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
I would still like to know what you were suggesting. Smoke makes things work. When the smoke gets out, it stops! |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
I wanted you to get accurate timing from power on to pin 16 high. If it was 2 seconds or slightly over, the MM2 probably thought it had seen a ! and was waiting for the stream of !'s signaling a reset command. That takes 2 seconds. Jim VK7JH MMedit |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3292 |
The startup sequence to detect a reset request is: - set console to 38400 baud - wait for 100ms - check if an exclamation mark (!) was received. If so: - wait a further 150ms - if we received at least four more then: - wait for 2 sec - check that we get at least 25 more consecutive !'s. If so: - clear flash, reset all options and restart So, normally the MM2 should start up in just over 100ms. If, for some reason, a stray ! was received startup would take just over 250ms. Geoff Edited 2021-08-05 20:19 by Geoffg Geoff Graham - http://geoffg.net |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
Thanks Jim and Geoff. ![]() That explains the 2 second delay then - it must have seen at least one ! for whatever reason. Reflashing the chip with a new copy of MMBASIC fixed the issue totally, so all I can put this down to at the moment, is that PGD and/or PGC were not as tight as they should have been, and might have caused a slightly corrupted download of the firmware, cos a reflash fixes this issue. Once programmed, the console is not even connected, so the pins are just o/c so should never be able to receive stray ! bytes, but in any event, reflashing fixed it. I just did not think of the firmware being the issue for AGES, as it WAS working like I said, but it just waited two seconds before it did! ![]() 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 |