bigdogguru
Administrator
- Joined
- Mar 12, 2010
- Messages
- 9,821
- Helped
- 2,350
- Reputation
- 4,694
- Reaction score
- 2,272
- Trophy points
- 1,413
- Location
- Southwest, USA
- Activity points
- 62,390
Can't you sleep?
Setting CMCON = 0x07, basically disables the comparator section. Take a look at the first diagram you posted above, "Comparators Off CM2:CM0=111".
Then if you look at each pin diagram on PORTA and realize the comparator section is off/disable then MOST of the PORTA pins behave like PORTB pins and require the same initialization as a PORTB pin, with the exceptions being RA4 and RA5, as well as, RA6 and RA7 if an external OSC is used.
Ciao
---------- Post added at 00:13 ---------- Previous post was at 00:10 ----------
By the way, many of the 16F series PIC, require disabling the ADCs analog inputs before using any PORTA pins as digital i/o. While this particular model requires disabling the comparator section.
Setting CMCON = 0x07, basically disables the comparator section. Take a look at the first diagram you posted above, "Comparators Off CM2:CM0=111".
Then if you look at each pin diagram on PORTA and realize the comparator section is off/disable then MOST of the PORTA pins behave like PORTB pins and require the same initialization as a PORTB pin, with the exceptions being RA4 and RA5, as well as, RA6 and RA7 if an external OSC is used.
Ciao
---------- Post added at 00:13 ---------- Previous post was at 00:10 ----------
By the way, many of the 16F series PIC, require disabling the ADCs analog inputs before using any PORTA pins as digital i/o. While this particular model requires disabling the comparator section.