ADC Channels pulling relatively same values

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
Steven_SS
Posts: 46
Joined: Wed Jul 18, 2018 6:33 pm
Has thanked: 18 times
Been thanked: 3 times
Contact:

ADC Channels pulling relatively same values

Post by Steven_SS »

In Flowcode V8, on my atmega2560 I am pulling in values from each analog input(0-3). I am reading the adc for its corresponding channel(correctly). But when I am looking at-as an example-the first one(PF0), and it gives me 512, all the other channels follow similarly to that like their connected to the first channel. WHICH THEIR NOT, their supposed to be independent from each other.
The attachment below is how I am doing it for each channel. I have a component per channel(PF0-PF3). I have also tried just using one and re-setting the channels as I move on. No luck. I can't find anywhere in the forum or online that can help me with this.

What do I have to do to get these channel's readings all independent!?
Attachments
Read_Analog_Input.PNG
(20.63 KiB) Downloaded 1107 times
I'm just trying to keep learning & growing in a infinite loop... unless I wanna break. Cheers :)
Steven

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:

Re: ADC Channels pulling relatively same values

Post by Benj »

Hello Steven,

You don't need the delays or the RawEnable / RawDisable macros. Just use the GetAverageInt macro.

To know more I would have to see the properties of the ADC components. Specifically the precharge time and conversion rate.

If you post your project file then I can have a look for you.

Post Reply