PDA

View Full Version : #CONFIG for a PIC12F683 ?



Gerald
- 24th March 2023, 14:47
Hi, I have a horrible pic programming system where I have to manually type in the config every time I want to write to the chip. (and sometimes I make mistakes!). Of course the elegant way is to include a #CONFIG statement at the compiler head of the code. What would be the correct #CONFIG code that sets the bits as follows? (Taken from page 84 of the PIC12F683 manual and it gives me correct result)

bit 11 FCMEN = 1
bit 10 IESO = 0
bit 9-8 BOREN = 01
bit 7 CPD = 0
bit 6 CP = 0
bit 5 MCLRE = 0
bit 4 PWRTE = 0
bit 3 WDTE = 0
bit 2-0 FOSC = 100

In real life it should look something like the following, but different words and values . . . .

#config
CONFIG FOSC = HS
CONFIG WDTEN = OFF
CONFIG PWRT = ON
CONFIG BOREN = OFF
CONFIG MCLRE = OFF
. . . . . . . . .
. . . . . . .
#endconfig

Thank you

Gerald
- 25th March 2023, 07:03
I have tried this and it seems to work:

#CONFIG
__config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_OFF & _CP_OFF
#ENDCONFIG

CuriousOne
- 29th March 2023, 05:12
Melabes MeConfig utility is an excellent thing for generating configs.

Ioannis
- 29th March 2023, 12:15
This was a beta try and does not support newer MCUs.

Also there will not be any new version of this really good idea.

Ioannis

CuriousOne
- 29th March 2023, 13:48
I don't think that 12F683 belongs to "new" CPUs in any means :D