Category: Software
Product Number: AD7768-1
大家好,我正在使用 Zynq7020 AXI-Quad-Spi 驱动 AD7768-1,驱动库使用的 ADI no-os,通过访问 0x2C 读取 24b 转换结果寄存器时结果完全正确。为了避免不必要的寄存器地址传输,我启用了 INTERFACE FORMAT CONTROL REGISTER (0x14) 寄存器中的
EN_CONT_READ (LSB),这样可以直接读取 24b 转换结果而不需要发送 0x2C 寄存器地址,然后我发现转换结果的出现错误。在诊断模式下,输入为 AD77681_POSITIVE_FS (FS-1LSB) 时转换结果为 0x7FFFFF,输入为 AD77681_NEGATIVE_FS (-FS) 和 AD77681_AIN_SHORT (0V) 时转换结果均为 0x000000,我使用逻辑分析仪采集了 SPI 数据,发现输入为 -FS 时 AD7768-1 输出 MSB 确实为 0

AXI-Quad-Spi 输入时钟为 80MHz,经过 4 分频后 SCLK 为 20MHz,配置代码如下
Status = ad77681_setup(&instance_ptr->ad77681_devs[channel], &instance_ptr->status_regs[channel], intr_instance_ptr);
if (Status != XST_SUCCESS)
{
log_error("AD7768 channel %u setup failed", channel);
instance_ptr->device_enabled[channel] = false;
continue;
}
#if AD77681_CONTINUOUS_READ_MODE_ENABLE
Status = ad77681_set_continuos_read(&instance_ptr->ad77681_devs[channel], AD77681_CONTINUOUS_READ_ENABLE);
if (Status != XST_SUCCESS)
{
log_error("AD7768 channel %u set continuous read failed", channel);
instance_ptr->device_enabled[channel] = false;
}
#endif
DRDY 高电平触发中断读取
adc_ret = ad77681_spi_read_adc_data(&group->ad77681_devs[channel], adc_data[channel], AD77681_CONTINUOUS_READ_MODE_ENABLE ? AD77681_CONTINUOUS_DATA_READ : AD77681_REGISTER_DATA_READ);
if (adc_ret != 0)
{
log_error("ADC read channel %d failed, ret %d", channel, adc_ret);
return;
}
希望能得到大家指点,谢谢!