Page 1 of 1

Solved ADC problem with 18F87K22 on easypic_pro_v7 board

Posted: Thu Jan 31, 2013 10:57 pm
by dannyvanneijenhoff
Hello

I have a problem to read the the ADC inputs on the 18F87K22 wich is mounted on easypic_pro_v7 board.

Everything works but one last problem to solve. :D :-)

Tried several settings on variable and the ADC settings (also the same settings as in other projects).

I can not get a good steady reading from the input.
I have showed the value of the variable to a LCD and LED.
And it fluctuate rapidly to every direction.
It looks like the value goes several times from 0-255.
But is difficult to read.

When we turn the potentiometer, the LCD -meter has a steady reading from 0 to 5Vdc.

The 18F87K22 works on 5V and the core on 3V3

Have anyone some suggestions I can look at. Thanks

Re: ADC problem with 18F87K22 on easypic_pro_v7 board

Posted: Thu Jan 31, 2013 11:06 pm
by dazz
can you attach your flowchart fcf file , then we can look at the settings etc

Regards
Dazz

Re: ADC problem with 18F87K22 on easypic_pro_v7 board

Posted: Sat Feb 02, 2013 9:19 am
by dannyvanneijenhoff
Thanks, that would be great.

Have written a new short program.

Also have a snapshot of the configration bits ot the micro.
ADC test.fcf
Test ADC
(10.5 KiB) Downloaded 395 times
.

Re: ADC problem with 18F87K22 on easypic_pro_v7 board

Posted: Tue Feb 05, 2013 2:26 pm
by dannyvanneijenhoff
Have changed the watcdog timer on disabled, no succes :cry: .

Re: ADC problem with 18F87K22 on easypic_pro_v7 board

Posted: Mon Feb 11, 2013 2:26 pm
by dannyvanneijenhoff
Try different settings, in the meantime.
The rest of the program is working wel.

Stil no good ADC readings, on LCD (and PWM).

I have now an stable reading on the LCD (Thanks to DAZZ :D ).
So i can study the problem, i stil have strange readings.
It looks like to much gain.

ADC component macro, Read AS Byte.
Variable VarADC0 = Byte
features of ADC: 40 cycly, conversion FOSC/128, Vreff VDD, Vref 500 x10mv

Changed my 0-5Vdc potentiometer to 0-150mVdc, fur better testing and measuring.

0 mV Potentiometer = 239 on LCD
next step (nothing between) on LCD 2,0 mV = 255,
next step 2,7 mV = 055,
next step 3,2 mV = 065, next step 4,4 mV = 165, next step 5,4 mV = 325, next step 6,9 mV = 485,
next step 8,0 mV = 645, next step 9,2 mV = 805, next step 10,5 mV = 962, next step 11,3 mV = 112,

Anyone any idee. :shock:

Re: ADC problem with 18F87K22 on easypic_pro_v7 board

Posted: Fri Feb 15, 2013 3:16 pm
by etillol
Hi,
If you are using Flowcode v4.5:
Did you try to change the faulty adc files in flowcode directories:
PIC_ADC_28.c and PIC_ADC_29.c in C:\Program Files\Matrix Multimedia\Flowcode V4\Components
may have bugs.
You have to replace them with the ones in the following thread:
http://www.matrixmultimedia.com/mmforum ... =29&t=8700