Moustafa
Newbie level 5
pic16f877a serial communication
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
can anyone help me in this problem ?
thanks
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();
}
}
}
can anyone help me in this problem ?
thanks