i have this code for uart receiving...
it is not working..
can somebody help me?
im trying to send bits from hyperterminal to usart... hence the uart is in receiving side...
it is not working..
can somebody help me?
im trying to send bits from hyperterminal to usart... hence the uart is in receiving side...
Code:
#include <p18C452.h>
#include <usart.h>
char readUSART(void);
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 );
firstCh = ReadUSART();
nextCh = ReadUSART();
while (!DataRdyUSART()) /* busy wait*/;
firstCh = ReadUSART();
while (!DataRdyUSART()) /* busy wait*/;
nextCh = ReadUSART();
//CloseUSART();
}