Home >color tft lcd module > DSP-based LCD common controller design
DSP-based LCD common controller design
2011-12-13 by seoer1

Introduction
Power electronic devices in the process of debugging and development, the need to regularly change the relevant control parameters, and needs to run real-time process monitoring devices at key points in the power of the waveform. Now the power electronic devices, the control panel of the controller chips, commonly used DSP (digital signal processor), due to its hardware limitations, the control parameters (such as PID control of the coefficient) changes, they often need to constantly change and programming process, it is difficult to modify parameters in real time online, but it is difficult to control the device to send complex instructions; In addition, the present device debugging process, the relevant point in the need to monitor the power waveform, often multi-channel isolated oscilloscope. This area has greatly increased the unit's R & D costs, and because the scope of the limited number of channels, and changes can not be increased at any time by monitoring the waveform points, while the oscilloscope probes by electromagnetic compatibility constraints, the length is limited, it is also caused by the use of debugging a lot of inconvenience.
The author's research group take a 100% low-floor light rail vehicle research task, in the device development process, due to the aforementioned reasons, the need to develop a set for the parameters, device control and to achieve universal controller analog waveform output . The controller supports the use of device communication protocol to send commands to the device and modify the parameters of the line, while real-time view device operating conditions, the receiving device to send digital and digitized analog data such as running. In addition, the controller output with multiple DA, the DA output termination on the oscilloscope can choose to view the remote device via buttons on the analog basic situation to oscilloscope-long-range power monitoring. Controller can be flexible to change the channel corresponding to the DA's power, greatly increasing the utilization of the channel sampling oscilloscope. In the communication protocol, the controller supports RS232, RS485, CAN bus and Ethernet protocols in order to satisfy the communication needs of different devices. Meanwhile, the controller for the relevant device parameters sent over digital, real-time using the China LCD module. For digitization of analog parameters, the controller calculates in real time while the average, RMS and other characteristic quantities using liquid crystal display unit, the other by 8 DA converter for converting the output to a sampling oscilloscope channel display. The liquid crystal display unit controller data can be automatically determined based on the size of the data digits of its fractional part, to always keep four significant figures. All relevant parameters and the received data, the controller can be saved to the ferroelectric memory, data is not lost after power-down, easy to use next time.
2 controller hardware components and functions

Among them, the controller of the CPU unit with TMS320C28X series DSP2812, it has a serial peripheral interface (SPI), two serial communication interfaces (SCIs), improving the local area network (eCAN), multi-channel buffered serial port (McBSP .) DSP2812 high-frequency, universal controller to meet the communication rate, while a good universal controller needs to support RS232, RS485, CAN bus, Ethernet, DA converter and other peripheral devices, reducing the system's development effort.
System type liquid crystal display unit using LCM128645ZK Chinese liquid crystal display module. The module power supply operating range (2.7V to 5.5V), low-power design of its products to meet the power requirements; the same time, the interface module and microcontroller interface flexibility (three modes: parallel 8-bit / 4, Serial 3-wire / 2 wire), can be realized characters, ASCII code, bitmap graphics with the screen display, support for all mainstream LCD operating instructions, set aside a variety of control lines (reset / series and select / brightness adjustment) for the user flexible use. DSP2812 generic I / O port to communicate with LCM128645ZK, send control commands and data related to the implementation of appropriate control its operation.
Controller, including function keys, including pages and menu items up / down, parameter data of increase / decrease, the current parameters of the modified / confirmed the function of the system selection. Button to scan the ranks arranged. When the scan button, advanced trekking scan, then scan the column. Scan through the ranks together to determine the current structure which button is pressed. Meanwhile, a key debounce software to improve the accuracy and reliability of operation. Buttons and DSP2812 the I / O interface connected to the maximum expansion of 16 (4 * 4) button array, in order to meet the operational requirements.
D / A converter 12 bit, 8-way selection of the DA chip AD5328, the DAC update rate of 167ksps, DAC to set the time to 6μs, DAC in the form of voltage. DSP2812 DA converter through the SPI bus data exchange, and 2 with the DSP I / O interface connected to a control signal.
MAX232 RS232 communication module used as a bus interface chip SCI interface is connected with the DSP. RS232 controller is mainly used for communication between PC and the remote programming of DSP program.
MAX485 RS485 communication module as a bus interface chip SCI interface is connected with the DSP. Inside the module using the HCPL2610 optocoupler isolation for high-speed level shifting and signal isolation, the output side of the module installed overvoltage surge of anti-and anti-jamming circuit, in order to improve communications reliability.
CAN communication modules use the DSP2812 enhanced LAN Controller (eCAN), compatible with the existing standard CAN2.0. It can be a strong electronic noise environment with other controllers to communicate reliably. With 32 fully configurable mailboxes and time stamp feature, eCAN module provides a versatile and robust with a serial communication interface.
LAN91C111 Ethernet communication module used as a control chip, the use of data lines, address lines and I / O port is connected with the DSP2812. LAN91C111 main features: adaptive transmission rate, support 100M/10Mbps; support burst data transfer; 8kb of internal memory device to send and receive buffer; support 8-bit, 16-bit, 32-bit data transfer mode ; in advance to send and receive functions.
In addition, we also use FRAM FRAM, through the I / O interface extends the DSP 2812 of RAM. TMS320F2812 has been integrated within the 18KB of RAM, for general applications, has no need to expand the external RAM. On-chip RAM can be accessed by 150MIPS speed, speed of operation in the demanding process, usually the frequently accessed blocks into the internal RAM to run, this can greatly increase the speed. And this system is a network communication system in the future will be a lot of data for network transmission, and thus should be extended outside the RAM as a data buffer. RAM selected Ramtron's FRAM, FRAM has the advantages of RAM and ROM, read and write speed, and the same can be used as non-volatile memory.

3 Controller Software Design
Actual use, lower power electronic devices of communication protocol can choose RS232/RS485/CAN / Ethernet in either.
System by the main control unit MCU and auxiliary control unit ACU, of which the MCU uses two DSP chips as the master. Figure in each DSP have configured the appropriate communications module. Users need to MCU or the corresponding parameters ACU high sampling frequency, real-time monitoring, through the controller's Ethernet interface in the target cell in the Ethernet module, the module that can be transmitted to the controller via Ethernet start specified parameters and data. Diagram using the controller's CAN communication interface to connect the MCU and ACU's internal CAN control network, to send control commands, see the relevant operating parameters and settings, the system control process time and instructions to send periodic heartbeat synchronization and frame communication to determine the state of the system, while some of the CAN network can transmit data with low sampling frequency of operation. The RS485 bus map as a backup communication bus, CAN bus failure in operation.
3.1 overall system software processes
According to the communication network structure, the overall software system can be designed to process, system software flow shown in Figure 4.
Power system first initializes the system first initialize the CPU and the LCD, set the necessary registers, clear color TFT LCD moduledata, making it into the corresponding work.
Program for key scan every 10ms to check whether a key is pressed, if there is button pressed, then the work according to a predetermined timing control liquid crystal display, flip the page to achieve the menu items moved to modify the relevant parameters and display functions. Communication data received by the appropriate standard digital communication interface for the query or receive interrupt.

3.2 CAN communication to achieve
Controller software design involves the RS232-based bus, RS485 bus, CAN bus and Ethernet data communications DSP interface design, considering the limited space, is only a brief implementation of CAN communication, other communication protocols to achieve with general principles the same.
The main program into the corresponding communication module, call the subroutine, the data transmission. Subroutine flow chart shown in Figure 5.
Initialize CAN module to enable CAN module clock, set the baud rate and the sending and receiving mail identifier, configure the sending and receiving mail, and point to the number of bytes, so to all mailboxes.
Determine whether you need to send data, such as the current mode is to send commands to the target DSP or send change of parameters, then send the data into the program, remove all sent mail to send response bit, the data is written to the mailbox command or parameter data area, set to send register sign in response to a request to start sending a message, send a response until the appropriate mailbox flag is set.
If not send commands or send has completed, then enter the receiver. When the transceiver receives the data bus, the recipient's mailbox is pending in the corresponding flag register is set. Check this one state, you can determine whether the received data, read data from mailbox after receiving reset receive flag RMP, waiting for the next reception.
The received data, digital display on the LCD can be, analog oscilloscope can be observed through the DA converter uses.
4 Summary
The author of the innovation by the universal controller CAN, Ethernet, RS485, RS232 and other communication parameters to achieve the change of power electronic devices and settings, and through the liquid crystal display. After debugging and actual use, this design has been applied to a common controller traction power supply system power electronic devices, run good, interference immunity and reliability to achieve the design requirements. Other power electronic devices based on debug needs, the universal controller can be flexible to change, easy to operate.

  keywords:color tft lcd module