News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

12F629 and config

Started by GERARD, Jun 13, 2023, 06:28 PM

Previous topic - Next topic

GERARD

Hello,
I would like to configure a 12F629 as an internal oscillator. What is the config directive?
Thanks in advance.

Gérard
I am the happy grandpa of twins

rick.curl

Hi Gérard-
It looks like the internal oscillator is 4Mhz only, so there are not a lot of options. On the Fuses tab in the compiler you can select INTRCIO.  On most PICS there is an OSCCON register. This chip does not have one. It does have an OSCCAL register, but there's no need to do anything with it unless you need to make a minor adjustment to clock speed.
BTW- that's an older chip.  take a look at PIC12F1572.  You get lots more function in the same package type for about the same cost.

-Rick

Maxi

The fuse configurator give some error for this device

here is the config
Device = 12F629
Declare Xtal=4
Config INTRC_OSC_NOCLKOUT, WDT_OFF, PWRTE_ON, MCLRE_OFF, BODEN_ON, CP_OFF, CPD_OFF

joesaliba

Quote from: rick.curl on Jun 13, 2023, 08:35 PMBTW- that's an older chip.  take a look at PIC12F1572.  You get lots more function in the same package type for about the same cost.

-Rick

Rick,

The PIC12F1572 lacks EEPROM if I am not mistaken. An alternative would be the PIC12F1840.

Joe

Stephen Moss

Quote from: Maxi on Jun 14, 2023, 05:42 AMThe fuse configurator give some error for this device
This usually occurs due to a mismatch between the fuse names used by the Compiler and those used by the Fuse Configurator because the Fuse Configurator used the current Microchip Names which match the current data sheets whereas the PPI files for older devices will use the original fuse names before Microchip changed them.

Rather than digging into the PPI file to find the compiler fuse names I usually set the Fuse Configurator output to ASM which then generates...
Declare Reminders Off
@ CONFIG_REQ = 0 ; Override Compiler's configuration setting
asm-
__Config  0x3FC4 ;FOSC_INTRCIO & WDTE_OFF & PWRTE_ON & MCLRE_OFF & BOREN_ON & CP_OFF & CPD_OFF
endasm-
Declare Reminders On
As the fuse value is written to the register directly rather then the compiler using the fuse name to determine the correct value to write it does not matter if the Compiler and Fuse Configurator use different fuse names.
     

GERARD

Thank you for all your answers.
I use this PIC because it was in my drawers. I want a minimal assembly that does a time delay. The value of the oscillator doesn't need to be very precise.
I couldn't find the right term for internal oscillator without CLKOUT.

I tried with the config given by Maxi and it works.
Have a nice sunny day.
I am the happy grandpa of twins