mariale442
Newbie level 2
I´m testing the USART with PIC18F4620. I'm trying a simple communication process where I'm writing "Hello World" to the Hyperterminal, but the Hyperterminal is receiving "xxxxxxxxxxxxxxxxxxxx" .I´m using C18 compiler and the C18 library.
Here is the code:
#include <p18f4620.h>
#include <usart.h>
void main (void)
{
// define a placeholder for the 2 chars
char inputstr[2];
// Configure all PORTA pins for output
TRISA = 0;
// Open the USART configured as 8N1, 9600 baud
OpenUSART ( USART_TX_INT_OFF &
USART_RX_INT_OFF &
USART_ASYNCH_MODE &
USART_EIGHT_BIT &
USART_CONT_RX &
USART_BRGH_LOW,25);
// write to the USART
putrsUSART("Hello World!\r\n");
while (1)
;
}
Here is the code:
#include <p18f4620.h>
#include <usart.h>
void main (void)
{
// define a placeholder for the 2 chars
char inputstr[2];
// Configure all PORTA pins for output
TRISA = 0;
// Open the USART configured as 8N1, 9600 baud
OpenUSART ( USART_TX_INT_OFF &
USART_RX_INT_OFF &
USART_ASYNCH_MODE &
USART_EIGHT_BIT &
USART_CONT_RX &
USART_BRGH_LOW,25);
// write to the USART
putrsUSART("Hello World!\r\n");
while (1)
;
}