11.07.2015 Views

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>PICBASIC</strong> <strong>PLUS</strong> CompilerDECLARE ADIN_STIME 0 to 65535 microseconds (us).Allows the internal capacitors to fully charge before a sample is taken.This may be a value from 0 to 65535 microseconds (us).A value too small may result in a reduction of resolution. While toolarge a value will result in poor conversion speeds without any extraresolution being attained.A typical value for ADIN_STIME is 50 to 100. This allows adequatecharge time without loosing too much conversion speed. But experimentationwill produce the right value for your particular requirement.The default value if the DECLARE is not used in the BASIC listing is50.Notes :Before the ADIN command may be used, the appropriate TRIS registermust be manipulated to set the desired pin to an input. Also, theADCON1 register must be set according to which pin is required asan analogue input, and in some cases, to configure the format of theconversion’s result. See the numerous Microchip datasheets for moreinformation on these registers and how to set them up correctly for thespecific device used.If multiple conversions are being implemented, then a small delayshould be used after the ADIN command. This allows the ADC’s internalcapacitors to discharge fully: -Again: Var = ADIN 3 ‘ Place the conversion into variable VarDELAYUS 1 ‘ Wait for 1usGOTO Again ‘ Read the ADC foreverSee also :RCIN, POT23Copyright Crownhill 2001

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!