ÿþ '' '' Parallax RFID Reader '' ____________________________________ '' | | R1: 1K Ohms '' | | (Limits current to P1) '' | ______________ | '' | | | | '' | | | | '' | | | GND |" ------> Ground '' | | | SOUT |" --R1--> P1 '' | | _____________| ENABLE |" ------> P0 '' | Vcc |" ------>+5V DC '' | | '' |____________________________________| '' '' '' EXAMPLE 22 '' '' RFID READER WITH VIDEO OUTPUT ''**************************************************************** ''IMPORTANT: Do not connect RFID +5 volt supply to the Propeller. ''**************************************************************** ''WHAT'S NEW IN THIS EXAMPLE: '' RFID READER '' -- This device reads Radio Frequency ID tags. '' SERIN_CHAR '' -- SERIN_CHAR is a method used to input serial data from '' RFID tags. ''**************************************************************** ''DIFFICULTY LEVEL: Easy ''**************************************************************** ''PURPOSE: '' 1. Illustrates how to connect an RFID reader to the Propeller. '' 2. Illustrates how to read and display RFID tag data using '' the Parallax RFID reader. ''Submitted by Charlie Johnson, June 10, 2006, [(C) C&C, Inc.] ''Modified, elaborated and posted by Dave Scanlan ''File: Example22_RFID_ReaderWithVideoOutput.spin ''**************************************************************** ''CORRECT OUTPUT: '' '' Video Display '' ____________________________________ '' | RFID TAG VALUES IN HEX AND ASCII | '' | XXXXXXXXXX | '' | XXXXXXXXXXXXXXXXXXXXXXXX | '' | | '' | XXXXXXXXXX | '' | XXXXXXXXXXXXXXXXXXXXXXXX | '' | | '' | | '' | | '' | | '' | | '' |____________________________________| '' '' ''**************************************************************** CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 ' RX_Pin = 1 Enable_Pin = 0 Out = %1 Low = 0 High = 1 CR = 13 ' VAR Byte Index Byte Rx_Data[12] 'Holds RFID tag's 12-byte record ' OBJ VideoDisplay: "TV_Terminal" 'Declare VideoDisplay BS2: "BS2_Functions" 'Declare BS2 ' PUB Start DirA[Enable_Pin] := Out VideoDisplay.Start(12) 'Instantiates VideoDisplay SetScreenWhiteOnDarkBlue BS2.Start(31, 30) 'Instantiates BS2 VideoDisplay.Str(String("RFID TAG VALUES IN HEX AND ASCII")) VideoDisplay.Out(Cr) ' ' using Debug Terminal Repeat OutA[Enable_Pin] := Low 'Enables RFID Index := 0 Repeat 12 'Gets 12 bytes from RFID reader Rx_Data[index++] := BS2.SERIN_CHAR(RX_Pin, 2400, BS2#NInv, 8) VideoDisplay.Str(@RX_data) 'Displays 10 RFID hex digits. Index := 0 Repeat 12 VideoDisplay.dec(RX_Data[Index++]) 'Displays full RFID in ASCII VideoDisplay.Out(Cr) VideoDisplay.Out(Cr) OutA[Enable_Pin] := High 'Disables RFID BS2.PAUSE(1_000) 'Pause for 1 second ' PRI SetScreenWhiteOnDarkBlue VideoDisplay.Out(3) VideoDisplay.Out(5) '' '' ADDITIONAL INFORMATION '' -- Be careful to not connect the RFID +5 volt supply to the Propeller '' -- Thanks for the contributions of Marty Hebel to BS2_Functions. '' -- Dave Scanlan does not support implanting RFID chips into humans. '' -- This example is intended for educational use only.