在“线程: ADS1262”中讨论的其他部件
大家好。
1.开机后读寄存器时,我有默认值
模式2 0x04
INPMUX 0x01
IDACMUX 0xbb
2.渗出后写功能:
void ads1263_group1_wreg (void)
{
volatile unsigned char d,r;
volatile unsigned char I;
r =3;//mode0寄存器
ads1263_cs_0;
//第一个字节-操作码1
//d = 0x2a;//rreg (0010-0x2) from IDAC0 reg (0x0a)
D = 0x40;
d |= r;
ads1263_write_byte(d);
//第二个字节-操作码2
//d = 0x2a;//rreg (0010-0x2) from IDAC0 reg (0x0a)
d = 0x20;
d |= r-1;
ads1263_write_byte(d);
//数据到regs
ads1263_write_byte(0x10);//mode0
ads1263_write_byte(0x00);//Mode1
ads1263_write_byte(0x05);//mode2
ads1263_write_byte(0x67);//inpmux
ads1263_write_byte(0x00);//offcal0
ads1263_write_byte(0x00);//offcal1.
ads1263_write_byte(0x00);//offcal2.
ads1263_write_byte(0x00);//fscal0
ads1263_write_byte(0x00);//fscal1.
ads1263_write_byte(0x40);//fscal2
ads1263_write_byte(0x3a);//idacmux
ads1263_write_byte(0x66);//idacmag
ads1263_write_byte(0x00);//refmux
ads1263_write_byte(0x00);//tdacp
ads1263_SCLK_0;
ads1263_cs_1;
}
在阅读后-
Mode2 0x05 -更改正常
INPMUX 0x01 -未更改-错误
IDACMUX 0xbb -未更改-错误
我做错了什么?
谢谢你