is this code possible for uart receiving?
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...
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...