Rotary Switch for Programming of P8X32A
AwesomeCronk
Posts: 1,055
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?
Comments
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
But all this begs the question; why 5 Props?
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?
- 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.
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.
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.
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 ?
You can use the free KiCad that does not have those limitations.
http://kicad-pcb.org/
Couldn't tell you. I have downloaded KiCad but have not fired it up yet.
Thanks for the link, by the way.
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
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.
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.
You could always wait for the P2 release, and drop 5 of those onto a PCB ?
http://forums.parallax.com/discussion/127983/55-parallax-propellers-parallells-processing-of-permanent-perturbations#latest