ad7606b 得到了正确的时序 但读出的数据都一样是错的

 如图

我是使用python在树莓派4上以软件模式、并口驱动AD7606B 代码如下 被卡了好几天 求帮忙

from periphery import MMIO
import RPi.GPIO as GPIO
import time

# all in BCM
# PI4 <=> EVAL-AD7606B FMCZ parallel/software mode
# BDn --> GPIOn n(0,15) GPLEV0 = 0xfe200034
pCS = 16
pRD = 17
pWR = 18
pRESET = 19
pBUSY = 20
pCONVST = 21    #gpclk
pFIRSETDATA = 26

DB_LIST = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]

GPIO_BASE = 0xfe200000
gpio_mmio = MMIO(GPIO_BASE,0xb3)

def ad7606b_pin_def():
    GPIO.setmode(GPIO.BCM)
    GPIO.setup([pCS,pRD,pWR,pRESET,pCONVST],GPIO.OUT)
    GPIO.output(pCS, GPIO.LOW)
    GPIO.output(pRESET, GPIO.LOW)
    GPIO.output(pRD, GPIO.HIGH)
    GPIO.output(pWR, GPIO.HIGH)
    GPIO.output(pCONVST, GPIO.HIGH)

    GPIO.setup([pBUSY,pFIRSETDATA],GPIO.IN)


def read_ad7606b_reg(addr):
    if(addr > 0x2f or addr <0x00):
        print("address error")
        return -1
    db = 0x8000 | (addr<<8#必须将位DB15设置为1才能选择读取命令。读取命令将AD7606B置于寄存器模式。位DB[14:8]必须包含寄存器地址

    GPIO.setup(DB_LIST,GPIO.OUT)
    GPIO.output(pWR, GPIO.LOW)
    gpio_mmio.write16(0x28,0xffff)  #GPCLR0
    gpio_mmio.write16(0x1c,db)      #GPSET0
    GPIO.output(pWR, GPIO.HIGH)
    
    time.sleep(0.001)

    GPIO.setup(DB_LIST,GPIO.IN)
    GPIO.output(pRD, GPIO.LOW)
    
    reg = gpio_mmio.read8(0x34)
    GPIO.output(pRD, GPIO.HIGH)

    return reg

def write_ad7606b_reg(addr,cont):
    if(addr > 0x2f or addr <0x00):
        print("address error")
        return -1

    if(cont > 0xff or cont <0x00):
        print("cont error")
        return -2

    db = 0x0000 | (addr<<8) |(cont&0xff)

    #要选择写命令,必须将位DB15设为0
    #位DB[14:8]包含寄存器地址
    #随后的8位DB[7:0]包含要写入所选寄存器的数据
    GPIO.setup(DB_LIST,GPIO.OUT)
    GPIO.output(pWR, GPIO.LOW)
    gpio_mmio.write16(0x28,0xffff)  #GPCLR0
    gpio_mmio.write16(0x1c,db)      #GPSET0
    GPIO.output(pWR, GPIO.HIGH)  #数据在WR引脚的上升沿锁存到器件上
    time.sleep(0.001)

if __name__ == "__main__":
    ad7606b_pin_def()
    time.sleep(1)
    write_ad7606b_reg(0x02,0b01000000)
    write_ad7606b_reg(0x03,0b00000000#RANGE 0-7 +-2.5V
    write_ad7606b_reg(0x04,0b00000000#RANGE 0-7 +-2.5V

    write_ad7606b_reg(0x06,0b00000000# 过采样关闭

    write_ad7606b_reg(0x11,0b10000000#0LSB
    write_ad7606b_reg(0x12,0b10000000#0LSB
    write_ad7606b_reg(0x13,0b10000000#0LSB
    write_ad7606b_reg(0x14,0b10000000#0LSB

    write_ad7606b_reg(0x19,0b00000000
    write_ad7606b_reg(0x1a,0b00000000
    write_ad7606b_reg(0x1b,0b00000000
    write_ad7606b_reg(0x1c,0b00000000

    print(bin(read_ad7606b_reg(0x2f)))# SILICON_REVISION

    #start read adc 
    write_ad7606b_reg(0x00,0b10101010#dont care cont 

    GPIO.output(pRESET,0)
    time.sleep(1)
    GPIO.output(pRESET,0)
    
    n = 10000
    while(1):
        GPIO.output(pCONVST,1)
        GPIO.output(pRD,1)
        GPIO.output(pRD,0)
        print(bin(gpio_mmio.read16(0x34)))
        GPIO.output(pRD,0)
        GPIO.output(pRD,1)
        GPIO.output(pRD,0)
        print(bin(gpio_mmio.read16(0x34)))
        GPIO.output(pRD,0)
        GPIO.output(pRD,1)
        GPIO.output(pRD,0)
        print(bin(gpio_mmio.read16(0x34)))
        GPIO.output(pRD,0)
        GPIO.output(pRD,1)
        GPIO.output(pRD,0)
        print(bin(gpio_mmio.read16(0x34)))
        GPIO.output(pRD,0)
        GPIO.output(pRD,1)
        GPIO.output(pCONVST,0)
        n = n-1

    gpio_mmio.close()