主题中讨论的其他器件:ADS8344、
我有一个评估板、其中包含来自不同供应商的 Cortex M4 MCU。 电路板具有 VDD = 3V3、GND、5V 和 DAC。 因为您猜我没有 DGND、AGND 等不同的接地平面。
请参阅以下信息。
我向 CH5馈送正弦信号、
我的 SPI RX 数据结构为:
union ADS8344{
uint8_t reg;
struct{
uint8_t PD0:1;
uint8_t PD1:1;
uint8_t SGL_DIF:1;
uint8_t res:1;
uint8_t A0:1;
uint8_t A1:1;
uint8_t A2:1;
uint8_t S:1;
}u8reg;
};
spi_tx.u8reg.S = 1; spi_tx.u8reg.A2 = 1; spi_tx.u8reg.A1 = 1; spi_tx.u8reg.A0 = 0; spi_tx.u8reg.res = 0; spi_tx.u8reg.SGL_DIF = 1; spi_tx.u8reg.PD1 = 0; spi_tx.u8reg.PD0 = 0;
我的 ADC 映射函数
#define VREF 2.5
#define LSB_VOLTAGE (2*2.5/65536)
float convertToVoltage(uint16_t rawValue) {
// Check if the value is in the negative range
if (rawValue & 0x8000) {
// Convert from 2's complement to signed integer
int16_t signedValue = -(int16_t)(0xFFFF - rawValue + 1);
// Calculate the voltage for the negative range
return (float)signedValue * LSB_VOLTAGE;
}
else {
// Calculate the voltage for the positive range
return (float)rawValue * LSB_VOLTAGE;
}
}
这里是我的朋友


我知道我从 SPI 收到了响应、但值错误。 我测得 IC 的 Vref 11引脚电压为2.5V。
您能告诉我我还能做些什么吗?








