mizzard
Joined: 26 Apr 2009 Posts: 11
|
rs232 in 16F84 1 wire free |
Posted: Sun Apr 26, 2009 7:43 pm |
|
|
Hello, I have a problem.
I'm using a goldwafer card (pic16f84) and I only have b7 pin to communicate with other pic, 18f2550. I'm trying to use
Code: |
#use rs232(stream = SALIDA_PC,baud=9600,parity=N,xmit=PIN_C7,bits=8)
#use rs232(stream = ENTRADA_WAFER, baud= 9600, parity=N, RCV=PIN_C7, bits=8)
|
The same pin to xmit and rcv, and I use fgetc(stream) when I want to read and fprintf(stream, "") when I want to write.
These works ok in 2550 but when I try to do the same in 16f84, when I use fprintf(stream,""), works ok, but when I want to read some sequence from 2550 using fgetc(stream), it doesn't work.
I can see the data transmission using a rs232 with hyperterminal, and I can see all that I send between 2 pics. The communication is:
PIC16F84 sends some string
PIC18f2550 reads the string and answers with other one
PIC16f84 reads the string and answers with other one
end
Well, if 16f84 doesn't read with fgetc, I can see all ok, but when i put in my code fgetc, the 2550 answer is wrong.
Any idea???
May I use other form to do this?? (I need some bidirectional code!)
Thanx a lot!!! |
|