• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

possible for uart receiving?

Status
Not open for further replies.

butters

Member
is this code possible for uart receiving?

Code:
#include <p18C452.h>
#include <usart.h>

char readUSART(void);
char firstCh;
char nextCh;

void main(void){


	// configure USART
  OpenUSART( USART_TX_INT_OFF  &
             USART_RX_INT_OFF  &
             USART_ASYNCH_MODE &
             USART_EIGHT_BIT   &
             USART_CONT_RX     &
             USART_BRGH_HIGH,25);

 

 while (!DataRdyUSART()) 
{
firstCh = ReadUSART();
}

	while (!DataRdyUSART())
	{
	nextCh = ReadUSART();
 	} 	

}

but when i tested it out, theres a signal coming out from the TX pin... strangely... and how do i make it so that when a data is transmitted via hyperterminal, a LED would light up?
im using c18 compiler with pic18f452...
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top