Home | Site Map | Contact us | 中文版  
 
   
 
By industry
By product
By Specifications
AVR-based single-chip LED display of gray Design and Implementation
About 1 AVR Microcontroller
AVR MCU is enhanced built-in FLASH the RISC (ReducedInstructionSetCPU) reduced instruction set of high-speed 8-bit single-chip, using hardware Harvard (Harward) structure, one clock cycle to achieve the implementation of a directive, the vast majority of orders were for single-cycle Instructions. ISP support for the ISP, which also supports the MEGA Series application programming in the IAP. FLASH program memory built-in rewritable more than 1,000 times, to users of the development and production and maintenance of convenience. Rewritable 100,000 times E2PROM, for the preservation of data after the power-down convenience. AVR MCU has a wealth of on-chip resources, such as RTC, WATCHDOG, AD converter, PWM, USART, SPI, TWI interface, I / O port features a strong ability to drive.

2, the overall system design

LED display system is mainly composed of 3 parts: PC PC image and text conversion to send the data unit, control unit and the display module.  

  PC images and text to complete the conversion code into the display screen, and display the information sent to the main control unit. Control unit with a choice of 32kB on-chip FLASHROM and 2kB-chip RAM of the AT-mega32 single-chip, there is no plug-in memory. If you want to store more information on the show, you can have a choice of 64kB on-chip FLASHROM the AT-mega64 or with 128kB on-chip FLASHROM the AT-megal28, can also plug-in memory to increase storage capacity. The main control unit on the completion of the data showed that the rolling and processing division, and then through the asynchronous serial port is sent to each of the sub-module. Each display module with 4 8 × 8 dot-matrix monochrome block a spell of 16 × 16 dot matrix screen, with a dynamic display ATmega8 completion of the scan.

Control unit and display the data communications module to adopt the standard asynchronous serial format, each frame of data, including a start bit, 8-bit data, an address / data marker, a place to stop a total of 11. Data transmission rate for the 625kb / s, byte transfer rate for 56.8kB / s. Each module by 256 LED structure, to achieve 16 gray-order needs of each LED space 4b, so every full-screen display module for the amount of data 128B, external Addressable 1B of the total bytes 129B. Control unit display module to update the content of the show, all sub-module addresses one by one by sending data showed that all the sub-module to update the data and then send a special address 0xFF characters as the word control, so that all the sub-module updates at the same time show Data, so as to avoid large screen, showing a large number of sub-module when the module frame out of sync. To the completion of the design of the 6 × 4 display module, due to communication constraints rate, frame rate of up to 56800 / (129 × 24 +1) = 18.34 frame / s, but also due to the completion of the full-screen control unit Data segmentation and display the contents of the movement of control, so the actual value of these frames below, but for the general picture shows that can meet the requirement.

On-site applications, the PC can be no PC, just to show that the information is stored in the main control unit can be adopted by the main control unit button to select and display the contents of the way, the cycle can be shown that text messages can be up and down Scroll about show.

3 System hardware design

The system is made up of two hardware components: the circuit board and display module driving circuit.

3.1 motherboard circuit

Motherboard circuit is very simple, ATmega32 from the smallest component of the system and the RS232, RS485 interface circuit.

Motherboard data from the asynchronous serial port to the various sub-module, in order to improve the speed and distance of the cases still be able to guarantee the reliability of data transmission, on board the message converted into RS485 signals, with a Shield of coaxial cable transmission to the sub-LED module. Conversion used for the interface chip MAX485, the chip work at 5V voltage, the highest transmission speed of up to 2.5Mb / s, transmission distance of up to l200m. With a shield of the coaxial cable can reduce the transmission process of signal interference.

In the PC from the PC to download data to FLASHROM, ATmega32 through the MAX232 chip and PC machine communication.

3.2 module display driver circuit

Sub-module from the display driver circuit RS485 converter circuit, sub-module address marking circuit and dot-matrix-driven circuit. RS485 conversion circuit and in the same motherboard, the same used for MAX485 level translators.

As a result of the asynchronous serial port single-chip multi-machine communication for data transmission, each child should have the module and its location corresponding to the address of the logo. Address marking circuit 8 times out of string and 8-bit chip 74HCl65 DIP switch components, so the system can accommodate up to 255 sub-module (OxFF address as the updated control module shows the character). If you simply set the internal software to determine the address of each module, each corresponding to AT-mega8 procedures are different, this will cause inconvenience to the programming process, the use of external hardware module pair Address for identification. 74HC165 parallel strings used for the conversion of the single chip in order to save resources pin.

LED dot matrix scanning method for dynamic drive, and the realization of gray-order 16 shows that in order to save single-chip scanner in the process of time consumption, increase the speed of scanning, data showed that output in parallel. Driver circuit 4-16 decoder decoding 74HC154 drive after 16 months in power transistor line as the 8550 election, 2 8-bit data latches 74LS373 as a line of data latches.  

4 system software design

System software design, including PC software design, motherboard AT-mega32 programming, shows that sub-module ATmega8 Programming 3.

PC software to complete the text and image editing, computer through the serial interface to display data on the motherboard. PC motherboard to receive data through in-house BootLoader zone procedures within FLASHROM data show that since the update. Motherboard data show that the division of treatment for each child sent to the module, and the completion of the data showed that the up and down, scroll around to deal with. Sub-module software pulse duty cycle modulation method to achieve 16 gray-order image display.

4.1 PC software design

PC software using VB development, the completion of the main image of the check point, compensation and linear array of data generated. First of all, image files will be converted to 96 × 64-resolution, color depth of 256 bands monochrome gray image, as the duty cycle driven by the use of its duty cycle LED / brightness for a number of characteristics, the characteristics required to join the index adjusted for the line Before delivery and display system for display. The formula for Dout = 15 × (Din/255) n. n for the ratio coefficient, the real proof shows that after 1.35, while the formula adopted by the completion of the first order from 256 to 16 gray-scale conversion of the gray band. MSComm control through the realization of PC motherboards and machine communication.

4.2 motherboard ATmega32 Programming

Host part of the software is divided into the main keys to respond to treatment, the data show that after the partition and the partition of the data sent 3. Data show that one of the most important division accounted for, at the same time show the scroll mobile content but also in this section. Button in response to the use of external interrupt response, with timers to carry out TO shake-bit keys to deal with post-effective signs in the main program of inspection of the key signs and respond effectively to deal with.    

4.3-show programming module

Shows that the software is divided into sub-module to receive data and dynamic display refresh 2. As the sub-module to achieve the 16 gray-order performance, but also to achieve a high enough refresh rate to avoid flicker, so set on the part of the show's higher speed. The design of this program are: full-screen (one for each sub-module for the 16 line × 16 dots / line) is divided into 16 time set piece, each time to achieve his film scanning. The time line for each film is divided into 15 sub-time film, in which dark gray for most of the time sub-0-bit chip, light gray for most of the time the 15-bit chip, to achieve this duty cycle 0 / 15 15/15 16 level, the average current control, in order to achieve the rank of 16 gray-scale display. Through: MEGA8-chip timer T2, each of the sub-time access to on-chip scan time of 52μs, 15 sub-time film scanning a single piece of time (52μs × 15 = 780μs), 16 months time scanning single-chip also constitute the first full-screen Scan (780μs × 16 = 12.48ms), then refresh rate of about 80Hz, the highest brightness can also ensure that no existing flash.

5 Conclusion

In this paper, based on the AVR MCU LED display has been applied to on-site, AVR MCU's watchdog function of the system is stable and reliable. Due to this design is the master-slave solution with scalability, and functionality to the ISP using the debug circuit boards and systems maintenance is a big convenience. Practice has proved that the system can easily display a variety of fonts text messages and 16 gray-order image, the image clear, stable, easy to operate, with very good value.

 
     
 
2013-7-30 Cast  |  Agent  |  Download  |  Message