Shop OBEX P1 Docs P2 Docs Learn Events
Rotary Switch for Programming of P8X32A — Parallax Forums

Rotary Switch for Programming of P8X32A

AwesomeCronkAwesomeCronk Posts: 1,055
edited 2018-07-25 22:45 in General Discussion
Hello, I am designing a schematic in diptrace for a board with 5 P1 units. I need a 5-position switch that can make multiple connections at each position, without crossing data, like plugging a PropPlug into one of 5 sockets, only with a switch and 1 socket. Can anyone help with this?
«1

Comments

  • jmgjmg Posts: 15,140
    Do you mean mechanical (as in 5 wafers of 5T1P) or electronic ?
    If electronic, what ratings does it need ? mA/V ?


    If you just want to connect a programming Plug, into one of 5 P1 units, that is quite a bit simpler.
    You just need to select TX, RX and maybe RS.
    That's still a few pins - simplest/cheapest is 3 x HC4051 or VHC4051
  • @jmg, thank you. I have decided to have jumpers to connect the pins.
  • Not enough information though. Jumpers are fine for options or for the occasional mode change but a nuisance if you had to change them constantly. If it is simply for programming once in a while then even then it is cumbersome. Are you jumpering all 3 lines, the RX, TX, and reset? That would be 15 jumper positions. It would be simpler then to join all RX lines together as well as TX together and simply hold all but one Prop in reset for that purpose. During reset the I/O are floating and paralleling all the RX/TX lines is not a problem if your software doesn't use serial normally.

    But all this begs the question; why 5 Props?
  • jmgjmg Posts: 15,140
    edited 2018-07-26 01:15
    ... Jumpers are fine for options or for the occasional mode change but a nuisance if you had to change them constantly. If it is simply for programming once in a while then even then it is cumbersome...
    Good point, if there is any sort of production volume involved here, it may be simplest to have a small MCU connect direct to each i2c device. That's just 10 pins, and you need a RX.TX for PC, and the PC+firmware programs all 5 in one download.

    That setup can program as many props as you like - a 20 pin 25c MCU can manage close to 16 props !


  • jmg wrote: »
    ... Jumpers are fine for options or for the occasional mode change but a nuisance if you had to change them constantly. If it is simply for programming once in a while then even then it is cumbersome...
    Good point, if there is any sort of production volume involved here, it may be simplest to have a small MCU connect direct to each i2c device. That's just 10 pins, and you need a RX.TX for PC, and the PC+firmware programs all 5 in one download.

    That setup can program as many props as you like - a 20 pin 25c MCU can manage close to 16 props !


    Yes, we love those little micros, they are cheap and easy to use, and since they are so simple there is hardly anything to learn. In fact they are way cheaper than an A/D or I/O chip plus you can customize them. However that still does not solve the user selection problem. Even if you use a cheap little push-button you would still need LEDs to indicate which one was active etc.

    I would use my little tiny 8-pin MSOP PIC12F1572 to drive 5 reset lines and then use pin 4 as the push-button input. Normally none of the reset lines are asserted but once the button is pressed it would hold all but the first Prop in reset, then successive presses would cycle through each Prop until the sixth press releases them all once again etc. Alternatively if jumpers were being considered then the Prop board could simply just have 5 programming headers. Why use a micro if you can do it with something simpler?
  • jmgjmg Posts: 15,140
    ... However that still does not solve the user selection problem. Even if you use a cheap little push-button you would still need LEDs to indicate which one was active etc.
    No need for any of that :)
    - with my direct i2c connect approach, you have a single (merged) file download, and all Prop memories are just programmed/selected by their place in memory map.
    Simplest would be a 64k increment per P1. A bonus is this could be faster than P1 link.

  • If your looking for rotary switches I would recommend Grayhill you can speicify decks, contacts , etc.
  • I designed a board with 2 props and a silabs CP2110 usb interface. On the programmer app I put a load button for each Prop and the first thing that happens is before prop loads is a GPIO on the CP2110 sets which prop will load via electronic switch. The same could be done for more props since there are extra GPIO to enable more devices. This way you load a binary into your app then just click the prop it should go to. If you wanted to get fancy you could put some unique delimiter in the binary. The app could parse the binary and auto select the GPIO.
  • @jmg - But I wasn't assuming that all 5 Props would have the same program otherwise it would be easy. But 5 I2C lines plus 5 reset lines plus RX/TX and RESETin start to add up to at least a 20-pin or more micro to avoid discrete components.

    But you said "my direct i2c connect approach", so does that mean you have actually done this and that you can post it?

    I normally have an 4x2 pin header with the bottom 4 pins matching a Prop Plug and the top 4 pins for I2C and 5V plus a key. That way I have a cloner which can read or write boards via I2C via quickly, without the need for a PC, so this method is suitable for factory or field programming.

  • jmgjmg Posts: 15,140
    edited 2018-07-26 22:53
    @jmg - But I wasn't assuming that all 5 Props would have the same program otherwise it would be easy. But 5 I2C lines plus 5 reset lines plus RX/TX and RESETin start to add up to at least a 20-pin or more micro to avoid discrete components.
    No, I am not assuming that.
    If you read carefully, you see I said " Prop memories are just programmed/selected by their place in memory map." and " (merged) file download" and " PC+firmware programs all 5 in one download."
    ie that means all 5 have a different download memory address, and the loader assigns a different memory area, to each prop, based on PC sent address. No Switches or LEDs needed.
    There is also no need for 5 RST lines, just one, so you can fit this into a 20 pin MCU. Loader MCU holds all Props in reset, while it loads the i2c memories, using i2c.


    I normally have an 4x2 pin header with the bottom 4 pins matching a Prop Plug and the top 4 pins for I2C and 5V plus a key. That way I have a cloner which can read or write boards via I2C via quickly, without the need for a PC, so this method is suitable for factory or field programming.
    Yes, or pogo pins...., or even SO package clothes-peg clips...

    The OP has not said how many they intend to make, but the fact they asked suggests the simpler approach of header-per-prop is rejected for some reason. Maybe they need closed-case field updates ?

  • @jmg are you suggesting that all props use the sames memory? I'm officially in over my head.
  • Update: Diptrace free version will not accept more than 100 pins.(whoop-ti-doo!) I am going to have to print the 5 different props pn 5 different boards, then create a board which will inter-lock with the 5 "Brain-Boards" and hold all of the sensory function, inputs, outputs, etc.
  • Update: Diptrace free version will not accept more than 100 pins.(whoop-ti-doo!) I am going to have to print the 5 different props pn 5 different boards, then create a board which will inter-lock with the 5 "Brain-Boards" and hold all of the sensory function, inputs, outputs, etc.
    You could try KiCad. It doesn't have any such limitations.

  • Update: Diptrace free version will not accept more than 100 pins.(whoop-ti-doo!) I am going to have to print the 5 different props pn 5 different boards, then create a board which will inter-lock with the 5 "Brain-Boards" and hold all of the sensory function, inputs, outputs, etc.

    You can use the free KiCad that does not have those limitations.

    http://kicad-pcb.org/
  • Is the interface anything similar? I will give KiCad a shot.
  • Is the interface anything similar? I will give KiCad a shot.

    Couldn't tell you. I have downloaded KiCad but have not fired it up yet.
  • Funny thing, the publisher's name is Simon Richter, and I have relatives with the name Ricter. :smiley:
    Thanks for the link, by the way.
  • jmgjmg Posts: 15,140
    @jmg are you suggesting that all props use the sames memory? I'm officially in over my head.

    Hehe, not quite. The props are all std, one eeprom each. After they are all placed on the PCB, and routed, you run i2c from each memory, to 2 pins each on a small programming tasked MCU.

    That's 10 MCU pins needed for 5 props i2c.
    Assuming you have all their reset lines paralleled, that's one more pin to hold the Props in reset.
    The MCU then also connects to the PC com lines, and requires some means to trigger a bootload/system - if you need remote load / closed case operation, the DTR line could be pulse-width measured.
    All that fits in a low cost 20 pin MCU. (or, if you have 5 props already, you could even use a 6th just for the loader - slightly larger, but one code-flow )

    The single memory map comes from the PC side, where you need to tell the MCU which prop, gets what image.
    The easiest way is to stack the 5 Prop programs into one large 64k x 5 image and send that. Intel hex has a 64k page and a record for page boundaries, so that is quite easy to do.

    Somewhere, we had a hex merge program for doing this multiple-hex file stuff....
    ahh, this looks usable : srec_cat.exe : http://www.keil.com/support/docs/2666.htm
  • AwesomeCronkAwesomeCronk Posts: 1,055
    edited 2018-07-27 21:24
    jmg, you are dunking me in- waaaay over my head. I'm just gonna try and figure out KiCad for now.

    If I were to do what you are suggesting, Would I have to get a special compiler and a matching dedicated chip?

    Maybe, I could just have another prop there, instead of a PropPlug, as I originally intended, I could find code on the Obex or attempt it myself(I'm not that good at Spin), but have that Prop read directly from the PC's com port, mimicing a USB flashdrive. Put the intended .spin files in the corresponding folders, then press a button on the board!
  • Kind of off-topic here, jmg, do you use KiCad? We may be able to share schematics on this, to be able to better understand what we are saying to each other.
  • jmgjmg Posts: 15,140
    jmg, you are dunking me in- waaaay over my head. I'm just gonna try and figure out KiCad for now.

    If I were to do what you are suggesting, Would I have to get a special compiler and a matching dedicated chip?

    Maybe, I could just have another prop there, instead of a PropPlug, as I originally intended, I could find code on the Obex or attempt it myself(I'm not that good at Spin), but have that Prop read directly from the PC's com port, mimicing a USB flashdrive. Put the intended .spin files in the corresponding folders, then press a button on the board!

    How many of these are you making, and do you need closed case / remote updates ? - or can you use the simpler pgm-plug-footprint-holes-per-prop suggested above ?
    Using another prop is fine, and I already suggested that above. That keeps the Sw side simpler.
    Typically, that PGM master prop, would hold all the 5 slave props in reset during i2c program.
  • AwesomeCronkAwesomeCronk Posts: 1,055
    edited 2018-07-27 21:47
    I was only planning on making 1, maybe 2. I don't guite understand what you mean about closed case/remote updates.
    I am going to roll with a master prop, responsible for programming and inter-prop communications.
    During the programming, I would let all of the other props remain in operation.
  • Here is my idea for this project.
  • jmgjmg Posts: 15,140
    I was only planning on making 1, maybe 2. I don't guite understand what you mean about closed case/remote updates.
    In small volumes, usually the reason for not using KISS of one-plug-per chip, is because there are constraints other than time - ie it may all be in a watertight case, or be hard to get at, so being able to update all the chips without opening the case is a real benefit.

  • Here is my idea for this project.
    You're going to build Humanoido's big brain? What do you plan on running on it?

  • Here a a snapshot of my schematic so far. As you can see, the Master Prop(far left), has three pins connecting to each of the Slave Props. For Slave 1, P0(Master) acts as the Tx pin on a PropPlug, P1(Master) as the Rx pin, P2(Master) is connected to the reset(Slave 1). The same Pattern applies to Slave 2, using P3, P4, and P5(Master).
    1241 x 556 - 40K
  • AwesomeCronkAwesomeCronk Posts: 1,055
    edited 2018-07-27 22:55
    I am building a Propeller-Based version(on a single circuit board), and I plan to just do this for the novelty of a supercomputer.
  • Maybe also to run a GUI similar to windows, while having a "Command Shell" to give BASIC(sort-of) commands that would run certain Spin subroutines in any of the 8 cogs in any of the available 5 Props.
  • jmgjmg Posts: 15,140
    I am building a Propeller-Based version(on a single circuit board), and I plan to just do this for the novelty of a supercomputer.

    You could always wait for the P2 release, and drop 5 of those onto a PCB ? ;)
Sign In or Register to comment.