Shop OBEX P1 Docs P2 Docs Learn Events
disconnect propboard and 12blocks program goes haywire — Parallax Forums

disconnect propboard and 12blocks program goes haywire

pongmstr2pongmstr2 Posts: 16
edited 2010-07-29 19:47 in Propeller 1
so when im running a program using 12 blocks everything is fine untill i disconnect the usb cable.· There is a small red light next to the usb port on the proto board that starts flashing and the program starts acting randomly.· Does anyone know how to fix this??·

thanks in advance, Henry

Comments

  • HannoHanno Posts: 1,130
    edited 2010-07-29 06:47
    I assume by "propboard" you mean Propeller Demo Board with an on-board usb chip? It's not "nice" to unplug the usb connector while your program is running and sending data back to the pc- best thing to do is load the program to eeprom- use 12Block's "load to eeprom" for that, then disconnect, then restart the program on the Propeller. What's going on is that the usb chip periodically resets the Propeller...
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Co-author of the official Propeller Guide- available at Amazon
    Developer of ViewPort, the premier visual debugger for the Propeller (read the review here, thread here),
    12Blocks, the block-based programming environment (thread here)
    and PropScope, the multi-function USB oscilloscope/function generator/logic analyzer
  • pongmstr2pongmstr2 Posts: 16
    edited 2010-07-29 07:07
    i just tried your sugestion, and its still doing the same thing as soon as either the usb cable is unplugged or power is cycled the red light next to the usb port starts flashing and keeps resetting the prop. Any other sugestions?
    --Henry--
  • pongmstr2pongmstr2 Posts: 16
    edited 2010-07-29 07:10
    One thing to add, it only does this when i use 12blocks. If i write the same program in spin it works fine and i don't have this issue. I just prefer 12blocks because its easier. Good job on it i love it. I'm new to the propeller chip and this really makes things easier.
    --Henry--
  • HannoHanno Posts: 1,130
    edited 2010-07-29 07:50
    Hi Henry,
    12Blocks let's you edit your program's parameters while it's running- and it gives you all sorts of debugging tools like "view pins", "view variables" and the terminal. These tools require a communication link with the Propeller. Currently when you pull out the usb plug, the Propeller side doesn't handle things well. I've talked to the guys at ftdi and hope to release a fix shortly. When you're loading a program from the Propeller Tool without support for debugging, no communication happens after the initial "load"- so the Propeller doesn't get reset.
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Co-author of the official Propeller Guide- available at Amazon
    Developer of ViewPort, the premier visual debugger for the Propeller (read the review here, thread here),
    12Blocks, the block-based programming environment (thread here)
    and PropScope, the multi-function USB oscilloscope/function generator/logic analyzer
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-07-29 14:24
    Hanno said...
    I've talked to the guys at ftdi and hope to release a fix shortly.
    From a purely software standpoint, a possible "fix" would be to require the Prop to be actively receiving data from the PC before it can transmit anything. Any transitions on TxD with the USB port unplugged will power and depower the FTDI chip, causing transitions on DTR, which resets the Prop. This is a well-known issue with at least a couple Prop boards, for which a simple hardware fix is available, viz:

    http://forums.parallax.com/showthread.php?p=847290 (and interior links)

    Hopefully Parallax can correct these in subsequent revs. BTW, I doubt that FTDI can be of much help. It's not a problem with their chip.

    -Phil
  • HannoHanno Posts: 1,130
    edited 2010-07-29 19:47
    Hi Phil,
    Thanks for the helpful pointer. My software fix is just as you described- a mode where the firmware doesn't transmit to the PC. The firmware will be in this mode whenever possible- and when the user presses "pause". I initially thought ftdi was to blame- the reset signal for the propeller was coming from their chip even though the dtr shouldn't have been toggled. Your explanation of it toggling due to power state change makes sense. I mainly use protoboards where I disconnect the propplug- so I didn't see this issue until very recently.
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Co-author of the official Propeller Guide- available at Amazon
    Developer of ViewPort, the premier visual debugger for the Propeller (read the review here, thread here),
    12Blocks, the block-based programming environment (thread here)
    and PropScope, the multi-function USB oscilloscope/function generator/logic analyzer
Sign In or Register to comment.