Hi again guys,
I'm using PIC16F877 and i want to use the comparator module. I'm simply comparing the temperature sensor voltage to a predefined potentiometer value on PORTA0 and PORTA3
I disabled the Analog module, enabled the CMIE and assigned 0x02 to CMCON (my case). As the datasheet specifies, when the output of the comparator changes state, CMIF should be set which is not happening in my case!!
Do I miss something here??
Thanks guys really
I set appropriately RA0 & RA3 to be analog by ADCON1 register. Is there anything more should i do? Is there any possibility that comparator module might be defected?
Theoretically it should work as you posted, but are you sure that you have 16F877(non-A version)? Because it doesn't have comparator module!!! 16F877A has it (so are you reading the A datasheet and using non-A part?)
Is there a document available that details the differences between A and non-A versions of the same PIC? It doesn't appear to be part of the 16F87xA datasheet.
I thought both versions were basically identical feature-wise. Those differences are quite annoying. Makes you wish they used a new part number instead of appending an A...
I thought both versions were basically identical feature-wise. Those differences are quite annoying. Makes you wish they used a new part number instead of appending an A...
The new part is OK. The annoying thing is some "smart" engineers choose to enable the new features as default in the new "A" version so that most people who are unaware of the changes are being caught up.
Why can't they just make the new changes available via extra bits of the register settings so that on default, the part will work in the same way with previous codes?
I know what you mean. I hate that too. Seems like the engineers didn't think about what it would cause to us. These extra features just brought us problems (aka unfamous Comparators On by default...)