The IS31FL3197 4-channel LED driver is very functionality controller of RGBW LEDs. Its detail description see in the datasheet of it. But it’s futile idea to seek for initialization procedure example there.
In order to initialize the IS31FL3197 LED driver you need to do next sequence of steps described following.
IS31FL3197 provides a power-on reset feature. When power on the device is in shutdown mode (by default SSD=”0″ in Shutdown Control Register). Therefore, the first step is turning the device from shutdown mode to normal operation. In order to do it you have to write the 0xF1 value to Shutdown Control Register (register address 0x01, see datasheet).
The next step is setting operating mode of the device. To select the operating mode you have to write the control byte value to Operation Configure Register (register address 0x02, see datasheet). By default (after power-on reset), PWM&Current Level Mode is selected for all of outputs. Therefore, if this is the mode you want, you can skip this step and left the default value of Operation Configure Register.
In PWM&Current Level Mode the average current of each output (and brightness of corresponding component of RGBW LED) is determined by values, stored in three registers:
The value stored in Current Band Register determines the common scale of the each output average current by setting the maximum output peak current of each LED output:
If you want to set the current band different of by default the next step is writing new value to Current Band Register.
In PWM & Current Level Mode, the values stored in Current Level Register and PWM Register will decide the output current together.
The value stored in Current Level Register determines the output current as a fraction of the maximum output peak current had set up the value in Current Band Register. Setting the output current by writing the value to Current Level Register must be done in two steps:
By default, after power-on reset or Reset command Current Level Register has 0x00 value, therefore modifying of it is necessary. Note that the need to activate the new value of Current Level Register by writing 0xC5 value to Color Update Register is not specified in the description of Current Level Register of IS31FL3197 datasheet (but is specified in the description of Color Setting Register of Pattern, which has the same address).
The two-byte value stored in PWM Register determines the output PWM duty cycle and, as result, the average current of each output. Setting the output PWM duty cycle by writing the value to PWM Register must be done in two steps:
By default, after power-on reset or Reset command PWM Register has 0x0000 value, therefore modifying of it is necessary.
The hardware implementation example is depicted on top of this page. The small board with the IS31FL3197 LED driver and four of LEDs connected to each output of it was made. The IS31FL3197 LED driver was controlled by the STM32-series microcontroller. The red LED was connected to output 1 of the IS31FL3197 LED driver, its brightness changes according to the average current as a function of the duty cycle of the PWM. The GIF-picture is taken from a short video shot on a smartphone.
Copyright © Sergii Zadorozhnyi, 2023
Please give us your valuable comment
You must be logged in to post a comment.