beautypg.com

3 – dac code examples, Dac code examples – Maxim Integrated DS4830 Optical Microcontroller User Manual

Page 45

background image

DS4830 User’s Guide

45

6.3

– DAC Code Examples


6.3.1

– DAC0 enabled with internal reference and output voltage is configured for 50% (1.25V) of internal

reference.


DACCFG = 0x0002; //Only DAC0 enabled and internal reference is selected
DACD0 = 0x0800; //DACD0 is set for 50%

6.3.2

– DAC2 enabled with external reference and output voltage is configured for 25% of external reference at

REFINA pin.


DACCFG = 0x0010; //Only DAC2 enabled and external reference is selected
DACD2 = 0x0400; //DACD2 is set for 25%

6.3.3

– DAC6 enabled with external reference and output voltage is configured for 25% of external reference at

REFINB pin.


DACCFG = 0x1000; //Only DAC6 enabled and external reference is selected
DACD6 = 0x0400; //DACD6 is set for 25%