这两天在用海哲的H8P16,但是在调试AD部分的时候,发现读出来的数据都是VDD,即 AD_MSB=0XFF,用过的帮我看下,以前也用过很多别的IC从没遇到过AD读数还有错的,本想请代理商的工程看下,还要通过业务转,业务出差,小厂的东西麻烦!
MOV A,@0B01001000
MOV IOC5,A
MOV A,@0B01001000 ;0B01001000
MOV ACHCON,A
MOV A,@0B01000110
MOV ADCON,A
MOV A,@0B11000011 ;0B11000000
MOV ADCON2,A
Main:
WDTC
NOP
NOP
NOP
JBS F_100MS
JMP Main
BC F_100MS
MOV A,@0B01000110
Adc_Start:
MOV ADCON,A
BS ADCON,7
MOV A,@0X30
MOV R_TEMP,A
DJZ R_TEMP
JMP $-1
Adc_Start1:
WDTC
NOP
JBC ADCON,7
JMP Adc_Start1
MOV A,AD_MSB
NOP
NOP
JMP Main |