Most of the existing neon lights and lantern controllers use special integrated circuits, which have multiple flashing modes and generally only provide 4 to 16 outputs. Since there are quite a lot of controller channels used in large neon lights, they can generally only be customized, which is expensive and has poor flexibility. This design adopts Liyuan Company's new generation BASIC microcontroller PS1016 and cost-effective 8-bit LED control driver PS7219, which can realize multiple ports and control any port. It can be widely used in large neon lights and plastic neon lights. As well as the programmable control of lanterns, it can be programmed directly on the product and debugged on the computer for direct transmission. It has the characteristics of simple design and easy use.
1 Introduction to main components The pin arrangement of PS1016 microcontroller is shown in Figure 1. Its characteristics are as follows: 1. The PICBASIC interpreter solidified inside the chip provides 32 statements; 2.20MHz system clock, 16 bidirectional bits can be independently programmed as input/output (I/O) ports, supporting a variety of I/O operations; 3. The PICBASIC source program is stored in the expanded 24LC16BE 2 PROM. The capacity of E 2 PROM is 2K bytes, which can store approximately 600 to 800 statements. |
1.2 8-bit LED control driver PS7219
The pin arrangement of PS7219 is shown in Figure 2. PS7219 is a high performance, low price multi-bit LED display driver. It is fully compatible with MAX7219 in terms of performance and adds functions such as bit flash. Its interface adopts the popular synchronous serial peripheral interface (SPI), which can be easily interfaced with any kind of microcontroller, and can provide 64 outputs or drive 64 independent LEDs at the same time. PS7219 has a 15×8 RAM function control register inside, which can be easily addressed. Each digit can be controlled and refreshed independently without rewriting the entire display. The brightness of the display can be controlled digitally. Each bit has a flicker enable control bit. When the pin CON is set to high level, all displays can be disabled to achieve the effect of reducing power consumption without affecting the modification of the control register. The PS7219 also has a power-down mode, a scan limit register that allows the user to select from a 1-digit display to an 8-digit display, and a test mode that forces all LEDs on. N PS7219s can be cascaded to achieve N × 8-bit LED display.
2 Hardware design The hardware block diagram is shown in Figure 3. |
Figure 3 Multi-port programmable neon light and lantern controller block diagram
Keyboard input Since the requirements for keys are not too high, PS1016's unique POT statement is used to identify the pressed keys; the digital display is four 8-segment numbers. The tube can be driven by the LED driver SAA1064 with I 2 C interface; the interface with the microcomputer uses the MAX232 interface circuit.
The entire system is based on the single-chip computer PS1016, which controls the input and output of the entire system. Its control can be divided into two states: programming and running. In the programming state, PS1016 accepts input from the small keyboard and processes the data and stores it in the 1M-bit CMOS serial E 2 PROM24LC256. During operation, the data is sequentially taken out from 24LC256 and sent to each PS7219 according to the programming design requirements. The port is lit and the entire program runs in a loop. Each additional extension adds 64 outputs.
3 Software design
The entire program is also divided into two parts: programming and operation. The overall block diagram of the program is shown in Figure 4.
Figure 4 Program flow diagram
The key to this program lies in the input, reading and writing of data. For reading and writing of 24LC256 and writing format program for PS7219, please refer to the relevant manual of Liyuan. The data structure and flag bits stored in 24LC256 can be determined according to needs, which will facilitate the use of a microcomputer to download control codes through the RS232 port in the future. After the program of PS1016 microcontroller is compiled on the microcomputer, it is downloaded to the microcontroller through the developer.
PS1016 uses two pins, SDA and SCL, to form an I 2 C bus interface with a data transfer rate of 60kHz, allowing PS1016 to expand I 2 C devices.
The I 2 C data transfer format is shown in Figure 5:
Among them, S is the start signal, A is the response signal, R/W is the read/write bit, and P is the stop signal.
S |
device type |
device choose |
R/W |
A |
Data 1 |
A |
Data 2 |
A |
Data 3 |
… |
A |
P |
Figure 5I 2 C data transfer format
24LC256 works in single-byte read and write or page read and write mode, using data 1 and data 2 to form high and low bit addresses. The following is the PS1016 read and write 24LC256 program to achieve single-byte data writing and reading. … W11=W11+1
'###Write 24LC256###
'W10 keyboard input port number to be lit
'The high bit is b21 and the low bit is b20
'W116-bit address counter high bit is b23 and low bit is b22
IICOUT$0A,$02,b23,b22,b21 'Write high-bit data
W11=W11+1
IICOUT$0A,$02,b23,b22,b20 'Write low-bit data
W11=W11+1
goto KEYBOARD INPUT 'Go to keyboard input subroutine
'###Read 24LC256###
W11=0 'Clear address counter
IICIN$0A,$02,b23,b22,b21 'Read high-order data
IICOUT$0A,$02,b23,b22,b20 'Read low-bit data
If w11=$FFFFthen START 'End mark, start again
W11=W11+1
… 'Send W10 data to PS7219 subroutine
goto LOOP
This design has been successfully produced and used in the neon lights (237 channels in total) advertising in shopping malls in Huaiyin City. It has good performance, flexible use and low price. affirmed by users.
The above program design, if slightly modified, can be used in other fields such as the controllable display of large-scale fireworks.
References
1PS1016BASIC Microcontroller Instruction Manual. Wuhan: Wuhan Liyuan Electronics Co., Ltd., 1997.5
Previous article:Heat source automatic tester based on microcontroller control
Next article:Multi-port programmable neon lights and lantern controllers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- STM32 RTC registers
- Inductance calculation formula
- [NXP Rapid IoT Review] + Recommendation for NXP Rapid IoT to connect the differential ADC input port of KW64 to the expansion port
- [Allwinner V853 heterogeneous AI intelligent vision development board review] "mkimage command not found" error solution...
- Live broadcast with prizes | Sign up for TI's June Embedded Processing Live Theme Week to get a glimpse of new products in industrial scenarios!
- [MSP430] Practical ADC use, internal temperature measurement use
- STM32F401CC spi flash recognition problem
- [Raspberry Pi 4B Review] + Building an OPENCV Environment
- Design and Application of Saber Simulation Software
- [2022 Digi-Key Innovation Design Competition] ESP32S2 button control RGB light