12.07.2015 Views

PCA9532 16-bit I C LED dimmer - E-LAB Computers

PCA9532 16-bit I C LED dimmer - E-LAB Computers

PCA9532 16-bit I C LED dimmer - E-LAB Computers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Philips Semiconductors<strong>16</strong>-<strong>bit</strong> I 2 C <strong>LED</strong> <strong>dimmer</strong>Product data<strong>PCA9532</strong>Programming exampleThe following example will show how to set <strong>LED</strong>0 to <strong>LED</strong>3 on. It willthen set <strong>LED</strong>4 and <strong>LED</strong>5 to blink at 1 Hz at a 50% duty cycle. <strong>LED</strong>6and <strong>LED</strong>7 will be set to be dimmed at 25% of their brightness (dutycycle = 25%). <strong>LED</strong>8 to <strong>LED</strong>15 will be set to off.Table 1.Start<strong>PCA9532</strong> address with A0-A2 = LOWPSC0 subaddress + auto-incrementSet prescaler PSC0 to achieve a period of 1 second:Blink period 1 PSC0 1152PSC0 = 151Set PWM0 duty cycle to 50%:PWM0256 0.5PWM0 = 128Set prescaler PCS1 to dim at maximum frequencyI 2 C-busSC0h12h97h80h00hBlink period maximumPSC1 = 0Set PWM1 output duty cycle to 25%:PWM1256 0.25PWM1 = 64Set <strong>LED</strong>0 to <strong>LED</strong>3 onSet <strong>LED</strong>4 and 5 to PWM0, and <strong>LED</strong>6 or 7 to PWM1Set <strong>LED</strong>8 to <strong>LED</strong>11 offSet <strong>LED</strong>12 to <strong>LED</strong>15 offStop40h55hFAh00h00hP2003 May 02 11

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!