English
Language : 

AN10397 Datasheet, PDF (4/10 Pages) NXP Semiconductors – How to use the SC18IM700 to control any I2C-bus device
Philips Semiconductors
AN10397
How to use the SC18IM700 to control any I2C-bus device
2.1 Programming example
The following example will show how to set LED0 to LED3 on. It will then set LED4 and
LED5 to blink at 1 Hz at a 50 % duty cycle. LED6 and LED7 will be set to be dimmed at
25 % of their maximum brightness (duty cycle = 25 %).
Table 1: PCA9531 programming example
Programming step
START
PCA9531 address with A0, A1, A2 = LOW
PSC0 subaddress + auto-increment
Set prescaler PSC0 to achieve a period of 1 second:
blink period = 1 = P----S---C----0-----+-----1-
152
PSC0 = 151
Set PWM0 duty cycle to 50 %:
P----W-----M------0- = 0.5
256
PWM0 = 128
Set prescaler PCS1 to dim at maximum frequency:
blink period = max
PSC1 = 0
Set PWM1 output duty cycle to 25 %:
P----W-----M------1- = 0.25
256
PWM1 = 64
Set LED0 to LED3 on
Set LED4, LED5 to PWM0, and LED6, LED7 to PWM1
STOP
I2C-bus data[1]
S
C0h
11h
97h
80h
00h
40h
55h
FAh
P
[1] This column shows the steps needed to be performed by the host to set the LED to blink at a specified rate.
AN10397_1
Application note
Rev. 01 — 5 December 2005
© Koninklijke Philips Electronics N.V. 2005. All rights reserved.
4 of 10