6.1 Data Reliability........................................................................................................... 102
6.1.1 Data Stream betwee n Read/W rite Device and T ranspond er................................. 102
6.1.2 Checking User Data ....................................................................................... 102
6.2 Data Privacy .............................................................................................................. 103
Author: Dieter Köckinger
Htswp.doc/HSPage 4 (104)
98-02-10Rev. 1.0Introduction
1 Introduction
This description refers to the interface between a host (e.g. PC) and a contactless 125 kHz
read/write device based on the HITAG Communication Controller, as there is e.g. the
HT CM400 (HITAG Core Module), HT RM440 family (HITAG Proximity Reader Module)
and HT RM800 family (HITAG Long Range Reader Module).
For easy and quick development of application specific host software Philips Semiconductors
provides a C-Library, Source- and Header-Files. These tools can be found on the floppy disk
added to this description.
Following transponders of the 125 kHz family are supported:
• HITAG 1
• HITAG 2
• MIRO / µEM (H400x)
• PIT (PCF793x)
Additional Features:
• High security by using cryptography, mutual authentication and password verification
• Addressing multiple (up to 255) read/write devices on a RS485-Bus
• Programmable port pins: 4 outputs; 2 inputs;
optional (requiring a special hardware because signals are not available on pin connectors
of Philips Semiconductors’ Core Module): 8 pins either in-/output configurable or for
connection to a keyboard-matrix up to 12 keys
• 85 bytes of user-defined data can be stored in an EEPROM of the read/write device
System Requirements to use Philips Semiconductors’ C-Library PROLIB6:
• IBM-PC or compatible (minimum 286 processor) with available serial interface
• Borland C-Compiler (Version 3.1 recommended)
Page 5 (104)Htswp.doc/HS
IntroductionRev. 1.098-02-10
1.1 Abbreviations
Please find in the following a list of the abbriviations used in this document.
addrAddress
BCCBlock Check Character
BYTE_TByte (unsigned character)
charCharacter
CRCCyclic Redundancy Check
DSPDigital Signal Processor
DWORD_TDouble Word (unsigned)
FFTFast Fourier Transformation
HFHigh Frequency
LSBLeast Significant Byte
MSBMost Significant Byte
nmbNumber
OTPOne Time Programmable
pagenrPage Number
RFRadio Frequency
roRead Only
r/wRead/Write
RWDRead/Write Device
snrSerial Number
TAG (tag)Transponder
woWrite Only
Htswp.doc/HSPage 6 (104)
98-02-10 Rev. 1.0 Introduction
1.2 Definitions
Data sheet status
Objective specificationThis data sheet contains target or goal specifications for product development.
Preliminary specificationThis data sheet contains preliminary data; s upplementary data may be
published later.
Product specification This data sheet c ontains final produc t spec ifications .
Limiting values
Limiting values given are in accordance with the Absolute Max imum Rating Syst em (IEC 134).
Stress above one or more of the limiting values may cause permanent damage to the device.
These are stress ratings only and operation of the device at thes e or at any other c onditions
above those given in the Characteristics s ection of the specific ation is not implied. Ex posure to
limiting values for extended periods may affect devic e reliability.
Application information
Where application information is given, it is advisory and does not form part of the specification.
Life support applications
These products are not designed for use in life support appliances, devices, or systems where
malfunction of these products can reasonably be expected to result in personal injury. Philips
Semiconductors´ customers using or selling these products for use in such applications do so on
their own risk and agree to fully indemnify Philips Semiconductors for any damages resulting from
such improper use or sale.
Page 7 (104) Htswp.doc/HS
Provided Host Software ModulesRev. 1.098-02-10
2 Provided Host Software Modules
2.1 Introduction
On the Floppy Disk added to this description you will find the following tools:
Library Files:
PROLIB6C.LIBCompact Memory Model
PROLIB6H.LIBHuge Memory Model
PROLIB6L.LIBLarge Memory Model
PROLIB6M.LIBMedium Memory Model
PROLIB6S.LIBSmall Memory Model
PROLIB6T.LIBTiny Memory Model
Depending on the Memory Model you choose for host software you have to include the
corresponding Library File in your project.
These Libraries are helpful for developing DOS software in Standard C language with a Borland
C-Compiler.
Header Files:
PROLIB6.HHITAG 1 / MIRO / RWD function declarations
PROLBLT6.HHITAG 2 function declarations
PROLBPH6.HPIT function declarations
PROLBMU6.HMultiple RWD function declarations (Network)
PROLVEG6.HFunction declarations for a special project requiring a special Reader-
Hardware and -Software
Each Header File provides function declarations with detailed information about the use of
commands.
Depending on the used command function (e.g. proloc_GetSnr) you have to include the
corresponding Header File(s) in your application specific source file.
Source Files:
PROLIB6.CHITAG 1 / MIRO / RWD functions
PROLBLT6.CHITAG 2 functions
PROLBPH6.CPIT functions
PROLVEG6.CFunctions for a special project requiring a special Reader-Hardware
and -Software
The code in the Source Files is identical with the code included in the Library Files.
There is no Source File for using multiple RWD’s because all necessary code is located in the
Header File PROLBMU6.H.
For developing software on other platforms by using other compilers we recommend to use our
Source Files and Header Files and make your specific adaptations.
Htswp.doc/HSPage 8 (104)
98-02-10Rev. 1.0Provided Host Software Modules
2.2 Using the Provided Host Software Modules
Communication via the serial interface between the host and the read/write device is handled by
using interrupts. As a consequence a host-program only has to test a flag (RWDEot) periodically
to recognize the end of a communication sequence. Meanwhile the program can execute other
functions while the data transfer is running in the background.
To do this, however, some flags are needed:
RWDEot: Helps to identify the end of a communication sequence
flag is set to 0 at a library function request
flag is set to 1 at the end of the serial protocol
RWDErr:Saves the error code
0 ... errorfree execution
<0 ... error has occured
RWDDataLen:Saves the number of bytes received via the serial interface.
Can take any value between 0 and 24.
• To open the serial port on the host system use function (Header File PROLIB6.H)
proloc_open(char *ComStr) // *ComStr="COM1" for COM1
//*ComStr= "COM2" for COM2
• To close the serial port on the host system use function (Header File PROLIB6.H)
proloc_close()
In order to prevent undesired side effects use proloc_close before program end or before a
new proloc_open.
• To change BCC calculation (when entering or leaving KeyInitMode) use function
• For communication in Extended Protocol use commands with ‘Proloc_M’-prefix (Header File
PROLBMU6.h)
The names of the commands described in the following have to be prefixed with „proloc_“
to get the correspoding names in the C-Library (e.g. function proloc_GetSnr() for command
GetSnr) for Ordinary Protocol.
All Header Files contain short examples to illustrate the usage of each command.
Page 9 (104)Htswp.doc/HS
Communication Reader-HostRev. 1.098-02-10
3 Communication Reader-Host
3.1 Introduction
The host (e.g. PC) communicates with the contactless 125 kHz read/write device via a serial
interface using a baud rate of 9600 baud.
Data transfer details are: 1 start bit, 8 data bits, 1 stop bit and no parity bit, the Least Significant
Bit is sent first.
Each communication sequence consists of a block of bytes sent by the host, and a block of bytes
answered by the reader.
All bytes are transmitted transparently, i.e. you can use any character between 0x00 and 0xFF.
Block Length:
Block Length is the sum of all transferred bytes including Block Length but excluding BCC.
Block Title:
The Command Byte if sent from host to reader.
The Status Byte if sent from reader to host.
Data:
Data bytes are only transmitted if data is transferred.
BCC:
The BCC (Block Check Character) is calculated by bytes 1 to n-1 (n=number of bytes of the
whole communication sequence).
A different BCC calculation in Operating Mode (mode of the reader for using standard
commands) and in KeyInit Mode (mode of the reader device for using personalization commands)
helps to avoid the overwriting of secret data accidentally.
BCC calculation in Operating Mode of the reader:
The BCC is computed by EXOR-operation of all block data bytes including Block
Length.
EXOR for 1 Bit: Example for command
AB EXOR
00
01
10
11
0
1Byte 3: BCC
1
0
Byte 1: Block Length
Byte 2: Command Byte
:
GetSnr
0000 00100x02
0100 01110x47
0100 01010x45
BCC calculation in KeyInit Mode of the reader:
The BCC is computed by adding all block data bytes including Block Length. The least
significant eight bits are used as BCC.
Htswp.doc/HSPage 10 (104)
98-02-10Rev. 1.0Communication Reader-Host
3.2 Ordinary Protocol
If only a single read/write device with a node address equal to zero is connected to the host (e.g.
on a RS232 serial line) the Ordinary Protocol is used to address this reader.
Format of the Ordinary Protocol (HOST→READER and READER→HOST):
Byte1234......n
Function
Block LengthBlock Titledatadata.........BCC
3.3 Extended Protocol
If more than one read/write devices with node addresses different from zero are connected to the
host (e.g. on a RS485 serial line) the Extended Protocol is used to address a single reader.
Format of the Extended Protocol (HOST→READER and READER→HOST):
Byte1234......n-1n
Function
Block Length
+ 0x80
Block Titledatadata.........Node
Address
BCC
Differences to Ordinary Protocol: Bit 7 of Block Length is set, and the Node Address is inserted
just before BCC.
If a reader’s node address is different from zero, the reader enters net-mode. In this mode the
reader expects all commands from the host to be sent in Extended Protocol including the right
Node Address (except SetModuleAdr). If the host transmits a string that does not meet these
conditions, the command is ignored, and there will be no answer from the reader (whereas a
reader being not in net-mode - with node address equal to zero - would at least answer with a
SERIAL ERROR message).
The command SetModuleAdr is used to assign a unique node address to a device whose serial
number is known. This command should be sent in Ordinary Protocol. If the right serial number
was sent, there will be an answer from the read/write device. This answer is sent in Ordinary
Protocol if the former node address of the reader was zero, otherwise the answer is sent in
Extended Protocol.
For communication in Extended Protocol use commands with ‘Proloc_M’-prefix. For further
information see Header File PROLBMU6.h.
Page 11 (104)Htswp.doc/HS
Communication Reader-HostRev. 1.098-02-10
3.4 Transfer Timeout Intervals
Character Delay:
Character Delay is the maximum time permitted to elapse between sending two consecutive
characters of a block.
Character Delay ≤ 150 ms
Block Delay:
Block Delay is only necessary if an error has occurred in the serial communication.
To allow for re-synchronization in that case of malfunction there must be a minimum interval defined as Block Delay - until sending the next block.
Block Delay ≥ 160 ms
Htswp.doc/HSPage 12 (104)
98-02-10Rev. 1.0Communication Reader-Host
3.5 Command Set
The Command Byte is part of the block sent from the host.
Command Bytes used in a Proximity (P) and/or Long Range (L) Reader:
The read/write device returns a Status Byte indicating an error if different from 0.
The following Error Codes are defined:
VALUEERROR NAMEDESCRIPTION
0no error
-1SERIAL ERRORError at the serial interface.
-3NOTAGThere was no answer of a transponder
detected by the read/write device.
-4TIMEOUTThere is not enough energy available to write
to the transponder.
-5INCORRECT PASSWORD RWDThe HITAG 2 password of the read/write
device is invalid.
-6INCORRECT PASSWORD TAGThe HITAG 2 password of the transponder is
invalid.
-7AUTHENTICATION ERRORAn error occurred during the authentication
process.
-8ACKNOWLEDGEMENT ERRORThe acknowledgement was not received
correctly.
-9CRYPTOBLOCK NOT INITA cryptographic command was transmitted
without authentication between the read/write
device and transponder.
-10EEPROM ERROREEPROM ( of the r ead /write device )
acknowledgement error.
-11EEPROM WRONG OLD DATAOn comparison old and new data prove
inconsistent.
-12EEPROM WRITE PROTECTEDYou attempted to write to the read/write
device EEPROM, although writing was not
allowed.
-13EEPROM READ PROTECTEDYou attempted to read from the read/write
device EEPROM, although reading was not
allowed.
-14PIT DATA OVERFLOWNew PIT-Data were received by the host
before the host-program read the old PITData (error generated by C-Library during
command ReadPit).
-15CRC ERRORWrong CRC from a HITAG 1 transponder in
Advanced Protocol Mode.
-20ANTENNA OVERLOADLong Range Reader: Broken or badly
detuned antenna (error only after command
ReadLRStatus).
Page 15 (104)Htswp.doc/HS
Communication Reader-HostRev. 1.098-02-10
3.7 Command Description for Operating Mode
The Operating Mode is a mode of the reader for using a set of standard commands as described in
the following.
In this mode the BCC is computed by EXOR-operation of all block data bytes including Block
Length.
The command KeyInitMode is used to enter t he KeyInit Mode ( mode of the r ead/write device for
using personalization commands), and a different set of commands becomes available.
3.7.1 GetSnr
This command provides the seri al number of a HITAG 1 transponder in Standard Protocol Mode.
For further information on the Standard Protocol Mode see chapter „Transponders“.
n = 0 if an error occurred (error code in Status).
n = 5 if data were read from a transponder (Status = 0).
more: Proximity Reader:more is always 0.
Long Range Reader: more equal to one indicates that there is at least one additional
transponder in the reading area of the read/write device.
Status: 0 ... no error
-1 ...SERIAL ERROR
-3 ...NOTAG
Htswp.doc/HSPage 16 (104)
98-02-10Rev. 1.0Communication Reader-Host
3.7.2 GetSnr_Adv
This com mand provides the serial n umber of a HITAG 1 transponder and sets the transponder into
Advanced Protocol Mode (command is not available for HITAG 1 transponders based on ASIC
HT1 ICS30 01x ; only available for HITAG 1 transponders based on ASIC HT1 ICS30 02x).
For further information on the Advanced Protocol Mode see chapter „Transponders“.
n = 0 if an error occurred (error code in Status).
n = 5 if data were read from a transponder (Status = 0).
more: Proximity Reader:more is always 0.
Long Range Reader: more equal to one indicates that there is at least one additional
transponder in the reading area of the read/write device.
Status: 0 ...no error
-1 ...SERIAL ERROR
-3 ...NOTAG
Page 17 (104)Htswp.doc/HS
Communication Reader-HostRev. 1.098-02-10
3.7.3 SelectSnr
This command selects the HITAG 1 transponder with a specified serial number. The content of
the transponder’s Configuration Page is returned.
If there is no such transponder in the field, a NOTAG error message is displayed.
ATTENTION: The serial number has to be the same as received with the preceding
GetSnr.
OTP:Configuration Page of HITAG 1
n = 0 if an error occurred (error code in Status).
n = 4 if data were read from a transponder (Status = 0).
Status: 0 ...no error
-1 ...SERIAL ERROR
-3 ...NOTAG
Htswp.doc/HSPage 18 (104)
98-02-10Rev. 1.0Communication Reader-Host
3.7.4 SelectLast
Selects the HITAG 1 transpo nder with the serial number that was read executing the last error free GetSnr command.
This command is an abbreviated version of SelectSnr as no serial number has to be transmitted via
the serial interface and the content of the Configuration Page is not returned.
Reads a page (4 bytes) of a selected HITAG 1 transponder.
If no transponder is selected, a NOTAG message will be generated even if there is a transponder
in the communication field of the antenna.
Using the byte -crypto- you define whether you want to work in Plain or in Crypto Mode.
Access to the secret area is only possible in Crypto Mode after a mutual authentication.
If -crypto- equals 1 (Crypto Mode) and you did not run an authentication procedure before,
Status will be set to -9.
n = 0 if an error occurred (error code in Status).
n = 4 if data were read from a transponder (Status = 0).
Status: 0 ...no error
-1 ...SERIAL ERROR
-3 ...NOTAG
-9 ...CRYPTOBLOCK NOT INIT
Page 21 (104)Htswp.doc/HS
Communication Reader-HostRev. 1.098-02-10
3.7.7 ReadBlock
Reads a block (16 bytes) of the selected HITAG 1 transponder.
If no transponder is selected, a NOTAG message will be generated even if there is a transponder
in the communication field of the antenna.
The start address is specified by -pagenr-. Data is read from the start address until the end of the
corresponding block. Thus a data length of 4, 8, 12 or 16 bytes is possible.
Use byte -crypto- to define whether you want to work in Plain or in Crypto Mode.
Access to the secret area is only possible in Crypto Mode after a mutual authentication.
If -crypto- equals 1 (Crypto Mode) and you did not run an authentication procedure before,
Status will be set to -9.
n = 0 if an error occurred (error code in Status).
n = 4, 8, 12, 16 depending on the page address if data were read from a transponder (Status = 0).
Status: 0 ...no error
-1 ...SERIAL ERROR
-3 ...NOTAG
-9 ...CRYPTOBLOCK NOT INIT
Htswp.doc/HSPage 22 (104)
98-02-10Rev. 1.0Communication Reader-Host
3.7.8 WritePage
Writes a page (4 bytes) to the selected HITAG 1 transponder.
If no transponder is selected, a NOTAG message will be generated even if there is a transponder
in the communication field of the antenna.
Use byte -crypto- to define whether you want to work in Plain or in Crypto Mode.
Access to the secret area is only possible in Crypto Mode after a mutual authentication.
If -crypto- equals 1 (Crypto Mode) and you did not run an authentication process before, Status
will be set to -9.
ATTENTION: To substantially increase the data reliability we strictly recommend to read
the previously written data (read after write).
Writes a block (16 bytes) to the selected HITAG 1 transponder.
If no transponder is selected, a NOTAG message will be generated even if there is a transponder
in the communication field of the antenna.
The start address is specified by -pagenr-. Data is written from the start address until the end of
the corresponding block. Thus a data length of 4, 8, 12 or 16 bytes is possible.
Use byte -crypto- to define whether you want to work in Plain or in Crypto Mode.
Access to the secret area is only possible in Crypto Mode after a mutual authentication.
If -crypto- equals 1 (Crypto Mode) and you did not run an authentication procedure before,
Status will be set to -9.
ATTENTION: To substantially increase the data reliability we strictly recommend to read
the previously written data (read after write).
Carries out t he single authentication procedure for HIT AG 1 transponders (authentication of the
transponder). The authentication procedure is aborted after sending the transponder logdata.
Using -keyinfo- you can choose between Key/Logdata Set A and B.
This command can be used - e.g. - to check if Keys and Logdata in the transponder and the
re a d/ w r it e de vice a r e the s ame . ( "C he c k, if the t r a ns pon de r is me mbe r o f t h e s a me ` family´ a s t he
read/write device").
ATTENTION: You cannot use any Crypto commands after TagAuthent.
After this abbreviated authentication procedure the transponder can only be accessed using
GetSnr or the command HFReset.
Carries out the full authentication procedure between the transponder and the read/write device.
After this mutual authentication you are allowed to edit areas which can only be accessed in
Crypto Mode.
Using -keyinfo- you can choose between Key/Logdata Set A and B.
Use a Plain command (that is still encrypted), HFReset or GetSnr (resets the already selected
This command is applied to a HITAG 2 transponder being in Password or Crypto Mode.
The command selects the transponder and provides its serial number and Configuration Byte
-config-.
If the byte -Status- shows „no error“ the transponder is selected and ready for read or write
accesses.
The byte -mode- selects one of two possible modes: Password or Crypto.
config:Configuration Byte of HITAG 2
n = 0 if an error occurred (error code in Status).
n = 5 if data were read from a transponder (Status = 0).
Status: 0 ...no error
-1 ...SERIAL ERROR
-3 ...NOTAG
-5 ...INCORRECT PASSWORD RWD
-6 ...INCORRECT PASSWORD TAG
-7 ...AUTHENTICATION ERROR
Page 27 (104)Htswp.doc/HS
Communication Reader-HostRev. 1.098-02-10
3.7.13 GetSnrReset_LT
This command is applied to a HITAG 2 transponder which is currently not in Password or Crypto
Mode but in one of the Public Modes. The command selects the transponder and provides its
serial number and Configuration Byte.
If the byte -Status- shows „no error“ the transponder is selected and ready for read or write
accesses.
The byte -mode- decides whether the selection process for the transponder is done corresponding
to the Password Mode or the Crypto Mode.