ACR38 Reference Manual version 1.9 February 20067. Communication protocolIn the normal operation, the ACR38 acts as a slave device with regards to the communication between acomputer and the reader. The communication is carried out in the form of successive command-responseexchanges. The computer transmits a command to the reader and receives a response from the reader afterthe command has been executed. A new command can be transmitted to the ACR38 only after theresponse to the previous command has been received.There are two cases where the reader transmits data without having received a command from thecomputer, namely, the Reset Message of the reader and the Card Status Message.7.1 Command to ACR38A command consists of six protocol bytes and a variable number of data bytes and has the followingstructure:Byte 1 2 3 4 5 ... N+4 (N>0)Header Instruction Data Length = N Data01 H Data Length NHeader Always 01 H to indicate the start of a command.Instruction The instruction code of the command to be carried out by the ACR38.Data Length Number of subsequent data bytes, and is encoded in 2 bytes. The first byte (MSB) andsecond byte (LSB) represent data length N.Data Data contents of the command.For a READ command, for example, the data bytes would specify the start address and thenumber of bytes to be read. For a WRITE command, the data bytes would specify the startaddress and the data to be written to the card.The data bytes can represent values to be written to a card and/or command parameterssuch as an address, a counter, etc.Note: Commands are sent from host computer to ACR38 through the BULK OUT endpoint.7.2 Response from ACR38The response from the ACR38 to any command depends on whether the command has been received bythe reader without error (e.g., checksum error).The response by the ACR38 to a correctly received command consists of three protocol bytes, two statusbytes and a variable number of data bytes and has the following structure:Byte 1 2 3 4 5 ... N+4 (N>0)Header Status Data Length = N Data01H Data Length NHeader Always 01 H to indicate the start of the response. Advanced Card Systems Ltd. Page 9 of 43