lt8900_init:
bc port5,0x01 ;;设置rst_n为高的时候开启芯片
call delayms
bs port5,0x01
call delayms
reg0--reg50初始化 (省略)
send_process:
;;jbc port5,0x02
;;jmp send_process
mov A,@0x34 ;;设置52寄存器0x8000
mov send_data,A
call spi_init
mov A,@0x80
mov send_data,A
call spi_init
mov A,@0x00
mov send_data,A
call spi_init
nop
mov A,@0x32 ;;发送reg50
mov send_data,A
call spi_init
mov A,@0x02 ;;在50寄存器中填入FIFO数据字节数
mov send_data,A
call spi_init
mov A,@0x12 ;;在50寄存器中填入FIFOH数据
mov send_data,A
call spi_init
mov A,@0x15 ;;在50寄存器中填入FIFOL数据
mov send_data,A
call spi_init
nop
mov A,@0x07 ;;在07寄存器中设置通道
mov send_data,A
call spi_init
mov A,@0x01
mov send_data,A
call spi_init
mov A,@0x20
mov send_data,A
call spi_init
nop
nop
bs port6,0x01
nop
;;ret
jmp main
为什么示波器出来的PKT管脚为2ms低电平和20ms的高电平周期 |