18F67K22 adc problem

Support-Forum für Deutschsprachige, die in ihrer Muttersprache schreiben möchten.

Moderator: Benj

Post Reply
saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

18F67K22 adc problem

Post by saschech@gmx.de »

Hallo " Flowcodler" und "matrix Admins"

Meine Probleme,mit dem ADC Macro sind leider nicht aus der Welt (trotz adc-update).Es werden einfach keine definierten Poti-Werte ausgelesen.
Im Listing steht:
void FCD_ADC1_SampleADC()
{

/*******Supported Devices******************************************************************
// 18F65K22, 18F66K22, 18F67K22, 18F85K22, 18F86K22, 18F87K22,
******************************************************************************************/
Hat jemand mit diesen pic`s und dem ADC-Macro erfolgreich gearbeitet?
Habe 2 Prints mit 18F67K22 aufgebaut;mit dem selben Ergebnis > glaube also nicht an einen Fehler meinerseits.

Anbei ein einfaches Testprogramm.Bräuchte schnellstens Hilfe,da mein Projekt im Moment zwangsweise " ruhen " muß......

Grüße Wolfgang
Attachments
_ecio40pin18F67K22.fcf
(120.78 KiB) Downloaded 302 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 18F67K22 adc problem

Post by Benj »

Hi Wolfgang,

I've had another look through the code and cannot spot any errors. I have some of the smaller K22 devices so I will have go with this today and see if this has the same problem.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 18F67K22 adc problem

Post by Benj »

Hello,

I've now had a good go with the 18F23K22 device and cannot get the ADC module to return anything other then 0. This is very strange. I have been through the datasheet and confirmed that the ADC module is switched on and that there are no other modules that could clash with the ADC. So far I'm drawing a blank. Is this the same as what you are getting?

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: 18F67K22 adc problem

Post by saschech@gmx.de »

Hello Benj

Ich kann mit dem Scope ein wechselndes Signal an port c messen ( viewing),ohne das poti zu verändern.

siehe PM:
If i turn the poti to 0,I show on my scope on port RC a periode between 50 and 100ms (without change the poti position)
In Simulation the value is from 0 to 255.

Gruss Wolfgang

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 18F67K22 adc problem

Post by Benj »

Hello Wolfgang,

I have updated the ADC component C files available from here and they should work to resolve your problem:

http://www.matrixmultimedia.com/mmforum ... 247#p26247

There was a bug in the code that automatically selects the registers based on a definition from the compiler toolchain. It seems the code was getting an incorrect definition and this was causing the code to return incorrect data.

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: 18F67K22 adc problem

Post by saschech@gmx.de »

Hello Benj

"Ich ziehe meinen Hut vor Dir",das ADC-Macro arbeitet jetzt wie ich es mir vorstelle.
Werde mein Projekt fortsetzen.Vielen Dank

Gruss Wolfgang

PWM[0] _1 > pin RC2 und PWM[0]_2 > alternative Pin > RE7 ist jetzt auch in Ordnung!

nochmals Danke

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 18F67K22 adc problem

Post by Benj »

Hallo Wolfgang

Das ist eine fantastische Neuigkeit Vielen Dank, dass es mich wissen. Froh sein alle arbeiten für Sie nun wie erwartet. Lassen Sie mich wissen, wenn Sie alles andere, was nicht funktioniert finden

Hello Wolfgang

Thats fantastic news thanks for letting me know. Glad its all working for you as expected now. Let me know if you find anything else that's misbehaving.

Post Reply