[技术求助] SPI口操作ADS1259

[复制链接]
 楼主| jlyuan 发表于 2020-11-16 20:38 | 显示全部楼层 |阅读模式
用SPI口操作ADS1259时,初始化写操作正确,但是在用读寄存器命令读时,是从第三个寄存器开始读,而且第一次发读命令,读不上来数据
shimx 发表于 2020-11-16 20:42 | 显示全部楼层
然后呢?
lizye 发表于 2020-11-16 20:45 | 显示全部楼层
第二次发读命令时,才能读到数据。
午夜粪车 发表于 2020-11-16 20:48 | 显示全部楼层

读取操作方法是否正确?如下
RREG: Read from Registers
Description: These opcode bytes read register data. The Register Read command is a two-byte opcode
followed by the output of the register data. The first byte contains the command opcode and the register address.
The second byte of the opcode specifies the number of registers to read – 1.
First opcode byte: 0010 rrrr, where rrrr is the starting register address.
Second opcode byte: 0000 nnnn, where nnnn is the number of registers to read.
The 17th SCLK rising edge of the operation clocks out the MSB of the first register
lizye 发表于 2020-11-16 20:52 | 显示全部楼层
是CPU的SPI的操作问题。
zhanghqi 发表于 2020-11-16 21:00 | 显示全部楼层
不知道用的什么单片机? 跟 SPI 全双工的操作也有关系.
zhenykun 发表于 2020-11-16 21:03 | 显示全部楼层
往往 SPI 读的过程, 要先写数据, 等数据发完, 同时数据才完成读取, 如果没有等待发送完成, 那么第一次就读不到数据了, 而第二次则可能读到了第一次的数据(这个过程不一定, 也有可能数据被冲掉).
jiajs 发表于 2020-11-16 21:06 | 显示全部楼层
不知道读不出来数据是指寄存器设置值还是ADC转换输出的数据
wyjie 发表于 2020-11-16 21:10 | 显示全部楼层
若是后者,需要判断DRDY low, 再去读。
xxrs 发表于 2020-11-16 21:13 | 显示全部楼层
是指读不出AD转换结果,我已经判断了DRDY LOW,然后再去读的,我用示波器观察过,START命令,波形正确,DRDY也变化,但是在发送了RDATA命令后,DOUT一直是低电平.
 楼主| jlyuan 发表于 2020-11-16 21:20 | 显示全部楼层
原理图贴上来看一下。要避免输入过载。当DRDY low, data read 必须在20 个fclk 循环内完成。
heweibig 发表于 2020-11-16 21:23 | 显示全部楼层

这个注意下时序的吧,还有启动电平信号的,停止电平信号的都需要注意的
xxrs 发表于 2020-11-16 21:27 | 显示全部楼层
SPI操作模式有没有配置好
yszong 发表于 2020-11-16 21:30 | 显示全部楼层
其实还是不大明白,我再琢磨琢磨吧,多谢了哈
您需要登录后才可以回帖 登录 | 注册

本版积分规则

880

主题

12030

帖子

4

粉丝
快速回复 在线客服 返回列表 返回顶部