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 CCS Technical Support

need help on RFID!

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







need help on RFID!
PostPosted: Tue May 27, 2008 8:56 pm     Reply with quote

hello i really need help on this.

i'm using a rfid reader from parallax. i need to read input from the reader then display on a LCD. the reader's sout pin is connected to PIC18F4550's RX pin which is pin_C7 while the reader's enable pin is connected to PIC18F4550's TX pin which is pin_C6.

the enable pin need to be pulled low to activate the reader. so the coding is output_low(PIN_C6);?

whereas if i wanna take input from pin_C7, the coding is
do
{
if(input(pin_c6)==1)
{
lcd_putc("\f tag detected ");
delay_ms(1000);
}

}while(1);

anything else i miss out? thanks!
horkesley



Joined: 20 Feb 2007
Posts: 48
Location: Essex UK

View user's profile Send private message Send e-mail Visit poster's website

RFID
PostPosted: Wed May 28, 2008 12:43 am     Reply with quote

Hi,

I think you have missed a lot of code.

I think the Parallax device outputs RS232?

Post your fuses.

Regards,
_________________
Horkesley Electronics Limited
jasmine126
Guest







PostPosted: Wed May 28, 2008 1:48 am     Reply with quote

#include <18F4550.h>
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV2,VREGEN
#use delay(clock=48000000)

#include <lcd.c>

#define LCD_E PIN_D0
#define LCD_RS PIN_D1
#define LCD_RW PIN_D2
#define LCD_DB4 PIN_D4
#define LCD_DB5 PIN_D5
#define LCD_DB6 PIN_D6
#define LCD_DB7 PIN_D7

#define RX PIN_C7
#define TX PIN_C6

void main()
{
lcd_init();
output_low(PIN_C6);

do
{
if(input(PIN_C7)==1)
{
lcd_putc("\f Tag Detected ");
delay_ms(100000);
}
}while(1);

}

thanks for the reply. this is the whole coding. i want the LCD to display "Tag detected" when i scan the tag but when it seems like it's constantly displaying the word. do i need to include #useRS232 if i'm using any serial cable?
jasmine126
Guest







typo
PostPosted: Wed May 28, 2008 1:50 am     Reply with quote

*if i'm not using any serial cable.
horkesley



Joined: 20 Feb 2007
Posts: 48
Location: Essex UK

View user's profile Send private message Send e-mail Visit poster's website

RFID
PostPosted: Wed May 28, 2008 2:03 am     Reply with quote

Hi,

You seem to have two issues here, the LCD and the RFID device. Why not get one part working first, then add the second parts code.

As I understand it the Parallax device gives out a RS232 string when the correct code is detected. So I would suggest using #use RS232...etc. and see if you can read in the code from the RFID.

Make sure you have the RS232 polarity correct.

When this works add the code for the LCD.

Regards
_________________
Horkesley Electronics Limited
jasmine126
Guest







PostPosted: Wed May 28, 2008 7:30 am     Reply with quote

i've tried reading the tags using RS232 and hyperterminal. worked fine. but now i need to take input from rfid then display on LCD without going through computer. meaning i won't be using a RS232. Sad

basically it's like the one from this site: tekcrack.com/arduino-lcd-wshift-parallax-rfid.html but the coding is different. some part i don't know how to modify thus resulting in many errors.
horkesley



Joined: 20 Feb 2007
Posts: 48
Location: Essex UK

View user's profile Send private message Send e-mail Visit poster's website

RFID
PostPosted: Wed May 28, 2008 12:08 pm     Reply with quote

You must use the RS232 input on the PIC to read the RFID unit.

I suggest you use the rda interrupt to do this.

There are numerous examples on this forum.

Are you the same person as jinggy?

Regards,
_________________
Horkesley Electronics Limited
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