I accept with linghtgreen about code:
Coding as below:
Define osc 8
define HSER_RCSTA 90H 'Enable serial port and continous receive
DEFINE HSER_TXTSTA 24H 'Enable transmit
DEFINE HSER_BAUD 9615
DEFINE HSER_CLROERR 1 'Clear overflow automatically
ADCON1 = 7
TRISB.0 = 1 'switch
TRISB.2 = 0 'LED
TRISC.6 = 0 'set TX(portC.6) to out
TRISC.7 = 1 'set RX(portC.7) to in
led1 var portb.2
Bookmarks