This is my first post ... Pleased to meet you all.
A little about me before I start explaining my problem.
I'm fair new to PIC programming but not C or C++ (I prefer C). I've been coding with various API's and libraries inc the useual ANSI, MU*, Linux, Win32, Win16 and some almost unknown 8Bit variations (some I founded myself, now obsolete).
I've pretty much nailed the basics on my own with PIC programming using MPlab and SourceBoost. But only on digital platforms. I've VERY limited electronics knowledge but learn quickly. I've been harvesting parts from old equipment and using those in some test applications. (Its cheaper to buy a £15 toy and get like £30 worth of steppers and other stuff from it)
Ok, here's my problem.
I'm trying to learn about using analog devices on PIC's, the 1st one im trying is on a PIC16F627 which seems good for practising (really high tolerances as I seem to be finding the right resistor values by trial and error lol)
I've enabled the comparator (the 627 has no ADC) ive put it in mode for dual independent comparators.
ok, I'm only trying to use one at the moment and set it on RA0:RA3. Im supplying a resistor between the 5vp and the comparison pin, and trying to detect a value on the other one. BUT i dont see it doing anything more than acting like a digital input. The comparison pin is showing a value of 0 as the volt value is below the logic threshold and by changing the resistance value on the other pin (RA0) is only showing 1 when the value is above the same threshold. just like normal TTL.
How am I supposed to be "seeing" an analogue value on that pin?
This is the section within the main loop that is supposed to be checking for one pin to be higher than the other (hardware: a pot on each pin, it should light the LED linked to RB3 when one pin has higher value than the other)
The comparator is configured with this word: 0b00000100 (or 0x04)
Which should be comparators in dual independent mode with no inversion or outputs.
I know it shouldn't effect it as I'm not using an interrupt but intcon is set to 0;
Anyone that can help me learn about using analogue devices on a pic (both with comparators and ADC's) would be MOST helpful.
I just need to be able to "see" a intergeric value for each input.
(i have other PIC's too including an 16F84 series and some other 62X's)