Wayne P.
08-09-2005, 11:25 PM
Please advise me on what might be causing my BS2e to intermittently reset all by itself. (?)
I've written all the $PBASIC 2 code, which includes multiple programs in individual EEPROM program slots of the BS2e.
(Therefore I've incorporated the 'RUN' command)
When I power-up my BS2e hardware the microcontroller obviously initiates the slot 0 program first. In my application, slot 0 is used for initializing some 'user preset' registers before starting the actual 'system code'. (The 'system code' as I call it, is the program code that will continually cycle, non-stop after the user initialization is performed at power-up. This cyclical 'system code' starts in slot 1)
Once all the user presets are entered, via external switch closures on INPUT lines of the BS2e, then I initiate a 'RUN 1' command to jump over to the slot 1 program. NOWHERE IN MY CODE, IN ANY PROGRAM SLOT, DO I HAVE THE·'RUN 0' COMMAND THAT WOULD REINTRODUCE THE INITIALIZATION MODE. (This action would obviously act the same as a power-up or system reset.....most undesirable in my application)
Yet, very intermittantly (a few times now) after running properly, my program automatically finds it's way back to the initialization mode waiting for the user to make his pre-set selections (?) I've ensured a stable, well regulated +5Vdc on Vcc and also a HI on pin 22 'Reset' via an external 47k pull-up resistor to +5V.
1. I know that a power disturbance could cause this problem. (An intermittent +5V·on Vcc pin 21 perhaps)
2. I know that pulling pin 22 low (reset) could also cause this. (I do have a momentary switch on pin 22 but no one is touching this button and the PCB trace at pin 22 is clear of debris to ground. (solder flux)
3. I know that a 'RUN 0' in my code will cause this problem.
What possible conditions (other than the two I mentioned above) could cause the BS2e to run the slot 0 code after leaving to another slot? (I've tried to recreate this reset fault by pressing all the switches at once, (keypad bashing) or in specific switch combinations, to simulate a possible 'finger fault' that might be confusing the BS2e......no such luck yet in manually initiating the problem)
Finally, could noise coming into the 'Serial In' or 'ATN' pin of the stamp cause my problem? I only suggest this because I·have noticed that if I leave my stamp project·powered & connected to my PC (RS232 port) and I then·reboot my PC, the stamp hardware reboots. It doesn't erase the program code...it simply resets my hardware thus·simulating the problem.
Thanks
I've written all the $PBASIC 2 code, which includes multiple programs in individual EEPROM program slots of the BS2e.
(Therefore I've incorporated the 'RUN' command)
When I power-up my BS2e hardware the microcontroller obviously initiates the slot 0 program first. In my application, slot 0 is used for initializing some 'user preset' registers before starting the actual 'system code'. (The 'system code' as I call it, is the program code that will continually cycle, non-stop after the user initialization is performed at power-up. This cyclical 'system code' starts in slot 1)
Once all the user presets are entered, via external switch closures on INPUT lines of the BS2e, then I initiate a 'RUN 1' command to jump over to the slot 1 program. NOWHERE IN MY CODE, IN ANY PROGRAM SLOT, DO I HAVE THE·'RUN 0' COMMAND THAT WOULD REINTRODUCE THE INITIALIZATION MODE. (This action would obviously act the same as a power-up or system reset.....most undesirable in my application)
Yet, very intermittantly (a few times now) after running properly, my program automatically finds it's way back to the initialization mode waiting for the user to make his pre-set selections (?) I've ensured a stable, well regulated +5Vdc on Vcc and also a HI on pin 22 'Reset' via an external 47k pull-up resistor to +5V.
1. I know that a power disturbance could cause this problem. (An intermittent +5V·on Vcc pin 21 perhaps)
2. I know that pulling pin 22 low (reset) could also cause this. (I do have a momentary switch on pin 22 but no one is touching this button and the PCB trace at pin 22 is clear of debris to ground. (solder flux)
3. I know that a 'RUN 0' in my code will cause this problem.
What possible conditions (other than the two I mentioned above) could cause the BS2e to run the slot 0 code after leaving to another slot? (I've tried to recreate this reset fault by pressing all the switches at once, (keypad bashing) or in specific switch combinations, to simulate a possible 'finger fault' that might be confusing the BS2e......no such luck yet in manually initiating the problem)
Finally, could noise coming into the 'Serial In' or 'ATN' pin of the stamp cause my problem? I only suggest this because I·have noticed that if I leave my stamp project·powered & connected to my PC (RS232 port) and I then·reboot my PC, the stamp hardware reboots. It doesn't erase the program code...it simply resets my hardware thus·simulating the problem.
Thanks