I am trying to read a digital output from a conversion from the ADCH register but i am being told that the ADCH register is invalid. Now, How can I transfer the contents of ADCH to a general purpose register.
Here is the code that I used. It is written in AVR Assebmly language.
.include "m168def.inc"
.org 0
ldi r17,96
sts ADMUX,R17
ldi r18,215
sts ADCSRA,r18
ldi r19,1
sts PRR,r19
ldi r21,255
out DDRD,r21
mov r20,ADCH
out PORTD,r20
nop
PLEASE HELP.