Skip to content

Arduino library for the following Texas Instrument's 12 bit DAC ICs: DAC121C081 and DAC121C085

License

Notifications You must be signed in to change notification settings

Wh1teRabbitHU/DAC121C08x-Driver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DAC121C08x

Description

Arduino library for the following Texas Instrument's 12 bit DAC ICs: DAC121C081 and DAC121C085. This IC only has one register, which stores both the output level data and the power down mode (PDM). Because of that no need to address the register when the library writes into it. The official datasheet with more detailed informations can be found here

Functions

The following functions are available in this library:

DAC121_initRegister

Full signature: void DAC121_initRegister(uint8_t i2cAddr, uint8_t mode, uint16_t data);

With this method you can set both the PDM and the output data configurations in one step. When you set any of the power down modes, the IC will enter the given mode. For power down mode there are handy macros to set your value.

The output data is a 12 bit number which determines the output voltage level based on the reference voltage. The output is mostly proportional to the number, the only exceptions are the first and the last value, which has a higher level gap then the others. For more details, see the official documentation.

DAC121_setPowerDownMode

Full signature: void DAC121_setPowerDownMode(uint8_t i2cAddr, uint8_t mode);

With this method you can set the power down mode which will automatically change the state of the IC. When you set any of the power down modes, the IC will enter the given mode. For power down mode there are handy macros to set your value.

DAC121_getPowerDownMode

Full signature: uint8_t DAC121_getPowerDownMode(uint8_t i2cAddr);

Using this method you can read the currently active operation mode from the register. It will return with a 2 bit number, which reflects the values of the macros.

DAC121_setData

Full signature: void DAC121_setData(uint8_t i2cAddr, uint16_t data);

This method will update the output voltage level generated by the IC. The output data is a 12 bit number which determines the output voltage level based on the reference voltage. The output is mostly proportional to the number, the only exceptions are the first and the last value, which has a higher level gap then the others. For more details, see the official documentation.

DAC121_getData

Full signature: uint16_t DAC121_getData(uint8_t i2cAddr);

This method returns the currently active output level as a 12bit integer value. The actual output voltage depends on the reference voltage given to the IC. (Or the power supply voltage for the DAC121C081 variant, because in that chip both lines are tied together internaly)

Macros

  • PDM_NORMAL: Normal operation
  • PDM_2_5K_GND: Terminated by a 2.5K to GND
  • PDM_100K_GND: Terminated by a 100K to GND
  • PDM_HIGH_IMP: High impediance mode

About

Arduino library for the following Texas Instrument's 12 bit DAC ICs: DAC121C081 and DAC121C085

Resources

License

Stars

Watchers

Forks

Packages