The configuration of an article was told. Let's talk about the text below.
began to take zfm-206 fingerprint surgery.
Let's start by introducing two types of zfm-206. One is USB type. The other is the UART. In view of individual needs, the UART goes up.
Since the intention is to use the UART on the Pcduino to do fingerprint access to the application, it is natural that the serial port settings, although the online tutorial Bad street. But to say a few important points, personally think this is more than the configuration of the serial port baud rate, data bit stop bit more technical, a lot of people are only know it but do not know why, I also reiterate this topic
Serial Port Open parameters
FD = open ("/dev/ttys1″,o_rdwr| O_noctty);
if (——-)
——-Omit 10,000 words here
You know this opens the device file, but do you know the meaning of these communication parameters? Amuse ....
Simply say a few common
O_RDWR Read and write mode open;
O_noctty does not allow the process to manage the serial port (tell Unix that the program does not want to be a "control Terminal" control program, do not specify this flag, any input will affect your program.
O_ndelay: Tell Unix that this program does not care about the DCD signal line status, that is, if the other port is running, does not indicate this flag, the program will be in the DCD signal line for low-level stop.
As for setting the baud rate and so on. Self-search on the internet. No technical content. People all over the country.
Serial port setup is complete. Start the fingerprint procedure.
According to the ZFM-206 official manual, control the fingerprint mainly through the UART to send serial instructions, fingerprint default parameters are: Baud rate: 57600 (can be changed), data bits: 8 stop bit 1
The first thing the fingerprint sends is the header verification. If the verification information is correct, a sequence of 16-based ACK codes is returned
Put a fingerprint handshake. Verification Information 16 binary send format
Baotou Address Pack identifies package length package contents (instruction/Data/parameter/ACK code) checksum
Each instruction is a certain 16 binary data code. Under
Small goofy here to emphasize a problem, the serial port to send data, is sent in 2, so, if you send the ' 1 ', then receive will be its decimal ascll code, small goofy once used Bluetooth Pro test.
Reason: The serial port sends the data in 2, treats 1 as the character processing, the binary transmission is 0011 0001. Then to the serial port to receive the data is 0011 0001, converted to 10 binary is 49. So the transmission of the past, the serial port really received the data is 49. Instead of 1. I hope you don't cropper here.
One of the workarounds:
Request memory space to send:
Let's get a little goofy.
Small Goofy finally remind a point, the digression ah. And it's easy for everyone to make mistakes. Use up space everyone may release in time, but also to control your defined pointers. Don't mess with your fingers. Avoid wild hands
Get some of my fingerprints. Admission and detection mode flowchart
To accept fingerprints.
Search for fingerprints
More articles focus on the blog of Goofyy Technology House. Portal: http://www.goofyy.com/
Pcduino Fingerprint access Control development – Chapter II