Selectively programming 2 P1s with 1 Plug

I have two P8Xs but only one Prop Plug, so I would like to be able to manually switch between sending the 4-bit programmer signal to Prop A or Prop B with a physical switch which will switch an "enable" signal between outputting to A vs B.

I should(?) be able to accomplish my goal by using two 4-bit tri-state buffers to the output data bus, with the switch's output serving as the enable signal driver.

Two of these 74HC126s seem perfect.

Two of these, with the 4 output enable pins connected to one pole of a physical switch which pulls them high (with a pull down resistor to ground for the OFF position), in my mind does what I'm trying to accomplish.

Is this solution over-engineered? Is there a more obvious way to do this? Thanks!

Comments

  • 15 Comments sorted by Date Added Votes
  • I guess it depends on how you want to use it after the programming is done.
    If you want to talk to both P8X's over the link, then a dual-uart like CP2105 would allow that - no mux needed at all.

    Simplest shared connection HW would be to use a COM device with both RTS and DTR to drive one reset each, & custom programming SW, but that assumes only one P8X ever communicates during run.
    You could OR wire the outputs, if you know only one-at-a-time was managed.
  • Thanks for the info @jmg !

    I think the CP2105 is definitely overkill, and I'm definitely not writing custom software to accomplish a task that is tantamount to moving the Plug to a different header when I want to program a different uC haha.

    Here's my use case:

    I'll be writing and modifying code for both uCs at potentially the same time, and they will be running at the same time. So simply ORing the outputs wouldn't do the trick. So I need to be able to selectively program one or the other at will and leave the other running unaffected.

    This is why I'm leaning towards the tri-state buffer and switch technique. Thoughts?
  • jmgjmg Posts: 11,779
    edited February 28 Vote Up0Vote Down
    escher wrote: »
    Here's my use case:

    I'll be writing and modifying code for both uCs at potentially the same time, and they will be running at the same time. So simply ORing the outputs wouldn't do the trick. So I need to be able to selectively program one or the other at will and leave the other running unaffected.

    This is why I'm leaning towards the tri-state buffer and switch technique. Thoughts?
    If this is mainly for development, of '2 live systems', why not just use (any old) two COM ports ?
  • I only have 1 Plug
  • escher wrote: »
    I only have 1 Plug
    Digikey links USB-COM ports as low as $4.56 - surely that's cheaper than a mess of wires and time ? :)
  • Are you talking about a USB-Serial cable? Sorry I'm not following.
  • escher wrote: »
    Are you talking about a USB-Serial cable? Sorry I'm not following.

    Yes, that's all Prop Plug is - a USB to Serial cable.

  • Oh wow, for some reason I thought there was some proprietary nonsense going on with it. Thanks for the help!
  • escherescher Posts: 113
    edited February 28 Vote Up0Vote Down
    @jmg won't I still have to wire up the whole USB to UART circuit i.e. 103973.png
  • escher wrote: »
    Oh wow, for some reason I thought there was some proprietary nonsense going on with it. Thanks for the help!
    There is a reset transistor/cap, but that's easily added if you find you need it.
  • escherescher Posts: 113
    edited February 28 Vote Up0Vote Down
    jmg wrote: »
    escher wrote: »
    Oh wow, for some reason I thought there was some proprietary nonsense going on with it. Thanks for the help!
    There is a reset transistor/cap, but that's easily added if you find you need it.

    @jmg So do I still need the FT232RQ or equivalent? Or should that be built into the USB-RS232 adapter?
  • jmgjmg Posts: 11,779
    edited February 28 Vote Up0Vote Down
    escher wrote: »
    jmg wrote: »
    escher wrote: »
    Oh wow, for some reason I thought there was some proprietary nonsense going on with it. Thanks for the help!
    There is a reset transistor/cap, but that's easily added if you find you need it.

    So do I still need the FT232RQ or equivalent?

    That's the part that does USB-UART(TTL), so yes, you need an equivalent.
    Cheapest module at Digikey is CP2104-MINIEK @ $4.56, next is Adafruit CP2104 FRIEND @ $5.95, then UMFT234XF @ $6.22 etc & CP2102N-MINIEK @ $8.50
    eBay has CH340 and CP2102 version modules for rather less.
    escher wrote: »
    @jmg won't I still have to wire up the whole USB to UART circuit i.e.

    Ah, the items I've linked above are all PCB modules, so have USB connector and 0.1" connectors - not bare chips.
  • jmg wrote: »
    escher wrote: »
    jmg wrote: »
    escher wrote: »
    Oh wow, for some reason I thought there was some proprietary nonsense going on with it. Thanks for the help!
    There is a reset transistor/cap, but that's easily added if you find you need it.

    So do I still need the FT232RQ or equivalent?

    That's the part that does USB-UART(TTL), so yes, you need an equivalent.
    Cheapest module at Digikey is CP2104-MINIEK @ $4.56, next is Adafruit CP2104 FRIEND @ $5.95, then UMFT234XF @ $6.22 etc
    eBay has CH340 and CP2102 version modules for rather less.

    Jeeze at that point I might as well just drop the other $10 and get another Plug. Thanks again for all the help!
  • Cluso99Cluso99 Posts: 13,786
    edited February 28 Vote Up1Vote Down
    The specific section that you need to be able to use almost any USB-Serial TTL is the transistor reset circuit connected to the DTR pin. Not all USB-Serial modules have the DTR accessible. CP2102 modules can be had for $1.19 on eBay inc postage. Just add the transistor with the resistor and capacitor.

    Of course 2 propplugs are easier.

    BTW if you are using PropTool, you can run two copies connected to two separate PropPlugs on the one PC. Makes development easier for different code.
  • MIchael_MichalskiMIchael_Michalski Posts: 93
    edited March 8 Vote Up0Vote Down
    escher wrote: »
    I have two P8Xs but only one Prop Plug, so I would like to be able to manually switch between sending the 4-bit programmer signal to Prop A or Prop B with a physical switch which will switch an "enable" signal between outputting to A vs B.

    I should(?) be able to accomplish my goal by using two 4-bit tri-state buffers to the output data bus, with the switch's output serving as the enable signal driver.

    Two of these 74HC126s seem perfect.

    Two of these, with the 4 output enable pins connected to one pole of a physical switch which pulls them high (with a pull down resistor to ground for the OFF position), in my mind does what I'm trying to accomplish.

    Is this solution over-engineered? Is there a more obvious way to do this? Thanks!

    If you really want to control two from one usb adapter,why not disconnect one of the LEDs and use it to switch the output (there might even be an unused output you could use for that). Then you can do it under software control.But I agree,your better off buying another adapter. They are only a couple bucks on ebay. I keep a handful of them around.

    Particularly patient proactive practice positively predicates practically precise poly-processor Parallax Propeller programming paradigms.

    .
Sign In or Register to comment.