kirtan.gopal
Newbie level 4
- Joined
- Mar 26, 2014
- Messages
- 6
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 34
I have implement in Proteus8 its working but not on physical model it always give 254 value in return.help me ......
where
wr- p2.4
rd-p2.5
cs p2.6
intr 2.7
Code:
ADC:
MOV P1,#00H
CLR P2.6
SETB P2.5
CLR P2.4
ACALL DELAY_200M
ACALL DELAY_200M
SETB P2.4 ; low to high pulse to WR for starting conversion
MOV R7,#225
Del_1_Sec4:
DJNZ R7,Del_1_Sec4
WAIT: JB P2.7,WAIT ; polls until INTR=0
CLR P2.6 ; ensures CS=0
MOV R7,#225
Del_1_Sec0:
DJNZ R7,Del_1_Sec0
CLR P2.5 ; high to low pulse to RD for reading the data from ADC
MOV R7,#225
Del_1_Sec1:
DJNZ R7,Del_1_Sec1
MOV VALUE,P0
SETB P2.6
SETB P2.5
RET
where
wr- p2.4
rd-p2.5
cs p2.6
intr 2.7
Last edited by a moderator: