[PicForth] AtoD (again)

Barry Gershenfeld barry_g at zmicro.com
Fri May 26 01:29:18 CEST 2006


>GO/DONE: A/D Conversion Status bit
>If ADON = 1:
>1 = A/D conversion in progress (setting this bit starts the A/D conversion)
>0 = A/D conversion not in progress (this bit is automatically cleared by 
>hardware when the A/D
>conversion is complete)
>This clearly is confusing, because it is in fact the next ( implemented ) 
>bit that is named ADON. Its description:
>ADON: A/D On bit
>1 = A/D converter module is operating
>0 = A/D converter module is shut-off and consumes no operating current

ADON (bit 0) turns the A/D section on or off.   You would normally turn it 
on and leave it on, but you can turn it off to save power when you're not 
using it, in a battery-powered application.

GO/DONE (bit 2) is what you use to do your sampling.   Set it to 1 to start 
the conversion, wait until it changes back to 0 and now the answer's available.

Barry



More information about the PicForth mailing list