ADC speed change

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
cruzxia
Posts: 88
Joined: Wed Jan 04, 2006 7:34 am
Been thanked: 8 times

ADC speed change

Post by cruzxia »

Hi, all

I have Pic 18F46K20 is running at 16mhz on the internal oscillator.
I sample the ADC to look for loss of power.
When the power is lost, the clock is slowed to 32khz to save current consumption when running on the backup battery.
When I sample the ADC at 32khz (to ckeck for Power) the charge time and acquisition time is incorrect, as it is still set for 16mhz. So the ADC won’t return a reading.

Is there an easy way to change the ADC settings in Flowcode v5, so that I can sample the ADC at both clock speeds?

regards
Andrew

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 speed change

Post by Benj »

Hello Andrew,

Sounds like a great idea and you should get a good power saving, let us know how you get on.

The simplest way is to set up two ADC components in Flowcode and attach them to the same ADC channel. Then setup the component properties so they match your desired sample parameters for each clock speed. Finally use a variable to decide which ADC component you collect the sample from depending on what clock speed you are running at. Think that should be about it :D .

Post Reply