One of the programming of USB drive-free RFID reader: Smart card

Source: Internet
Author: User

With the popularization of RFID applications, more and more software engineers need to use RFID reader programming to achieve their own needs. In order to make the software engineer understand the use of RFID reader faster, this paper chooses a commonly used USB drive-free RFID reader sdt-ha to do the analysis. USB-free drives typically use a USB HID interface because the Windows system itself is driven by a HID interface, so there is no need to publish the driver separately.

To write RFID reader program, you must first understand the RFID reader read and write card memory structure. Now widely used is the M1 (S50) card and its compatible card as the representative of the smart card, the following will detail the memory structure of the S50 card.

The standard S50 smart card has 8Kbits of memory, equivalent to 1K bytes, which can actually be used to store data with 752 bytes, why it shrinks, and will be explained in a later memory introduction.

The standard S50 smart card has 16 sectors, each with 4 blocks and 16 bytes per block. All that counts is 16*4*16=1024 bytes (1K). Since the block is the smallest management unit of the card structure, we read and write this card in accordance with the block to operate, that is, must be 16 bytes. Each of the 4 blocks consists of a sector unit that is formed to manage the card's key, which is the corresponding key and sector of the card. There are 16 sectors, and there are 16 sets of keys that work independently of each other. A set of keys works only on this sector (4 blocks), regardless of other sectors. This design allows the smart card to be used for up to 16 different applications at the same time.

The key for each sector is stored in the last piece of the sector, occupying a separate block. The key is divided into a key and a B key, which can be found in the article "about S50 card key A and key B".

The NO. 0 block of the No. 0 sector is used to hold related data such as serial numbers, is read-only and cannot write any data. If we define the block in order, then the block number is from 0 to 63. 0 to 3 blocks are the No. 0 sector, 4 to 7 blocks are the 1th sector, and so on, and the 60th to 63rd block is the 15th sector. The NO. 0 block is read-only, 3rd block, 7 pieces .... The 63rd block is all key blocks and cannot be used to hold data, so the total block of data that can be saved is 16*3-1=47 block, total 47*16=752 bytes.

(Reprint please specify source: Friend I technology website http://www.youwokeji.com.cn)

The latest edition RFID reader product manual download

(Reprint please specify source: Friend I technology website http://www.youwokeji.com.cn)

The latest edition RFID reader product manual download

One of the programming of USB drive-free RFID reader: Smart card

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.