View previous topic :: View next topic |
Author |
Message |
mohamad eisa
Joined: 22 Feb 2013 Posts: 1
|
Serial communication rs232 (from pic to pc) |
Posted: Fri Feb 22, 2013 9:53 am |
|
|
Help me plz to receive data from pc in pic16f877a.
This code for transmitted data from pic to lcd and pc (hyper terminal ) thruogh serial port its work.
But i don't know how to receive the feedback from pc in pic and lcd.
plz help
Code: |
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,stream=PC)\\hex file
void main() {
char k;
lcd_init();
kbd_init();
fprintf(PC,"\t Hi");
lcd_putc("\fENTER U ACUNT...\n");\\display in lcd working
k=0;
while (TRUE) {
k=kbd_getc();
if(k!=0)
if(k=='*')
lcd_putc('\f');
else
lcd_putc(k);
fprintf(PC,"\t%c",(char)k); \\ its working in hiper terminal
}
}
|
|
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Fri Feb 22, 2013 11:15 am |
|
|
Hi,
You've tacked your question onto a totally unrelated thread. Don't do that,
start your own thread. In your new thread, tell us your compiler version
number, and how you have your PIC wired to your PC. A simple schematic
would be ideal. Also, post a complete test program that we can compile. Your
code as posted is not complete.
John
+++++++++++++++++++
Split into new thread per request.
- Forum Moderator
+++++++++++++++++++ |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Fri Feb 22, 2013 5:42 pm |
|
|
I don't understand your question. Please rephrase.
Tell me, in short simple statements:-
1) What works.
2) What does not work.
3) What you want to do.
Mike |
|
|
|