我正在尝试使用 Raspberry Pi 控制 DAC7562EVM。我已连接:
信号 - PI - TI - 信号
MOSI - P1-19 - J2-11 SDI
SCLK - P1-23 - J2-3 SCLK
CEO - P1-24 - J2-1 /SYNCO
接地 - P1-25 - J2-4 接地
此外,JP1 引脚用于将/LDAC 接地。
到目前为止,我已经在 SDI、SCLK 和 /SYNC0 引脚上使用了示波器,并且可以验证同步引脚不会中断数据传输。此外,我可以看到 DAC 接收到的 8 位序列。
我一直在使用的代码如下:
import spidev
spi = spidev.SpiDev()
spi.open(0,0)
spi.mode = 2
spi.max_speed_hz = 1000000
spi.bits_per_word = 8
spi.xfer2([0x20,0x0,0x3]) # Powers on all DACs
spi.xfer2([0x38,0x0,0x0]) # External reference
spi.xfer2([0x30,0x0,0x4]) # /LDAC is low
spi.xfer2([0x17,0x66,0x60]) # Output of 2 V to DAC-A and updates all registers (Vref is 5 V)
spi.close()
我不明白我怎么知道正在发送消息,但我没有从 DAC 获得任何可辨别的输出。我错过了什么?
DAC7562 数据表:http ://www.ti.com/lit/ds/slas719e/slas719e.pdf
DAC7562EVM 手册:http ://www.ti.com/lit/ug/sbau183a/sbau183a.pdf
我发现这个答案对 SPI 模式很有帮助,但无法实现其他指令:TI DAC8568 的树莓派上的 SPIDEV 未按预期运行