The atmegas contain a 10 bit successive approximation a/d converter with an 8 channel multiplexer.
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 |
These constants can be passed to adcref
to select the voltage
reference used for conversions.
These constants can be passed to adcjust
to control the
justification of bits in the result register.
These constants can be passed to adcclk
to control the
prescaler of the conversion clock.