ADC Problem

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

Moderator: Benj

Post Reply
Dave Squibb
Flowcode v5 User
Posts: 104
Joined: Fri Oct 10, 2014 11:15 am
Has thanked: 27 times
Been thanked: 22 times

ADC Problem

Post by Dave Squibb »

Hello,
This code works in simulation and the pot reads in 0 - 1023. On the hardware (PIC18F45K22) the LCD only reads up to 256 max. Is it me or is it a bug? Thanks, Dave.
ADC_Test.fcfx
(9.14 KiB) Downloaded 241 times

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times

Re: ADC Problem

Post by stefan.erni »

Hi Dave

256 looks like a Byte....Then it's maybe a bug.

But can you control if your PIC is on 5Volt or 3.3V. because you set Analog Ref to 5Volt.
In the AD-component try to change convesionspeed , set to osc/64.
How is your input to the AD-converter? Did you use a potmeter or the real motor?

regards

Stefan

Dave Squibb
Flowcode v5 User
Posts: 104
Joined: Fri Oct 10, 2014 11:15 am
Has thanked: 27 times
Been thanked: 22 times

Re: ADC Problem

Post by Dave Squibb »

Hi Stefan,
Thanks for replying. It was the 256 that made me think it might be a bug. The input is a current measuring circuit using an op amp.
I removed the op amp and fed 0 to 5 V directly to the AD input and all works perfectly!
Fault is on the hardware somewhere.
Thanks again, Dave.

Post Reply