Skip to content

synchronous update via LDAC pin does not work #17

@rosch99

Description

@rosch99

Problem:
Attempting to latch the outputs VA-VD via LDAC does not work.
Outputs are updated immediately, regardless of the state of the LDAC pins.
More info and tests were reported at:
https://forums.adafruit.com/viewtopic.php?t=198312
https://forums.adafruit.com/viewtopic.php?t=199196

Analysis and findings:
The UDAC-bit is hard coded to "0" at every I2C write command.
adafruit_mcp4728.py line 224:
write_command_byte = 0b01000000 # 0 1 0 0 0 DAC1 DAC0 UDAC

suggested solution:
a) hard code UDAC-bit to "1"
adafruit_mcp4728.py line 224:
write_command_byte = 0b01000001 # 0 1 0 0 1 DAC1 DAC0 UDAC
and use LDAC-Pin to control the output ports
LDAC = True # output ports are locked (no updates)
LDAC = False # output ports are updated immediately
advantage: fast and easy to implement
disadvantage: hardcoded solution, ports cannot be controlled individually.

or

b) implement a function to control UDAC bit(s)
advantage: each port can be controlled individually
disadvantage: only one port can be selected at a time, but not all together!

suggested Enhancements (nice to have):
a) implement "Fast Write command" to write DAC Input Registers Sequentially from Channel A to D
b) implement "Multi-Write command" to write Multiple DAC Input Registers
c) implement faster clock speeds (400kHz, 1MHz, 3.4MHz), maybe as in busio.I2C

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions