Hey guys

Just for the record: I'm still writing an article about the question I
posed earlier :) But your help about USB resulted in a nice project!

But now - in between the exams! - I'm preparing for the next project:
Transform the 18F2553 to a measuring device using LabVIEW.
I was just doing some tests with JALLIB, since it's USB library is
really easy, but in the future we might need to go to C (because of
performance?).

The problem: the ADC is acting up! I'm using the example program and
removed the Serial communication. To be able to view the output, I
send the low_res output to portb (which has 8 LEDs connected).

That's where the strange part starts...

At 5V input, the digital value is 15 (out of 255), when I go down a
little, it goes to 255...
When I go down further, it stays 255 (until about 2.5V)

Then it drops rapidly to 0, and goes back up to about 240. And then it
goes down again to 0 (at 0V).

I took some code I wrote this semester in ASM that does about the same
(but with timer1 and interrupts), and that one does what it should!
there I'm reading the high byte (which should be the same as the JAL
equivalent would do).
These are the AD settings there.

ADCON1 = 0b00001110;    // AN0 = analog
ADCON2 = 0b00010110;    // Left justified, 4TAD, Fosc / 64

The only thing I could think of is that this microcontroller has a
12bit ADC, but I don't really know why that could be a problem.
Does anyone know what I'm doing wrong?

Kind regards
Toon

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to