Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

C18 and USART problem with communication process

Status
Not open for further replies.

mariale442

Newbie level 2
Joined
Jul 28, 2006
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,324
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.

:cry::cry::cry::cry::cry::cry::cry::cry::cry:

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)
;
}
 

Re: C18 and USART

Do you set hyperterminal baud rate correctly?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top