Hi all,
I came across a tutorial on using USART with the PIC18F. The coding in the tutorial is the one below:
When building the program, the attached errors are occurring. Why is that?
I included the #include <usart.h> library. Is this the correct one?
Thanks in advance.
I came across a tutorial on using USART with the PIC18F. The coding in the tutorial is the one below:
Rich (BB code):
void main(void)
{
TRISC.RC7= 1; // Make UART RX pin input
TRISC.RC6= 0; // Make UART TX pin output
/* asynchronous mode, 8-bit data, HIGH baud rate, transmit enabled */
TXSTA = 0X24;
/* 9600 BAUD RATE, Fosc=10MHZ, SO SPBRG VALUE IS SET AS 0X40 */
SPBRG = 0X40;
/* serial port enable bit is set HIGH */
RCSTA.SPEN = 1;
TXREG = 'S'; // Data loaded into TXREG Register
While (PIR1.TXIF == 0); //wait till TXIF bit is low
I included the #include <usart.h> library. Is this the correct one?
Thanks in advance.
Attachments
-
36.5 KB Views: 23