Two props one serial device
electric550
Posts: 122
This is a silly question...maybe answered before sorry.
Ok lets say I have two propellers
Pin 1 and 2 from prop 1 are connected to serial device
Pin 1 and 2 from prop 2 are connected to the same serial device
would it be possible to communicate with prop pins in parallel with the device? I guess I am asking if there is some High Z state to put the pins of prop 1 into while prop 2 is accessing the device? Otherwise I will just use jumpers. or just disconnect device from different configuration.
Ok lets say I have two propellers
Pin 1 and 2 from prop 1 are connected to serial device
Pin 1 and 2 from prop 2 are connected to the same serial device
would it be possible to communicate with prop pins in parallel with the device? I guess I am asking if there is some High Z state to put the pins of prop 1 into while prop 2 is accessing the device? Otherwise I will just use jumpers. or just disconnect device from different configuration.
Comments
But you need to be careful on doing this because some propeller commands will force their pin into an output, even if you previously set it as an input. You will have to set the DIRA of your pin to an input every time a command uses that same pin.
I have a need to do the same thing, and I plan to clock both props on the same external clock. I set the pins as inputs, and then once i transmit data on one prop's pin, right after my TX code is done with sending serial, i set the DIRA of that same pin to an input. (because the serial code automatically changed my tx pin to an output, so I must set it back to an input once the data is transmitted in full.
DIRA 〈= Direction register for 32-bit port A.
Set Pin 1 and 2 as inputs while other prop is sending data. The only way to make sure is precise timing, or have both props use the same external clock source, and them have the program count clocks from boot, to determine which prop can send/recieve data during its "window"
You can leave the INPUTS (from serial device TO prop pins RX) you can leave that normal, each prop can read that data at the same time.
The transmit, or TX lines from the prop are what you need to be concerned about. If both props transmit at the same time, and you don't have some resistors between them, they will fry.
depending on your serial speed, you can use 330ohm resistors out each prop tx line to the serial device.
then if you do have both props TX at the same time, they won't fry.
Also you can poll the TX line on both props to see if its in use? I dunno.
I would just have both props use the same external clock, and then time the serial TX so that each prop can only transmit in its own "window".
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Meh. Nothing here, move along.
Post Edited (BPM) : 6/4/2009 12:53:45 AM GMT
If your having your 5mhz prop and the 8mhz oled prop both send TX data TO your serial device,
you could solve the problem by having a 3rd signal line running between the two props.
Just have the prop that is transmitting set that 3rd line high when it is about to transmit,
and put code that looks at that line to determine if the other prop is transmitting at that time.
Kinda like a "Request To Send (RTS) / Clear To Send (CTS)" in standard serial communications.
There are tons of ways to do this, if you run into any issues doing any of this, post here!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Meh. Nothing here, move along.
Post Edited (BPM) : 6/4/2009 1:18:21 AM GMT
If you have a need for more I/O, I would suggest Tim's expander kit:
http://www.brilldea.com/product_uoledioc.html
I bought a couple and they go together pretty quick. Has a nice connector for the Prop Plug too.
Just a side note: If you use any of the uOLED Objects, be sure and check the clock settings. These modules shipped with 8 MHz and 10 MHz xtals.
The modules I got from Parallax were 10 MHz and the ones I just got from Dontronics are 8MHz.
Jim
PS Check out Mike Green's uOLED96Prop Basic. It's fun to play with.
http://obex.parallax.com/objects/213/
Also check out Ray's uOled-96-Prop: Serial Interface.
http://obex.parallax.com/objects/322/