OneTechnologyWay•P. O . Box9106•Norwood,MA02062-9106,U.S.A.•Tel : 781.329.4700•Fax :781.461.3113•www.analog.com
ADP8860 Software User Guide
INTRODUCTION
This user guide describes the functionality of the Analog
Devices, Inc., ADP8860 and provides software development
guidelines. The ADP8860 communicates with an external
processor using an I
2
C interface and an interrupt line (nINT).
The processor sends initialization and activation commands
to the ADP8860, which acts as a slave device.
The interrupt line, from the ADP8860 to the processor, is used
to indicate a failure condition, such as a thermal shutdown or
an overvoltage and LED/output short circuit, or to indicate a
V
OUT
light level threshold has been crossed. All interrupt sources are
maskable. Refer to Figure 1 for a typical application diagram.
Figure 2 shows a schematic with keypad light control.
The interrupt line is active low; each interrupt source has an
individual masking bit. The processor can reset the ADP8860
anytime by pulling the nRST line low; this operation reinitializes the ADP8860 at the default state and places the device
in standby mode.
OPTIONAL
PHOTOSENSOR
ALS
PHOTOSENSOR
0.1µF
0.1µF
V
A2
A1
C1
B1
B2
C1+
C1–
C2+
C2–
1µF
OUT
C1
1µF
C2
1µF
08158-001
V
nRST
SDA
SCL
nINT
IN
1µF
VDDIO
VDDIO
VDDIO
VDDIO
D3D1E3D2E4D3D4D4C4D5B4
A3
E1
ADP8860
C2
E2
D2
A4
GND1
D6/
CMP_IN2
D1
GND2
D7C3CMP_IN
B3
Figure 1. Typical Application Schematic with Optional Second Photo Diode
Rev. 0 | Page 1 of 44
UG-005 Software User Guide
TABLE OF CONTENTS
ADP8860 Software User Guide ...................................................... 1
Listing for ADP8860_Regs.h .................................................... 31
Listing for ADP8860 Constants.h ............................................ 36
Listing for ADP8860 Reset.h .................................................... 38
Listing for ADP8860 MainProgram.c...................................... 39
Rev. 0 | Page 2 of 44
Software User Guide UG-005
KEYPAD LIGHT
UP TO 10 LEDs (6mA EACH)
60mA MAX TOTAL CURRENT
VDDIO
I
CONTRO L
SIGNALS
V
IN
R1 R2 R3 R4
nRST
2
C
nINT
1µF
DISPLAY BACKLI GHT
DL1
DL2
DL3
D3
E3
D1
VIN
A3
GND1
A4
D1
GND2
nRST
E1
SDA
C2
SCL
E2
nINT
D2
E4
D2
D3
Figure 2. Schematic with Keypad Light Control
DL4
D4
D4
ACCESSORY
LIGHTS OR
SUB-DISPLAY BL
DL5
DL6
C4
B4
D5
D6/
CMP_IN2
ADP8860
DL7R5DL8
R6
B3
D7C3CMP_IN
VOUT
C1+
C1–
C2+
C2–
DL17
R15
2.8V
PH2
OPTIONAL
PHOTOSENSOR
0.1µF
A2
A1
C1
B1
B2
1µF
C1
1µF
C2
1µF
PH1
MAIN
PHOTOSENSOR
0.1µF
08158-002
Rev. 0 | Page 3 of 44
UG-005 Software User Guide
I2C INTERFACE MODE
The ADP8860 includes an I2C-compatible serial interface for
controlling the LED current, as well as for readback of system
status registers. The I
2
C device address is 0x54 (0101 0100,
binary) for a write sequence and 0x55 (0101 0101, binary) for
a read sequence. Figure 3 shows the I
2
C write sequence while
Figure 4 shows a read operation.
B7B0B7B0B7B0
STACKREGISTER ADDRESSACKREGISTER VALUE
0101010
R/W
The ADP8860 sends data from the register denoted by the
register address. The lowest bit number (0) represents the least
significant bit, and the highest bit number (7) represents the
most significant bit. The register address content selects which
of the ADP8860 registers data is written to or read from.
ACK
ST
START
SLAVE TO MASTER
MASTER TO SLAVE
DEVICE ID
0x54 FOR WRI TE
OPERATIO N
SELECT ADP8860 REGISTER TO
WRITE I N THE 0x00 TO 0x24 AND
WRITE = 0
FROM ADP8860
0x2E RANGE
Figure 3. I
2
C Write Operation
8-BIT VALUE TO WRITE IN THE
ADDRESSED REGIST ER
FROM ADP8860
FROM ADP8860
STOP
08158-003
B7B0B7B0B7B0
ST
DEVICE ID
0x54 FOR WRI TE
START
OPERATION
SLAVE TO MASTER
MASTER TO SLAVE
R/W
ACKREGISTER ADDRESSACKACKREGISTER VALUEACK0101010
SELECT ADP8860 REGISTER TO
WRITE I N THE 0x00 TO 0x24 AND
WRITE = 0
FROM ADP8860
0x2E RANGE
Figure 4. I
B7B0
RS0101010
DEVICE ID
0x55 FOR READ
OPERATION
FROM ADP8860
REPEATED START
2
C Read Operation
R/W
8-BIT VALUE TO WRITE IN THE
READ = 1
ADDRESSED REGIST ER
FROM MASTER
ST
STOP
08158-004
Rev. 0 | Page 4 of 44
Software User Guide UG-005
INTERRUPTS
There are up to five interrupt sources available on the ADP8860
as follows:
• CMP_INT is from the main light sensor comparator.
• CMP2_INT is from sensor Comparator 2.
• OVP_INT is from the overvoltage protection comparator.
• TSD_INT is from the thermal shutdown circuit.
• SHORT_INT is from the short-circuit detection
comparator.
Each interrupt has individual masking/enable bits mapped in
Register INTR_EN. If the respective bit in the masking register
is 0, an interrupt is not generated to the external processor,
however the interrupt pending bit (on the MDCR2 register) can
be set in case the monitored condition occurs. This can be used
by the processor to periodically poll the interrupt pending
register (Register MDCR2) looking for an event to be true. If
the masking register bit is 1 an interrupt is generated (the nINT
line goes low) to the external processor in case an interrupt
pending bit is set.
CMP_INT is set every time the main light sensor comparator
detects a threshold transition (rising or falling condition). This
comparator has two programmable thresholds (L2 and L3)
defining the transition level from dark to office (L3) and from
office to outdoor (L2).
The CMP2_INT interrupt works the same way as CMP_INT
except that the sensing input comes from the second light
sensor. The programmable threshold is the same as the main
light sensor comparator.
The OVP_INT interrupt is generated when the charge pump
output voltage rises above a safety limit. In the event of an over-
voltage condition, the charge-pump is disabled until the output
voltage decreases to a recovery working level. An overvoltage
event can be generated when the load is removed from the
circuit and the input voltage, multiplied by the charge pump
gain (can be 1.5× or 2×), is above the OVP limit. In this condition, the interrupt to the external processor is generated
periodically. Therefore, the software should handle a case of
this sort by turning off the ADP8860 or disabling the OVP
interrupt mask.
The TSD_INT interrupt is generated when the die temperature in
the ADP8860 rises above a safety limit, typically 150°. When this
condition occurs, the charge pump and the LED drivers are turned
off waiting for the die to cool down. When the die temperature
decreases below ~130° the circuit is activated again automatically.
No interrupt is generated when the device turns on again, however
if the software clears the pending interrupt and the temperature
remains above 130° another interrupt is generated.
The SHORT_INT interrupt is generated if the output of the
charge-pump VOUT is shorted to ground or an LED connected
to the sink output is shorted. In a short-circuit event, the charge
pump and drivers are turned off immediately and the shortcircuit pending flag is set. The processor may then retry new
activations or issue a diagnostic message. Interrupts are cleared
by writing a 1 in the pending register bit. If Bit INT_CFG in
Register MDCR is set to 1, this forces the nINT line deassertion
(Logic High) for 50 μs after the processor clears the interrupt
pending, and the interrupt condition persists. If INT_CFG is 0,
the nINT line remains asserted (Logic Low) after the processor
clears the interrupt pending and the interrupt condition
persists.
MDCR (0x01)
BIT 6
INT_CFG
50µs
INT
INTERRUPT
DE-ASSERTI ON
INT_CLEAR
(ASSERTED WHEN WRITING
THE INTERRUPT PENDING
FLAGS I N MDCR2)
BIT 4BIT 3BIT 2BIT 1BIT 0
SHORT_IENCMP_IENCMP2_IENOVP_IENTSD_IEN
SHORT_INT TSD_INTOVP_INT CMP2_INT CMP_INT
BIT 4BIT 3BIT 2BIT 1BIT 0
Figure 5. Interrupt Logic
Rev. 0 | Page 5 of 44
INTR_EN (0x03) – INTERRUPT MASKS
MCDR2 (0x02) – INT ERRUPT PENDING
08158-005
UG-005 Software User Guide
DATA FLOW DIAGRAMS
Figure 6 and Figure 7 show the backlight data flow and the individual data flow, respectively.
NSTBY = 0
OR VIN < UVLO
TURN OFF
BACKLIGHT
AND ISINKS
STANDBY
BLEN = 0
OR TSD_INT = 1
OR SHORT_INT = 1
NSTBY = 1
NO COMMAND
BLEN AND
FOVR = 1
FADE IN
TO DIM
BLEN = 1
BL_FO TIMEOUT
WAITING
COMMAND
DIM_EN AND
BLEN = 1
BACKLIGHT
DIM STATE
(OFFT)
BACKLIGHT
FADE IN
TO MAX
BL_FI TIMEOUT
DIMT = DISABL ED
BACKLIGHT
ACTIVATIO N
TIME (DIMT)
DIM_EN = 1
AND DIMT TIM EOUT
BACKLIGHT
NOTES
1. DASHED LINE INDICATES AN INTERRUPT O R AN EVENT THAT CAN HAPPEN ANYTI ME DURING THE DEVICE O PERATION.
2. COMMANDS FRO M I
COMMANDS TO MAKE THE FLOW REPRES ENTATION CLEARER.
2
C ARE ALWAYS MO NITORED AND EXECUTED. T HE FLOW SHOWS A COMMON BUBBLE FOR
NSTBY = 0
DIM_EN = 0
AND DIMT = DISABL ED
OFFT TIMEOUT
AND DIM_EN = 0
DIM_EN = 1 OR
OFFT = DISABLED
BACKLIGHT
OFF
BL_FO TIMEOUT
BACKLIGHT
FADE OUT
Figure 6. Backlight Data Flow
TO OFF
08158-006
Rev. 0 | Page 6 of 44
Software User Guide UG-005
OR TIMEOUT
SCx OFF = 0
(ALWAYS ON)
ACTIVATIO N
INDIVIDUAL
xSINK
TIMEOUT
SCFI = 0
SCON
NSTBY = 0
OR VIN < UVLO
BACKLIGHT
AND ISINKS
xSINK
FADE-IN
FADE-OUT
TURN OFF
STANDBY
NSTBY = 1
NO COMMAND
WAITING
SCx_EN = 1
SCx OFF
TIMEOUT
SCx_EN = 0SCx_EN = 0
xSINK
COMMAND
TURN OFF
INDIVIDUAL
SCFO = 0
OR TIMEOUT
SINK
NSTBY = 0
SIS_EN = 1
AND ISCC = 0
ENABLED
SINKS
FADE-IN
OR TIMEOUT
xSINK
SCFO = 0
OR TIMEOUT
SCFI = 0
SCx_EN = 0
OR TSD_INT = 1
OR SHORT_INT = 1
OFF
ENABLED
SINKS
FADE-OUT
ACTIVATE
ENABLED
SIS_EN = 0
OR ISCC ≠ 0
SINKS
SIS_EN = 1
AND ISCC = 0
NOTES
1. DASHED LINE INDICATES AN INTERRUPT O R AN EVENT THAT CAN HAPPEN ANYTI ME DURING THE DEVICE OPERATION.
Figure 7. Individual Sinks Data Flow
Rev. 0 | Page 7 of 44
08158-007
UG-005 Software User Guide
SETTING THE LED CURRENT
The ADP8860 contains seven current sink outputs that can be
software configured to operate as part of the LED backlight or
as individual sinks, such as funlights or keypad lights. All
outputs can drive up to 30 mA with the exception of the seventh
sink (D1B/LED7) that can drive up to 60 mA, which is ideal for
keypad light applications where up to 10 LEDs can be driven in
parallel with shunt resistors (see Figure 2).
The application software must program which output to use as
part of the backlight and which to use for the individual sinks.
Register BLSEN is used for this purpose. If the selection bit
associated with the LED sink (Bit 0 controls LED1, Bit 1
controls LED2, and so on) is set to 0, it is part of the LED
backlight; otherwise, if set to 1, it is an independent sink. In
this case, Register ISCC controls the individual sink turn-on
and turn-off activations. For example, if BLSEN is programmed
with 0x70, LED1 to LED4 are used for the backlight while LED5
to LED7 are individual sinks. Bit 7 in BLSEN is not used.
In backlight operation, there are three distinct selectable brightness levels: dark, office, and daylight. Each brightness level has
two programmable settings:
•The MAX brightness defined in Register BLMX1 (day-
light), Register BLMX2 (office), and Register BLMX3
(dark) can range from 0 mA to 30 mA.
•The DIM brightness level defined in Register BLDM1 for
daylight, Register BLDM2 for office, and Register BLDM3
for dark can range from 0 mA to 30 mA.
The backlight LED current depends on the backlight transfer
law, linear or square, programmed in the CFGR register Bit 2
and Bit 1. Tabl e 2 shows all the current values available
according to the control law selected.
The transfer function for the linear law is
__
ISCALEFULL
⎞
⎟
⎠
RegValue
⎛
_
RegValueIBACKLIGHT (1)
= (2)
×=
⎜
⎝
IBACKLIGHT
127_ ×
ISCALEFULL
__
127
where:
BACKLIGHT_I is the desired LED current in mA.
RegValue is the digital 7-bit value programmed in the backlight
current registers.
FULL_SCALE_I is the maximum backlight current value, which
is 30 mA.
The transfer function for the square law is
2
⎞
__Re
ISCALEFULLgValue
(3)
⎟
⎟
⎠
RegValue
⎛
⎜
_
=
IBACKLIGHT
⎜
⎝
=
×
127
IBACKLIGHT
_127 ×
(4)
ISCALEFULL
__
Table 1. Backlight Transfer Laws—CFGR Register Bits[2:1]
Bits[2:1] Fading Law Fading Time Change
00 Linear Law DAC Linear time steps
01 Square Law DAC Linear time steps
10
11
Square Law DAC
(Cubic 1)
Square Law DAC
(Cubic 2)
Nonlinear time steps
(Type 1)
Nonlinear time steps
(Type 2)
The complete set of square law current values are given in
Tabl e 2.
If the automatic light sensing control is enabled (CMP_AUTOEN,
Bit 1, is set to 1 in Register MDCR) the result from the light
sensing comparator controls the backlight brightness in one of
the three levels (dark, office, and daylight).
In this mode, it is not possible to force, by software, a defined
level. Thus, settings on Bits[4:3] (BLV) in the CFGR register are
not considered in automatic light sensing mode. In case the
automatic light sensing mode is disabled (0 is written to
CMP_AUTOEN in the MDCR register), software can force the
backlight brightness in one of the three possible modes (dark,
office, or daylight) by writing Bits[4:3] (BLV) in Register CFGR
(see Tabl e 3).
Table 3. Brightness Level—Bits[4:3] (BLV) in CFGR Register
Each individual sink has a dedicated current register defining
its brightness level. As with the backlight, the current level
depends on the transfer law selected in the ISCFR register
Bits[1:0] (SC_LAW).
The ISC1 register defines the current level for LED1, the ISC2
register defines the level for LED2, and so on until ISC7, which
controls the current for LED7. The maximum current level
programmable is 30 mA. However, LED7 can be set up to
60 mA if Bit 7 in the ISC7 register is set to 1. The possible
current levels for 30 mA are listed in Tab le 2 .
Rev. 0 | Page 11 of 44
UG-005 Software User Guide
Table 4. Complete Set of Square Law Current Values for LED7
—60 mA Range
Square Cubic Law 1 and Square Cubic Law 2 use the same
square transfer law values with faster increment/decrement
times when fading in and out.
FADE OVERRIDE MODE
The fade override mode is enabled when Bit 0 (FOVR) in the
CFGR register is set to 1. In this mode, the backlight skips the
fade-in time when Bit BLEN in the MDCR register is set to 1
and it goes directly to the programmed maximum backlight
35
30
25
20
15
LED CURRENT (mA)
10
5
0
020406080100120
Figure 8. LED Current Transfer Law Curves
LINEAR LAW
SQUARE LAW
DIGITAL VALUE (DAC)
brightness intensity. There remains a 100 ms ramp-up time to
avoid rapid change in current. The fade-in time is not skipped
at the very first activation, after an off condition.
This mode is useful is situations where the backlight is fading
out and the user depresses a keypad button. The system
software can intercept this condition, set the FOVR bit, then
write the BLEN bit to 1 again. Fade-out time is not affected by
the FOVR bit.
08158-008
Rev. 0 | Page 14 of 44
Loading...
+ 30 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.