Hi Bruce,
I won't ask howto but where to look for the answer
I'm trying to use gpio.3 as an input, but I dont know how to set it as such.
Setting trisio=%00001000 does not help me
Thanks in advance
Originally Posted by Bruce
Hi Bruce,
I won't ask howto but where to look for the answer
I'm trying to use gpio.3 as an input, but I dont know how to set it as such.
Setting trisio=%00001000 does not help me
Thanks in advance
Originally Posted by Bruce
Hi Pablo,
PBP has default config fuse settings in device specific header files. Look in your PBP directory for a file named 12F683.INC. Open this file.
You'll see the PBP default config fuse settings for this target PIC. It looks somthing like this;
This is used only if you're using the default PM asembler that ships with PBP.
device pic12F683, intrc_osc_noclkout, wdt_on, mclr_on, protect_off
And this one is used when you're using the Microchip MPASM assembler.
__config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON & _CP_OFF
Notice how the default settings for /MCLR (GPIO.3) all have the reset function enabled (mclr_on, _MCLRE_ON)?
You can over-ride these default config fuse settings, and make GPIO.3 available as an input by editing the file, and changing it to mclr_off or _MCLRE_OFF, save the file, and re-compile.
Or simply add this line to the beginning of your code (if using the PM asembler);
@ device pic12F683, intrc_osc_noclkout, wdt_on, mclr_off, protect_off
Now you just need to make the pin an input by setting the appropriate TRIS bit.
Melanie posted a nice tutorial on config settings here:
http://www.picbasic.co.uk/forum/showthread.php?t=543 so I won't elaborate.
Thanks again Bruce, just added that line, and now I can use this extra pin !!
I trully appreciate your answers.
Pablo
Bookmarks