ADC component macro Questions

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
Ron
Posts: 225
Joined: Wed Apr 11, 2007 6:15 pm
Has thanked: 2 times

ADC component macro Questions

Post by Ron »

Hi,

SampleADC
The Chip samples the analogue input and stores the value in memory.

Where in memory? Why would you use this, normally you would manipulate data after reading the sample. Since we have the INT Read & BYTE Read to move values into memory so we can manipulate them, when would the SampleADC command be used?

INT ReadValueAsInt
Returns the full analogue value as a INT value.
Note: The value can be 8 bit, 10 bit or greater depending on the specific device used. Please refer to the device datasheet for full details.

Does the INT ReadValueAsInt do the SampleADC or must you do the SampleADC then the INT ReadVauleAsINT macro?


BYTE ReadValueAsByte
Returns the 8 most signifiicant bits of the analogue value as a BYTE value.
The resulting value 0-255 can be easier to work with in some instances (e.g. output to a port, ) than the the full INT value.


Does the BYTE ReadValueAsInt do the SampleADC or must you do the SampleADC then the BYTE ReadVauleAsINT macro?


Thanks

Ron

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Post by Benj »

Hello

You must always do a sample ADC before you perform a read. The sample ADC takes a reading of the analogue voltage and stores the result into two 8 bit registers inside the PICmicros memory. The read functions simply get hold of this result.

Ron
Posts: 225
Joined: Wed Apr 11, 2007 6:15 pm
Has thanked: 2 times

Post by Ron »

Hi,

Thanks......

Ron

Post Reply