PDA

View Full Version : Configuration...again...?



Ruben Pena
- 27th September 2008, 22:17
Dear friends:
I am working with a 16F886 in PM,PBP2.50b,and I have no problem with the configuration,until
I try to set the BOD voltage to 2.1Volts.
Here is the config..
@ device pic16f886 , HS_OSC
@ DEVICE pic16f886 , PWRT_OFF
@ DEVICE pic16F886 , PROTECT_ON
@ DEVICE PIC16F886 , WDT_OFF
@ DEVICE PIC16F886 , LVP_OFF
I added the next line to set the BrownOut Voltage to 2.1 Volts
@ device PIC16F886 , BOR21V , as the inc file states...But when it compiles and goes to
the USB melabs programmer,the fuses still shows BOD = 4 V.
A closer look at the INC file states that this parameter is for the "device2" directive,but if
I add the 2 after the device the PM compiler rejects this line.
Any help...?
Thanks in advance...
Ruben de la Pena V.

skimask
- 27th September 2008, 22:39
Don't know if it makes a differences or not, but the BOR21V line, you don't have the DEVICE capitalized.
Also, just for grins, try setting it to BOR4V and see what happens...
And just to make sure that you're doing things correctly, try changing a different setting and see if the read back matches your changes...

Bruce
- 27th September 2008, 22:49
@ DEVICE2 BOR21V should get you there.

Ruben Pena
- 27th September 2008, 23:14
Thanks Bruce:
Your last mail works. But is a little weird to have to change the "format" of the device directive. "Omit in the DEVICE2 the PIC name".
By the way, I test the DEVICE with upper and lower chars and always work.
Thanks again and greetings...
Ruben de la Pena V.

Bruce
- 27th September 2008, 23:44
You don't really need a new line for every config directive unless you want to place a
comment on each line explaining what each config statement is.

This works, and saves a boat-load of typing;

@ DEVICE PIC16F886, HS_OSC, PWRT_OFF, PROTECT_ON, WDT_OFF, LVP_OFF
@ DEVICE2 BOR21V

The @ DEVICE2 line doesn't work with or need the target PIC, and placing PIC16F886 on
each new line is just redundant information.

This also works, but why bother typing in the same thing over, and over again?

@ DEVICE PIC16F886, HS_OSC
@ DEVICE HS_OSC, PWRT_OFF
@ DEVICE HS_OSC, PWRT_OFF, PROTECT_ON
@ DEVICE HS_OSC, PWRT_OFF, PROTECT_ON, WDT_OFF
@ DEVICE HS_OSC, PWRT_OFF, PROTECT_ON, WDT_OFF, LVP_OFF
@ DEVICE2 BOR21V