Abstract: μPSD32xx is a section of collection 51 essence and PSD (programmable system component) with a body’s SoC monolithic integrated circuit, has many functional units, the performance-to-price ratio is high, widely applies in the tax controls the cash register, the tax to control and taxes and so on miniature printer controls in the equipment. In the article introduced μPSD32xx monolithic integrated circuit’s principal characteristic and the development environment, gave have applied this chip to realize the tax controlled the software and hardware design proposal.
Key word: μPSD3234A; The tax controls; Modular design; API function
1 introduction
The tax controls the equipment is the National Tax affairs Department realizes one of tax administration informationization inevitable methods, the tax controls controls one of equipment as the tax, is in electronic installation’s under and so on computer coordinations realizes the tax to control the function the electronic installation, it may guarantee that the management data the correct production, the reliable memory and the safe transmission, can satisfy requests and so on Tax authorities’ management and data investigation. The tax controls usually with an ordinary cash register (main engine) connected, completes the function which together the management and the tax control, the connection relations see Figure 1.
The tax controls is the collection software and hardware in a body’s embedded system, to use the monolithic integrated circuit effectively and enhance the development the versatility, may use the platform thought and the modular design, the division hierarchical structure, by realizes hardware’s flexibility and software’s probability as far as possible.
2 μPSD32xx monolithic integrated circuit synopses
2.1 principal characteristics
μPSD32xx the series is the new monolithic integrated circuit which ST (Italian law semiconductor) the company promotes, it uses the enlargement mode MCS-51 essence, is the MCU PSD SoC monolithic integrated circuit, this component has the following characteristic:
●2 the piece Flash memory, uses in the stored routine or the data, easy to realize in the application programs the (IAP) function.
* may choose prepares the electricity protection large capacity SRAM.
●2 programmable logic circuit, respectively be address decoding DPLD and combinatory logic CPLD.
●6 group general I/O provides reaches 37 or 46 I/O pins. * main from way I2C.
* low speed pattern USB 1.1.
●2 road serial channel UART.
* in system programming JTAG mouth.
2.2 development environments
The system software may 51 integrated development environment μVision2 carry on the design, the translation and the simulation in KEIL Corporation’s KEIL, and software carries on programming downloading and the internal disposition using ST Corporation’s PSDsoft the Express. This software may to μPSD32xx series monolithic integrated circuit’s internal Flash, SRAM and PLD carries on the disposition, and will translate the production the program’s code file (.HEX) and the configuration files fusion produces the .OBJ document to download to the monolithic integrated circuit. When downloading must use FlashLINK to program the cable connection PC machine standard and the mouth and monolithic integrated circuit’s JTAG mouth.
3 hardware design plan
3.1 hardware demands
The tax controls the basic function which should have to be as follows: Has the real-time clock and the record tax controls the data the mass memory unit; Has conforms to ISO7816 the standard IC card reader-writer, supports the tax to control the card, the user card and the tax administration card; May pass USB or the serial port and the main engine communication; Has after the power failure may preserve the memory data and the clock movement backup battery; But the permission unusual power failure does not destroy any valid data.
3.2 hardware system composition
The tax controls the internal hardware system structure to see Figure 2.
(1) master control module MCU
Master control module MCU uses ST Corporation μPSD3234The monolithic integrated circuit, its interior has 256kB host Flash, 32kB Flash and 8kB SRAM, the working voltage is 5V, selects the 24MHz crystal oscillator. And SRAM by the piece outside battery backup power supply, may deposit some long-term preserved the data, the standby current only needs 1μA.
The master control module is connected through USB or UART and the main engine, is connected through I2C and RTC, passes I/O and ICC and MEM is connected.
(2) clock module RTC
Clock module RTC uses ST Corporation’s M41T0M6, this chip has the real-time clock/calendar function, may time the millisecond, the second, the minute, the hour, the week, Japan, the month, the year, the century. In the system power failure later may by the piece outside battery backup power supply, maintain the internal clock continues the movement. Uses the 32.768kHz crystal oscillator, working voltage 5V, the operating current 130~200 μA, battery backup voltage 3V, the standby current only needs 1uA. The I2C maximum transmission speed is 400kHz.
(3) memory MEM
Memory MEM uses ST Corporation’s 2MB serial Flash chip M25P16, altogether has 32 sectors, each sector 256 pages, each page of 256 bytes, the page programming time is 1.4ms. M25P16 uses the SPI bus interface, biggest transmission speed 50MHz, low working voltage 3.3V. In order to realize the 5V-3.3V logic level to transform, may use Onsemi Corporation’s three group non-opposition Schmitt trigger NL37WZ17, its compatible 5V and the 3V logic level, the output actuation may reach 24mA. The Flash memory mainly uses for to save the receipt data and the tax controls the data.
(4)IC card module ICC
IC card module ICC uses Onsemi Corporation’s NCN6004A. NCN6004A has the double tax office outpost connection, conforms to ISO 7816-3 and the EMV standard. Working voltage 5V, electric current 150mA, built-in DC/DC, can provide the 65mA/5V power source for each card, exterior crystal oscillator 14.28MHz, built-in programmable card correspondence main line clock.
MCU carries on the serial communication through the I/O line and NCN6004A. In order to save the I/O resources, may choose the multiplying segment way, namely two cards share a group channel, by chooses the card signal discrimination, realizes the tax to control the card and the user card visit function separately.
(5) USB connection
The MCU interior has the USB communication controller, for the filter and the ESD protection, the connection part uses Onsemi Corporation’s STF202. The STF202 working voltage is the 3.3V, DIN2 foot interior belt 1.5kΩ on pulls the resistance. Because MCU only supports the low speed USB equipment, therefore its USB_D_ must connect STF202 DIN2, communication speed 1.5Mb/s.
(6) UART connection
The UART transformation chip uses Intersil Corporation’s HIN202, MCU interior to have 2 group UART, may select the RS232 communication. The HIN202 working voltage is 5V, has 2 group receiving and dispatching actuations.
(7) power source module PWR
System’s exterior electric power supply divides into two groups, a group provides 5V directly with the AC/DC adapter; In addition yilu inputs (5V/500mA) by the main engine through the USB connection line. The user may the optional group provide directly to the 5V component work.
In order to realize the electricity protection function, uses Onsemi Corporation’s pressure-rise chip NCP1402SN50T1, its lowest input trigger voltage is 0.8V, output voltage 5V, output current 200mA. When system normal work, NCP1402SN50T1 may for the big condenser charge, once the power failure, the big electric capacity still might maintain this chip to work period of time, this time may complete some vital tasks, avoids the unusual power failure making the mistake. The big electric capacity has used two series connected 3.3F/2.5V coiling electric capacity, when fills may maintain supplies power above for 30 seconds.
uses Onsemi Corporation’s NCP500SN33T1 5V to the 3.3V voltage switch, this chip output current is 150mA, but is the 3.3V component provides the working voltage.
What the battery backup uses is two 3V/210mAh lithium batteries, the power supply may maintain above at least 10 years.
(8) monitors module MON
The monitoring module uses Onsemi Corporation’s MAX708, MAX708 to be possible to realize on the electricity replacement and the hand reset, but also has the voltage monitoring function, when design in its PFI end connection suitable voltage-division resistance, when like the main power source power failure, MAX708 may produce the power failure signal of stop, with completes the vital task or the backup important data.
MAX708 working voltage 5V, replacement threshold value 4.38V, resetting time 200ms, low pressure monitoring input threshold value 1.25V.
(9) status indicator SIC
The status indicator uses the illumination second-level tube, uses in instructing conditions separately and so on power source connection, card insertion, JATG procedure downloading. May also connect on MCU I/O makes a mistake, status indicators and so on movement, from examination.
4 practical application electric circuits
The tax controls MCU with other hardware core’s circuit diagram as shown in Figure 3. In the chart has given the clock, the Flash memory and the IC card module and the MCU connection mode.
5 software design plan
The tax controls the software to contain two major parts as a whole: Main engine end software and equipment end software. Between the main engine end and the equipment end uses “the order - reply” the way to carry on the data communication. By main engine end routing directive, equipment end reply.
The main engine end software may divide into four: The application layer, the tax control the function level, the communication management and the equipment actuate the level; The equipment end software may also divide into four: The master control level, the tax control the function level, the device management level, the hardware to actuate the level. Following main introduction equipment end software construction.
5.1 master control levels
The master control of function is responsible for the system and equipment’s communication monitoring, the agreement management, the tax initialization, with main engine’s between controls order package of explanation and duty business and so on dispatch.
5.2 taxes control the function level
The tax controls the function according to GB code controls to the tax the request design, is responsible for the machine initialization and the registration, the distribution receipt, writes the receipt, to return a ticket, the invalidated ticket, the upload receipt, the date transaction and the volume compiles business and so on data, declaration, investigation.
5.3 device management level
The device management level is aims at the complex equipment design the executive program, mainly includes the IC card management, the memory management, the USB communication management.
The IC card executive program is defers to GB18240.2-2003 to control the IC card to the tax the request design operational order procedure, may divide into the basic command and the expansion order. The basic command has the file operation, the read-write record, to have the random number, the internal and external to authenticate, to take the response, application locking and so on; The tax controls the card special-purpose order to have the card to register, to write a check, Japan trades signs and so on functions; The user card special-purpose order has the registration signature, the distribution receipt, to declare goods the data to compile and so on functions.
The memory executive program uses for to the Flash storage space to carry on the allocation management. This procedure according to loop record’s way design, mainly completes the receipt to be detailed, date transaction and volume business and so on summary record formatting, read-write, search. Simultaneously is also responsible to save in SRAM the address distribution list management, data and so on indicator records.
The USB communication executive program is defers to the low speed USB1.1 standard as well as the man-machine interface equipment (HID) the category request design, uses for to complete the main line enumeration and data communication business. This procedure mainly uses Endpoint 0 (IN/OUT) to control the transmission mode, and uses the input output report form (Report) the form to come and the main engine exchange data.
5.4 hardware actuate the level
The hardware actuates the level is causes each hardware equipment to realize the first floor operation driver, including clock, IC card, API storehouse functions and so on Flash MEM, UART and USB. And the clock function clock and calendar functions and so on realizes the establishment, to read, to write. The IC card function realizes the IC card to insert card functions and so on examination, card high and low electricity, card replacement and card order. Flash the MEM function realizes the exterior Flash memory’s cleaning, to read, to write and so on functions. UART and the USB function realizes functions and so on establishment, receive and transmission data.
Figure 3
6 concluding remark
In the article introduced the tax controls the principle of design, this design proposal through the application function debugging, has been able to satisfy the product the primary need. What needs to explain, in the actual product, may consider that uses the modulation design concept, i.e. the hardware uses the module ledger wall construction, advocates processing and the hardware core concentrates in the module, the power source and the connector and so on lay aside on the ledger wall; The software first floor may seal the API function to the upper formation the form. Like this is advantageous satisfies the different level the demand, the segmentation tax controls industrial the market, is advantageous in the developer and supplier’s localization choice. Through many kinds of developments and the cooperation way, achieves reduces the cost, raises the efficiency and the saving of time goal.