dear all
I am using the pic 16f877a to make serial comm. with the PC via RS232
also i use MicroC c-compiler and the code as follows
when i tried the hyperterminal it does not receive any thing from PIC
the program is simple : send character from computer to PIC so PIC sends it back
i connected the
pin 25 :RC6 to pin 11 in max232
pin 25 :RC7 to pin 12 in max232
max232 :
Pin 13 to pin 3 in serial cable Tx
pin 14 to pin 2 in serial cable RX
Code:
unsigned short i;
void main(){
Usart_Init(19200);
Delay_ms(100);
while(1){
if (Usart_Data_Ready()) { // If data is received
i = Usart_Read(); // Read the received data
Usart_Write(i); // Send data via USART
Delay_80us();
}
}
}
Did you check the manual to see what actually is done inside Usart_Write() ? The reason I ask is it was not clear if that function check TMIF before writting to TXREG.
thanks
i checked the connection again and i know the problem , it was the serial cable connection : i use the male pin cnfiguration insted of the female to know the RX,TX,..
Did you check the manual to see what actually is done inside Usart_Write() ? The reason I ask is it was not clear if that function check TMIF before writting to TXREG