Receiving Serial
heathclf
Posts: 43
Hello all,
I've posted before, but am still very new to microcontrollers. I'm trying to receive string / numbers / whatever from my pc to my propeller chip. I'm using FullDuplexSerial, just because, but can't get it to work.
My code is really just:
Debug.rx
Debug.str(string(rxbyte))
Where:
OBJ
Debug: "FullDuplexSerial"
and
PUB rx : rxbyte
'' Receive byte (may wait for byte)
'' returns $00..$FF
repeat while (rxbyte := rxcheck) < 0
I keep getting errors. Any help would be much appreciated. When replying, please don't assume I know too much.
Thanks.
I've posted before, but am still very new to microcontrollers. I'm trying to receive string / numbers / whatever from my pc to my propeller chip. I'm using FullDuplexSerial, just because, but can't get it to work.
My code is really just:
Debug.rx
Debug.str(string(rxbyte))
Where:
OBJ
Debug: "FullDuplexSerial"
and
PUB rx : rxbyte
'' Receive byte (may wait for byte)
'' returns $00..$FF
repeat while (rxbyte := rxcheck) < 0
I keep getting errors. Any help would be much appreciated. When replying, please don't assume I know too much.
Thanks.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I am 1011, so be surprised!
Advertisement sponsored by dfletch:
Come and join us on the Propeller IRC channel for fast and easy help!
Channel: #propeller
Server: irc.freenode.net or freenode.net
If you don't want to bother installing an IRC client, use Mibbit. www.mibbit.com
Here's some source code from the library:
PUB start(rxpin, txpin, mode, baudrate) : okay
'' Start serial driver - starts a cog
'' returns false if no cog available
''
'' mode bit 0 = invert rx
'' mode bit 1 = invert tx
'' mode bit 2 = open-drain/source tx
'' mode bit 3 = ignore tx echo on rx
stop
longfill(@rx_head, 0, 4)
longmove(@rx_pin, @rxpin, 3)
bit_ticks := clkfreq / baudrate
buffer_ptr := @rx_buffer
okay := cog := cognew(@entry, @rx_head) + 1
using a 1 or a 0 doesn't seem to invert the output. How can I accomplish this?
Thanks a lot.