How to speed up NFC development?

How to speed up NFC development?

In 2014, thanks to Apple's participation, NFC quickly entered the public's field of vision. Domestic manufacturers are also eager to try, hoping to get a share of this field. However, many people still don't know what NFC is. What else can it do besides payment? Is there any room for us to explore...

1. What is NFC?

In fact, NFC, like Bluetooth, has a set of protocol stack specifications. It is a short-distance communication specification based on the 13.56MHZ frequency band. The usual communication distance is about 3 cm, and the longest is no more than 10 cm. You can find out its benefits and advantages by searching Baidu. I will not elaborate here. It is a protocol compatible with RFID protocol that supports master-slave calling. It has more advantages than the original RFID and is compatible with the previous wireless ID card application scenarios. In the past, the host of RFID could only be the host and could not switch to the role of tag (slave).

2.What can NFC do?

Many people know that NFC started with payment, because now Apple is making Apple Pay, Google is making Google Wallet, China Mobile, Alipay, etc. are all using NFC for payment, and China Merchants Bank has also launched a service like QuickPass....

However, payment involves UnionPay certification, which involves the interests of all parties and has a high entry threshold. It is not something that ordinary companies and individuals can play with. I personally think that ordinary friends who want to participate in the NFC camp should forget about NFC payment. We have nothing to do with it. It is played by big companies and big conglomerates. If we don’t pay attention to NFC payment, what else can NFC do?

NFC actually stands for Near field communication. Payment is just one of its typical applications. In fact, it can be used to transmit any data. However, what can be done and what should be done are two different things. What to use NFC for depends on its characteristics and advantages. The characteristic of NFC is that the communication establishment time is very fast and the transmission rate is relatively slow, so it is suitable for scenarios where the amount of data is relatively small and the process is short and fast.

I think two application directions are the key points:

1. Read and write contactless IC cards (various ID cards, IC cards)

2. P2P (peer-to-peer) communication - can transmit custom data

In the field of security: NFC can be used for dynamic password access control, or even an advanced identity recognition system that is compatible with both mobile phones and ID cards. It can also be used as a sign-in system, valuables equipment management, etc. . .

NFC is used in smart access control (supports mobile phone + door card)

In terms of anti-counterfeiting and source tracing: there is a lot that can be done, and it is also something that ordinary people like us can do. For example, products such as Wuliangye have used NFC tags for anti-counterfeiting and source tracing.

In the field of professional applications: mainly using NFC's P2P communication, mobile phones and industrial equipment can transfer data to each other at will, conveniently utilizing the processing power and convenience of mobile phones. For example, as long as industrial machines are equipped with NFC, mobile phones can be used to configure parameters, read the status data of industrial equipment, etc. In particular, now bank ATMs have also begun to use P2P to conduct business, such as small payments, cardless withdrawals, etc., which can all be completed with mobile phones. The data of encrypted card numbers and passwords are transmitted through P2P, which is safe and flexible, and has a larger operating space than card simulation. For example, the SMC532 module of Hot Wheels has been used in some ATM machines in China for applications such as small withdrawals and cardless withdrawals. Users can open the application on their mobile phones to bind their bank cards, and then swipe them on the ATM to withdraw money, eliminating the trouble of entering passwords or forgetting to bring bank cards. Among them, the NFC point-to-point communication function of the SMC532 module is used. The module can transmit data between mobile phones with NFC functions. These data are encrypted by the ATM application, ensuring security and convenience.

NFC is used in advertising machines (distributing coupons and other data)

3. How to quickly develop NFC functions?

To develop NFC functions, communication must be carried out in accordance with the NFC protocol. The NFC application protocol stack is naturally quite complex in order to take into account factors such as security and efficiency, and it will take some time to fully understand its application.

If you want to quickly develop NFC functions, it is best to use an NFC module with a built-in protocol stack, such as the SMC532 module from HotWheel Technology. It has an MCU that has the NFC application protocol stack built into it, so users don't have to understand the NFC protocol stack at all. They only need to send a series of commands through the serial port to implement complex NFC functions. Whether it is a single-chip microcomputer or a device running an embedded system (WINCE, ucos-II, Android), the NFC function can be quickly added. One serial port command corresponds to one NFC function, such as card reading, card writing, P2P..., all of which can be done with one command.

The NFC module reads the card number and P2P data and transmits them directly through the serial port automatically, which is very convenient and fast. In particular, the P2P communication between the NFC device and the mobile phone uses the NDEF format, which involves LLCP, LIBNFC, SNEP, NEDF, etc. If you develop it yourself, the workload is very large. If your device main control is made of a single-chip microcomputer, it cannot run these protocol stacks, so it is best to use a module such as SMC532, which will save a lot of trouble. You don’t have to worry about the details of NFC transmission. You only need to worry about what data to transmit, what data to read, and other business logic-related matters.

Example:

Card reading: When an NFC card enters the antenna range, SMC532 automatically reads the value of a certain address and sends it through the serial port

PS. This default read address can be configured through commands.

Write card:

For example, if you need to write data 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 into address block 02, the command is as follows:

Send NFC data to mobile phone (P2P method)

Users can conduct P2P communication with mobile phones through the SMC532 module. The NDEF data format can transmit any data. Hot Wheels provides DEMO sample program source code for each platform and provides demonstration program source code on mobile phones, allowing you to quickly implement customized NFC functions.

.....................00 FF

The above data are all in hexadecimal.

After these data are set, when an NFC phone comes close and runs the Hot Wheels P2P software, the module will send red data to the phone.

The mobile phone sends NFC data to the module

The mobile app interface provided by Hot Wheels is as follows

When the SMC532 NFC module receives P2P data from a mobile phone, if it is large data, it will be transmitted to the host in frames. There are two frame formats in the data transmitted by the module to the host through the serial port:

You see, it’s really a simple operation to realize the complex functions of NFC.

----- Developing NFC is that simple...

<<:  How did WeChat product managers and architects handle 1 billion red envelopes?

>>:  How to grab red envelopes scientifically: write a program to grab red envelopes

Recommend

4 modules teach you how to use marketing thinking to seduce girls

"I will be 27 after this birthday. I will ch...

How to place a high-quality advertisement? Advertising tips!

What is a good advertisement? Everyone has a diff...

Willows have sprouted. Can they be eaten? How? Where?

Today is Arbor Day, and it is early spring. The &...

Retinal hemorrhage after exercise, why does aerobics still "strain your eyes"?

Has everyone done the “blanket exercise” that has...

iOS 11.2 will enable free trial apps

November 7 news As we all know, in the Windows Ap...

If you want to advertise well, these cases are indispensable

As we all know, excellent cases are of great sign...

Xiaopeng responded to the car fire accident: caused by collision

As new energy vehicles become a major trend in th...