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.
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
Solved ADC problem with 18F87K22 on easypic_pro_v7 board
Moderator: Benj
-
- 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
- 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.
-
- 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
can you attach your flowchart fcf file , then we can look at the settings etc
Regards
Dazz
Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php
-
- 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
Thanks, that would be great.
Have written a new short program.
Also have a snapshot of the configration bits ot the micro.
.
Have written a new short program.
Also have a snapshot of the configration bits ot the micro.
.
- Attachments
-
- 2.JPG (110.14 KiB) Viewed 5531 times
-
- 1.JPG (61.56 KiB) Viewed 5531 times
-
- 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
Have changed the watcdog timer on disabled, no succes .
-
- 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
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 ).
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.
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 ).
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.
- Attachments
-
- ADC test.fcf
- (14 KiB) Downloaded 285 times
-
- 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
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
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