Tutorials to .com

Tutorials to .com » Mechine » Mcu » Embedded design using C8051F020 Tester

Embedded design using C8051F020 Tester

Print View , by: iSee ,Total views: 20 ,Word Count: 2324 ,Date: Sat, 22 Aug 2009 Time: 4:01 PM

With the continuous development of monitoring and control technologies, embedded operating system will be applied to the measurement and control areas, in order to achieve real-time online testing has become a development trend, and an increasing number of industrial testing equipment at the scene of a variety of increased demand, I hope to test equipment able to test the direction of the development of real-time online. Based on these needs, this paper based on the C8051F020-controlled tester shows part of the keyboard design. Embedded in the test system, under this section only as a digital machine, and through the RS485 bus interface for communication with the host computer, which will receive the test data in accordance with the requirements of control commands to be displayed in the display, testing staff will be sent at the same time various requests to the host computer signals back to the test data for a certain treatment.

1 System hardware design

The hardware of the system by the mcu module (C8051F020), power module, display module (OCM320240K), matrix keyboard module, such as four-part composition, the overall hardware design of its system block diagram shown in Figure 1. Among them, the foreign expansion of the design of the buffer memory and flash memory. Solve the high-speed data receiving and processing does not match the character of the problem of small storage capacity.

Embedded design using C8051F020 Tester

1.1 MCU module C8051F020

C8051F020 is Cygnal Introduces high-performance single-chip is fully integrated mixed-signal system-on-chip, which radically changed the appearance of the slow 8051 performance low impression. C8051F020 patent Cygnal used high-speed, pipelined structures, as well as with the MCS-51 instruction set is fully compatible with the CIP-51 core microprocessor. CIP-51 in 8051 to enhance the speed to take a new approach, the CISC chip in to maintain the same structure and command system, the introduction of assembly-line operation command, thus the abolition of the concept of a machine cycle. Its clock cycle command to run the units for each clock cycle a single-cycle executable directive, thus greatly improving the speed command is a function of relatively complete, high-speed, high-performance single-chip microcomputer.

This choice of the system design as a single-chip MCU Tester The main reason is that the CIP-51 and MCS-51 instruction is fully compatible with the standard 8051 can use the assembler, compiler and software packages development, but also very easy to use software personnel transplantation; on the other hand, can take full advantage of its rich resources of universal digital port, rather than the address / data multiplexed lines, the design of peripheral circuits can be greatly simplified. As the chip's low port (P0, P1, P2, P3) can be addressed by the bit can also be byte-addressable, so the control signal system in the low ports are part of the design; and high-port (P4, P5, P6, P7) can only be addressed by the byte, the MCU and display modules, memory modules and other data, address bus are part of the design in high-port; C8051F020-rich port and its flexibility in the allocation of resources through the use of priority cross-switch decoder achieved; and that all pins are used 5V voltage. And can be configured as open-drain or push-pull output mode and the weak pull.

1.2 LCD Module OCM320240K

Human, 80% of access to information from vision, and eventually all kinds of information through the information display to achieve human-computer exchange. As the liquid crystal display (LCD) with low operating voltage, micropower, CMOS circuit using direct-drive, and a light easy to carry, therefore, upon emerging on the popular, intelligent instruments, such as natural products has become the first choice for display.

The single-chip system control to the LCD module to control the use of indirect methods. That is, the data do not use single-chip systems, and use of its I / O port to achieve contact with the LCD module. The design of LCD modules can be with the MCU data bus port P1 as a data bus to connect the other three time-series control signal line is usually the use of 8051 population of the P3 is not used I / O port to control. Access off of the CPU's memory space, and its interface circuit has nothing to do with the timing, the timing completely achieved by software programming.

Graphic dot-matrix LCD modules significantly OCM320240K integrity of the PCB board containing the drive system (built-in controller SED1335 liquid crystal display), the interface system includes a drive system and power control signals. Its rows, columns are used drive KS0086, by the four operational amplifier bias circuit composed of liquid crystal display. Dot-matrix liquid crystal display controller SED1335 through its interface with the microcontroller and the programming can be realized on the liquid crystal display text, graphics, menus, and content page about mobile functions. On the LCD output to the potential electrode signal phase, peak, frequency modulation parameters such as exchange-driven electric field can be established in order to achieve liquid crystal display.

1.3 Power Supply Module

Industrial site for the use of portable embedded tester, may consider the use of DC power supply. The system requirements for the three power +5 V, +3.3 V, -23 V. Which is a +3.3 V power supply to the C8051F020 chip. -23 V is required for large LCD negative voltage power supply, +5 V is the drive and other chip logic power supply. Power module design uses an external power supply dual power supply, +8 V and -33 V DC power supply circuit after a regulator can provide the above-mentioned three kinds of voltage. Specific circuit design as shown in Figure 2, which in the +5 V and +3.3 V power connection interface can be used as the LED power indicator light, said power supply connected to lights. Capacitor circuit is used in power supply filtering.

Embedded design using C8051F020 Tester

Matrix keyboard module 1.4

Keyboard interrupt module is designed with non-coding means 8 × 8 matrix keyboard, in order to save power, the design of pull-up resistor selected. Button on the rows, columns, respectively, received MCU line of P2, P3 port, INT0 external interrupt as connected to the P0.2 port of the MCU. Contain keys 0 to 9 number keys, the menu shows the "OK", "Cancel" and "double", "under the double" and test system control keys and other necessary basic function keys.

1.5 external expansion circuit

The design of the circuit outside the expansion of two parts: one is outside the extended high-speed buffer memory, as a result of the test instrument through RS485 bus from the host computer receiving the data may be high-speed data, and high-speed data bus and display module processing speed may not match, which must take into account the expansion of the use of an external cache to satisfy the display module 64 KB of RAM requirements shows the test data can also be sub-screen display. In this paper, selection of 128 KB of SRAM chips STC62WV1024; the other is outside of a FLASH memory expansion for increased testing power-down protection for the case of a sudden power-off test data is not lost. More important objective is to show the module as a result of built-in user-defined CGRAM character database of small capacity, it will be built taking into GB expansion from the basic font stored in the FLASH, the MCU according to the needs of its dynamic management, At the same time continue to show the character to complete the necessary transfer of the operations transferred. This will meet the requirements of large font, while maintaining real-time scheduling. The design uses the chip K9F2G08U.

2 shows the software modules

2.1 LCD initialization

LCD display features a powerful reason why, in addition to its own show with a certain degree of hardware functions and, more importantly, through the software design to achieve a variety of display features, including the basic display and show by a combination of the basic features of the expansion shows. However, prior to use, generally must be based on the characteristics of LCD module initialization parameter choices to its initialization, initialization process as shown in Figure 3, the specific initialization code is as follows:

Embedded design using C8051F020 Tester

Embedded design using C8051F020 Tester

2.2 Chinese characters display

SED1335 through the character code to determine the character library of characters first address and the data matrix corresponding to the liquid crystal display module. Appear on the LCD screen of the character block 16 × 16 dot matrix text display RAM is actually a bit of the screen corresponding to the 16 × 16 lattice. SED1335 display memory through user-defined library of characters CGRAM. Users can write in the corresponding units of the corresponding character code, and then through the subroutine call to the achievement of Chinese characters show that the following character is to show the "Welcome" Part of the procedure code:

Embedded design using C8051F020 Tester

Due to the limited capacity of CGRAM, it could be considered to be user-defined basic character of the GB library expansion on the outside of the FLASH, and then by the MCU according to test data types and user needs non-stop from FLASH dynamic font and font required temporarily transferred CGRAM in existence. Display module through the expansion of custom font can display the OCM320240K more perfect and powerful. Thus more suitable for display in various fields.

2.3 Menu display

LCD module should be designed to show the menu as far as possible with an ordinary PC to maintain the same menu structure (ie, tree topology was), in order to adapt to the operation of customary operators. The design of the menu display is at the keyboard in conjunction with the attainable. To simplify operation, the keyboard display with the menu button on the control settings, generally speaking, only "OK", "Cancel" and "double", "turn under the" basic functions, such as through the button operation of these procedures and the command menu display implementation of procedures to respond to the keyboard and menu display process shown in Figure 4. Operation, press the "OK" button, the screen will display the next menu level; and press the "turn on", "over the next" key, the cursor will blink at the same level menu to move between each menu item to show the current election the menu. No menu at all levels, you can set two variables mn, ln to the current menu, respectively, and the cursor where the line (the first act of 0, and so on). Initialization procedure, mn = 0, ln = 0; with "OK" button to change the menu code to be (mn = mn × 2 + ln), "Cancel" button to change the menu number (mn = [mn / 2 ]), "the double", "over the next" key can change the cursor position (ln = ln ± 1). Such as menu 12 menu cursor is on the 5th position in the third line (ln = 2) when the press "OK" key to get the serial number for the 5 × 2 +2 = 12. Determine the number and cursor position menu, and then call the display program (the implementation of the procedure or function) to display a menu of new and re-set the cursor position. Its routine code as follows:

Embedded design using C8051F020 Tester

Embedded design using C8051F020 Tester

3 Conclusion

After completing the hardware and software design, can be designed for the debugging of the circuit board in order to achieve its display. At present, the host computer system and debug the cascade is still under way. In addition, taking into account the growing use of touch-screen a wide range of circuit design in the system are also taken into account and with touch screen controller (ADS7843) display DV320240F interface module in order to touch the future in accordance with the need to increase functionality.

Micro Controller Unit Articles

Can't Find What You're Looking For?

Rating: Not yet rated


No comments posted.