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
ADC speed change
Moderator: Benj
- 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
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
.
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
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel