[数据转换器-信号链] 读不上来数据

[复制链接]
1878|13
 楼主| chuxh 发表于 2014-4-27 22:05 | 显示全部楼层 |阅读模式
用SPI口操作ADS1259时,初始化写操作正确,但是在用读寄存器命令读时,是从第三个寄存器开始读,而且第一次发读命令,读不上来数据
zyf部长 发表于 2014-4-27 22:06 | 显示全部楼层
然后呢?
 楼主| chuxh 发表于 2014-4-27 22:10 | 显示全部楼层
第二次发读命令时,才能读到数据。
pengf 发表于 2014-4-27 22:11 | 显示全部楼层
读取操作方法是否正确?如下
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
liuzaiy 发表于 2014-4-27 22:12 | 显示全部楼层
liuzaiy 发表于 2014-4-27 22:12 | 显示全部楼层
看看这个例子
 楼主| chuxh 发表于 2014-4-27 22:14 | 显示全部楼层
是CPU的SPI的操作问题。
airwill 发表于 2014-4-27 22:15 | 显示全部楼层
不知道用的什么单片机? 跟 SPI 全双工的操作也有关系.
往往 SPI 读的过程, 要先写数据, 等数据发完, 同时数据才完成读取, 如果没有等待发送完成, 那么第一次就读不到数据了, 而第二次则可能读到了第一次的数据(这个过程不一定, 也有可能数据被冲掉).
zyf部长 发表于 2014-4-27 22:15 | 显示全部楼层
不知道读不出来数据是指寄存器设置值还是ADC转换输出的数据
zyf部长 发表于 2014-4-27 22:17 | 显示全部楼层
zyf部长 发表于 2014-4-27 22:15
不知道读不出来数据是指寄存器设置值还是ADC转换输出的数据

若是后者,需要判断DRDY low, 再去读。
 楼主| chuxh 发表于 2014-4-27 22:17 | 显示全部楼层
是指读不出AD转换结果,我已经判断了DRDY LOW,然后再去读的,我用示波器观察过,START命令,波形正确,DRDY也变化,但是在发送了RDATA命令后,DOUT一直是低电平.
supernan 发表于 2014-4-27 22:21 | 显示全部楼层
原理图贴上来看一下。要避免输入过载。当DRDY low, data read 必须在20 个fclk 循环内完成。
 楼主| chuxh 发表于 2014-4-27 22:21 | 显示全部楼层
睡了,明天再说吧,多谢大家
vivilzb1985 发表于 2014-4-28 22:06 | 显示全部楼层
这个注意下时序的吧,还有启动电平信号的,停止电平信号的都需要注意的
您需要登录后才可以回帖 登录 | 注册

本版积分规则

936

主题

11296

帖子

2

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