Pedro Pinto
- 6th May 2009, 17:40
Hello All
I try to comunicate via Usart on PORTC.6 and PORTC.7 with Pic 18F4520
and initiate with this:
' Initialize USART
TRISC = %10111111 ' Set TX (PortC.6) to out, rest in
SPBRG = 25 ' Set baud rate to 2400
RCSTA = %10010000 ' Enable serial port and continuous receive
TXSTA = %00100000 ' Enable transmit and asynchronous mode
or with this:
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h
DEFINE HSER_BAUD 2400
DEFINE HSER_SPBRG 25
DEFINE HSER_CLROERR 1
but, everytime i want compile the programm it show error messages like:
Symbol not previously defined (RC2IF)
Symbol not previously defined (PIR3)
Symbol not previously defined (RCREG2)
Symbol not previously defined (TX2IF)
Symbol not previously defined (SPBRG2)
Symbol not previously defined (TXREG2)
Symbol not previously defined (TXSTA2)
Symbol not previously defined (RCSTA2)
I use PBP Pro 2.50 and Pic 18F4520
with instruction like this:
HSERIN2 800,final,[wait ("P"),dec2 function,dec3 pcb,dec3 dumy]
Anyone idea what i make wrong?
Thanks for help
Regards
Pedro
I try to comunicate via Usart on PORTC.6 and PORTC.7 with Pic 18F4520
and initiate with this:
' Initialize USART
TRISC = %10111111 ' Set TX (PortC.6) to out, rest in
SPBRG = 25 ' Set baud rate to 2400
RCSTA = %10010000 ' Enable serial port and continuous receive
TXSTA = %00100000 ' Enable transmit and asynchronous mode
or with this:
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h
DEFINE HSER_BAUD 2400
DEFINE HSER_SPBRG 25
DEFINE HSER_CLROERR 1
but, everytime i want compile the programm it show error messages like:
Symbol not previously defined (RC2IF)
Symbol not previously defined (PIR3)
Symbol not previously defined (RCREG2)
Symbol not previously defined (TX2IF)
Symbol not previously defined (SPBRG2)
Symbol not previously defined (TXREG2)
Symbol not previously defined (TXSTA2)
Symbol not previously defined (RCSTA2)
I use PBP Pro 2.50 and Pic 18F4520
with instruction like this:
HSERIN2 800,final,[wait ("P"),dec2 function,dec3 pcb,dec3 dumy]
Anyone idea what i make wrong?
Thanks for help
Regards
Pedro