This paper studies the use of MAX7219 and BC7281 control chips to achieve different display and control of LEDs.
1.MAX7219 display mode application
1.1 MAX7219 Introduction
MAX7219 is an 8-bit 7-segment LED serial input/output common cathode display driver chip produced by MAXIM. Currently, there are many introductions to its applications [1,2]. MAX7219 provides many registers, allowing users to control many aspects such as decoding display, display brightness, scanning limit, etc.
1.2 System Hardware Connection
MAX7219 is connected to the microcontroller through three leads: DIN, CLK and LOAD. DIN is the serial data input terminal, CLK is the clock frequency, and LOAD is used to latch the signal.
The microcontroller sends the binary number bit by bit to the DIN terminal in the form of a 16-bit data packet, and shifts one bit of data into the shift register of the MAX7219 at each rising edge of CLK. During the 16-bit data transmission process, LOAD must maintain a low level. When the 16-bit data is shifted in, LOAD must become high at or after the 16th CLK rising edge, but before the next CLK rising edge, to load the data into the corresponding internal register, otherwise the data will be lost. When multiple MAX7219s are cascaded, the DOUT pin of the previous chip must be connected to the DIN of the next chip, and the CLK and LOAD pins are shared.
The 16-bit data format is as follows:
The display circuit connections are as follows (only the main pins are drawn):
1.3 Partial program code
The displayed code is as follows:
2. BC7281 display mode application
2.1 BC7281 Introduction
BC7281 is a 16-bit LED digital tube display and keyboard interface chip. Each bit can be displayed independently with different decoding or without decoding. The flashing properties and display brightness can be controlled independently, and the flashing frequency can be changed at any time.
BC7281 has 16 display registers and 15 control registers, with the address range from 00H to 1FH. The display register has an address of 00H to 0FH, and the most commonly used control register is the working mode register, with an address of 12H. The meaning of each data bit is as follows:
MOD: Shift register mode control. When MOD=0, it is applicable to general shift registers, such as 74HC164, etc.; when MOD=1, it is applicable to shift registers with secondary latches, such as 74HC595, etc.
INV: Segment drive data output polarity control. When INV=0, the data of each display register is directly output through the shift register as segment drive data; when INV=1, the content of the display register is inverted before being output from the shift register.
KMS: Keyboard working mode selection.
BMS: Blink control mode selection. When BMS=0, a blink switch control register (10H) is used to control the blinking properties of each display bit, and the 8th to 15th display bits cannot be controlled individually; when BMS=1, it works in extended mode, and the blinking properties of bits 0-7 are controlled by 10H, and the blinking properties of bits 8-15 are controlled by the extended control register 19H.
ES: Energy saving mode. When this bit is 1, the effective drive current is reduced to half of the normal state (the display brightness is reduced accordingly).
KO: Display off mode. When this bit is 1, the display scan is off, but the keyboard remains operational. (The display register contents are not deleted and can be updated).
RP: Register protection mode. When RP=1, the internal registers of BC7281 cannot be directly rewritten.
SCN: Scan enable control. When SCN=0, scanning is disabled, including display scanning and keyboard scanning; when SCN=1, scanning is enabled.
2.2 System Hardware Connection
BC7281 uses a high-speed two-wire interface to communicate with the MCU when displaying, which only occupies a small amount of I/O port resources and host time. The two lines are the data line DAT and the synchronous clock line CLK. DAT: The data terminal for serial communication with the MCU, which is a bidirectional data transmission port. When used as an output, it is an open-drain output and requires an external pull-up resistor; CLK: The clock terminal for communication with the MCU, the falling edge is valid.
When the interface is idle, the DAT pin of BC7281 is in high-impedance input state, and the pull-up resistor makes the DAT line high. When starting to transmit data, the MCU must first establish a handshake signal with the BC7281. The MCU first sends several CLK clock pulses to the BC7281 and detects the DAT line at the same time. After receiving the handshake pulse, the BC7281 will output a low level on the DAT line, indicating that it is ready to receive MCU data. After the MCU detects the DAT low level, it continues to send a CLK pulse within the specified time, prompting the BC7281 to restore the DAT pin to the high-impedance input state, so that the DAT line returns to a high level. After detecting the high level, the MCU can start sending data. At each falling edge of CLK, the data is moved into the memory.
The serial interface data width is 8 bits, and a group of two bytes constitutes a complete instruction. The instruction format is as follows:
The display circuit connections are as follows (only the main pins are drawn):
2.3 Partial Program Code
The displayed code is as follows:
3. Comparison of two display modes
The system first adopted the MAX7219 display method.
MAX7219 is much simpler than BC7281 in hardware connection, but it occasionally has unstable phenomena in use, especially when multiple MAX7219s (>=3) are cascaded, and the system freezes. Later, the display mode of BC7281 was changed, and the overall stability of the system was greatly improved. In addition, the system initialization of BC7281 chip is simpler than MAX7219, and most of its registers can be set to default values, occupying less I/O resources, and the cost is relatively advantageous.
Previous article:LED unit board fault analysis and repair
Next article:Brief description of AC power LED lighting protection
Recommended ReadingLatest update time:2024-11-16 17:44
- Popular Resources
- Popular amplifiers
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- 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
- GD32E231 DIY Part 3: LED Smooth Dimming Principle
- Far away, yet close at hand
- The power cord is too long and the power-on voltage is too high. Should I use a TVS tube?
- What is the essence of GND in the circuit?
- EEWORLD University - i.MX Linux Development Practical Guide
- Encoder Problems
- Introduction to IC Packaging and Testing Process
- TI C6000 Optimization Advanced: Loops are the most important!
- A zero voltage platform appears on the secondary side of the forward converter, causing large oscillations. What might be the cause? How can I solve it?
- DIY a ESP32 game console based on MicroPython