Page 1 of 1

Need help with RFID 125 Khz Hitag S2048 transponder.

Posted: Tue Jan 14, 2014 3:23 pm
by Mathy
Hello,

I made some tests with the RFID component.
I have a 125 Khz Hitag S2048 transponder and I can read the 4 bytes with the READ_RFID_UID command.
It works very well.

Now, I'm trying to read the 16 bytes with the READ_RFID_BLOCK command but It doesn't work.
I think I don't understand very well what means the address and the key_type macro.

Is it possible to have additional information ?

Thank you for your help :)

Re: Need help with RFID 125 Khz Hitag S2048 transponder.

Posted: Tue Jan 14, 2014 5:23 pm
by Mathy
Re,

I think there is a problem in your code because in the RFID module datasheet, we need to send 0x72 to execute the READ_RFID_BLOCK command and flowcode send 0x52 like in the READ_RFID_UID command.
If I replace 0x52 by 0x72, it still don't work and i don't know if it is because of a bug ar because i don't understand how works the macro.

Is it possible to have a look a this ?

Thank you :)

Re: Need help with RFID 125 Khz Hitag S2048 transponder.

Posted: Wed Jan 15, 2014 10:03 am
by Mathy
I think i have spotted the problem.
I don't know if It is made in the rules but you can see here the new component c file :

Code: Select all

/*Macro_Read_RFID_Block_Start*/

	MX_UINT8 RetVal;
	MX_UINT8 UID_Val = 0;
  
	{
		//125 Khz
	 
		{
			RFID_SendRS232Char(MX_RFID_READ_BLOCKH);		//Send Read Block Command
			RFID_SendRS232Char(Address);				//
			
			RetVal = %a_UART_Receive(200);		//Collect response
			if ((RetVal & 0x06) == 0x06)				//if Read command succsesful
			{
				%a_MX_RFID_In_Buff[0]  = %a_UART_Receive(200);	//Collect LS Byte response
				%a_MX_RFID_In_Buff[1]  = %a_UART_Receive(200);
				%a_MX_RFID_In_Buff[2]  = %a_UART_Receive(200);
				%a_MX_RFID_In_Buff[3]  = %a_UART_Receive(200);
				%a_MX_RFID_In_Buff[4]  = %a_UART_Receive(200);
				%a_MX_RFID_In_Buff[5]  = %a_UART_Receive(200);
				%a_MX_RFID_In_Buff[6]  = %a_UART_Receive(200);
				%a_MX_RFID_In_Buff[7]  = %a_UART_Receive(200);
				%a_MX_RFID_In_Buff[8]  = %a_UART_Receive(200);
				%a_MX_RFID_In_Buff[9]  = %a_UART_Receive(200);
				%a_MX_RFID_In_Buff[10] = %a_UART_Receive(200);
				%a_MX_RFID_In_Buff[11] = %a_UART_Receive(200);
				%a_MX_RFID_In_Buff[12] = %a_UART_Receive(200);
				%a_MX_RFID_In_Buff[13] = %a_UART_Receive(200);
				%a_MX_RFID_In_Buff[14] = %a_UART_Receive(200);
				%a_MX_RFID_In_Buff[15] = %a_UART_Receive(200);	//Collect MS Byte response
			}
			return RetVal;
		}
		
	  
	}