mikesmixes777
New Member
Hi,
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
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
}