November 21, 2024, 06:08:46 PM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


Retrieving Tag ID from Tag

Started by pbronson, March 09, 2008, 08:26:21 AM

Previous topic - Next topic

pbronson

I am using a BS2 Board of Education from Parallax and have the Parallax RFID reader installed. I am trying to get the codes from two Tags that I received with the reader and am at a loss on how to do it. I have run the "door lock" program and I am getting an "unauthorized" read so I believe that everything is working properly but I need to have the codes so that I can update the EPPROM table in the program to accept the Tags that I have.

Any help would be appreciated.

Pete

JonnyMac

This will read and display a tag ID.  If you're using a Prop-2 you must replace the ULN2803 with a ULN2003 so that the ULN doesn't interfere with serial comms on P15.


' =========================================================================
'
'   File...... Tag_Reader.BS2
'   Purpose...
'   Author.... Jon Williams, EFX-TEK (www.efx-tek.com)
'   E-mail.... jwilliams@efx-tek.com
'              Copyright (c) 2008 EFX-TEK
'              Some Rights Reserved
'              see: http://creativecommons.org/licenses/by/3.0/us/
'   Started...
'   Updated...
'
'   {$STAMP BS2}
'   {$PBASIC 2.5}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------


' -----[ Revision History ]------------------------------------------------


' -----[ I/O Definitions ]-------------------------------------------------

RX              PIN     15                      ' serial from reader
Enable          PIN     14                      ' low = reader on


' -----[ Constants ]-------------------------------------------------------

#SELECT $STAMP
  #CASE BS2, BS2E, BS2PE
    T2400       CON     396
  #CASE BS2SX, BS2P
    T2400       CON     1021
  #CASE BS2PX
    T2400       CON     1646
#ENDSELECT


' -----[ Variables ]-------------------------------------------------------

buf             VAR     Byte(10)                ' RFID bytes buffer


' -----[ Initialization ]--------------------------------------------------

Reset:


' -----[ Program Code ]----------------------------------------------------

Main:
  LOW Enable
  SERIN RX, T2400, [WAIT($0A), STR buf\10]      ' wait for hdr + ID
  HIGH Enable

  DEBUG CLS, STR buf\10
  PAUSE 500

  GOTO Main


' -----[ Subroutines ]-----------------------------------------------------


' -------------------------------------------------------------------------


' -----[ User Data ]-------------------------------------------------------



You might also want to read this article as it goes beyond the basic documentation:
-- http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol6/col/nv120.pdf
Jon McPhalen
EFX-TEK Hollywood Office

pbronson

Thanks Jon,

Do you ever take any time off?  I'm not complaining............just appreciative to have such a reachable resaource..
Sincerely,
Pete

JonnyMac

No rest for th wicked... I mean, weary!
Jon McPhalen
EFX-TEK Hollywood Office