CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

need a lot of help with RFID module

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Andrew911tt
Guest







need a lot of help with RFID module
PostPosted: Wed Mar 12, 2008 2:26 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Mar 12, 2008 5:18 pm     Reply with quote

Where is the code for gfgets()?

What is your question?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Mar 12, 2008 5:33 pm     Reply with quote

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








PostPosted: Wed Mar 12, 2008 5:34 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group