TTL Serial out
tellurian
Posts: 52
OK I'm stumped and so embarrassed ... this should be easy
I am using Full DuplexSerial to set up a TTL serial connection do a synapse wireless device (http://www.synapse-wireless.com/snap-components/rf-engine ... they blow the pants off Xbee btw:).
I can read data from the Synapse module just fine ... but tx from propeller is sending nothing (!! ?). for example ... I send "scan" to the module but the propeller only outputs 0xFF for each character (or is it 0x00? lol ... looking at it on the scope ... not sure if I have the scope polarity right)
Here is a test program:
basically pin 4 only ever puts 0xFF (or 0x00 like I said ... per the scope) ... certainly NOT "scan"
What am I doing wrong (and stupid) ?
Thanks for any insight & help
I am using Full DuplexSerial to set up a TTL serial connection do a synapse wireless device (http://www.synapse-wireless.com/snap-components/rf-engine ... they blow the pants off Xbee btw:).
I can read data from the Synapse module just fine ... but tx from propeller is sending nothing (!! ?). for example ... I send "scan" to the module but the propeller only outputs 0xFF for each character (or is it 0x00? lol ... looking at it on the scope ... not sure if I have the scope polarity right)
Here is a test program:
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 '------------------------------------------------------------------------------- 'Propeller Pinout '------------------------------------------------------------------------------- sio_rx = 3 'propeller IO pin for serial tx from Synapse RF sio_tx = 4 'Propeller IO pin for serial rx to Synapse RF OBJ SIO : "fullduplexserial" PUB start | gx, tmr1, idx, str, tmp SIO.start( sio_rx, sio_tx, 0, 9600 ) repeat SIO.str( string ("scan" ) ) waitcnt( 3000000 + cnt )
basically pin 4 only ever puts 0xFF (or 0x00 like I said ... per the scope) ... certainly NOT "scan"
What am I doing wrong (and stupid) ?
Thanks for any insight & help
Comments
waitcnt(_clkfreq*2 +cnt) 'wait 2 secs
or
waitcnt(_clkfreq/1000 + cnt) 'wait 1ms
Your delay is (assumed 80MHz) 3,000,000 / 80,000,000 = 37.5ms. At 9600 baud, this is ~1000 chars/sec. So you are actually fine.
Have you tried outputting FDX to pins 30/31 and looking with PST (parallax serial terminal)? You should add a delay before you start to send to give you time to invoke PST.
The wait is just junk I just wanted a break between send in the "scan" messages. FDS should work with any pins and I need a TTL connection not using pins 30/31. I am not implying there is something wrong with FDS, rather I am sure that I am overlooking something. The above test "program" is just to show a very simple example ... it should be outputting "scan" but all I see is the start bit and the stop bit with 0x00 for each character.. I have tried this on 3 different parallax chips and always get the same result. The device I talk to will output a string on command and I can read it just fine, but nothing comes out of the prop's TX pin (the simple program shown should output the "scan" command but does not). I tried pullups and pull downs (i.e. all ttl -> RS232 chips do that internally) but no difference
So ... if anyone has done a serial TTL connection to some (any) device, perhaps you could provide some insight or point me to some place (URL) with an example.
I see this on the scope on pin 4 :
I do not have anything connected to the propeller, just put a scope probe on pin4 ... I see start and stop bits but the message bytes are all 0x00 ... not "scan".
Tks
Here is how the output of your code looks on my scope:
Andy
At any rate I swapped out FDS for PST and presto its working like it should! For some reason FDS just keeps shooting out blank characters (I have no clue why atm). So I will just use PST instead, probably will trim out the terminal stuff (don't need it). I am using the Text based GUI for VGA_HiRes_Text Driver I wrote a long time ago to monitor and control a network of Synapse RF modules so I need to maximize the space (the VGA_HiRes_Text driver gobbles up a good chunk of memory, even at 800x600).
I've never been a fan of XBee, the Synapse RF Modules are way easier to use, cheaper, more powerful (will run user code right in the module), and have fantastic range ...up to 3 miles LOS. (no I don't own stock, lol).
Looks like your FDS is broken.Do you perhaps have a modified version in the same directory as your test spin code? The compiler will then compile this version and not the one from the library.
Andy