CDC Firmware

The device appears as a virtual serial port (COM port) by implementing the USB Communications Device Class, Abstract Control Model (CDC/ACM) specification. All major operating systems, including Windows, Linux, and MacOS support such devices out-of-the-box.

An AT command set is provided to query tags, read and write data, and configure the device itself.

Port settings

The device represents itself as a virtual COM port. As such, port settings, like communication speed, parity or stop bit settings will be ignored. No specific configuration is necessary and the port can be operated at any settings (without influencing the communication speed).

General Frame Format

Device modes

RFID device can be in two modes: scanning (SCAN1) and application controlled mode (SCAN0). The default mode (i.e. the device mode after POR) is selected via the device settings. Factory defaults set it to scanning mode.

All commands except LED control, BUZZ control, settings related, and device reboot will fail with ERROR while in SCAN1 mode

Error codes

When a tag reports an error, an additional frame describing the error can be returned before the ERROR frame. This additional frame has the following format:

+CME ERROR: <code>

where code is the last error reported by RFID IC. It is a 32bit unsigned integer in decimal format with the following bit fields:

CDC/ACM AT Command Set. API Referece.

Device Information

This command queries the product information and firmware version of the device.

Syntax:

Request ATI\r
Response <product descrition> <firmware version/build date>
S/N <serial number>

Example:

Request ATI\r
Response Open-Development RFID Reader (CDC-AT) 1.0F Jan 17 2018
S/N 220333635434B431500280010

LED Control

This command controls the state of the light-emitting diode (LED).

Syntax:

Request AT+D1=[0|1|2|nil]\r Changes the state of the LED to
0=off, 1=on, 2=blinking.
If no state is specified (i.e. nil),
the application relinquishes control to the firmware
Response OK

Example:

Request AT+D1=1\r Turn the LED on
Response OK
Request AT+D1=\r Return control to the firmware
Response OK
Request AT+D1?\r Query LED state
Response +D1=1
OK
LED is on

Buzzer Control

This command controls the state of the buzzer

Syntax:

Request AT+B=[0|1|nil]\r Changes the state of the buzzer to
0=off, 1=on.
If no state is specified (i.e. nil),
the application relinquishes control to the firmware
Response OK

Example:

Request AT+B=1\r Turn the buzzer on
Response OK
Request AT+B=\r Return control to the firmware
Response OK
Request AT+B?\r Query the buzzer state
Response +B=1
OK
Buzzer is on

RFID Mode Control

This command switches the device mode.

Syntax:

Request AT+SCAN[0|1]\r
Response OK

Example:

Request AT+SCAN0\r
Response OK Scanning disabled

Enable/Disable RF Field

This command switches the RF field, generated by the IC, on or off

Syntax:

Request AT+RF=[0|1]\r 1 - switch on
0 - switch off
Response OK

Example:

Request AT+RF=0\r
Response OK RF field is off
Request AT+RF?\r Query the RF field state
Response +RF=0
OK
RF field is currently off

Inventory scan

Requests an inventory scan. Returns a list of UIDs (may be empty) of active tags. All the discovered tags are scanned and halted/deselected.

Syntax:

Request AT+I\r
Response +UID=<HEX UID><SAK>
OK
possibly repeated or absent

Example:

Request AT+I\r
Response +UID=EC6D140708
+UID=343D7091725D8600
OK

Inventory Scan (without Anti-Collision)

Requests an inventory scan without anti-collision (selects and returns the first detected tag, if any).

Syntax:

Request AT+i\r
Response +UID=<HEX UID><SAK>
OK
possibly absent

Example:

Request AT+i\r
Response +UID=EC6D140708
OK

Inventory Scan (select next tag)

Halts the currently selected tag and requests an inventory scan without anti-collision (i.e select the next tag)

Syntax:

Request AT+n\r
Response +UID=<HEX UID><SAK>
OK
possibly absent

Example:

Request AT+n\r
Response +UID=343D7091725D8600
OK

Select Tag

Select a single tag by UID for further processing. The tag access commands (read/write block) address the current tag. current means either the first one according to the anti-collision algorithm, or the one, selected with this command. Passing an empty UID will deselect the current tag (if any).

Syntax:

Request AT+SELECT=<HEX UID>\r
Response OK
ERROR
Tag selected
Tag is not present

Example:

Request AT+SELECT=343D7091725D86\r
Response OK Tag selected
Request AT+SELECT=343D7091725D87\r
Response ERROR Tag is not present

Check Tag Presence

Check whether a tag with the specified UID is currently present. Unlike the AT+SELECT=... command this one just checks the tag presence, it does select the tag and does not make it the current one.

Syntax:

Request AT+C=<HEX UID>\r
Response OK
ERROR
Tag is present
Tag is not present

Example:

Request AT+C=343D7091725D86\r
Response OK Tag is present
The current UID has not changed!
Request AT+C=343D7091725D87\r
Response ERROR Tag is not present

Get Current Tag Information

Request detailed information about the current tag: UID, block size, block count, type. UID us returned in hexadecimal format, BS (block size), BC (block count), T (type) in decimal format.

Recognized tag types

Syntax:

Request AT+S\r
Response +UID=<HEX UID>,BC=<bc>,BS=<bs>,T=<t>
OK
ERROR tag did not respond
or SCAN1 mode is enabled

Example:

Request AT+S\r
Response +UID=EC6D140708,BC=64,BS=16,T=0
OK

Read Data Block

Read data block from tag memory. The block number must be within the range supported by the tag (see BC field in the AT+S\r request), and passed in decimal format. Returns the block number, followed by the actual data in hexadecimal format. Number of bytes in the data equals the tag block size (see BS field in the AT+S\r request). A tag must be selected prior to executing this command (either by calling AT+i,AT+S, or AT+SELECT)

Syntax

Request AT+R0\r
Response +DATA <number of bytes>:<hex data>
OK
+CME ERROR: <code>
ERROR
tag did not respond, reported an error
or SCAN1 mode is enabled

Example

Request AT+R0\r
Response +DATA 0:EC6D1407920804009944314230353913
OK

Write Data Block

Write data block to tag memory. The block number must be within the range supported by the tag (see BC field in the AT+S\r request), and passed in decimal format. The data must be passed in hexadecimal format. The length of the data must match the size of a data block as returned in the BS parameter (i.e. pass 2*BS hexadecimal characters).

Syntax

Request AT+W<block number>:<HEX DATA>
Response OK
+CME ERROR: <code>
ERROR
write or auth error (if +CME... is reported)
syntax error or SCAN1 mode is enabled (if no +CME...)

Example

Request AT+W1:000102030405060708090A0B0C0D0E0F\r
Response OK

Device Settings

The following commands change various device settings. The are executed regardless of the device mode. Individual commands change only in-RAM settings. In order to save the current settings to ROM, execute the AT+P command.

Enable/Disable the LED

This command enables/disables the LED. This setting only affects whether the firmware switches the LED when a tag is detected/lost. Regardless of this setting, you can switch the LED on and off using AT+D1... command.

Syntax:

Request AT+L[0|1|?]\r ? - query the current value
0 - do not switch LED on/off
1 - switch LED on/off
Response OK

Example:

Request AT+L?\r
Response +L=1
OK
LED will be switched on/off

Enable/Disable the Buzzer

This command enables/disables the buzzer. This setting only affects whether the firmware will make a beep when a tag is detected or not. Regardless of this setting, you can switch the buzzer on and off using AT+B... command.

Syntax:

Request AT+Z[0|1|?]\r ? - query the current value
0 - do not make a beep
1 - make a beep
Response OK

Example:

Request AT+Z?\r
Response +Z=1
OK
The device will beep when a tag is detected

RFID Receiver Gain

The recevier gain is measured in dBm. The valid range is [18;48]dBm. The default value is 33dBm.

The valid gain values are

If any other value is passed, it will be rounded (to the nearest available value greater than the one pased).

Syntax:

Request AT+G=[18-48]\r ? - query the current value
+G= - revert to default (33)
Response OK

Example:

Request AT+G=24\r
Response OK The value will be rounded
The value will not be applied immediately
Request AT+G?\r
Response +G=33
OK
The value (24) has been rounded.

Tag Presence Query Frequency

When in SCAN1 mode, the device queries the tag presence every N ms (default value: 1000ms). This command controls the query frequency (i.e. the interval N). Valid range is [250-65535] ms. Values smaller than the minimum one will be accepted and silently increased to fit in the range. Values greater then the aximum one will result in an error.

Syntax:

Request AT+T[?|<value>]\r ? - query the current value
Response OK

Example:

Request AT+T?\r
Response +T=1000
OK
The current interval value is 1000ms
Request AT+T1500\r
Response OK The current interval value set to 1500ms

Mifare Authentication Key

Mifare Classic tags need an authentication key to be read/written. The following command sets the key (the key type and 6 bytes long key itself), which will be used to authenticate connected Mifare Classic tags. The default value is FF

Syntax:

Request AT+K<type><hex data>\r type can be
A or B
Response OK

Example:

Request AT+KA000102030405\r
Response OK Key set to 00..05 type A
Request AT+K?
Response +A000102030405\r
OK
returns current key type and value

SAK

(for version 1.0F Apr 3 2018 and above)

By default Mifare SAK (Select Acknowledge Code) is appended to the UID in the scanning mode. This can be disabled/enabled using the +A command.

Syntax:

Request AT+A[0|1|?]\r ? - query the current value
0 - do not append SAK
1 - append SAK
Response OK

Example:

Request AT+A?\r
Response +A=1
OK
SAK will be appended

Data selection (scanning mode)

(for version 1.0F Apr 3 2018 and above)

This setting controls data (UID or block) printed when a new tag is detected. 1 - UID, 0 - block, determined by the Block Number setting

Syntax:

Request AT+U[0|1|?]\r ? - query the current value
0 - print block
1 - print UID (the default)
Response OK

Example:

Request AT+U?\r
Response +U=1
OK
UID will be printed

Block number selection (scanning mode)

(for version 1.0F Apr 3 2018 and above)

In scanning mode the device continuously scans whether an RFID tag is present and prints UID or the selected block. This setting controls the block number being printed:

If the block does not exist or cannot be read (ex. due to an authorization failure) nothing is printed.

Syntax:

Request AT+b[?|<value>]\r ? - query the current value
Response OK

Example:

Request AT+b?\r
Response +b=0
OK
Block 0 contents will be printed
Request AT+b1\r
Response OK Block 1 contents will be printed

Write settings to ROM

This command saves the current in-RAM setting to ROM, i.e. makes them permanent

Syntax:

Request AT+P\r
Response OK

Device Control

The following commands manage the RFID reader device itself:

Device Reboot

Reboot the device

Syntax:

Request AT+Q\r
Response OK

Firmware Update

Reboot the device and start the bootloader (this command may not be supported by some devices. If not supported, acts as AT+Q\r).

Syntax:

Request AT+X\r
Response OK