From what I see it's mostly a matter of setting up the defines and running getbytes?
Is this the barebones of what I need to get data in/out of serialdata?
As long as data is at portc.7 it continuously runs in the background as an input, loading serialdata while any other code is executing?
I can then sample serialdata when I need to in my code?
DEFINE LOADER_USED 1
DEFINE OSC 4
DEFINE HSER_RCSTA 90h ' enable serial port,
define HSER_TXSTA 24h ' enable transmit,
define HSER_SPBRG 25 ' set baudrate to 9600
DEFINE HSER_CLOERR 1 ' automatic clear overrun error
TRISC = %10000000 ' PORTC.7 is the RX input, PORTC.6 is the TX output
' Serial communication definition
Getbytes:
While RCIF = 1 ' clear the buffer
HSERIN 100,error,[Serialdata] ' take it
hserout [serialdata] ' send it
Wend
Bookmarks