SNOSCR5D March 2013 – December 2016 LP55231
PRODUCTION DATA.
The LP55231 is a fully integrated lighting management unit for producing lighting effects for mobile devices. The LP55231 includes all necessary power management, high-side current sources, temperature compensation, two-wire control interface and programmable pattern generators. The overall maximum current for each driver is set by an 8-bit register.
The LP55231 controls LED luminance with a pulse-width modulation (PWM) scheme with a resolution of 12 bits. Also, the temperature compensation is done by PWM.
The LP55231 provides flexibility and programmability for dimming and sequencing control. Each LED can be controlled directly and independently through the serial bus, or LED drivers can be grouped together for pre-programmed flashing patterns.
The LP55231 has three independent program execution engines, so it is possible to form three independently programmable LED banks. LED drivers can be grouped based on their function so that, for example, the first bank of drivers can be assigned to the keypad illumination, the second bank to the funlights, and the third group to the indicator LED(s).
Each bank can contain 1 to 9 LED driver outputs. Instructions for program execution engines are stored in the program memory. The total amount of the program memory is 96 instructions, and the user can allocate the memory as required by the engines.
The LP55231 has built-in LED error detection. Error detection does not only detect open and short circuit, but provides an opportunity to measure the VFs of the LEDs. The test event is activated by a serial interface write, and the result can be read through the serial interface during the next cycle. This feature can also be addressed to measure the voltage on the VDD, VOUT, and INT pins. Typical example usage includes monitoring battery voltage or using INT pin as a light sensor interface.
When charge-pump automatic mode selection is enabled, the LP55231 monitors the voltage over the drivers of D1 to D6 so that the device can select the best charge-pump gain and maintain good efficiency over the whole operating voltage range. The red LED element of an RGB LED typically has a forward voltage of about 2 V. For that reason, the outputs D7, D8, and D9 are internally powered by VDD, since battery voltage is high enough to drive red LEDs over the whole operating voltage range. This allows the driving of three RGB LEDs with good efficiency because the red LEDs do not load the charge pump. LP55231 is able to automatically enter power-save mode when LED outputs are not active, thus lowering idle current consumption down to 10 µA (typical). Also, during the downtime of the PWM cycle (constant current output status is low), additional power savings can be achieved when the PWM power-save feature is enabled.
The luminance of an LED is typically a function of its temperature even though the current flowing through the LED remains constant. Since luminance is temperature dependent, many LED applications require some form of temperature compensation to decrease luminance and color purity variations due to temperature changes. The LP55231 has a built-in temperature-sensing element, and PWM duty cycle of the LED drivers changes linearly in relationship to changes in temperature. User can select the slope of the graph (31 slopes) based on the LED characteristics (see Figure 13). This compensation can be done either constantly, or only right after the device wakes up from powersave mode, to avoid error due to self-heating of the device. Linear compensation is considered to be practical and accurate enough for most LED applications.
Compensation is effective over the temperature range −40°C to +90°C.
The LP55231 includes a pre-regulated switched-capacitor charge pump with a programmable voltage multiplication of 1 and 1.5×. In 1.5× mode, by combining the principles of a switched-capacitor charge pump and a linear regulator, a regulated 4.5 V output is generated from the Li-Ion input voltage range. A two-phase non-overlapping clock generated internally controls the operation of the charge pump. During the charge phase, both flying capacitors (C1 and C2) are charged from input voltage. In the pump phase that follows, the flying capacitors are discharged to output. A traditional switched-capacitor charge pump operating in this manner use switches with very low on-resistance, ideally 0 Ω, to generate an output voltage that is 1.5× the input voltage. The LP55231 regulates the output voltage by controlling the resistance of the input-connected pass-transistor switches in the charge pump.
At lower input voltages, the charge pump output voltage may degrade due to effective output resistance (ROUT) of the charge pump. The expected voltage drop can be calculated by using a simple model for the charge pump shown in Figure 14.
The model shows a linear pre-regulation block (REG), a voltage multiplier (1.5×), and an output resistance (ROUT). Output resistance models the output voltage drop that is inherent to switched capacitor converters. The output resistance is 3.5Ω (typ.), and it is a function of switching frequency, input voltage, flying capacitors’ capacitance value, internal resistances of the switches and ESR of the flying capacitors. When the output voltage is in regulation, the regulator in the model controls the voltage V’ to keep the output voltage equal to 4.5 V (typical).
With increased output current, the voltage drop across ROUT increases. To prevent drop in output voltage, the voltage drop across the regulator is reduced, V’ increases, and VOUT remains at 4.5 V. When the output current increases to the point that there is zero voltage drop across the regulator, V’ equals the input voltage, and the output voltage is on the edge of regulation. Additional output current causes the output voltage to fall out of regulation, so that the operation is similar to a basic open-loop 1.5× charge pump. In this mode, output current results in output voltage drop proportional to the output resistance of the charge pump. The out-of-regulation output voltage can be approximated by: VOUT = 1.5 × VIN – IOUT × ROUT.
The charge pump is controlled with two CP_MODE bits in MISC register (address 36H). When both of the bits are low, the charge pump is disabled, and output voltage is pulled down with an internal 300-kΩ (typical) resistor. The charge pump can be forced to bypass mode, so the battery voltage is connected directly to the current sources; in 1.5× mode output voltage is boosted to 4.5 V. In automatic mode, charge-pump operation mode is determined by saturation of constant current drivers, as described in LED Forward Voltage Monitoring.
When the charge-pump automatic mode selection is enabled, voltages over LED drivers D1 to D6 are monitored.
NOTE
Power input for current source outputs D7, D8, and D9 are internally connected to the VDD pin.
If the D1 to D6 drivers do not have enough headroom, charge-pump gain is set to 1.5×. Driver saturation monitor does not have a fixed voltage limit, since saturation voltage is a function of temperature and current. Charge pump gain is set to 1×, when battery voltage is high enough to supply all LEDs.
In automatic gain change mode, the charge pump is switched to bypass mode (1×), when LEDs are inactive for over 50 ms.
Charge pump gain control utilizes digital filtering to prevent supply voltage disturbances (for example, the transient voltage on the power supply during the GSM burst) from triggering unnecessary gain changes. Hysteresis is provided to prevent periodic gain changes (which could occur due to LED driver) and charge-pump voltage drop in 1× mode. The hysteresis of the gain change is user-configurable; default setting is factory-programmable. Flexible configuration ensures that hysteresis can be minimized or set to desired level in each application.
LED forward voltage monitoring and gain control block diagram is shown in Figure 15.
LP55231 LED drivers are constant current sources. Output current can be programmed by control registers up to 25.5 mA. The overall maximum current is set by 8-bit output current control registers with 100-μA step size. Each of the 9 LED drivers has a separate output current control register.
The LED luminance pattern (dimming) is controlled with PWM (pulse width modulation) technique, which has internal resolution of 12 bits (8-bit control can be seen by user). PWM frequency is 312 Hz. See Figure 16.
LED dimming is controlled according to a logarithmic or linear scale, see Figure 17. A logarithmic or linear scheme can be set for both the program execution engine control and direct PWM control. Note: if the temperature compensation is active, the maximum PWM duty cycle is limited to 50% at 25°C. This is required to allow enough headroom for temperature compensation over the whole temperature range −30°C to +90°C.
The LP55231 is very suitable for white LED and general purpose applications, and it is particularly well suited to use with RGB LEDs. The LP55231 architecture is optimized for use with three RGB LEDs. Typically, the red LEDs have forward voltages below 2 volts, thus red LEDs can be powered directly from VDD. In the LP55231 D7, D8, and D9 drivers are powered from the battery voltage (VDD), not from the charge-pump output. D1 to D6 drivers are internally connected to the charge-pump output, and these outputs can be used for driving green and blue (VF = 2.7 V to 3.7 V typical) or white LEDs. Of course, D7, D8, and D9 outputs can be used for green, blue or white LEDs if the VDD voltage is high enough.
An RGB LED configuration example is given in the Typical Applications.
Automatic power-save mode is enabled when POWERSAVE_EN bit in register address 36H is 1. Almost all analog blocks are powered down in power save if an external clock signal is used. Only the charge-pump protection circuits remain active. However, if the internal clock has been selected, only charge pump and LED drivers are disabled during the power save; the digital part of the LED controller needs to stay active. In both cases the charge pump enters the weak 1× mode. In this mode the charge pump utilizes a passive current limited keep-alive switch, which keeps the output voltage at the battery level. During the program execution LP55231 can enter power save if there is no PWM activity in any of the LED driver outputs. To prevent short power-save sequences during program execution, LP55231 has an instruction look-ahead filter. During program execution engine 1, engine 2, and engine 3 instructions are constantly analyzed, and if there are time intervals of more than 50 ms in length with no PWM activity on LED driver outputs, the device enters power save. In power-save mode program execution continues uninterrupted. When an instruction that requires PWM activity is executed, a fast internal start-up sequence is started automatically.
PWM cycle power-save mode is enabled when register 36 bit [2] PWM_PS_EN is set to 1. In PWM power-save mode analog blocks are powered down during the down time of the PWM cycle. Which blocks are powered down depends whether the external or internal clock is used. While the automatic power-save mode (see Automatic Power-Save Mode) saves energy when there is no PWM activity at all, the PWM power-save mode saves energy during PWM cycles. Like the automatic power-save mode, PWM power-save mode also works during program execution. Figure 18 shows the principle of the PWM power-save technique. An LED on D9 output is driven at 50% PWM, 5-mA current (top waveform). After PWM power-save enable, the LED-current remains the same, but the LP55231 input current drops down to about 50 µA when the LED is OFF, or to approximately 200 µA when the charge-pump-powered output(s) are used.
The I2C-compatible synchronous serial interface provides access to the programmable functions and registers on the device. This protocol uses a two-wire interface for bidirectional communications between the ICs connected to the bus. The two interface lines are the Serial Data Line (SDA) and the Serial Clock Line (SCL). Every device on the bus is assigned a unique address and acts as either a Master or a Slave depending on whether it generates or receives the serial clock SCL. The SCL and SDA lines should each have a pullup resistor placed somewhere on the line and remain HIGH even when the bus is idle. Note: CLK pin is not used for serial bus data transfer.
The data on SDA line must be stable during the HIGH period of the clock signal (SCL). In other words, state of the data line can only be changed when clock signal is LOW.
START and STOP conditions classify the beginning and the end of the data transfer session. A START condition is defined as the SDA signal transitioning from HIGH to LOW while SCL line is HIGH. A STOP condition is defined as the SDA transitioning from LOW to HIGH while SCL is HIGH. The bus master always generates START and STOP conditions. The bus is considered to be busy after a START condition and free after a STOP condition. During data transmission, the bus master can generate repeated START conditions. First START and repeated START conditions are equivalent, function-wise.
Every byte put on the SDA line must be eight bits long, with the most significant bit (MSB) being transferred first. Each byte of data has to be followed by an acknowledge bit. The acknowledge related clock pulse is generated by the master. The master releases the SDA line (HIGH) during the acknowledge clock pulse. The LP55231 pulls down the SDA line during the 9th clock pulse, signifying an acknowledge. The LP55231 generates an acknowledge after each byte has been received.
There is one exception to the acknowledge after every byte rule. When the master is the receiver, it must indicate to the transmitter an end of data by not acknowledging (negative acknowledge) the last byte clocked out of the slave. This negative acknowledge still includes the acknowledge clock pulse (generated by the master), but the SDA line is not pulled down.
After the START condition, the bus master sends a chip address. This address is seven bits long followed by an eighth bit which is a data direction bit (READ or WRITE). The LP55231 address is defined with ASEL0 and ASEL1 pins, and it is 32h when ASEL1 and ASEL0 are connected to GND. For the eighth bit, a 0 indicates a WRITE, and a 1 indicates a READ. The second byte selects the register to which the data is written. The third byte contains data to write to the selected register.
ASEL0 and ASEL1 pins configure the chip address for the LP55231 as shown in Table 1.
ASEL1 | ASEL0 | ADDRESS | 8-BIT HEX ADDRESS |
---|---|---|---|
(HEX) | WRITE/READ | ||
GND | GND | 32 | 64/65 |
GND | VEN | 33 | 66/67 |
VEN | GND | 34 | 68/69 |
VEN | VEN | 35 | 6A/6B |
The auto-increment feature allows writing several consecutive registers within one transmission. Every time an 8-bit word is sent to the LP55231, the internal address index counter is incremented by one, and the next register is written. Table 2 shows writing sequence to two consecutive registers. Auto-increment feature is enabled by writing EN_AUTO_INCR bit high in the MISC register (addr 36h). Note: serial bus address auto increment is not supported for register addresses from 16 to 1E.
MASTER | START | CHIP ADDR =32H | WRITE | REG ADDR | DATA | DATA | STOP | ||||
LP55231 | ACK | ACK | ACK | ACK |
The LP55231 is controlled by a set of registers through the two-wire serial interface port. Some register bits are reserved for future use. Table 3 below lists device registers, their addresses and their abbreviations. A more detailed description is given in Control Register Details.
HEX ADDRESS | REGISTER NAME | BIT(s) | READ/ WRITE |
DEFAULT VALUE AFTER RESET | BIT MNEMONIC AND DESCRIPTION |
---|---|---|---|---|---|
00 | ENABLE / ENGINE CNTRL1 | [6] | R/W | x0xxxxxx | CHIP_EN 0 = LP55231 not enabled 1 = LP55231 enabled |
[5:4] | R/W | xx00xxxx | ENGINE1_EXEC Engine 1 program execution control |
||
[3:2] | R/W | xxxx00xx | ENGINE2_EXEC Engine 2 program execution control |
||
[1:0] | R/W | xxxxxx00 | ENGINE3_EXEC Engine 3 program execution control |
||
01 | ENGINE CNTRL2 | [5:4] | R/W | xx00xxxx | ENGINE1_MODE ENGINE 1 mode control |
[3:2] | R/W | xxxx00xx | ENGINE2_MODE ENGINE 2 mode control |
||
[1:0] | R/W | xxxxxx00 | ENGINE3_MODE ENGINE 3 mode control |
||
02 | OUTPUT DIRECT/RATIOMETRIC MSB | [0] | R/W | xxxxxxx0 | D9_RATIO_EN Enables ratiometric dimming for D9 output. |
03 | OUTPUT DIRECT/RATIOMETRIC LSB | [7] | R/W | 0xxxxxxx | D8_RATIO_EN Enables ratiometric dimming for D8 output. |
[6] | R/W | x0xxxxxx | D7_RATIO_EN Enables ratiometric dimming for D7 output. |
||
[5] | R/W | xx0xxxxx | D6_RATIO_EN Enables ratiometric dimming for D6 output. |
||
[4] | R/W | xxx0xxxx | D5_RATIO_EN Enables ratiometric dimming for D5 output. |
||
[3] | R/W | xxxx0xxx | D4_RATIO_EN Enables ratiometric dimming for D4 output. |
||
[2] | R/W | xxxxx0xx | D3_RATIO_EN Enables ratiometric dimming for D3 output. |
||
[1] | R/W | xxxxxx0x | D2_RATIO_EN Enables ratiometric dimming for D2 output. |
||
[0] | R/W | xxxxxxx0 | D1_RATIO_EN Enables ratiometric dimming for D1 output. |
||
04 | OUTPUT ON/OFF CONTROL MSB | [0] | R/W | xxxxxxx1 | D9_ON ON/OFF Control for D9 output |
05 | OUTPUT ON/OFF CONTROL LSB | [7] | R/W | 1xxxxxxx | D8_ON ON/OFF Control for D8 output |
[6] | R/W | x1xxxxxx | D7_ON ON/OFF Control for D7 output |
||
[5] | R/W | xx1xxxxx | D6_ON ON/OFF Control for D6 output |
||
[4] | R/W | xxx1xxxx | D5_ON ON/OFF Control for D5 output |
||
[3] | R/W | xxxx1xxx | D4_ON ON/OFF Control for D4 output |
||
[2] | R/W | xxxxx1xx | D3_ON ON/OFF Control for D3 output |
||
[1] | R/W | xxxxxx1x | D2_ON ON/OFF Control for D2 output |
||
[0] | R/W | xxxxxxx1 | D1_ON ON/OFF Control for D1 output |
||
06 | D1 CONTROL | [7:6] | R/W | 00xxxxxx | MAPPING Mapping for D1 output |
[5] | R/W | xx0xxxxx | LOG_EN Logarithmic dimming control for D1 |
||
[4:0] | R/W | xxx00000 | TEMP COMP Temperature compensation control for D1 output |
||
07 | D2 CONTROL | [7:6] | R/W | 00xxxxxx | MAPPING Mapping for D2 output |
[5] | R/W | xx0xxxxx | LOG_EN Logarithmic dimming control for D2 output |
||
[4:0] | R/W | xxx00000 | TEMP COMP Temperature compensation control for D2 output |
||
08 | D3 CONTROL | [7:6] | R/W | 00xxxxxx | MAPPING Mapping for D3 output |
[5] | R/W | xx0xxxxx | LOG_EN Logarithmic dimming control for D3 output |
||
[4:0] | R/W | xxx00000 | TEMP COMP Temperature compensation control for D3 output |
||
09 | D4 CONTROL | [7:6] | R/W | 00xxxxxx | MAPPING Mapping for D4 output |
[5] | R/W | xx0xxxxx | LOG_EN Logarithmic dimming control for D4 output |
||
[4:0] | R/W | xxx00000 | TEMP COMP Temperature compensation control for D4 output |
||
0A | D5 CONTROL | [7:6] | R/W | 00xxxxxx | MAPPING Mapping for D5 ouput |
[5] | R/W | xx0xxxxx | LOG_EN Logarithmic dimming control for D5 output |
||
[4:0] | R/W | xxx00000 | TEMP COMP Temperature compensation control for D5 |
||
0B | D6 CONTROL | [7:6] | R/W | 00xxxxxx | MAPPING Mapping for D6 output |
[5] | R/W | xx0xxxxx | LOG_EN Logarithmic dimming control for D6 output |
||
[4:0] | R/W | xxx00000 | TEMP COMP Temperature compensation control for D6 output |
||
0C | D7 CONTROL | [7:6] | R/W | 00xxxxxx | MAPPING Mapping for D7 output |
[5] | R/W | xx0xxxxx | LOG_EN Logarithmic dimming control for D7 output |
||
[4:0] | R/W | xxx00000 | TEMP COMP Temperature compensation control for D7 output |
||
0D | D8 CONTROL | [7:6] | R/W | 00xxxxxx | MAPPING Mapping for D8 output |
[5] | R/W | xx0xxxxx | LOG_EN Logarithmic dimming control for D8 output |
||
[4:0] | R/W | xxx00000 | TEMP COMP Temperature compensation control for D8 output |
||
0E | D9 CONTROL | [7:6] | R/W | 00xxxxxx | MAPPING Mapping for D9 output |
[5] | R/W | xx0xxxxx | LOG_EN Logarithmic dimming control for D9 output |
||
[4:0] | R/W | xxx00000 | TEMP COMP Temperature compensation control for D9 output |
||
0F TO 15 | RESERVED | [7:0] | RESERVED FOR FUTURE USE | ||
16 | D1 PWM | [7:0] | R/W | 00000000 | PWM PWM duty cycle control for D1 |
17 | D2 PWM | [7:0] | R/W | 00000000 | PWM PWM duty cycle control for D2 |
18 | D3 PWM | [7:0] | R/W | 00000000 | PWM PWM duty cycle control for D3 |
19 | D4 PWM | [7:0] | R/W | 00000000 | PWM PWM duty cycle control for D4 |
1A | D5 PWM | [7:0] | R/W | 00000000 | PWM PWM duty cycle control for D5 |
1B | D6 PWM | [7:0] | R/W | 00000000 | PWM PWM duty cycle control for D6 |
1C | D7 PWM | [7:0] | R/W | 00000000 | PWM PWM duty cycle control for D7 |
1D | D8 PWM | [7:0] | R/W | 00000000 | PWM PWM duty cycle control for D8 |
1E | D9 PWM | [7:0] | R/W | 00000000 | PWM PWM duty cycle control for D9 |
1F TO 25 | RESERVED | [7:0] | RESERVED FOR FUTURE USE | ||
26 | D1 CURRENT CONTROL | [7:0] | R/W | 10101111 | CURRENT D1 output current control register. Default 17.5 mA (typ.) |
27 | D2 CURRENT CONTROL | [7:0] | R/W | 10101111 | CURRENT D2 output current control register. Default 17.5 mA (typ.) |
28 | D3 CURRENT CONTROL | [7:0] | R/W | 10101111 | CURRENT D3 output current control register. Default 17.5 mA (typ.) |
29 | D4 CURRENT CONTROL | [7:0] | R/W | 10101111 | CURRENT D4 output current control register. Default current is 17.5 mA (typ.) |
2A | D5 CURRENT CONTROL | [7:0] | R/W | 10101111 | CURRENT D5 output current control register. Default current is 17.5 mA (typ.) |
2B | D6 CURRENT CONTROL | [7:0] | R/W | 10101111 | CURRENT D6 output current control register. Default current is 17.5 mA (typ.) |
2C | D7 CURRENT CONTROL | [7:0] | R/W | 10101111 | CURRENT D7 output current control register. Default current is 17.5 mA (typ.) |
2D | D8 CURRENT CONTROL | [7:0] | R/W | 10101111 | CURRENT D8 output current control register. Default current is 17.5 mA (typ.) |
2E | D9 CURRENT CONTROL | [7:0] | R/W | 10101111 | CURRENT D9 output current control register. Default current is 17.5 mA (typ.) |
2F TO 35 | RESERVED FOR FUTURE USE | [7:0] | RESERVED FOR FUTURE USE | ||
36 | MISC | [7] | R/W | 0xxxxxxx | VARIABLE_D_SEL Variable D source selection |
[6] | R/W | x1xxxxxx | EN_AUTO_INCR Serial bus address auto increment enable |
||
[5] | R/W | xx0xxxxx | POWERSAVE_EN Powersave mode enable |
||
[4:3] | R/W | xxx00xxx | CP_MODE Charge pump gain selection |
||
[2] | R/W | xxxxx0xx | PWM_PS_EN PWM cycle powersave enable |
||
[1] | R/W | xxxxxx0x | CLK_DET_EN External clock detection |
||
[0] | R/W | xxxxxxx0 | INT_CLK_EN Clock source selection |
||
37 | ENGINE1 PC | [6:0] | R/W | x0000000 | PC Program counter for engine 1 |
38 | ENGINE2 PC | [6:0] | R/W | x0000000 | PC Program counter for engine 2 |
39 | ENGINE3 PC | [6:0] | R/W | x0000000 | PC Program counter for engine 3 |
3A | STATUS/INTERRUPT | [7] | R | 0xxxxxxx | LEDTEST_MEAS_DONE Indicates when the LED test measurement is done. |
[6] | R | x1xxxxxx | MASK_BUSY Mask bit for interrupts generated by START-UP_BUSY or ENGINE_BUSY. |
||
[5] | R | xx0xxxxx | START-UP_BUSY This bit indicates that the start-up sequence is running. |
||
[4] | R | xxx0xxxx | ENGINE_BUSY This bit indicates that a program execution engine is clearing internal registers. |
||
[3] | R | xxxx0xxx | EXT_CLK_USED Indicates when external clock signal is in use. |
||
[2] | R | xxxxx0xx | ENG1_INT Interrupt bit for program execution engine 1 |
||
[1] | R | xxxxxx0x | ENG2_INT Interrupt bit for program execution engine 2 |
||
[0] | R | xxxxxxx0 | ENG3_INT Interrupt bit for program execution engine 3 |
||
3B | INT/GPO | [2] | R/W | xxxxx0xx | INT_CONF INT pin can be configured to function as a GPO with this bit |
[0] | R/W | xxxxxxx0 | INT_GPO GPO pin control for INT pin when INT_CONF is set 1 |
||
3C | VARIABLE | [7:0] | R/W | 00000000 | VARIABLE Global 8-bit variable |
3D | RESET | [7:0] | R/W | 00000000 | RESET Writing 11111111 into this register resets the LP55231 |
3E | TEMP ADC CONTROL | [7] | R | 0xxxxxxx | TEMP_MEAS_BUSY Indicates when temperature measurement is active |
[2] | R/W | xxxxx0xx | EN_TEMP_SENSOR Reads the internal temperature sensor once |
||
[1] | R/W | xxxxxx0x | CONTINUOUS_CONV Continuous temperature measurement selection |
||
[0] | R/W | xxxxxxx0 | SEL_EXT_TEMP Internal/external temperature sensor selection |
||
3F | TEMPERATURE READ | [7:0] | R | 00011001 | TEMPERATURE Bits for temperature information |
40 | TEMPERATURE WRITE | [7:0] | R/W | 00000000 | TEMPERATURE Bits for temperature information |
41 | LED TEST CONTROL | [7] | R/W | 0xxxxxxx | EN_LED_TEST_ADC |
[6] | R/W | x0xxxxxx | EN_LED_TEST_INT | ||
[5] | R/W | xx0xxxxx | CONTINUOUS_CONV Continuous LED test measurement selection |
||
[4:0] | R/W | xxx00000 | LED_TEST_CTRL Control bits for LED test |
||
42 | LED TEST ADC | [7:0] | R | N/A | LED_TEST_ADC LED test result |
43 | RESERVED | [7:0] | RESERVED FOR FUTURE USE | ||
44 | RESERVED | [7:0] | RESERVED FOR FUTURE USE | ||
45 | ENGINE1 VARIABLE A | [7:0] | R | 00000000 | VARIABLE FOR ENGINE1 |
46 | ENGINE2 VARIABLE A | [7:0] | R | 00000000 | VARIABLE FOR ENGINE2 |
47 | ENGINE3 VARIABLE A | [7:0] | R | 00000000 | VARIABLE FOR ENGINE3 |
48 | MASTER FADER1 | [7:0] | R/W | 00000000 | MASTER FADER |
49 | MASTER FADER2 | [7:0] | R/W | 00000000 | MASTER FADER |
4A | MASTER FADER3 | [7:0] | R/W | 00000000 | MASTER FADER |
4B | RESERVED FOR FUTURE USE | RESERVED FOR FUTURE USE | |||
4C | ENG1 PROG START ADDR | [6:0] | R/W | x0000000 | ADDR |
4D | ENG2 PROG START ADDR | [6:0] | R/W | x0001000 | ADDR |
4E | ENG3 PROG START ADDR | [6:0] | R/W | x0010000 | ADDR |
4F | PROG MEM PAGE SEL | [2:0] | R/W | xxxxx000 | PAGE_SEL |
50 | PROGRAM MEMORY 00H/10H/20H/30H/40H/50H | [15:8] | R/W | 00000000 | CMD Every Instruction is 16-bit width. The LP55231 can store 96 instructions. Each instruction consists of 16 bits. Because one register has only 8 bits, one instruction requires two register addresses. In order to reduce program load time the LP55231 supports address auto-incrementation. Register address is incremented after each 8 data bits. Thus the whole program memory page can be written in one serial bus write sequence. |
51 | [7:0] | R/W | 00000000 | ||
52 | PROGRAM MEMORY 01H/11H/21H/31H/41H/51H | [15:8] | R/W | 00000000 | |
53 | [7:0] | R/W | 00000000 | ||
54 | PROGRAM MEMORY 02H/12H/22H/32H/42H/52H | [15:8] | R/W | 00000000 | |
55 | [7:0] | R/W | 00000000 | ||
56 | PROGRAM MEMORY 03H/13H/23H/33H/43H/53H | [15:8] | R/W | 00000000 | |
57 | [7:0] | R/W | 00000000 | ||
58 | PROGRAM MEMORY 04H/14H/24H/34H/44H/54H | [15:8] | R/W | 00000000 | |
59 | [7:0] | R/W | 00000000 | ||
5A | PROGRAM MEMORY 05H/15H/25H/35H/45H/55H | [15:8] | R/W | 00000000 | |
5B | [7:0] | R/W | 00000000 | ||
5C | PROGRAM MEMORY 06H/16H/26H/36H/46H/56H | [15:8] | R/W | 00000000 | |
5D | [7:0] | R/W | 00000000 | ||
5E | PROGRAM MEMORY 07H/17H/27H/37H/47H/57H | [15:8] | R/W | 00000000 | |
5F | [7:0] | R/W | 00000000 | ||
60 | PROGRAM MEMORY 08H/18H/28H/38H/48H/58H | [15:8] | R/W | 00000000 | |
61 | [7:0] | R/W | 00000000 | ||
62 | PROGRAM MEMORY 09H/19H/29H/39H/49H/59H | [15:8] | R/W | 00000000 | |
63 | [7:0] | R/W | 00000000 | ||
64 | PROGRAM MEMORY 0AH/1AH/2AH/3AH/4AH/5AH | [15:8] | R/W | 00000000 | |
65 | [7:0] | R/W | 00000000 | ||
66 | PROGRAM MEMORY 0BH/1BH/2BH/3BH/4BH/5BH | [15:8] | R/W | 00000000 | |
67 | [7:0] | R/W | 00000000 | ||
68 | PROGRAM MEMORY 0CH/1CH/2CH/3CH/4CH/5CH | [15:8] | R/W | 00000000 | |
69 | [7:0] | R/W | 00000000 | ||
6A | PROGRAM MEMORY 0DH/1DH/2DH/36D/46D/5DH | [15:8] | R/W | 00000000 | |
6B | [7:0] | R/W | 00000000 | ||
6C | PROGRAM MEMORY 0EH/1EH/2EH/3EH/4EH/5EH | [15:8] | R/W | 00000000 | |
6D | [7:0] | R/W | 00000000 | ||
6E | PROGRAM MEMORY 0FH/1FH/2FH/3FH/4FH/5FH | [15:8] | R/W | 00000000 | |
6F | [7:0] | R/W | 00000000 | ||
70 | ENG1 MAPPING MSB | [0] | R | xxxxxxx0 | D9 Engine 1 mapping information, D9 output |
71 | ENG1 MAPPING LSB | [7] | R | 0xxxxxxx | D8 Engine 1 mapping information, D8 output |
[6] | R | x0xxxxxx | D7 Engine 1 mapping information, D7 output |
||
[5] | R | xx0xxxxx | D6 Engine 1 mapping information, D6 output |
||
[4] | R | xxx0xxxx | D5 Engine 1 mapping information, D5 output |
||
[3] | R | xxxx0xxx | D4 Engine 1 mapping information, D4 output |
||
[2] | R | xxxxx0xx | D3 Engine 1 mapping information, D3 output |
||
[1] | R | xxxxxx0x | D2 Engine 1 mapping information, D2 output |
||
[0] | R | xxxxxxx0 | D1 Engine 1 mapping information, D1 output |
||
72 | ENG2 MAPPING MSB | [0] | R | xxxxxxx0 | D9 Engine 2 mapping information, D9 output |
73 | ENG2 MAPPING LSB | [7] | R | 0xxxxxxx | D8 Engine 2 mapping information, D8 output |
[6] | R | x0xxxxxx | D7 Engine 2 mapping information, D7 output |
||
[5] | R | xx0xxxxx | D6 Engine 2 mapping information, D6 output |
||
[4] | R | xxx0xxxx | D5 Engine 2 mapping information, D5 output |
||
[3] | R | xxxx0xxx | D4 Engine 2 mapping information, D4 output |
||
[2] | R | xxxxx0xx | D3 Engine 2 mapping information, D3 output |
||
[1] | R | xxxxxx0x | D2 Engine 2 mapping information, D2 output |
||
[0] | R | xxxxxxx0 | D1 Engine 2 mapping information, D1 output |
||
74 | ENG3 MAPPING MSB | [0] | R | xxxxxxx0 | D9 Engine 3 mapping information, D9 output |
75 | ENG3 MAPPING LSB | [7] | R | 0xxxxxxx | D8 Engine 3 mapping information, D8 output |
[6] | R | x0xxxxxx | D7 Engine 3 mapping information, D7 output |
||
[5] | R | xx0xxxxx | D6 Engine 3 mapping information, D6 output |
||
[4] | R | xxx0xxxx | D5 Engine 3 mapping information, D5 output |
||
[3] | R | xxxx0xxx | D4 Engine 3 mapping information, D4 output |
||
[2] | R | xxxxx0xx | D3 Engine 3 mapping information, D3 output |
||
[1] | R | xxxxxx0x | D2 Engine 3 mapping information, D2 output |
||
[0] | R | xxxxxxx0 | D1 Engine 3 mapping information, D1 output |
||
76 | GAIN CHANGE CTRL | [7:6] | R/W | 00xxxxxx | THRESHOLD Threshold voltage (typ.). 00 – 400mV 01 – 300mV 10 – 200mV 11 – 100mV |
[5] | R/W | xx0xxxxx | ADAPTIVE_THRESH_EN Activates adaptive threshold. |
||
[4:3] | R/W | xxx00xxx | TIMER 00 – 5ms 01 – 10 ms 10 – 50 ms 11 – Infinite |
||
[2] | R/W | xxxxx0xx | FORCE_1x Activates 1.5x to 1x timer. |
00 ENABLE/ ENGINE CONTROL1
01 ENGINE CONTROL2
02 OUTPUT DIRECT/RATIOMETRIC MSB
03 OUTPUT DIRECT/RATIOMETRIC LSB
04 OUTPUT ON/OFF CONTROL MSB
05 OUTPUT ON/OFF CONTROL MSB
06 D1 CONTROL
TEMP_COMP BITS | CORRECTION FACTOR (%) |
---|---|
00000 | Not activated - default setting after reset. |
11111 | −1.5 1/°C |
11110 | −1.4 1/°C |
... | ... |
10001 | −0.1 1/°C |
10000 | 0 1/°C |
00001 | 0.1 1/°C |
... | ... |
01110 | 1.4 1/°C |
01111 | 1.5 1/°C |
The PWM duty cycle at temperature T (in centigrade) can be obtained as follows: PWMF = [PWMS – (25 – T) × correction factor × PWMS] / 2, where PWMF is the final duty cycle at temperature T, PWMS is the set PWM duty cycle (PWM duty cycle is set in registers 16H to 1EH) and the value of the correction factor is obtained from the table above.
For example, if the set PWM duty cycle in register 16H is 90%, temperature T is −10°C and the chosen correction factor is 1.5% 1/°C, the final duty-cycle PWMF for D1 output is [90% – (25°C − (−10°C) ) × 1.5% 1/°C × 90%]/2 = [90% – 35 × 0.015 × 90%]/2 = 21.4%. Default setting 00000 means that the temperature compensation is non-active and the PWM output (0 to 100%) is set solely by PWM registers D1 PWM to D9 PWM.
07 D2 CONTROL to 0E D9 CONTROL
16 D1 PWM
17 D2 PWM to 1E D9 PWM
26 D1 CURRENT CONTROL
CURRENT BITS | OUTPUT CURRENT (mA, typical) |
---|---|
00000000 | 0.0 |
00000001 | 0.1 |
00000010 | 0.2 |
... | ... |
10101111 | 17.5 (default setting) |
.... | .... |
11111110 | 25.4 |
11111111 | 25.5 |
27 D2 CURRENT CONTROL to 2E D9 CURRENT CONTROL
36 MISC
37 ENGINE1 PC
38 ENGINE2 PC
39 ENGINE3 PC
3A STATUS/INTERRUPT
3B INT/GPO
3C VARIABLE
3D RESET
3E TEMP ADC CONTROL
3E — Bit [0] SEL_EXT_TEMP
3F TEMPERATURE READ
TEMPERATURE READ BITS | TEMPERATURE INTERPRETATION (°C, typ.) |
---|---|
11010111 | −41 |
11011000 | −40 |
... | ... |
11111110 | −2 |
11111111 | −1 |
00000000 | 0 |
00000001 | 1 |
00000010 | 2 |
... | ... |
01011000 | 88 |
01011001 | 89 |
40 TEMPERATURE WRITE
41 LED TEST CONTROL
LED_TEST_CTRL BITS | MEASUREMENT |
---|---|
00000 | D1 |
00001 | D2 |
00010 | D3 |
00011 | D4 |
00100 | D5 |
00101 | D6 |
00110 | D7 |
00111 | D8 |
01000 | D9 |
01001 to 01110 | Reserved |
01111 | VOUT |
10000 | VDD |
10001 | INT-pin voltage |
10010 to 11111 | N/A |
42 LED TEST ADC
45 ENGINE1 VARIABLE A
46 ENGINE2 VARIABLE A
47 ENGINE3 VARIABLE A
48 MASTER FADER1
49 MASTER FADER2
4A MASTER FADER3
4C ENG1 PROG START ADDR
4D ENG2 PROG START ADDR
4E ENG3 PROG START ADDR
4F PROG MEM PAGE SELECT
70H ENG1 MAPPING MSB
71H ENG1 MAPPING LSB
72H ENG2 MAPPING MSB
73H ENG2 MAPPING LSB
74H ENG3 MAPPING MSB
75H ENG3 MAPPING LSB
76H GAIN_CHANGE_CTRL
The LP55231 has three independent programmable execution engines. All the program execution engines have their own program memory block allocated by the user. Note that in order to access program memory the operation mode needs to be load program, at least for one of the three program execution engines. Program execution is clocked with a 32.7-kHz clock. This clock can be generated internally or an external 32-kHz clock can be connected to CLK pin. Using an external clock enables synchronization of LED timing to the external clock signal.
Supported instruction set is listed in Table 4, Table 5, Table 6, and Table 7 below:
Inst. | Bit [15] | Bit [14] | Bit [13] | Bit [12] | Bit [11] | Bit [10] | Bit [9] | Bit [8] | Bit [7] | Bit [6] | Bit [5] | Bit [4] | Bit [3] | Bit [2] | Bit [1] | Bit [0] |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ramp(1) | 0 | pre- scale | step time | sign | # of increments | |||||||||||
ramp(2) | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | pre- scale | sign | step time | # of increments | ||
set_pwm(1) | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | PWM value | |||||||
set_pwm(2) | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | PWM value | |
wait | 0 | pre- scale | time | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Inst. | Bit [15] | Bit [14] | Bit [13] | Bit [12] | Bit [11] | Bit [10] | Bit [9] | Bit [8] | Bit [7] | Bit [6] | Bit [5] | Bit [4] | Bit [3] | Bit [2] | Bit [1] | Bit [0] |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mux_ld_start | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | SRAM address 0-95 | ||||||
mux_map_start | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | SRAM address 0-95 | ||||||
mux_ld_end | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | SRAM address 0 - 95 | ||||||
mux_sel | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | LED select | ||||||
mux_clr | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
mux_map_next | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
mux_map_prev | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
mux_ld_next | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
mux_ld_prev | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 |
mux_ld_addr | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | SRAM address 0-95 | ||||||
mux_map_addr | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | SRAM address 0-95 |
Inst. | Bit [15] | Bit [14] | Bit [13] | Bit [12] | Bit [11] | Bit [10] | Bit [9] | Bit [8] | Bit [7] | Bit [6] | Bit [5] | Bit [4] | Bit [3] | Bit [2] | Bit [1] | Bit [0] |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rst | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
branch(2) | 1 | 0 | 1 | loop count | step number | |||||||||||
branch(3) | 1 | 0 | 0 | 0 | 0 | 1 | 1 | step number | loop count | |||||||
int | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
end | 1 | 1 | 0 | int | reset | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
trigger | 1 | 1 | 1 | wait for trigger | send a trigger | 0 | ||||||||||
ext. trig | X(1) | X(1) | E3 | E2 | E1 | ext. trig | X(1) | X(1) | E3 | E2 | E1 | |||||
jne | 1 | 0 | 0 | 0 | 1 | 0 | 0 | Number of instructions to be skipped if the operation returns true | variable 1 |
variable 2 |
||||||
jl | 1 | 0 | 0 | 0 | 1 | 0 | 1 | Number of instructions to be skipped if the operation returns true | variable 1 |
variable 2 |
||||||
jge | 1 | 0 | 0 | 0 | 1 | 1 | 0 | Number of instructions to be skipped if the operation returns true | variable 1 |
variable 2 |
||||||
je | 1 | 0 | 0 | 0 | 1 | 1 | 1 | Number of instructions to be skipped if the operation returns true | variable 1 |
variable 2 |
Inst. | Bit [15] | Bit [14] | Bit [13] | Bit [12] | Bit [11] | Bit [10] | Bit [9] | Bit [8] | Bit [7] | Bit [6] | Bit [5] | Bit [4] | Bit [3] | Bit [2] | Bit [1] | Bit [0] |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ld | 1 | 0 | 0 | 1 | target variable | 0 | 0 | 8-bit value | ||||||||
add(1) | 1 | 0 | 0 | 1 | target variable | 0 | 1 | 8-bit value | ||||||||
add(2) | 1 | 0 | 0 | 1 | target variable | 1 | 1 | 0 | 0 | 0 | 0 | variable 1 |
variable 2 |
|||
sub(1) | 1 | 0 | 0 | 1 | target variable | 1 | 0 | 8-bit value | ||||||||
sub(2) | 1 | 0 | 0 | 1 | target variable | 1 | 1 | 0 | 0 | 0 | 1 | variable 1 |
variable 2 |
This is the instruction useful for smoothly changing from one PWM value into another PWM value on the D1 to D9 outputs; in other words, generating ramps (with a negative or positive slope). The LP55231 allows programming very fast and very slow ramps.
Ramp instruction generates a PWM ramp, using the effective PWM value as a starting value. At each ramp step the output is incremented/decremented by one unit, unless the number of increments is 0. Time span for one ramp step is defined with prescale bit [14] and step time bits [13:9]. Prescale = 0 sets 0.49 ms cycle time and prescale = 1 sets 15.6 ms cycle time; so the minimum time span for one step is 0.49 ms (prescale × step time span = 0.49 ms × 1) and the maximum time span is 15.6 ms × 31 = 484 ms/step.
Number of increments value defines how many steps are taken during one ramp instruction; increment maximum value is 255d, which corresponds increment from zero value to the maximum value. If PWM reaches minimum/maximum value (0/255) during the ramp instruction, ramp instruction is executed to the end regardless of saturation. This enables ramp instruction to be used as a combined ramp and wait instruction. Note: Ramp instruction is wait instruction when the increment bits [7:0] are set to zero.
Programming ramps with variables is very similar to programming ramps with numerical operands. The only difference is that step time and number of increments are captured from variable registers, when the instruction execution is started. If the variables are updated after starting the instruction execution, it has no effect on instruction execution. Again, at each ramp step the output is incremented/decremented by one unless increment is 0. Time span for one step is defined with prescale and step time bits. Step time is defined with variable A, B, C or D. Variables A, B and C are set with ld-instruction. Variable D is a global variable and can be set by writing the VARIABLE register (address 3C). LED TEST ADC register (address 42) can be used as a source for the variable D, as well. Note: Variable A is the only local variable which can be read throughout the serial bus. Of course, the variable stored in 3CH can be read (and written), too.
Setting register 06H, 07H, or 08H bit LOG_EN high/low sets logarithmic (1) or linear ramp (0). By using the logarithmic ramp setting the visual effect appears like a linear ramp, because the human eye behaves in a logarithmic way.
NAME | VALUE (d) | DESCRIPTION |
---|---|---|
prescale | 0 | Divides master clock (32.7 kHz) by 16 = 2048 Hz -> 0.488 ms cycle time |
1 | Divides master clock (32.7 kHz) by 512 = 64 Hz -> 15.625 ms cycle time | |
sign | 0 | Increase PWM output |
1 | Decrease PWM output | |
step time(1) | 1 - 31 | One ramp increment done in (step time) x (prescale). |
# of increments(1) | 0 - 255 | The number of increment/decrement cycles. Note: Value 0 takes the same time as increment by 1, but it is the wait instruction. |
step time(2) | 0 - 3 | One ramp increment done in (step time) x (prescale). |
Step time is loaded with the value (5 LSB bits) of the variable defined below. | ||
0 = local variable A | ||
1 = local variable B | ||
2 = global variable C | ||
3 = register address 3CH variable D value, or register address 42H value. | ||
The value of the variable should be from 00001b to 11111b (1d to 31d) for correct operation. | ||
# of increments(2) | 0 - 3 | The number of increment/decrement cycles. Value is taken from variable defined below: |
0 = local variable A | ||
1 = local variable B | ||
2 = global variable C | ||
3 = register address 3CH variable D value, or register address 42H value. |
Suppose that the LED dimming is controlled according to the linear scale and effective PWM value at the moment t = 0 is 140d (approximately 55%), as shown in the figure below, and we want to reach a PWM value of 148d (approximately 58%) at the moment t = 1.5 s. The parameters for the RAMP instruction are:
This instruction is used for setting the PWM value on the outputs D1 to D9 without any ramps. Set PWM output value from 0 to 255 with PWM value bits [7:0]. Instruction execution takes sixteen 32-kHz clock cycles (=488 µs).
NAME | VALUE (d) | DESCRIPTION |
---|---|---|
PWM value (i)(1) | 0 - 255 | PWM output duty cycle 0 - 100% |
variable (ii)(1) | 0 - 3 | 0 = local variable A |
1 = local variable B | ||
2 = global variable C | ||
3 = register address 3CH variable D value, or register address 42H value. |
When a wait instruction is executed, the engine is set in wait status, and the PWM values on the outputs are frozen.
NAME | VALUE (d) | DESCRIPTION |
---|---|---|
prescale | 0 | Divide master clock (32.7 kHz) by 16 which means 0.488 ms cycle time. |
1 | Divide master clock (32 768 Hz) by 512 which means 15.625 ms cycle time. | |
time | 1 - 31 | Total wait time is = (time) × (prescale). Maximum 484 ms, minimum 0.488 ms. |
These instructions define the engine-to-LED mapping. The mapping information is stored in a table, which is stored in the SRAM (program memory of the LP55231). LP55231 has three program execution engines which can be mapped to 9 LED drivers. One engine can control one or multiple LED drivers. There are totally eleven instructions for the engine-to-LED-driver control: mux_ld_start, mux_map_start, mux_ld_end, mux_sel, mux_clr, mux_map_next, mux_map_prev, mux_ld_next, mux_ld_prev, mux_ld_addr and mux_map_addr.
Mux_ld_start and mux_ld_end define the mapping table location in the memory.
NAME | VALUE (d) | DESCRIPTION |
---|---|---|
SRAM address | 0-95 | Mapping table start/end address |
Mux_map_start defines the mapping table start address in the memory, and the first row of the table is activated (mapped) at the same time.
NAME | VALUE (d) | DESCRIPTION |
---|---|---|
SRAM address | 0-95 | Mapping table start address |
With mux_sel instruction one, and only one, LED driver can be connected to a program execution engine. Connecting multiple LEDs to one engine is done with the mapping table. After the mapping has been released from an LED, PWM register value still controls the LED brightness.
NAME | VALUE (d) | DESCRIPTION |
---|---|---|
LED select | 0-16 | 0 = no drivers selected |
1 = LED1 selected | ||
2 = LED2 selected | ||
... | ||
9 = LED9 selected |
Mux_clr clears engine-to-driver mapping. After the mapping has been released from an LED, the PWM register value still controls the LED brightness.
This instruction sets the next row active in the mapping table each time it is called. For example, if the 2nd row is active at this moment, after mux_map_next instruction call the 3rd row is active. If the mapping table end address is reached, activation rolls to the mapping table start address next time when the mux_map_next instruction is called. The engine does not push a new PWM value to the LED driver output before set_pwm or ramp instruction is executed. If the mapping has been released from an LED, the value in the PWM register still controls the LED brightness.
Similar than the mux_map_next instruction, but only the index pointer is set to point to the next row; that is, no mapping is set, and the engine-to-LED-driver connection is not e updated.
This instruction sets the previous row active in the mapping table each time it is called. For example, if the 3rd row is active at this moment, after mux_map_prev instruction call the 2nd row is active. If the mapping table start address is reached, activation rolls to the mapping table end address next time the mux_map_prev instruction is called. Engine does not push a new PWM value to the LED driver output before set_pwm or ramp instruction is executed. If the mapping has been released from an LED, the value in the PWM register still controls the LED brightness.
Similar than the mux_map_prev instruction, but only the index pointer is set to point to the previous row; that is, no mapping is set, and the engine-to-LED-driver connection is not updated.
Mux_map_addr sets the index pointer to point the mapping table row defined by bits [6:0] and sets the row active. The engine does not push a new PWM value to the LED driver output before set_pwm or ramp instruction is executed. If the mapping has been released from an LED, the value in the PWM register still controls the LED brightness.
NAME | VALUE (d) | DESCRIPTION |
---|---|---|
SRAM address | 0-95 | Any SRAM address containing mapping data. |
Mux_ld_addr sets the index pointer to point the mapping table row defined by bits [6:0], but the row is not set active.
NAME | VALUE (d) | DESCRIPTION |
---|---|---|
SRAM address | 0-95 | Any SRAM address containing mapping data. |
Branch instruction is mainly indented for repeating a portion of the program code several times. Branch instruction loads step number value to program counter. Loop count parameter defines how many times the instructions inside the loop are repeated. The LP55231 supports nested looping, that is, loop inside loop. The number of nested loops is not limited. Instruction takes sixteen 32-kHz clock cycles.
NAME | ACCEPTED VALUE (d) | DESCRIPTION |
---|---|---|
loop count (i) | 0-63 | The number of loops to be done. 0 means an infinite loop. |
step number | 0-95 | The step number to be loaded to program counter. |
loop count (ii) | 0-3 | Selects the variable for loop count value. Loop count is loaded with the value of the variable defined below. |
0 = local variable A | ||
1 = local variable B | ||
2 = global variable C | ||
3 = register address 3CH variable D value, or register address 42H value |
Send interrupt to processor by pulling the INT pin down and setting corresponding status bit high. Interrupt can be cleared by reading interrupt bits in STATUS/INTERRUPT register at address 3A.
NAME | VALUE | DESCRIPTION |
---|---|---|
int | 0 | No interrupt is sent. PWM register valuesremain intact. |
1 | Reset program counter value to 0 and send interrupt to processor by pulling the INT pin down and setting corresponding status bit high to notify that program has ended. PWM register values remain intact. Interrupt can be cleared by reading interrupt bits in STATUS/INTERRUPT register at address 3A. | |
reset | 0 | Reset program counter value to 0 and hold. PWM register values remain intact. |
1 | Reset program counter value to 0 and hold. PWM register values of the non-mapped drivers remain. PWM register values of the mapped drivers are set to 0000 0000. On completion of int instruction with this bit set to 1 the master fader registers are set to zero as follows: Program execution engine 1 sets MASTER FADER 1 (48H) to zero, engine 2 sets MASTER FADER 2 (49H) to zero and engine 3 sets MASTER FADER 3 (4AH) to zero. |
Rst instruction resets Program Counter register (address 37H, 38H, or 39H) and continues executing the program from the program start address defined in 4C-4E. Instruction takes sixteen 32-kHz clock cycles. Note that default value for all program memory registers is 0000H, which is the rst instruction.
End program execution. Instruction takes sixteen 32-kHz clock cycles.
Wait or send triggers can be used to, for example, synchronize operation between the program execution engines. Send trigger instruction takes sixteen 32-kHz clock cycles and wait for trigger takes at least sixteen 32-kHz clock cycles. The receiving engine stores the triggers which have been sent. Received triggers are cleared by wait for trigger instruction. Wait for trigger instruction is executed until all the defined triggers have been received. (Note: several triggers can be defined in the same instruction.)
External trigger input signal must stay low for at least two 32-kHz clock cycles to be executed. Trigger output signal is three 32-kHz clock cycles long. External trigger signal is active low, for example, when trigger is sent/received the pin is pulled to GND. Send external trigger is masked; that is, the device which has sent the trigger does not recognize it. If send and wait external trigger are used on the same instruction, the send external trigger is executed first, then the wait external trigger.
NAME | VALUE (d) | DESCRIPTION |
---|---|---|
wait for trigger | 0 - 31 | Wait for trigger from the engine(s). Several triggers can be defined in the same instruction. Bit [7] engages engine 1, bit [8] engine 2, bit [9] engine 3 and bit [12] is for external trigger I/O. Bits [10] and [11] are not in use. |
send a trigger | 0 - 31 | Send a trigger to the engine(s). Several triggers can be defined in the same instruction. Bit [1] engages engine 1, bit [2] engine 2, bit [3] engine 3 and bit [6] is for external trigger I/O. Bits [4] and [5] are not in use. |
The LP55231 instruction set includes the following conditional jump instructions: jne (jump if not equal); jge (jump if greater or equal); jl (jump if less); je (jump if equal). If the condition is true, a certain number of instructions are skipped (that is, the program jumps forward to a location relative to the present location). If condition is false, the next instruction is executed.
NAME | VALUE (d) | DESCRIPTION |
---|---|---|
number of instructions to be skipped if the operation returns true. | 0 - 31 | The number of instructions to be skipped when the statement is true. Note: value 0 means redundant code. |
variable 1 | 0 - 3 | Defines the variable to be used in the test: |
0 = local variable A | ||
1 = local variable B | ||
2 = global variable C | ||
3 = register address 3CH variable, or register address 42H value. | ||
variable 2 | 0 - 3 | Defines the variable to be used in the test: |
0 = local variable A | ||
1 = local variable B | ||
2 = global variable C | ||
3 = register address 3CH variable, or register address 42H value. |
This instruction is used to assign a value into a variable; the previous value in that variable is overwritten. Each of the engines have two local variables, called A and B. The variable C is a global variable.
NAME | VALUE (d) | DESCRIPTION |
---|---|---|
target variable | 0 - 2 | 0 = variable A |
1 = variable B | ||
2 = variable C | ||
8-bit value | 0 - 255 | Variable value |
Operator either adds 8-bit value to the current value of the target variable, or adds the value of the variable 1 (A, B, C or D) to the value of the variable 2 (A, B, C or D) and stores the result in the register of variable A, B or C. Variables overflow from 255 to 0.
NAME | VALUE (d) | DESCRIPTION |
---|---|---|
8-bit value (i) | 0 - 255 | The value to be added. |
target variable | 0 - 2 | 0 = variable A |
1 = variable B | ||
2 = variable C | ||
variable 1 (ii) | 0 - 3 | 0 = local variable A |
1 = local variable B | ||
2 = global variable C | ||
3 = register address 3CH variable, or register address 42H value. | ||
variable 2 (ii) | 0 - 3 | 0 = local variable A |
1 = local variable B | ||
2 = global variable C | ||
3 = register address 3CH variable, or register address 42H value. |
SUB Operator either subtracts 8-bit value from the current value of the target variable, or subtracts the value of the variable 2 (A, B, C or D) from the value of the variable 1 (A, B, C or D) and stores the result in the register of target variable (A, B or C). Variables overflow from 0 to 255.
NAME | VALUE (d) | DESCRIPTION |
---|---|---|
8-bit value (i) | 0 - 255 | The value to be added. |
target variable | 0 - 2 | 0 = variable A |
1 = variable B | ||
2 = variable C | ||
variable 1 (ii) | 0 - 3 | 0 = local variable A |
1 = local variable B | ||
2 = global variable C | ||
3 = register address 3CH variable, or register address 42H value. | ||
variable 2 (ii) | 0 - 3 | 0 = local variable A |
1 = local variable B | ||
2 = global variable C | ||
3 = register address 3CH variable, or register address 42H value. |