Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

rfid tag value is not machting ?..

Status
Not open for further replies.

haroon_tech

Member level 2
Joined
Apr 28, 2011
Messages
51
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
bangalore
Activity points
1,727
hi,

i am using 12khz wiegand rfid reader module , that has given wiegand data lines i.e data0 & data1 . i have written the code to read the tag when its comes in vicinity.
On the tag the numbers are "0010039334 153,12326" . i think it is EMbased tag.

what i could read in my code is for same above tag "17926604" ?

is this correct or garbage but every time it gives same value? further is there any algorithm to extract the data what i have been received?

plz can any one help me out???

thank you.
 

12Khz ??

There could be ... oh .... so many interface/ translation issues.

The good news is that you get a steady output. Try it with a different card, and see if you get different but steady 'garbage' also.

If so, then SOME things are working correctly, but you are probably not doing the protocols matching/ interpretation correctly.
Read the documents again, review your code again.

For e.g., are you sure its an EM card ? Can you read EM card using Wiegand ?

cheers!
:)
 
Last edited:
i am using 12khz wiegand rfid reader module , that has given wiegand data lines i.e data0 & data1 . i have written the code to read the tag when its comes in vicinity.
On the tag the numbers are "0010039334 153,12326" . i think it is EMbased tag.

what i could read in my code is for same above tag "17926604" ?

is this correct or garbage but every time it gives same value? further is there any algorithm to extract the data what i have been received?


Which Wiegand protocol? Wiegand26, Wiegand34, etc? The number represents the subsection of data in bits transmitted, for example Wiegand 26 consists of 24 bits of data and 2 bits for parity.


Wiegand is a communications protocol which can be used to transmit various types of information, including RFID, Mag Swipe, Keypad, etc. The Wiegand communications protocol essentially serves the same purpose as RS-232, RS-485, RS-422, etc.

So YES, there certainly are EM400X based 125kHz RFID tag readers which offer a WiegandXX interface, as well as RS-232, RS-485, TTL, etc.

I might also mention, most RFID readers only output data upon a successful read of the tag, incompatible tags typically result in NO data transmission.



Now concerning the "EM" based tags, these are tags with EM400X/EM410X transponders, which utilize 64-bit Manchester Encoding to contain a 40-bit ID.

For example the 40-bit ID of an EM400X/EM410X transponder tag:

4500be4a75 or 0100010100000000101111100100101001110101

A Wiegand26 transmission of the above ID, truncates it to the 24-bit Least Significant Bits (LSbs):

0100010100000000101111100100101001110101


101111100100101001110101

The above 24-bits are sometimes presented on the tag in the following format:

190,19061

101111100100101001110101

190: 10111110
19061: 0100101001110101


I should point out that the truncation of the 40-bit ID to 24-bit ID can easily result in two tags with unique IDs appearing identical once they are transmitted using the Wiegand26 protocol.

The preceding fact should be carefully considered when designing a RFID system.



Now back to your situation.

Both the numbers, "0010039334" and "153,12326" appear to represent the same 24-bit LSbs of the 40-bit ID of the tag:

0010039334: 100110010011000000100110

153: 10011001
12326: 0011000000100110


Therefore, it is likely that your Wiegand routine is incorrectly interpreting the Wiegand transmission.

Post the Wiegand routine so that it maybe examined.


BigDog
 
ya this is my code
wiegand 26bit format (harware is Microchip ASK reader ckt )
Code:
#include<htc.h>
void display(unsigned long,unsigned char);
void read_data(void);
#include"uart_header.h"
#include"uart_header.c"
#define led RB7
#define ledd TRISB7
#define data0 RB0
#define data1 RB1

	unsigned char convert1=0;							//clear convert1
	unsigned int convert2=0;				


			//clear convert2
	unsigned char data[26];							
	
	unsigned char mode=0;								//clear mode

main()
{
	unsigned char i;						

		convert1=0;												//clear convert1
		convert2=0;												//clear convert2
		ledd=0;
		TRISB0=1;
		TRISB1=1;
		
			
		usart_init();
		
		while(1)
		{	
			
				transmitstring("\n\r");
			transmitstring("Place your tag");
			
			transmitstring("\n\r");
		while(mode==0)
			{
				i=0;
			transmitstring("\n\r");
		//	if((data0==0)||(data1==0)) 
		//	{
			//	transmitstring("\n\rwait processing....");
			//	mode=1;					
				if((data0==0)&&(data1==1))							//if data0 changes (data0 is active low)
			{
				data[i]=0;										//save that the bit received is 0
				while((data0==0)&&(data1==1));					//wait until data0 back to high logic
			}													
			else if ((data0==1)&&(data1==0))					//if data1 changes (data1 is active low)
			{
				data[i]=1;										//save that the bit received is 1
				while((data0==1)&&(data1==0));					//wait until data1 back to high logic
			}
			i+=1;												//i+1

			while(i<26)											//repeat the loop until all 26 bit data are sent (start from 0 to 25)
			{	
				while((data0==1)&&(data1==1));					//wait while data0 and data1 remain at high logic level (no changes at data0 and data1)
				if((data0==0)&&(data1==1))						//if data0 changes (data0 is active low)
				{
					data[i]=0;									//save that the bit received is 0
					while((data0==0)&&(data1==1));				//wait for data stream finish sending from RFID tag again (data0 or data1 will back to high logic)
				}
				else if ((data0==1)&&(data1==0))				//if data1 received is 0 (data1 is active low)
				{
					data[i]=1;									//save that the bit received is 1
					while((data0==1)&&(data1==0));				//wait for data stream finish sending from RFID tag again (data0 or data1 will back to high logic)
				}
				i+=1;											//i+1
			}

																
			
			for(i=0;i<8;i++)												//loop for data[0]-data[7]
			{
				convert1=(convert1<<1)|data[i+1];							//shift current data and combine with previous data, store data in convert1			}
			}
			for(i=0;i<16;i++)												//loop for data[8]-data[25]
			{
				convert2=(convert2<<1)|data[i+9];							//shift current data and combine with previous data, store data in convert2
			}
				
				display(convert1,3);							//display convert1 in 3 decimal number
											
				display(convert2,5);							//display convert2 in 5 decimal number

					led=1;
			//	__delay_ms(1);
				led=0;							
			
			
		
}
		}		
}





void display(unsigned long data,unsigned char num_dig)
{
	if(num_dig>=10)											
	{
		data=data%10000000000;
		transmit(data/1000000000+0x30);      //send to hyperteminal 
	}	
	if(num_dig>=9)
	{
		data=data%1000000000;
		transmit(data/100000000+0x30);     //send to hyperteminal
	}	
	if(num_dig>=8)
	{
		data=data%100000000;
	transmit(data/10000000+0x30);         //send to hyperteminal
	}	
	if(num_dig>=7)
	{
		data=data%10000000;
	transmit(data/1000000+0x30);         //send to hyperteminal
	}	
	if(num_dig>=6)
	{
		data=data%1000000;
		transmit(data/100000+0x30);       //send to hyperteminal
	}	
	if(num_dig>=5)
	{
		data=data%100000;
		transmit(data/10000+0x30);         //send to hyperteminal
	}	
	if(num_dig>=4)
	{
		data=data%10000;
		transmit(data/1000+0x30);        //send to hyperteminal
	}
	if(num_dig>=3)
	{
		data=data%1000;
		transmit(data/100+0x30);         //send to hyperteminal
	}
	if(num_dig>=2)
	{
		data=data%100;
		transmit(data/10+0x30);        //send to hyperteminal
	}
	if(num_dig>=1)
	{
		data=data%10;
		transmit(data+0x30);          //send to hyperteminal
	}
}


thank you valuable feedback .....
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top