View previous topic :: View next topic |
Author |
Message |
jasmine126 Guest
|
need help on RFID! |
Posted: Tue May 27, 2008 8:56 pm |
|
|
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
|
RFID |
Posted: Wed May 28, 2008 12:43 am |
|
|
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
|
|
Posted: Wed May 28, 2008 1:48 am |
|
|
#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 |
Posted: Wed May 28, 2008 1:50 am |
|
|
*if i'm not using any serial cable. |
|
|
horkesley
Joined: 20 Feb 2007 Posts: 48 Location: Essex UK
|
RFID |
Posted: Wed May 28, 2008 2:03 am |
|
|
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
|
|
Posted: Wed May 28, 2008 7:30 am |
|
|
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.
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
|
RFID |
Posted: Wed May 28, 2008 12:08 pm |
|
|
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 |
|
|
|