PDA

View Full Version : U2270 RFID transponder



Marcick
- 18th March 2007, 10:19
Hello,

Does anybody have code example for reading the data stream of a U2270B transponder ?
I see that they are 64 bit, manchester encoded, but I don't know how to write a simple code (interrupt driven or not) that trigger the first 9 sync bit and capture the remaining data bits.
Please help ...

ajay4u1976
- 26th November 2007, 06:30
Hello,

Does anybody have code example for reading the data stream of a U2270B transponder ?
I see that they are 64 bit, manchester encoded, but I don't know how to write a simple code (interrupt driven or not) that trigger the first 9 sync bit and capture the remaining data bits.
Please help ...

there are code example check it out
/*================================================= ====*/
/*******************************NAMH BHAGWATE VASUDEVAY********************************
** PROGRAM FOR ATMEL 125KHZ. RFID READER
** USING CPU PHILIPS "P89C51RD2BN"
** XTL = 22.1184MHZ.
================================================== =====================================
PIN CONNECTIONS ||CFE = P3.5;rfin=P3^6;stnby=p3^7;
================================================== =====================================*/
#include <reg52.h>
#include <stdio.h>
#include <intrins.h>
#include <string.h>
// #include "Kboard.h"
// #include "lcd_rfid.h"
/*------------------------------------------------------------------------------------*/
sbit cfe =P3^5;
sbit rfin =P3^6;
sbit standby =P3^7;
sbit led =P1^1;
#define LED_ON led=0;
/*================================================= =================================*/
unsigned int i=0,j=0;
unsigned char buffer[10],buf_count,bit_count,byte_count;
unsigned char key,c_data,status_flag,bit_flag, temp=0x01;

/*================================================= =================================
FUNCTION PROTOTYPES
-------------------- */
void bit_time_delay();
void first_bit_delay();
void collect_data();
void show_data();

/*================================================= =================================*/
void main()
{
/* SCON = 0x50; /* SCON: mode 1, 8-bit UART, enable rcvr /
TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload /
TH1 = -6; /* TH1: reload value for 9600 baud @ 22.1184 Mhz /
TR1 = 1; /* TR1: timer 1 run /
ET0 = 1; /* Enable Timer 0 Interrupts /
TR0 = 1; /* Start Timer 0 Running /
TI = 1; /* TI: set TI to send first char of UART /
/*-----------------------------------------------------------------------------------*/
init_lcd();
KB_init();
delay_wait(100);
rfin =1; /* radio friquency in from rfic */
standby =1; /* standby enable power of rf module */
i=0,j=0;
buf_count=0;
bit_count=0;
byte_count=0;
cfe=1;
// backlit_on;
/*-----------------------------test debug aria---------------------------*/
// first_bit_delay();
// bit_time_delay();
/*================================================= ======================*/
while(1)
{
i=0,j=0;
buf_count=0;
bit_count='0';
byte_count=0;
key=0x00;

bit_count=0;status_flag=1; // sequence flag=1
while(rfin); // wait to start transi.
backlit_on;
first_bit_delay(); //384 delay
while(status_flag && bit_count<9)// examin frist 9 bit to high
{
if(rfin==0){status_flag=0;}
bit_time_delay();
bit_count++;
}
if(status_flag==0)
{lcd_puts("error");delay_wait(1000);}
/*-----------------------------------------------------------------*/
if(status_flag)
{
while(byte_count<=10) // collecting data
{
temp=0x01;
for(bit_count=0;bit_count<=5;bit_count++)
{
if(rfin){c_data |=temp; }// 0x01 // 0000 0001 lsb frist
temp<<= 1;
bit_time_delay();
}
c_data &= 0x1f;
buffer[buf_count]=c_data;
c_data=0;
buf_count++;
byte_count++;
}
} //-------------------------collecting data

buf_count=0;
send_command(0x80);
while(buf_count<=10)
{
key=buffer[buf_count];
key &= 0x0f;
key= key+0x30;
lcd_putc(key); //printf("%c ",key);
buf_count++;
}
delay_wait(2000);
lcd_clear();
backlit=1; // cfe=1;

while((key=getkey())!='#');
/*================================================= =================================*/
} // while1
}// main */

/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& END OF MAIN &&&&&&&&&&&&&&&&&&&&&&&&&&&/

/*------------------------------------------------------------------------------------*/
void bit_time_delay() // delay = 512
{
for(j=0;j<116;j++);
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();

}



/*--------------------------------------------------------------------------------------*/
void first_bit_delay() // delay= 384
{
for(i=0;i<87;i++);
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
}

/*--------------------------------------------------------------------------------------*/

hello dear if not works care on delay routine and bit collection (>>)