Hi,
I can not get arround to read the RFID reader.
I was able to properly read my RFID by connecting to pin 3 from my computer's serial port and using hyperterminal so I know the RFID module is working.
Running my code bellow I see the word "test" on my LCD so I know the LCD is properly connected but everytime I get a beep out of my RFID tag I get garbage characters and different characters every time I use the same tag, I am using the dev board that came with Pickit2 (16F887) and connected LCD in 4 bit mode to port B0-B3, RS to B4 and EN to B5 with output of RFID to port C7.
Any help would be appreciated to get me started.
Thank you.
Code:
INCLUDE "modedefs.bas"
DEFINE OSC 4
TRISB = %11000000
ADCON0 = %00000000
ANSELH = %00000000
WPUB = %00000000
IOCB = %00000000
DEFINE LCD_DREG PORTB ' Set LCD Data port
DEFINE LCD_DBIT 0 ' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
DEFINE LCD_RSBIT 4 ' Set LCD Register Select bit
DEFINE LCD_EREG PORTB ' Set LCD Enable port
DEFINE LCD_EBIT 5 ' Set LCD Enable bit
DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
DEFINE LCD_LINES 2 ' Set number of lines on LCD
DEFINE LCD_COMMANDUS 2000' Set command delay time in us
DEFINE LCD_DATAUS 50 ' Set data delay time in us
define HSER_RCSTA 90h
'DEFINE HSER_TXSTA 20h
DEFINE HSER_BAUD 9600
DEFINE HSER_SPBRG 25
define HSER_CLROERR
A0 var byte
A1 var byte
A2 var byte
A3 var byte
A4 var byte
A5 var byte
A6 var byte
A7 var byte
A8 var byte
A9 var byte
A10 var byte
A11 var byte
LCDOUT $FE,1,"test" 'clear lcd
pause 1000
LCDOUT $FE,1
main:
HSERIN [A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11]
LCDOUT $FE,1,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11
goto main
End
Bookmarks