Multi prop communication/loading
hinv
Posts: 1,255
I was wondering if anyone has done this in a standard sort of way.
It appears that there are just not enough pins to control everything for some projects that I have in mind like running parallel LCD's, attaching memory chips, etc.
I know most people have used serial LCD's, but if you look at the price diference, I think it would be cheaper to use another prop chip, and then loading the slave prop from the master prop, and then maybe using the same 2 i2c lines for communication.
I just didn't want to reinvent the wheel here if somebody has done it.
It appears that there are just not enough pins to control everything for some projects that I have in mind like running parallel LCD's, attaching memory chips, etc.
I know most people have used serial LCD's, but if you look at the price diference, I think it would be cheaper to use another prop chip, and then loading the slave prop from the master prop, and then maybe using the same 2 i2c lines for communication.
I just didn't want to reinvent the wheel here if somebody has done it.
Comments
www.mikronauts.com - a new blog about microcontrollers
I tied three port pins between each of the Props, not really knowing how I was going to use them to communicate, but I figgured it would be enough to make something work.· Once I actually started writing a·function·to communicate between all three Propellers, I found that two pins were enough.·
I'll post my code if anyone REALLY wants it, but it's such a·hack that I'm pretty sure anyone could easily improve on it.
My inter-prop communication function works like this:··
·
·· The two com·signals are Clock and Data
··· The data pin is pulled low with a resistor.·· This lets any of the three props put data out on this line.
·· one of the Props ( will call it Prop-A ) generates the clock signal. It starts with a syncronization pulse that
···is low for a count of ten.· ( it can be shorter or longer, there just needs to be enough time for the other
·· two propellers to realize that it's been low for a while )
·· As soon as the clock line goes high, this begins the transmission of a frame of data.
·· the frame consists of three blocks that belong to each propeller in turn.· I'm using 32 bits for each propeller, ( any·block size should·work)··on the first·32·clock pulses , Propeller A puts it's 32 bits worth of data out on·the data pin. When the clock count gets to 33, that is the start of Propeller B's 32 bit data frame, and so on until 96 clocks·have·passed.· This lets each propeller have it's turn to talk and·each can read the data coming from the other two propellers as well.
I'm not doing anything fancy with this format, I'm just using it as flags to indicate an I/O condition or start or stop·a function on one of the other processors, but it should be·fairly easy to do more complex communication if necessary.
As for·plain old vanilla·I/O, ·the port expansion chips using· I2C communication look like a great solution. Go to Digikey an type in "expansion"· you'll get a list of chips that let you add between 8 and 40 I/O lines that only tie up 2 of the Propellers pins.· I haven't·actually used them yet, but I'm laying out a new board right now that I'll be using a couple of them on. It seems pretty simple.
I'd also love to know if someone has a better way to let multiple propellers talk with each other.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
" Anything worth doing... is worth overdoing. "
··············································· ( R.A.H. )
····································