Quote Originally Posted by Acetronics View Post
Hi,

are you sure of this line ???

Code:
CMCON0 = %00001011	' Analog comparator: Comparator w/ Output and with Internal Reference CM<2:0> = 011
Alain
OK, closer examination of the datasheet shows:

bits <2:0>: 011 = CIN- pin is configured as analog, CIN+ pin is configured as I/O, COUT pin configured as
Comparator output, CVREF is non-inverting input.
bit <3>: 1
CIS: Comparator Input Switch bit When CM<2:0> = 110 or 101:
1 = CIN+ connects to VIN-
0 = CIN- connects to VIN-
When CM<2:0> = 0xx or 100 or 111: CIS has no effect.

So...I don't see how CMCON0 would be causing my issue...?

Quote Originally Posted by HenrikOlsson View Post
Alain,
I've been looking at the datasheet and I honestly can't see what the problem with that specific line might be. As usual I suspect a R-M-W issue and I was going to suggest that perhaps the simulator doesn't deal with all the features of the comparator (like internal Vref) but I have nothing to back that up with.

/Henrik.
Yeah, so now I'm kind of thinking the problem is in the Proteus simulator. I posted this because usually something like this means I've done something dumb in the setup. But since 3 smart people have looked at it and not seen an obvious problem (am I interpreting your responses correctly?) I think I'll next try the MPLAB simulator and then try a quick hardware prototype to see if indeed bit 0 actually changes when I change bit 5 in code. I kind of doubt it will.

Quick, everyone...last chance to solve my problem before I get out the soldering iron....