We can use ordinary I/O to realize the simplest LED driver . However, I/O control can only realize the ON and OFF of LED, and cannot be used for light mixing, flashing and other functions. Moreover, each LED needs to occupy a separate I/O resource, which is undoubtedly very cost-effective. We can also use a dedicated high-current LED controller to design, but the high cost will first become a problem, and the design is complicated, and the degree will increase accordingly with the emergence of various interferences. Based on this, NXP has launched a series of LED drivers using the I2C interface . It can control the ON/OFF, flashing and RGB mixing of 4 to 24 LEDs at the same time through the two lines of the I2C interface. In the light mixing solution, each LED is driven by an independent 8bit/256-step PWM. At present, the current range of each LED that can be driven by the chip itself is between 25mA and 100mA. Of course, for some high-current applications, we only need to use an external field effect tube to achieve it.
This I2C-based LED control method increases the convenience and flexibility of design, and also reduces the investment in software and hardware, making the mysterious LED suddenly simple and wonderful to us. Below, we will take the NXP LED driver PCA9633 as an example to fully explain the advantages of this LED driver through several simple applications.
The PCA9633 is a quad-channel LED driver capable of driving a maximum current of 25mA per channel and provides a selectable fixed I2C address and a 4-bit or 7-bit hardware programmable hardware address, depending on the package (Figure 1).
From Figure 1, we can see that each LED is controlled by a separate 8-bit/256-step PWM, and because PWM is fast enough, it can theoretically mix any color of light through the four LEDs it drives. In addition to each separate PWM, PCA9633 also provides a Group PWM, through which we can control the brightness and frequency of the mixed color light, making up for some functions that cannot be achieved by adjusting a single PWM. So how does PCA9633 achieve dimming? The secret lies in PWM. If PWM is not used, it can only complete the on and off actions; low-speed PWM can only achieve LED flashing, which is not enough to achieve the purpose of color mixing; high-speed PWM can achieve RGB color mixing; if the PWM speed is controllable, then the dual functions of flashing and color mixing can be achieved. Moreover, through the controllable 8-bit/256-step PWM, the color level is increased and the sense of color hierarchy is improved (see Figure 2).
Now that we know the principle of color mixing, how is a specific color produced? We know that the human eye's perception of color is the superposition of the average brightness of various colors. We can control the brightness of the driven LED by controlling the duty cycle of each PWM of PCA9633. According to the principle of three primary colors, if we drive RGB (or RGBA) LEDs, we can get the desired color by adjusting the different brightness of these three LEDs. Figure 3 is an example of PCA9633 controlling three RGB LEDs to adjust pink light.
[page]
Through the above description, we basically know the internal structure and driving principle of PCA9633. Next, we will use several applications of PCA9633 fixed I2C address to further understand the advantages of this LED controller.
In the first application, we will use PCA9633 to control the brightness bar. As we know, applications like brightness bar usually require a large number of LEDs connected in series. If a single interface is used to control each LED, the cost and software complexity will be greatly increased. However, through I2C, only two control lines are needed in hardware, and only one byte command is needed in software to easily control it. In addition, due to the uniqueness of the I2C device address, several PCA9633s can be used for control according to the number of driven LEDs. If the actual application does not have enough driving current of PCA9633 itself, it can be easily solved by adding a FET on the periphery. In addition, the unique Group PWM of PCA9633 makes it easy to control the light intensity and flicker of the entire brightness bar. The following is its schematic diagram (see Figure 4), in which the I2C master is provided by the system, which can be an MCU or a logic circuit .
The left half of Figure 4 is the I2C master, which will not be described in detail. The top right is the LED current limiting resistor . Usually the forward voltage of the LED is about 3V, which may vary depending on the color and manufacturing process. We can calculate the value of this current limiting resistor by the required LED current: R=(Vsupply-Vfsum)/If. If the required LED current is greater than 25mA, the FET added in the figure can easily solve this problem. After we add the FET, we only need to set the OUTDRV of the corresponding register of PCA9633 to high to distinguish it from its default value. Now we can see that the schematic diagram is quite simple to control so many LEDs with PCA9633, and it is also convenient to set the registers in the software. PCA9633 provides simple and complete internal registers, such as LED output structure setting, power saving mode setting, chip enable mode setting, LED output state setting, and control register setting for each PWM and Group PWM. In addition, PCA9633 also provides a register setting increment bit, that is, if we set this bit, we can complete the sequential configuration of all internal registers through a command sequence, which is very useful in some specific applications and can save software and system resources to the greatest extent. Below, we will use another example to illustrate the setting of internal registers.
The second example is that we use PCA9633 to complete the function of breathing light. Although PCA9633 does not have a breathing light module inside, we can achieve this function through some simple register settings, which undoubtedly has a great advantage in cost compared to dedicated breathing light chips. For the sake of convenience, we only use PCA9633 to control the breathing action of an LED. The schematic diagram is very simple and is omitted here. The purpose of breathing is achieved by controlling the gradual brightening and dimming process of this LED. To achieve this function, the independent PWM of PCA9633 will be the most important factor. As we have mentioned before, each LED is controlled by an 8bit/256-step PWM, which means that each light has 256 adjustable brightness levels, which can perfectly realize the breathing function. Specifically, we complete it by controlling the duty cycle of PWM. If our LED is controlled by PWM0 of PCA9633, then the duty cycle of PWM0 will determine the brightness of this LED: Bright (duty cycle) = PWM0[7:0]/256. With this principle in mind, we can write something to the register of PCA9633 via I2C:
START
0xC4 (write operation to PCA9633 I2C device address C4)
00h=0x00; 01h=0x00 (set the LED output structure to open drain)
08h=0x02 (Set LED to be controlled by PWM0)
Delay 1 second (Delay 1 second for breathing)
02h= bright ; For bright=0; bright<255; bright++ (LED gradually brightens from 0 to 255)
Delay 10 ms (delay 10 ms to continue after fading in)
02h=bright; For bright=255; bright>0; bright- - (LED dims from 255 to 0)
STOP
At this point, a complete breathing process is completed. With a few simple register settings, it seems that only complex systems or dedicated chips can do this. From the above two examples, we can see that using NXP's I2C LED driver is very simple and easy to operate in terms of hardware and software, and the functions that can be achieved with such devices are in no way inferior to some systems and proprietary chips.
In summary, NXP I2C LED drivers provide a cost-effective LED design solution. Compared with GPIO or dedicated LED drivers, it not only saves system resources, but also greatly reduces the cost and complexity of the design, and can effectively improve the reliability of the design and the uniformity of the driving light. In addition, the use of such LED drivers can effectively help us reduce the design cycle and improve design flexibility. NXP can currently provide customers with I2C LED drivers ranging from 4 to 24 channels, and have been applied to various fields such as automobiles, home appliances, and communications.
Previous article:OLED display technology and features: Does the power supply affect the display quality?
Next article:Analysis and implementation of TV video hardware decoding based on BT.656
Recommended ReadingLatest update time:2024-11-16 17:58
- Popular Resources
- Popular amplifiers
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- Modern Compiler Principles C Language Description (Ampel)
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Enjoy big-screen gaming anytime, anywhere: Making portable 4K UHD 240Hz gaming projector a reality
- AMD surpasses Intel: CPU shipments surge in Q3 this year
- Exynos is losing ground, Samsung plans to use Qualcomm chips in home appliances
- Intel and 50 partners unveiled a full range of 30 notebook and desktop AI PCs equipped with Intel Core Ultra (2nd Generation)
- Innovation leads the new trend of mobile refrigeration GMCC will present new products at 2024 CIAAR
- Lenovo and NVIDIA expand collaboration to jointly launch new liquid-cooled AI servers
- Ceiling fan solution based on XMC1302
- Gartner: Global AI PC shipments are expected to account for 43% of total PC shipments in 2025
- 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
- FPGA Implementation of Light Band Centerline Extraction in 3D Scanning Images
- RT-Thread system solves the problem that low-priority tasks cannot be suspended with high-priority tasks
- Automatically load Cadence Toolbox functional components
- Let's read together! ——Power supply design book recommendations
- What is the problem with the progress bar when AD is doing PCB routing? (The problem has been solved, welcome to continue discussing)
- EEWORLD University Hall----Live Replay: Introduction to Jacinto?7 Industrial Application Processor
- [Repost] How to quickly distinguish common SMT patch components
- MOS tube power supply problem
- Use of TI DSP Integrated Development Environment CCS
- Learn MSP430F5529 programming routine 1