Shop OBEX P1 Docs P2 Docs Learn Events
Resetting the Propeller — Parallax Forums

Resetting the Propeller

kt88seampkt88seamp Posts: 112
edited 2009-12-11 06:31 in Propeller 1
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

Comments

  • John AbshierJohn Abshier Posts: 1,116
    edited 2009-12-10 22:48
    repeat while buffer <> "#" and buffer <> "*" and buffer <> -1
    buffer := SER.rxtime(1000)

    if buffer == -1
    reboot

    John Abshier
  • kt88seampkt88seamp Posts: 112
    edited 2009-12-11 01:32
    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?
  • MagIO2MagIO2 Posts: 2,243
    edited 2009-12-11 06:31
    Are you sure that this is a good approach?

    Programming the EEPROM did not work and you reboot exactly with this EEPROM image?
Sign In or Register to comment.