工具与软件:
我正在尝试使用 ADS7952实现多通道输出。 我无法选择特定通道#2、#4、#5、#6、#8、#9、 #10. 我在配置方面提出的问题。 其他通道#0、#1、#3、#7、#11运行正常。 我使用的是 Manula 模式。 我可以看到用于选择模式和通道的配置字看起来不错。 我没有设置任何 GPIO 设置。
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.
上电时、我已使用此方法并使用此字来配置 GPIO:
uint16_t gpioSettings = 0x4001;//设置 GPIO 模式(D15- D12)
adc_7952_cs_enable ();
/*!<循环、而 DR 寄存器未处于架构*/
while (SPI_I2S_GetFlagStatus (ADC_7952_SPI、SPI_I2S_FLAG_TXE)=复位);
/*!<通过 SPI 外设发送字*/
SPI_I2S_SendData (ADC_7952_SPI、gpioSettings);
/*!<等待接收到的数据*/
while (SPI_I2S_GetFlagStatus (ADC_7952_SPI、SPI_I2S_FLAG_RXNE)=复位);
SPI_I2S_ReceiveData (ADC_7952_SPI);
/*!<取消选择 ADC */
adc_7952_cs_disable ();
我是用这种方法写入和读取数据的、只发送了四次 SDI、读取了4次 SDO 就得到了数据。
uint16_t outputData;
uint16_t cmd = 0x1;//设置手动模式(D15-D12)
uint16_t gpiomode = 0x0;//启用位 DI06-DI00的编程
uint16_t 范围= 0x00;
uint16_t configWord = 0x0;
//通道地址设置为4位、D10-D07
configWord =(cmd << 12)|(gpiomode <<11)|(channel << 7)| RANGE;
//debugPrintf (" SENDWORD %d\r\n"、configWord);
//将通道设置四次。 并读取输出数据
outputData = sendReceiveOnce (configWord);
outputData = sendReceiveOnce (configWord);
outputData = sendReceiveOnce (configWord);
outputData = sendReceiveOnce (configWord);
debugPrintf ("ADC7952通道#%d rawvalue %d\r\n"、(outputData&0xF000)>>12、outputData&0x0FFF);
我对每个通道(0-11)重复上述步骤。 我预计通道会根据我的选择进行切换。 但这并没有发生。 它仅更改为0、1、3、7、11。
你好、钱德拉、
我昨天撰写了这本书、但忘记把它发送出去了。
我看到你在谈论的问题,但我不知道什么会导致这种情况。 您正在发送正确的序列以更改为通道2、但之后是2次转换、您会看到器件输出0x3006、指示转换属于通道3、因此这有点令人费解。
只有一个器件会发生这种情况吗? 是否能够使用其他器件进行试用? 会发生同样的情况吗? 您是否能够压缩.Sal 文件并将其附加到此处? 我要检查一下计时中是否有任何东西关闭。
此致、
Joel
e2e.ti.com/.../SessionManual-1.zip
您好、Joel、感谢您的快速响应。 我将发送相关.Sal 文件的压缩文件。
-Chandra