Design scheme of streamlined LED dot matrix system based on PSoC

Abstract: This paper introduces the difference between the traditional LED display design method controlled by single-chip microcomputer and the LED display design method based on PSoC technology, and expounds the advantages of PSoC technology in the design of LED dot matrix display system. Taking the CY8C27443 chip of PSoC series as the core, the LED dot matrix display system is taken as an example to describe the hardware design, PSoC configuration and software function specific design implementation method of PSoC multi-function compact size LED dot matrix system. Because the internal resources of the CY8C27443 chip are more abundant, the design of the LED dot matrix system is simpler than the 51 single chip circuit, the performance is more stable, and the software design is simpler and more convenient, thereby greatly saving the development cycle and cost.

Traditionally, 51 single-chip microcomputers are used to control the display of LED dot matrix. The function of the display is relatively simple. If you want to diversify its functions, it often takes a lot of time and effort to design complex peripheral circuits. Therefore, software and hardware are used in the system design. The design is more complicated, which increases the difficulty of development; increases the size and weight of the display, is not easy to transport and install; more importantly, the production cost of the product is relatively high. Compared with traditional LED displays, the versatile and compact LED dot matrix display developed based on PSoC technology utilizes the technical advantages of the system-on-chip to integrate modules of different functions on the same chip, since it only adds and reduces The modules on the chip can increase or decrease the corresponding functions, which largely compensates for the shortcomings of the traditional LED display, shortens the development cycle, and makes the product easier to upgrade and update.

1 System working principle

1.1 PSoC series microcontroller introduction

PSoC: (Programmable System-On-Chip) programmable system-on-chip, is a new generation of system-on-chip microcontroller. Cypress's PSoC(TM) mixed-signal array is a programmable system-on-a-chip (SOC) that integrates analog and digital components that are often required for expansion in microcontrollers and embedded systems. At the same time, PSoC can also be considered as an 8-bit microcontroller, which is an 8-bit microcontroller. However, unlike a conventional microcontroller, it requires almost no peripheral circuitry. A PSoC chip can implement an electronic system, and PSoC has more internal resources than a typical microcontroller. Foreign experts have referred to its development as the second electronics revolution. The PSoC chip used in this system is CY8C27443. CY8C27xxx is the most powerful series of analogs in the PSoC mixed-signal array [1]. Table 1 below compares the 28-pin CY8C24533 and AT89C51. From the above table, we can see that the internal resources of the CY8C27443 chip are more abundant, so the design of the LED dot matrix system is simpler than the 51 single chip circuit, and the performance is more stable. The chip is very cheap and also adds A/D module, D/A module, SPI interface module, PWM module, temperature sensor, etc. can be integrated inside the chip, which makes the peripheral circuit greatly reduced, and the hardware circuit size is more streamlined and reliable. The software design is also simpler and more convenient, which greatly saves the development cycle. Although the price of CY8C27443 chip is 2-3 times higher than that of 51 MCU, but its internal resources are available for configuration, the system cost can be saved by 50%~60%.

Table 1 Comparison between CY8C24533 and AT89C51

Table 1 Comparison between CY8C24533 and AT89C51

1.2 Hardware Design of PSoC-based Reduced Size LED Dot Matrix System

The hardware design of the PSoC-based versatile reduced-size LED dot matrix system is shown in Figure 1. The PSoC-based LED dot matrix system uses the TG202 smoke sensor sensor, the HM1500 humidity sensor, and the PSoC on-chip integrated temperature sensor. The smoke concentration, humidity and temperature in the air are collected separately and released to the LED display in time. When an abnormal situation occurs, the buzzer can also be used to issue an alarm. The collected data can also be sent to the PC for external environment monitoring through the Si4432 wireless transceiver module. At the same time, characters can be input on the PC and sent to the LED display through the wireless transceiver module to post advertisements and notifications. Because PSoC has both on-chip and off-chip system clock sources. From and the display scan speed can be improved, making the product hardware design performance more reliable, coupled with PSoC can be dynamically reconfigured, so the product is more flexible and more complete, the function is more complete; the software design has the API function provided by the manufacturer for the selection, the programmer There is no need to worry about the underlying driver as with the 51-chip microcomputer, which greatly shortens the development cycle of the underlying driver, thereby enabling more application development and improving development efficiency.

Figure 1 Hardware design of a PSoC-based multifunction, compact size LED dot matrix system

Fig.1 Hardware design of PSoC-based multi-function compact size LED dot matrix system

1.2.1 TGS202 as a gas sensor

The system uses TGS202 as a gas sensor to detect the CO, CO2, gas, methane and other gases contained in the air to detect the smoke in the environment. When these gases are detected, the internal resistance of the TG202 becomes small, so that the voltage at the output terminal rises rapidly. In order to achieve the function of detecting fire.

By configuring the amplifier in the PSoC and the 8-bit 8-channel A/D conversion module, and the internal sinc2 filter is a hardware circuit to reduce CPU overhead and 64x oversampling, reducing front-end filtering The anti-aliasing of the device requires this filter. It is realized to convert the analog quantity of the gas sensor into a digital quantity, and repeat the test three times or more to send the average value of the obtained data to the specified unit storage.

Once the gas is found to exceed the standard, the PWM module output port outputs a 1KHz square wave to drive the buzzer to achieve the purpose of the alarm.

1.2.2 Temperature sensor

The PSoC microcontroller comes with a temperature sensor inside, and its absolute temperature is proportional to the linear output voltage. The Flash Temp application programming interface (API) converts the temperature sensor to one count per degree Celsius. PSoC's internal temperature sensor, Flash Temp, provides an initial temperature measurement of the bFlashWriteBlock function for the user module. It measures from -40 to +80 degrees in degrees Celsius.

1.2.3 Humidity sensor

Humidity is the physical quantity indicating the content of water vapor in the air [2]. The system uses HUMIREL's HM1500 humidity transmitter. The humidity sensor of HM1500 selects the humidity sensitive capacitor HS1101. When the relative humidity changes, the moisture sensitive membrane can adsorb. And releasing water vapor molecules, causing a change in its dielectric constant, thereby changing the capacitance of the element. Humidity can be measured as a function of capacitance versus relative humidity [3].

The HM1500 has a built-in amplifier circuit and uses a constant voltage source to output a volt-level voltage signal proportional to the relative humidity. Since the temperature affects the delay of the humidity varistor, the PGA module is added to the PSoC to compensate the error according to the relationship between voltage and relative humidity, and then the 12-bit A/D converter is connected.

1.2.4 LED dot matrix display

The implementation process of the display is shown in Figure 2. The LED dot matrix display is composed of 128 1.9mm 8&TImes;8 LED dot matrix blocks, each forming 32&TImes; 32 rectangular dot matrix. With the progressive scan method, because the scanning time is fast and the visual persistence effect of the human eye, it can be seen that the LED dot matrix displays a complete graphic or text. The line driver uses the ULN2803 high-voltage and high-current Darlington transistor array integrated chip. Since the ULN2803 single-pin maximum output sink current is 500mA, the inverter module is configured in the PSoC27443 and the single-column column driver circuit is integrated by the integrated circuit. The 74HC595, which constitutes an 8-bit serial-in-and-out shift register and an 8-bit output latch, and the control of the shift register and output latch are independent, and can be implemented in the display by cascading the 74HC595. At the same time as the data of each column is transmitted, the column data of the next row is transmitted, that is, the purpose of overlapping processing is achieved. The dot matrix data serially output from the I/O port of the MCU is moved bit by bit to the corresponding position with the action of the shift clock. After receiving the latch signal, the data is output in parallel to the column line of the LED, and finally the row drive signal Lights up a row of LED pixels.

Figure 2 LED display works

1.2.5 Communication between PSoC and PC

The communication between PSoC and PC is shown in Figure 3. The Si4432 wireless transceiver module is used for communication. The Si4432 chip is a highly integrated, low-power, multi-band EzRadioPRo series wireless device from Silicon Labs. Transceiver chip. It operates from 1.9 to 3.6 V and operates in four bands of 315/433/868/915 MHz; an integrated diversity antenna, power amplifier, wake-up timer, digital modem, 64-byte transmit and receive data FIFO, And configurable GPIO and more. The Si4432 requires few external components when it is used. It requires only a 30MHz crystal oscillator, several capacitors and inductors to form a highly reliable transceiver system with simple design and low cost.

With a receive sensitivity of -117 dB, the Si4432 provides excellent link quality while minimizing power consumption while extending the transmission range; minimum filtering bandwidth of 8 kHz for excellent channel selectivity; 240 to 960 In the MHz band, the maximum output power can be up to +20dBm without the power amplifier, and the transmission and reception distance can be up to 2km when the design is good.

The Si4432 is suitable for wireless data communication, wireless RS485/RS232 data communication and many other fields.

Figure 3 Hardware block diagram of PSoC-based versatile reduced-size LED dot matrix system and PC communication

Figure 3 Hardware block diagram of PSoC-based multi-function reduced-size LED dot matrix system and PC communication

The system forms a star network, and communication between the PC and multiple LED displays is multi-machine communication. Adopting master-slave structure: The host computer is a PC that controls different slaves by finding the corresponding address. The PSoC control wireless transceiver module as the slave does not actively send commands or data, and is controlled by the host and only one in a multi-machine system. The host is the PC, and each slave does not communicate with each other. Even if information exchange is required, it must be forwarded by the host. Finally, it is sent to the LED display in the form of a data packet through the wireless transceiver module. The format of the data packet defined by this system is shown in Table 2: where the preamble is 0XFFAA55.

In the transmission process, a preamble with a set length can be added in front of each packet; in order to identify the arrival of the frame, the receiving end needs a preamble to perform frame synchronization, thereby determining when to send and receive data between the transceiver systems. . After the preamble of the sync word, the set sync word is used as the flag code of the sync mode. The synchronization word set by this system is 2 bytes, and the content of the synchronization word is 0x2DD4. The receiving end starts receiving data after detecting the synchronization word. The data payload length is 1 byte, and the payload data payload is the data sent by the user. The CRC checksum is checked by the built-in CRC. The Si4432 integrates functions such as modulation/demodulation, encoding/decoding, etc., so that the preamble, synchronization word, data payload length and CRC checksum are automatically added by hardware. The user only needs to set the structure and part of the data packet. The specific content of the structure, such as the preamble and the sync word, is fine.

Table 2 Packet format

Table 2 Packet format

1.3 System Software Design

The principle of interrupt time-sharing is used to form the system main program and the interrupt service program. The main program is shown in Figure 4. The main program continuously judges whether the corresponding flag is 1. As long as the flag is equal to 1, the corresponding subroutine is entered through the interrupt. Interrupt subroutine (TImer8 Interrupt), time interrupt, counter flag unit is 70H, whenever? When t=100ms is reached, the corresponding flag is set.

1.4 Host Application

The application shown in Figure 5 is developed using Delphi.

Delphi is a simple, easy to learn, powerful, easy to use and fast and efficient visual development environment (IDE) for Windows. It has a WYSIWYG visual interface design style and object-oriented programming. Widely used in various fields.

Delphi provides a good interface design capability and has a strong function in PC serial communication.

Figure 5 One of the PC software interfaces

Figure 5 One of the PC software interfaces

1.4.1 modulo

Displaying Chinese characters must use the dot matrix glyph information of Chinese characters, also known as the Chinese character font. That is, the digitization of Chinese characters. According to the display definition of Chinese characters, the application software has a variety of fonts for users to choose. For example, 16&TImes;6 dot matrix fonts, each word is composed of 16 rows and 16 columns of dot matrix. That is, each word in the national standard Chinese character library is represented by 256 dot matrix.

We can understand each point as a pixel and the glyph of each word as an image. In fact, this display can display not only Chinese characters, but also any graphics in the 256-pixel range. It is convenient to display various special characters by modulating the bitmap.

The mode of taking the mold can be divided into horizontal and vertical mode for the user to select.

1.4.2 Serial Communication Implementation Method in Delphi Environment

The system uses the MSComm control, which transmits and receives data through the serial port to provide basic serial communication functions for applications, so that programmers do not have to spend a lot of time to understand more complex API functions. The system: the use of the transmission binary number, you need to use the Variant variable matrix, the matrix size automatically adjust mscomm1.Settings := '9600, N, 8, 1 '; / / parameter settings, return baud rate, parity, data Bit, stop bit mscomm1.SThreshold: = 0; / / send all data mscomm1.PortOpen: = true at a time; / / open the port mscomm1.RThreshold := 16; / / set how many bytes received and generate OnComm events, capture and process An event or error that occurred during communication.

2 Conclusion

The versatile and compact LED dot matrix system designed with PSoC chip is very powerful, the hardware design is simple, the software programming only needs to call the API function, and the system is configurable, flexible and no need to add chips, which greatly enhances its Value for money.

It is a single color product with extremely high color purity. It is pure in color,

can be choose in a variety of colors (red, yellow, blue, green, white, white, etc.).

often powered by DC12-24V, which consumes low energy, has high brightness and stable performance.

Generally suitable for interior decoration, pool, disco, bar, karaoke and other ambient lighting.

Unique technology and high standard of anti-static ensure the life and quality of the light strip.

More and more are used for furniture lighting.

Mono LED Strip

Addressable LED Strip,LED Strip Lights,5050Smd Flex LED,Mono LED Strip