need guidance, how to communicate and update variables between propellers
laser-vector
Posts: 118
I have two propellers
the first one is running a touchscreen display with graphics, numbers and other objects. its pretty much maxed out on memory. so i have a second propeller that i want to read all of the sensors in my project and transfer that data to the first propeller.
where should i start learning about multi-propeller communication?? what different methods are available (eg. prop #2 updates prop #1's variables <or> prop #1 reads from prop #2...)
what types of communication methods (protocols) are easy to start learning this (eg. asynchronous RS232 or clocked serial data..)??
any help would be great!
Thx
the first one is running a touchscreen display with graphics, numbers and other objects. its pretty much maxed out on memory. so i have a second propeller that i want to read all of the sensors in my project and transfer that data to the first propeller.
where should i start learning about multi-propeller communication?? what different methods are available (eg. prop #2 updates prop #1's variables <or> prop #1 reads from prop #2...)
what types of communication methods (protocols) are easy to start learning this (eg. asynchronous RS232 or clocked serial data..)??
any help would be great!
Thx
Comments
RS232 at the TTL level is "off=3.3V, on=0V) so you can put a led on the line with a dropping resistor and the anode of the led on the 3V line, so it flashes when data goes through. That makes debugging a whole lot easier.
The RS232 code has big buffers, so you can send a burst of data and the other prop can read it out when it is ready. This is where the propeller really shines compared with so many other microcontrollers - you can have a cog buffering all that data all in the background.
At times I've even resorted to silly slow baud rates (110 baud, anyone?) to debug things. Then ramp up the speed when it is working. You can make it as fast as pasm will go (or until problems like line capacitance and reflection start becoming a problem, but that is up in the megahertz).
i gave that code in your sig a try,
i loaded the Prop_Comm_Demo onto two props,
made sure that prop 1's rx went to prop 2's tx and vise verse.
installed the two 10k pull-down resistors.
connected a 200mhz scope to the tx pin on prop 1.
i see the data flow but when running at PLL 16x i see a lot of transiant voltage spikes (like little inductive peaks on the leading edge of the square waves..) and to me the data doesn't look very clean...
when i turn the PLL down to 4x the transient peaks are still present but the square waves are much more defined!!
so, aside from all that, when i run this code and debug it on the parallax serial terminal all i get are warnings
what should it be debugging if information did not differ??
by different does it mean corrupt or nothing is there???
i was really hoping someone could shed some light on this issue
It is best for you to load some known data into the TX propeller and just make sure it is coming over to the RX propeller. Because you are getting movement on the line my guess is that the data is being sent, but the seeds won't sync.
Keep in mind that both propellers must be the same clock speed (+/- 0.2%) which shouldn't be a problem with most crystals, but you just need to keep that in mind when reprogramming them to slower speeds.
Here is a photo of my propeller. Also on a breadboard. I have decoupling caps and 1000µF cap on power, a pulldown resistor on the line I am measuring. There is still a bit of a spike, but nothing like you are seeing.
i was originally using some skinny volt meter probes but once i replaced them with a nice insulated probe the square waves were apparent.
as you can see: Ch1 (yellow) is the crappy volt meter probes while Ch2 (blue) is the probe designed for the oscilloscope