Simple Propeller to propeller communications
Hugh
Posts: 362
Hi Folks,
Can someone please commend to me a simple method of sending data (strings) from one Propeller to another? I've played with FullDuplexSerial, but without success.
Any pointers (excuse the pun) gratefully received!
Thanks
Hugh
Can someone please commend to me a simple method of sending data (strings) from one Propeller to another? I've played with FullDuplexSerial, but without success.
Any pointers (excuse the pun) gratefully received!
Thanks
Hugh
Comments
Clock out clocks Data Output, Clock IN clocks the input line. You cross the IN's and OUTs between the two props and you've got something much faster and more reliable than an async connection. Let me know if this makes sense. If not, I'll be glad to elaborate.
Jim-
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Signature space for rent, only $1.
Send cash and signature to CannibalRobotics.
I think Jim may be thinking above my head, but any elaboration might get me started.
Mike,
I have tried some more intricate approaches, but at the most 'simple end' of things tried the following as a receiver:
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
OBJ
text : "vga_Drive"
serial : "FullDuplexSerial"
PUB main | gmt
serial.start(2, 1, 1, 4800)
text.start(16)
repeat
text.out(00)
text.str(serial.rx)
waitcnt(1_000_000_0 + cnt)
with something similar at the other end, but with the Tx on one going to the Rx pin of the other and vice versa.
I have also used the gps_vga spin code from the ObEx (i.e., something which I know works) and sent a GPS NMEA sentence from the other prop.
Thanks
Hugh
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Hugh - the thinking woman's Geoffrey Pyke.
SENDER SIDE:
OBJ
serial : "FullDuplexSerial"
PUB main
serial.start(2, 3, 0, 4800)
repeat
serial.tx(88)
waitcnt(1_000_000 + cnt)
RECEIVER SIDE:
OBJ
text : "vga_Drive"
serial : "FullDuplexSerial"
pub main
serial.start(2, 3, 0, 4800)
text.start(16)
text.out(00)
repeat
text.str(serial.rx)
text.str(string("*"))
Pin 3 on the first prop is connected to pin 3 on the other and vice versa.
What I see is just the string of asterisks propagating down the page...
Have I omitted a FullDuplex Serial method or someting silly like that?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Hugh - the thinking woman's Geoffrey Pyke.
The problem with the asterisks is that "text.str" expects the address of a string. You want to use "text.out(serial.rx)". It may be that, because you have Rx connected to RX, that FullDuplexSerial is just seeing noise on the Rx line and interpreting that as garbage. You don't see the garbage because "text.str(serial.rx)" is interpreting the resulting value as an address and there's nothing displayable at that address (hopefully zero bytes which terminate the "string").
You said "Pin 3 on the first prop is connected to pin 3 on the other and vice versa"
It must be Pin 3 on the first prop is connected to pin 2 on the other and vice versa
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Sapieha
Data is moving across, but I will have to think about what is happening:
Sending '128' results in reverse video 'A' being displayed by text.out
Sending '129' results in reverse video 'B' being displayed, etc.,...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Hugh - the thinking woman's Geoffrey Pyke.
Only seven least significant bits get sent. Should have twigged that earlier!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Hugh - the thinking woman's Geoffrey Pyke.
If I send data via:
Serial.tx(1)
Serial.tx(2)
Serial.tx(3)
Serial.tx(4)
Then the data is correctly sent. However, my attempt to send a 'Long' named 'pt' as follows does not
Serial.tx(pt[noparse][[/noparse] 0 ])
Serial.tx(pt[noparse][[/noparse] 1 ])
Serial.tx(pt[noparse][[/noparse] 2 ])
Serial.tx(pt[noparse][[/noparse] 3 ])
Can a 'Long' not be ripped apart as bytes in this way?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Hugh - the thinking woman's Geoffrey Pyke.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Hugh - the thinking woman's Geoffrey Pyke.
or
Can one use usb communication between two propellers using FTDI IC'c. I picture this
The reason I ask is that I am skeptical about the USB A connectors and the FTDI ic.
You can't do USB communications that way. USB is a master-slave or host-client protocol. All USB devices are normally clients and two clients won't do anything if they're hooked together. You could hook two Propellers together, but you'd need to use something like the Parallax Memory Stick Datalogger on one side (because that's a USB host) and an FTDI USB to serial adapter on the other side (which is a USB client).
The Wikipedia article on USB (en.wikipedia.org/wiki/USB) is a good introduction to the protocol.