PDA

View Full Version : Resetting the Propeller



kt88seamp
12-11-2009, 06:41 AM
I want the propeller to reset itself when a serial recieve command times out. The purpose of this is to detect to see if someone pulls out the USB cable while data is being transmitted

I wrote a program that I thought would work properly (see attached, PUB Program is where the code is). It does kind of work. The cable needs to be reconnected for the propeller to reset. I wantĚthe propĚto reset when the cable is pulled.

Post Edited (kt88seamp) : 12/11/2009 1:28:39 AM GMT

John Abshier
12-11-2009, 06:48 AM
repeat while buffer <> "#" and buffer <> "*" and buffer <> -1
buffer := SER.rxtime(1000)

if buffer == -1
reboot

John Abshier

kt88seamp
12-11-2009, 09:32 AM
That code only covers the portion where the transmission is initiated. The data is recieved with the code in the Program method. Lets say a large amount of data is being transmitted. It will take at least a few seconds for it all to be recieved. Now lets say the user pulls the plug during transmission. My C# program will display a red X message box saying the connection has been broken. When this happens I am trying to make the propeller reset itself. The code does halt its execution when the plug is pulled but it only resets when the user puts the plug back in. Does this have anything to do with the result of a transmission time out being -1?

MagIO2
12-11-2009, 02:31 PM
Are you sure that this is a good approach?

Programming the EEPROM did not work and you reboot exactly with this EEPROM image?