Devkit m24lr A An
Devkit m24lr A An
Devkit m24lr A An
Application note
Developing an application allowing PR101-USB and MR101-USB
FEIG readers to communicate with M24LRXX transponders
Introduction
This application note explains how to develop a Visual Basic or C/C++ application code to
drive ISO 15693 FEIG readers from a host computer. FEIG readers are contactless readers
which can communicate with transponders based on the STMicroelectronics M24LRXX
Dual interface EEPROM.
The readers are delivered within ST demonstration kit DEMOKIT-M24LR-A and
development kit DEVKIT-M24LR-A:
● PR101-USB FEIG reader is delivered within the DEMOKIT-M24LR-A (see Figure 1)
● MR101-USB FEIG reader is delivered within the DEVKIT-M24LR-A (see Figure 1).
This application note helps software engineers using and including the software delivered
within the DEMOKIT-M24LR-A and the DEVKIT-M24LR-A in their own application. Code
examples are also provided to illustrate how to send Visual Basic and C/C++ RF
commands.
Note: 1 For details on FEIG readers go to http://www.feig.de.
2 This application note complements FEIG development tool documentation and examples.
Contents
1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1 M24LRXX dual interface EEPROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 PR101-USB and MR101-USB FEIG contactless readers . . . . . . . . . . . . . 7
1.2.1 PR101-USB FEIG reader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2.2 MR101-USB FEIG reader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.3 FEIG development toolchain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3 Installation requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.1 Installing the .dll files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
List of tables
List of figures
1 Description
53" CABLE
"*
53" CABLE
POWER
-2 53" &%)' 53" SUPPLY
2& READER WITH
EXTERNAL ANTENNA !)
RF ISO 15693 commands are sent by the host computer to the M24LRXX transponders via
the PR101-USB or MR101-USB reader RF interface. Two types of commands are available:
● High-level commands (see Section 5)
The host sends an already formatted request sent to the transponders via the reader RF
interface. As an example, the High-level Inventory request launches an anticollision
sequence to identify all the transponders present in the RF field and sends back the UID
information to the host. Refer to http://www.feig.de for a description of the full set of high-
level commands supported by the readers.
● Transparent commands (see Section 6).
RF Transparent commands are sent by the host to the transponders via the reader RF
interface. The Transparent commands transmit single or multiple frames compliant with
the ISO 15693 protocol. Refer to the MR101-USB datasheet for a detailed description
of the available Dual interface EEPROM command.
The transponders answers are sent back to the computer.
Examples are included to allow you using, modifying the RF requests sent to the
transponders, and decoding RF answers from the transponders. Both Visual Basic and
C/C++ examples are provided.
3 Installation requirements
FEIG Windows SDK includes several .dll files which allow to drive all the FEIG USB readers
in Visual Basic and C/C++ languages. They support all RF ISO 15693 commands.
The .dll files required to drive FEIG drivers are the following:
● Low level functions to drive USB readers
– FEUSB.dll contains all the functions required for the PC to communicate through a
USB interface.
– FEUSB.bas: declaration file for Visual Basic project (VB6)
– FEUSB.h: header file for C/C++ project
– FEUSB.lib: declaration file for C/C++ project
● Medium level functions to driver any readers
– FEISC.dll contains the functions required to perform basic communications
through any communication interfaces
– FEISC.bas: declaration file for Visual Basic project (VB6)
– FEISC.h: header file for C/C++ project
– FEISC.lib: declaration file for C/C++ project
Refer to Section 4.1: Overview of reader detection and connection functions for a detailed
description of FEUSB.dll and FEISC.dll function.
Dll documentation and programming examples are available on the FEIG website
http://www.feig.de.
4.1.1 FEUSB_ClearScanList
FEUSB_ClearScanList Visual Basic prototype
Table 1 illustrates the FEUSB_ClearScanList Visual Basic function.
4.1.2 FEUSB_Scan
FEUSB_Scan Visual Basic prototype
Table 3 illustrates the FEUSB_Scan Visual Basic function.
4.1.3 FEUSB_GetScanListSize
FEUSB_GetScanListSize Visual Basic prototype
Table 5 illustrates the FEUSB_GetScanListSize Visual Basic function.
4.1.4 FEUSB_GetScanListPara
FEUSB_GetScanListPara Visual Basic prototype
Table 7 illustrates the FEUSB_GetScanListPara Visual Basic function.
4.1.5 FEUSB_OpenDevice
FEUSB_OpenDevice Visual Basic prototype
Table 9 illustrates the FEUSB_OpenDevice Visual Basic function.
4.1.6 FEISC_NewReader
FEISC_NewReader Visual Basic prototype
Table 11 illustrates the FEISC_NewReader Visual Basic function.
'init display
‘txtDetectResult.Text = ""
oSearch.iMask = 0
if (iDeviceHandle < 0)
{
/* Error : USB connection problem */
/* Close USB connection */
iErr = FEUSB_CloseDevice(iDeviceHandle);
return 0;
}
/* Link FEIG USB device with FEISC functions */
/* and get USB hanle */
iFeiscHandle = FEISC_NewReader( iDeviceHandle );
if (iFeiscHandle < 0)
{
/* Error : USB connection problem */
/* Close USB connection */
iErr = FEISC_DeleteReader( iFeiscHandle );
return 0;
}
Else
{
/* USB connection OK */
/* iDeviceHandle is handle for FEUSB functions */
/* iFeiscHandle is handle for FEISC functions */
return 1;
}
IngStatus =
FEISC_0xB0_ISOCmd(lngAttachedDeviceHandle(1),
Prototype
&hFF,strReqData,lngReqDataLen,strRespData,
lngRespDataLen,N)
IngAttachedDeviceHandle(1): USB reader handle which has been filled in
after the reader detection process (FEISC_NewReader function).
&hFF: Communication address.
strReqData: High-level command to be sent to the reader.
lngReqDataLen: High-level command length.
strRespData: Transponder answer (if any). This variable is filled after the
USB request is issued. Before sending any USB request, strRespData
must be formatted as follows:
Parameters Dim strRespData As String * 512
lngRespDataLen: size of the RF answer (length of strRespData).
N: Format of all the parameters passed to the function
0: ASCII.
Example: ‘2356’ corresponds to the string ‘#V’ composed of 2 ASCII
codes.
1: Characters.
Example: ‘2356’ corresponds to 4 characters (2, 3, 5, 6)
2: Hexadecimal.
Example: ‘2356’ corresponds to 2 bytes (&h23 and &h56)
lngStatus: error code
Returned value 0: USB request transmission successful
1: USB request transmission failed
If (lngRespDataLen = 0) Then
Cmd_Inventory_FEIG = False
‘txtInventoryRF_answer.Text = "No Tag answer detected"
Else
lngTranspNumber = CLng("&h" & Mid(strRespData, 1, 2))
If (lngRespDataLen > 1 And lngTranspNumber > 3) Then
Cmd_Inventory_FEIG = False
‘Too much Tags detected :
Else
Cmd_Inventory_FEIG = True
‘lngTranspNumber & " Tags Detected"
For i = 0 To lngTranspNumber - 1
strtransponder = Mid(strRespData, 3 + (20 * (i)), 20)
Next i
End If
End If
int entry3;
int i;
UCHAR sReqData[64]={0};
UCHAR sRspData[64]={0};
int iReqLen,iRspLen;
int iResult, iResult2;
int iRspLength=56;
printf("\n\n\n\n");
printf("\n>>> INVENTORY request in ISO mode : ");
printf("\n --> request : ");
for (i=0; i<iReqLen; i++) printf("%.2x",sReqData[i]);
printf("\n\n\n\n");
printf("\npress any key to continue");
printf("\n");
scanf("%x", &entry3);
iResult2 = FEISC_0xB0_ISOCmd(iFeiscHandle,0xFF,
sReqData, iReqLen, /* request */
&sRspData[0], &iRspLen,/* answer */
2);/* length format 2 */
if (iResult2 != 0)
{
/* Reset to ready request problem */
}
else
{
/* Reset to ready request OK */
}
return iResult;
}
lngReqDataLen = Len(strReqData)
If (lngRespDataLen = 0) Then
cmd_ResetToReadyRF_FEIG = False
Else
cmd_ResetToReadyRF_FEIG = True
End If
End Function
IngStatus =
FEISC_0xBF_ISOTranspCmd(lngAttachedDeviceHandle(1),&hFF,
Prototype
M, lngRspLength, strReqData,
lngReqDataLen,strRespData,lngRespDataLen,N)
IngAttachedDeviceHandle(1): USB reader handle which has been filled in
after the reader detection process (FEISC_NewReader function).
&hFF: Communication address.
M: Mode. The method used by the Transparent command to detect the
transponder answer depends on the mode.
1: answer detected after reception of a Read request
2: answer detected after reception of a Write request with Option_flag = 0.
3: answer detected after reception of a Write request with Option_flag = 1.
4: answer detected after reception of an Inventory request
lngRspLength: Expected RF answer size (bit number)
strReqData: RF request frame to be sent to the reader
lngReqDataLen: RF request frame length (strReqData)
Parameters strRespData: Transponder answer (if any). This variable is filled after the
USB request is issued. Before sending any USB request, strRespData must
be formatted as follows:
Dim strRespData As String * 512
lngRespDataLen: strRespData length (0 if no answer)
N: Format of all the parameters passed to the function
0: ASCII.
Example: ‘2356’ corresponds to the string ‘#V’ composed of 2 ASCII
codes.
1: Characters.
Example: ‘2356’ corresponds to 4 characters (2, 3, 5, 6)
2: Hexadecimal.
Example: ‘2356’ corresponds to 2 bytes (&h23 and &h56)
lngStatus: error code
Returned value 0: USB request transmission successful
1: USB request transmission failed
1)
' RF READ REQUEST RESULT
' if(lngStatus = 0) then PASS else FAIL
' if (lngRespDataLen = 0) then No transponder answer
' else strRespData contains the transponder answer
If (lngRespDataLen = 0) Then
RFReadsingleBlock = False
‘txtReadRF_answer.Text = "No detected Tag answer"
Else
If (Mid(strRespData, 1, 2) = "00") Then
RFReadsingleBlock = True
‘txtReadRF_answer.Text = strRespData & " = read single block
OK"
‘txtReadData.Text = Mid(strRespData, 3, 8)
Else
RFReadsingleBlock = False
‘txtReadRF_answer.Text = strRespData & " = Error code"
End If
End If
End Function
/* RF REQUEST RESULT */
/* if(iResult == 0) PASS else FAIL */
/* if (iRspLen == 0) No transponder answer */
/* else sRspData contains the transponder answer */
return iResult;
}
The AN3224.zip package contains two simple projects to test the RF ISO 15693 High-level
and Transparent commands. These projects can be used to understand how to develop an
application to communicate with the FEIG RF USB readers:
● AN3224_VB_sourcecode folder contains the Visual Basic project
● AN3224_C_sourcecode folder contains the C/C++ project,
The AN3224.zip package can be downloaded from http://www.st.com/dualeeprom.
Revision history
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the
right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any
time, without notice.
All ST products are sold pursuant to ST’s terms and conditions of sale.
Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no
liability whatsoever relating to the choice, selection or use of the ST products and services described herein.
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this
document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products
or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such
third party products or services or any intellectual property contained therein.
UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED
WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS
OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.
UNLESS EXPRESSLY APPROVED IN WRITING BY TWO AUTHORIZED ST REPRESENTATIVES, ST PRODUCTS ARE NOT
RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING
APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY,
DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE
GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER’S OWN RISK.
Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void
any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any
liability of ST.
Information in this document supersedes and replaces all information previously supplied.
The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.