Solved ADC problem with 18F87K22 on easypic_pro_v7 board

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
dannyvanneijenhoff
Posts: 65
Joined: Thu Feb 07, 2008 7:59 am
Has thanked: 17 times
Been thanked: 10 times
Contact:

Solved ADC problem with 18F87K22 on easypic_pro_v7 board

Post 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
Attachments
18F87K22.JPG
(127.75 KiB) Downloaded 1048 times
Last edited by dannyvanneijenhoff on Wed Feb 20, 2013 9:52 am, edited 2 times in total.

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: ADC problem with 18F87K22 on easypic_pro_v7 board

Post by dazz »

can you attach your flowchart fcf file , then we can look at the settings etc

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

dannyvanneijenhoff
Posts: 65
Joined: Thu Feb 07, 2008 7:59 am
Has thanked: 17 times
Been thanked: 10 times
Contact:

Re: ADC problem with 18F87K22 on easypic_pro_v7 board

Post 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 351 times
.
Attachments
2.JPG
2.JPG (110.14 KiB) Viewed 5531 times
1.JPG
1.JPG (61.56 KiB) Viewed 5531 times

dannyvanneijenhoff
Posts: 65
Joined: Thu Feb 07, 2008 7:59 am
Has thanked: 17 times
Been thanked: 10 times
Contact:

Re: ADC problem with 18F87K22 on easypic_pro_v7 board

Post by dannyvanneijenhoff »

Have changed the watcdog timer on disabled, no succes :cry: .

dannyvanneijenhoff
Posts: 65
Joined: Thu Feb 07, 2008 7:59 am
Has thanked: 17 times
Been thanked: 10 times
Contact:

Re: ADC problem with 18F87K22 on easypic_pro_v7 board

Post 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:
Attachments
ADC test.fcf
(14 KiB) Downloaded 285 times

etillol
Posts: 8
Joined: Tue Feb 12, 2013 3:31 pm
Location: Carpentras, France
Has thanked: 2 times
Been thanked: 3 times
Contact:

Re: ADC problem with 18F87K22 on easypic_pro_v7 board

Post 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

Post Reply