我有2个 DAC8760器件以菊花链形式连接、2个器件配置为10伏输出、
第一个是正确的、但第二个不超过3伏。
它与配置相同,我以48位帧发送,但只有第一个有效。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
这是我的代码和丑图。
//控制注册
LATCH = 0;
SPI2_Send24_Bits (0x55、0x10、0x09);
LATCH = 1;
//配置寄存器
LATCH = 0;
SPI2_Send24_Bits (0x57、0x00、0x00);
LATCH = 1;
//增益调节器
LATCH = 0;
SPI2_Send24_Bits (0x58、0x00、0x00);
LATCH = 1;
//增益零寄存器
LATCH = 0;
SPI2_Send24_Bits (0x59、0x00、0x00);
LATCH = 1;
//控制注册
LATCH = 0;
SPI2_Send24_Bits (0x55、0x10、0x09);
SPI2_Send24_Bits (0x00、0x00、0x00);
LATCH = 1;
//配置寄存器
LATCH = 0;
SPI2_Send24_Bits (0x57、0x00、0x00);
SPI2_Send24_Bits (0x00、0x00、0x00);
LATCH = 1;
//增益调节器
LATCH = 0;
SPI2_Send24_Bits (0x58、0x00、0x00);
SPI2_Send24_Bits (0x00、0x00、0x00);
LATCH = 1;
//增益零寄存器
LATCH = 0;
SPI2_Send24_Bits (0x59、0x00、0x00);
SPI2_Send24_Bits (0x00、0x00、0x00);
LATCH = 1;
//输出值
LATCH = 0;
SPI2_Send24_Bits (0x01、0xff、0xff);//9.98伏
SPI2_Send24_Bits (0x01、0xff、0xff);//3.1伏
您好、Ernesto、
您应确认以下几点:
1.这种连接是否正确? 因此、我个人不喜欢 SDI/SDO 命名惯例。 主器件上有称为 SDO 和 SDI 的引脚、但 SDO 和 SDI 是指从器件数据输入和从器件数据输出。 在您的图中、主器件上有一个称为 SDI 的引脚、但连接到 SDO 引脚、这令人困惑。 我会在主器件上确认引脚是 MISO 还是 MOSI。 您可以监控将 DAC1连接到 DAC2的导线、并验证数据格式是否正确。
2.使用示波器验证您的时序是否有效。 我在过去看到、一些 MCU 会缓冲 SPI 数据、因此 SPI2_Send24_Bits 函 数可能会返回、但实际上并未完成命令设置。 您的写入命令中可能有一个轮询函数、用于检查写入是否完成、但这通常被忽略。 您可能会注意到、在命令完成之前、锁存线会变为高电平。
两个器件的读取命令是否都起作用?
谢谢、
Paul