View previous topic :: View next topic |
Author |
Message |
Andrew911tt Guest
|
need a lot of help with RFID module |
Posted: Wed Mar 12, 2008 2:26 pm |
|
|
Ok I am using a PIC16F877A and a Parallax RFID Reader Module 2814
parallax.com/Portals/0/Downloads/docs/prod/audiovis/RFID-Reader-v1.2.pdf
I am just trying to read the ID and then output it.
Code: | #include <protoalone.h>
#include <utility.c>
#include <stdlib.h>
#include <input.c>
#use rs232 (baud=2400, parity=N, bits=8, stop=1, xmit=PIN_C3, rcv=PIN_C2, stream=RFID)
#use rs232 (baud=9600, xmit=PIN_C6, rcv=PIN_C7, stream=COMP)
#define RFID_ON PIN_C1
void main() {
char string_a[20]="no ID";
fprintf(COMP,"\r\n%s",string_a);
output_low (RFID_ON);
gfgets(string_a,RFID);
output_high (RFID_ON);
fprintf(COMP,"\r\n%s",string_a);
} |
|
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Wed Mar 12, 2008 5:18 pm |
|
|
Where is the code for gfgets()?
What is your question? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Mar 12, 2008 5:33 pm |
|
|
You didn't show your #fuses statement. It might have problems.
But at a minimum, you need to add a while(1); statement at the end
of main(). The compiler puts a hidden sleep instruction there. Without
that statement, you will miss the last two characters of your ID value. |
|
|
Guest
|
|
Posted: Wed Mar 12, 2008 5:34 pm |
|
|
ckielstra wrote: | Where is the code for gfgets()?
What is your question? |
Sorry that is suppose to be fgets() typo when posting here
Why is it not working i think it has some thing to do with fgets() or the #use rs232 for the rfid |
|
|
|