PIC16F688 RA0 & RA1 as input

General discussion on mikroC.
Post Reply
Author
Message
M14
Posts: 8
Joined: 18 Sep 2008 23:13

PIC16F688 RA0 & RA1 as input

#1 Post by M14 » 19 Mar 2012 21:22

For some reason i cannot use RA0 and RA1 as input. These pins are also the program pins, does that has something to do with it?

For the record:

Code: Select all

TRISA = 0x03; // RA0 & RA1 are input
ANSEL = 0; // All inputs are digital

lukes
Posts: 5
Joined: 24 Dec 2011 16:20

Re: PIC16F688 RA0 & RA1 as input

#2 Post by lukes » 19 Mar 2012 21:39

Hello,

Have you ever checked the Diagram ?
Maybe you should try to turn off the comparators (C1IN C1Out)

M14
Posts: 8
Joined: 18 Sep 2008 23:13

Re: PIC16F688 RA0 & RA1 as input

#3 Post by M14 » 19 Mar 2012 23:29

FML ... Comparator module is on by default ...

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: PIC16F688 RA0 & RA1 as input

#4 Post by filip » 20 Mar 2012 13:05

Hi,

Yes, you should disable comparators to use them as a digital I/O.

Regards,
Filip.

M14
Posts: 8
Joined: 18 Sep 2008 23:13

Re: PIC16F688 RA0 & RA1 as input

#5 Post by M14 » 20 Mar 2012 14:52

I noticed before with other Microchip controllers that the analog inputs are configured instead of digital I/O by default. With the PIC16F688 the analog inputs are not configured by default, but the comparators are. I think this is very confusing, should there be any reason for Microchip to design it like this? Not your or MikroE's fault offcourse :).

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: PIC16F688 RA0 & RA1 as input

#6 Post by filip » 21 Mar 2012 09:25

Hi,

Well, it is something that we are all facing when developing our projects.
There is no other solution than reading the datasheet. :)

Regards
Filip.

Post Reply

Return to “mikroC General”