I am using a PIC18F252. I can send data to hyperterminal successfully.
My question, where in your code do you "look" for data received? I'm using Asynchronous mode. I read that RCIF will be set when reception is complete and an interupt generated "IF" they are enabled. There is a way without using interupts...
DO i write a seperate routine to check for data received...if so how?
Any help will be appreciated.
Thanks
Code:
void init_usart(void)
{
TXSTA=0b00100100; // Asynch,8bits,tx enb
RCSTA=0b10010000; // Cont receive enb
SPBRG=129; // BaudRate=9600 @ 20Mhz as Table
RCSTAbits.SPEN=1; // Enable Serial Port
}
void write_usart(unsigned char send_ch)
{
TXREG = send_ch;
while(TXSTAbits.TRMT==0); // Wait for TX to finish
}
hey, when you set up the tx pin of the uart, did you set its direction as input or output? Some people on this forum have said it should be set as input, which i found a bit confusing. Thanks