寄存器的操作方式如下所示,
写入部分:
spi_wr(0x0000, 0x81);
usleep(200000);
spi_wr(0x0001, 0x00);
spi_wr(0x0002, 0x00);
spi_wr(0x4003, 0x00);
spi_wr(0x4004, 0x68);
spi_wr(0x60f7, 0x01);
usleep(200000);
spi_wr(0x6000, 0x01);
usleep(50000);
spi_wr(0x6000, 0x00);
spi_wr(0x0011, 0x80);
spi_wr(0x0059, 0x20);
spi_wr(0x4003, 0x00);
spi_wr(0x4004, 0x69);
spi_wr(0x6000, 0x80);
spi_wr(0x4003, 0x00);
spi_wr(0x4004, 0x6a);
spi_wr(0x6012, 0x02);
spi_wr(0x6017, 0x40);
spi_wr(0x6017, 0x00);
spi_wr(0x4003, 0x00);
spi_wr(0x4004, 0x68);
spi_wr(0x6000, 0x01);
usleep(50000);
spi_wr(0x6000, 0x00);
spi_wr(0x4003, 0x00);
spi_wr(0x4004, 0x69);
spi_wr(0x6002, 0x40);
spi_wr(0x6006, 0x1f);
/**********************************/
spi_wr(0x4003, 0x00);
spi_wr(0x4004, 0x61);
spi_wr(0x4001, 0x00);
spi_wr(0x4002, 0x00);
spi_wr(0x6068, 0x02);
usleep(50000);
读取部分:
spi_wr(0x4001, 0x00);
spi_wr(0x4002, 0x00);
spi_wr(0x4003, 0x00);
spi_wr(0x4004, 0x69);
read_back = spi_rd(0xe000);
read_back = spi_rd(0xe006);
这里试了很多JESDBANK部分的寄存器,无论写入了什么值,读取都为0,ANOLOG BANK寄存器,复位的值,写入的值后读取都是正确的,不知道是什么原因。时钟使用了LMK04714产生了1GHz的采样时钟,ADC的spi时钟500KHz左右。