krüe :: avrforth :: adc

a/d

The atmegas contain a 10 bit successive approximation a/d converter with an 8 channel multiplexer.

words

word stack description
adcref ( x -- ) reference voltage selection
adcmux ( x -- ) multiplexer channel selection
adcjust ( x -- ) result justification
adcclk ( x -- ) conversion clock prescaler
adcflag ( -- bit ) conversion complete interrupt flag
adcint ( -- bit ) conversion complete interrupt enable
'adc ( -- a ) conversion complete interrupt vector
adc ( -- ) enable adc
/adc ( -- ) disable adc
adcstart ( -- ) start conversion
adcwait ( -- ) wait for conversion complete
adcdata ( -- a ) result register

constants

reference voltage

These constants can be passed to adcref to select the voltage reference used for conversions.

result justification

These constants can be passed to adcjust to control the justification of bits in the result register.

clock prescaler

These constants can be passed to adcclk to control the prescaler of the conversion clock.