Help For Beginner - Communicate between SX'es?
MyYz400
Posts: 11
My project has ALOT of inputs and outputs. Aprrox 22 Inputs and 24 Oututs needed. So this is much more than even the 44pin SX can handle. So I was thinking of having one of the SX just handle inputs and another handle outputs and just serial between them (so only use 1 or 2 lines for comm). I was almost thinking of sending a serial strip of info every so often defining input status. Like (11011001) as in Input1=hi; Input2=hi; Input3=lo; etc.
Anyone able to lead me in the right direction on how to accomplish this? I've done minor playing around with the SX proto board, but not a whole lot. I have a fair amount of experience in electronics, just kinda new to the MC world. Links to guides, or a laymans directions would be much appreciated. Thanks in advance!
Oh, about 6 of the inputs and 6 of the outputs are analog, but I was going to wait to tackle that one.
Anyone able to lead me in the right direction on how to accomplish this? I've done minor playing around with the SX proto board, but not a whole lot. I have a fair amount of experience in electronics, just kinda new to the MC world. Links to guides, or a laymans directions would be much appreciated. Thanks in advance!
Oh, about 6 of the inputs and 6 of the outputs are analog, but I was going to wait to tackle that one.
Comments
Open true means that there is a pullup on the single wire connecting the two SX serial pins and the SXes drive the pin LOW and release (to INPUT) to high.
Now, that said, for a project like this, rather than programming and debugging two micros, I would probably just pick up three '595 shift out registers and three '165 shift in registers to handle the extra inputs/outputs. That way I would have a single SX and I would only need four pins to control the six peripheral chips (one data, one clock, two latches -- one latch for the chain of '595 outputs and one for the chain of '165 inputs).
Whoops, just realized some of your IO is analog. So two micros may be necessary (or you could add a SPI controlled ADC and DAC to your chain of SPI peripherals, sharing clock and data lines).
Search the SX forum for "serial" -- you'll find lots of examples.
74HC165 Parallel to Serial
http://www.parallax.com/Store/Components/AllIntegratedCircuits/tabid/154/CategoryID/31/List/0/SortField/0/catpageindex/2/Level/a/ProductID/230/Default.aspx
74HC595 Serial to Parallel
http://www.parallax.com/Store/Components/AllIntegratedCircuits/tabid/154/CategoryID/31/List/0/SortField/0/catpageindex/2/Level/a/ProductID/229/Default.aspx
MCP3208 8-Channel 12-Bit A/D Converter with SPI Serial Interface
http://www.parallax.com/Store/Components/AllIntegratedCircuits/tabid/154/CategoryID/31/List/0/SortField/0/catpageindex/2/Level/a/ProductID/573/Default.aspx
There are plenty of examples on the web for wiring these chips up. If you use them you may be able to get by with just a single SX processor.
Robert