PDA

View Full Version : Using GPIO.3 as input on 12F629



Sharky
- 5th May 2006, 10:25
Hi,

I would like to use GPIO.3 as an input on the 12F629.
But how do I do that in the right way?
Is this the right way?


@ DEVICE pic16F628, INTRC_OSC_NOCLKOUT, NO_MCLR

DEFINE OSCCAL_1K 1 ' Load factory value into OSCCAL
CMCON=7 ' Turn analog comparators off
TRISIO = %11001111 ' Set GPIO 0-3 as inputs 5-6 as outputs


I have to use NO_MCLR right?

If I look on page 54 in the datasheet, the CONFIG word bit 5 sould be set to 0, does NO_MCLR do that?

There is a note (note 5) that says: When MCLR is asserted in INTOSC or RC mode , the internal clock oscillator is disabled.
What dose that mean?

Kind regards
Sharky

mister_e
- 5th May 2006, 15:35
At least choose the right processor ;) But anyway, open the m12F629 .INC file in your PBP\INC folder, there you'll se your config fuses.

So i bet it should look like


@ DEVICE 12F629, INTRC_OSC_NOCLKOUT, MCLR_OFF

Sharky
- 5th May 2006, 19:41
Hi mister_e,

Dooh, yes of course it's: @DEVICE 12F629 :o

Thanks!

Sharky