xpress_embedo
Advanced Member level 4
I want to use two Serial Ports in a Single Controller.. Thats why i choose PIC16F877A having one Serial Port...
I read the CCS Help topics??
How can I use two or more RS-232 ports on one PIC®?
And Just Copy Paste its Code and program my Controller.. but it is neither working on hardware nor on proteus...
Pls help
Here is My Code
Online A and Online B are Coming properly but when i type character in COM_A Nothing happens...
fgetc is not working
Pls help
Thanks in Advance
I read the CCS Help topics??
How can I use two or more RS-232 ports on one PIC®?
And Just Copy Paste its Code and program my Controller.. but it is neither working on hardware nor on proteus...
Pls help
Here is My Code
Code:
#include<16f877a.h>
#use delay(clock = 20000000)
#fuses HS,NOWDT,NOPROTECT,NOBROWNOUT
#use RS232(BAUD=9600, XMIT=PIN_C6, RCV=PIN_C7, STREAM=COM_A)
#use RS232(BAUD=9600, XMIT=PIN_C4, RCV=PIN_C5 , STREAM=COM_B)
void main()
{
char c;
fprintf(COM_A,"Online-A\n\r");
fprintf(COM_B,"Online-B\n\r");
while(TRUE)
{
c = fgetc(COM_A);
fputc(c, COM_A);
fputc(c, COM_B);
}
}
Online A and Online B are Coming properly but when i type character in COM_A Nothing happens...
fgetc is not working
Pls help
Thanks in Advance