Need Help with the FullDuplexSerial.class ...
Hello,
I am new to the prop chip and object code. I am assuming that the FullDuplexSerial Code is a driver that sets up· communication for the prop. After the code is programmed in the chip can I just give a command to wait for serial data and if so could someone please give me an example for 9600 baud, 8-data bits and one stop bit, no parity.
Thank You.
I am new to the prop chip and object code. I am assuming that the FullDuplexSerial Code is a driver that sets up· communication for the prop. After the code is programmed in the chip can I just give a command to wait for serial data and if so could someone please give me an example for 9600 baud, 8-data bits and one stop bit, no parity.
Thank You.
Comments
con
(whatever speed you need)
obj:
serial:"simple serial"
text."tv_text" 'or vga or whatever
var
byte temp[noparse][[/noparse]120]
pub start|a
serial.start(pin,pin,4800)
repeat
text.out($1)
repeat a from 0 to 119 '120 read at a shot
temp[noparse][[/noparse]a]:=serial.rx
repeat a from 0 to 119
text.out(temp[noparse][[/noparse]a]
waitcnt(80_000_000+cnt)'wait one second
[noparse][[/noparse]code]
obj
ser : "FullDuplexSerial" ' Full Duplex Serial Controller
con
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
serRecv = 0 ' Receive on I/O pin 0
serXmit = 1 ' Transmit on I/O pin 1
pri main | c
' Note that FullDuplexSerial does not handle parity and always
' uses 8 data bits and one stop bit. There are options for inverting
' either the transmit or receive lines or both and options for "open"
' signalling (open collector/drain) on transmit and for throwing away
' echoed received characters.
ser.start(serRecv,serXmit,%0000,9600) ' 9600 Baud
ser.str(string("This is a test string that will be transmitted.",13,10))
repeat
if (c := rxtime(500)) => 0 ' Wait up to 500ms for a character
case c of
"0".."9":
' do something with a digit
"A".."Z","a".."z":
' do something with a letter
13:
' ok, here's a return
8:
' backspace key
Very Helpfull !
jmlprop