PDA

View Full Version : How to use GPIO meant for OSC



Pic2008
- 25th August 2008, 11:07
I'm not sure how to use PicBasic to configure PIC12F629 so that GP3,4,5 can be used as GPIO. Any idea without using assembly? I want to use internal 20MHz oscillation.

mackrackit
- 25th August 2008, 11:35
Set the config to


__config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF

Then you can use the internal 4 MHz osc and GP3 can be used for an input.
Then turn off the ADC
http://www.picbasic.co.uk/forum/showthread.php?t=561

Pic2008
- 26th August 2008, 05:57
Problem solved. Need to use the following code if not using MPASM assembler in PBP:

asm
device pic12F629, MCLR_OFF,INTRC_OSC_NOCLKOUT, wdt_off, pwrt_on,protect_off
endasm