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 Problem
Moderator: Benj
-
- Flowcode v5 User
- Posts: 104
- Joined: Fri Oct 10, 2014 11:15 am
- Has thanked: 27 times
- Been thanked: 22 times
-
- 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
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
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
-
- Flowcode v5 User
- Posts: 104
- Joined: Fri Oct 10, 2014 11:15 am
- Has thanked: 27 times
- Been thanked: 22 times
Re: ADC Problem
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.
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.