Skip to content

drivers: dac: Add drivers for TI DAC family X311 on SPI bus #90811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Snap-A
Copy link

@Snap-A Snap-A commented May 29, 2025

Summary

This PR submits the device driver code for the Texas Instrument chip family DAC N311, with N indicating the resolution (see below).
These chips provide a single output channel and support "power mode" selection by reserving the two MSB values for this.
There is a single "register" that is updated with each 16-bit write to the chip via SPI.

Code Changes

The driver was code was modeled after DAC drivers for other chip families, where different resolutions are supported.

  • The new Kconfig.tx311 enables the driver when a matching entry is added to the device tree;
  • The new driver (dac_tx311.c) processes the device tree to set the correct resolution value;
    Chip Resolution
    5311 8 bits
    6311 10 bits
    7311 12 bits
    8311 14 bits
  • The related YAML files use a "base" file to share the configuration "schema".
  • The configuration adds the property power-down-mode to set the power mode bits.

Tests

Normal Mode

This driver was developed to control the TI 6311 DAC chip that is part of an external PCB. The SPI bus was connected to a Raspberry Pico W and a sample program was created to generate a "saw tooth" signal with a period of a few seconds and the power mode set to "normal".

A oscilloscope was connected to the Vout pin of the chip to confirm the full voltage range, 0 to 3.3 V, is produced.

DS1Z_DAC_Output

Resistor to GND Mode

The power mode was set to "power-down-100k" and the test program was recompiled. The DAC output shows no saw-tooth signal.

Add shared code in 'dac_tx311.c' and configuration files.
Support power mode bits via configuration.

Signed-off-by: Andreas Wolf <awolf002@gmail.com>
Copy link

@Snap-A Snap-A marked this pull request as ready for review May 29, 2025 17:16
@github-actions github-actions bot added area: DAC Digital-to-Analog Converter platform: TI SimpleLink Texas Instruments SimpleLink MCU labels May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: DAC Digital-to-Analog Converter platform: TI SimpleLink Texas Instruments SimpleLink MCU
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants