1523 views|0 replies

1

Posts

0

Resources
The OP
 

Logistics POS machine with serial port expansion IC [Copy link]

Logistics POS machine with serial port expansion IC
I. Background
With the development and progress of Internet technology, more and more of our work needs to rely on computers or electronic devices. Even many traditional industries have undergone earth-shaking changes driven by "Internet +". For example, in the logistics industry we used to have, now the goods in the logistics industry are sent out by mail, mailed to the recipient's signature, and we can query them anytime and anywhere. So how can this information be transmitted to the Internet in real time? Of course, it is inseparable from our increasingly powerful smart handheld terminals. Isn't this a successful example of "Internet + industry smart hardware". Of course, there are many industries with such needs, such as e-commerce, retail, government departments, etc.
2. Industry Overview
Smart hardware terminals are increasingly used in various industries in our lives. At the same time, in order to meet the actual needs of various industries, the industry is also constantly improving and exploring new needs for these designs. At present, our common smart hardware terminals mainly include POS machines, handheld PDAs, etc. Next, we will introduce the design of a handheld terminal device based on the serial port expansion chip WK2XXX.
Now more and more handheld terminals will integrate rich functions, so more functional hardware modules will be added, such as our common card reader module, GPS module, wireless communication module, print head module, scanner module, fingerprint reader module, etc. These modules usually use UART interface to communicate with the main CPU.
Our usual CPU comes with 2 to 3 UARTs. In addition to a debugging uart, there
are only 1 or 2 UART interfaces left for us, so we have to expand more serial ports to load related functional modules. After considering some domestic and foreign serial port expansion ICs, we finally decided to choose the serial port expansion chip in the wk2xxx series of Kaiwei Electronics Co., Ltd. for the following reasons: The hardware transceiver cache of the wk2xxx series serial port expansion chip is large, and there are timeout interrupts, etc.
III. Overall design plan
1. Overall principle block diagram


This design uses Samsung's S5PV210 as the main control CPU, which can run Linux, Android, and wince7.0 system platforms. Then use the WK2204 serial port expansion chip to realize the installation of different serial port modules. Specific serial port expansion modules include card readers, GPS, serial port printers, serial port scanners, etc.
2. Introduction to WK2204
WK2204 is the first 4-channel UART device with low power consumption and support for UART/SPITM/IIC bit parallel bus interface with 256-level FIFO. The chip can be selected to work in any of the above main interface modes through mode selection, and the selected main interface can be expanded to 4 UARTs with enhanced functions. The
extended sub-channel UART has the following functional features:
the baud rate, word length, and check format of each sub-channel UART can be set independently, and the maximum communication rate can be 1.5Mbps.
Each sub-channel can be independently set to work in advanced working modes such as IrDA infrared communication, RS-485 automatic transceiver control, 9-bit network address automatic identification, and software/hardware automatic flow control.
Each sub-channel has an independent 256-level FIFO for receiving/transmitting. The FIFO interrupt can be programmed with trigger points according to user needs and has a timeout interrupt function.
WK2204 uses QFN24 green and environmentally friendly lead-free package, can work in a wide operating voltage range of 2.0V to 3.6V, and has a configurable automatic sleep/wake-up function.

4. Hardware Design Points
1. This hardware design mainly introduces the related peripheral circuits of WK2204 and the way to expand UART


From the above figure, we can see that wk2204 realizes data communication with S5PV210 through SPI interface, and also outputs its own interrupt signal to the external interrupt input pin of S5PV210, so that the relevant data received by WK2204 can be quickly processed through interruption.
At the same time, the 4 serial port devices connected to wk2204, card reader, GPS, printer, and scanner communicate with wk2204 through UART, and finally realize communication with S5PV210.
5. Key points of software design
This design also takes LINUX system as an example. System-level products like this mainly include driver design, system transplantation, and application APP design. We mainly focus on the driver design of WK2204 under LINUX. Because this is also the key and difficulty of this design.

1. Introduction to the overall driver framework of Wk2204
The driver of an embedded system is the interface between the Linux system kernel and the device hardware. It maps system calls to specific operations of specific devices on actual hardware. The relationship is shown in the following figure:

In this way, the application can operate the hardware device like an ordinary file. The user program only needs to care about this abstract file, and all the work dealing with the hardware is handed over to the driver. For example, if we want to output a string to the screen, we only need to write the string to the file abstracted by the graphics card, and the work of actually transferring the string to the graphics card is done by the driver.
Under Linux, the driver is part of the kernel and runs in kernel state. You can compile the driver statically with the kernel. The disadvantage is that the kernel will be larger, and if the driver fails, it will cause the entire system to crash; it can also be compiled in module mode and dynamically loaded when needed.
Linux3.0 is the most widely used version at present. It is easy to develop drivers and is also convenient to port to other versions of Linux. This software product is the driver software for the WK2XXX series serial port expansion chip developed based on the Linux (linux3.0 kernel) platform of S5PV210.

We will not introduce the driver program in detail here. You can ask for the specific driver program from Weikai Microelectronics Co., Ltd. They have prepared relevant drivers.
2. System call
Since the driver is finally reflected in the system as a serial device file, when we make printer and scanner related applications, we can directly call the system's serial device file to implement the application.

VI. Summary
Now in the era of rapid development of the Internet, as a device designer, we must first understand market demand and quickly realize the demand into products. All of this requires modular design of product design, which can not only reduce development time, but also increase system stability and reduce costs. With more and more serial port devices today, it may be more important for us to choose a good serial port expansion chip. From the understanding of Weikai Microelectronics, Wk2204 has been mass-produced, and from the feedback of the market, the product is stable, easier to use and more practical.

This post is from Linux and Android

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list