View Full Version : Need Help with the FullDuplexSerial.class ...
02-03-2007, 01:01 AM
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.
02-03-2007, 01:43 AM
Not sure about what you are doing but if you use simple serial with the gps module lets say it would be something like this
(whatever speed you need)
text."tv_text" 'or vga or whatever
repeat a from 0 to 119 '120 read at a shot
repeat a from 0 to 119
waitcnt(80_000_000+cnt)'wait one second
02-03-2007, 01:43 AM
make sure your indentation is correct as my reply did not include it
02-03-2007, 01:44 AM
First of all, have a look at the source code for FullDuplexSerial.spin which is included with the Propeller Tool. As is true with many of the I/O drivers written by a variety of people, there are comments, some detailed, that explain how the driver works and how to use it. Many of these drivers also come with a simple demo program. As an example for FullDuplexSerial:
ser : "FullDuplexSerial" ' Full Duplex Serial Controller
_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))
if (c := rxtime(500)) => 0 ' Wait up to 500ms for a character
case c of
' do something with a digit
' do something with a letter
' ok, here's a return
' backspace key
02-04-2007, 10:40 AM
Thanks guys, I will study this and ask further questions if needed.
Very Helpfull !