PDA

View Full Version : 16F1827 Changed INC File by Microchip?



Ioannis
- 11th May 2013, 11:10
If anyone has still an older installation of MPLAB (say 8.5x) I'd like a copy of the P16F1827.inc file.

I suspect that Microchip has changed the file without warning.

I had a configuration line working just fine like this:

#config
__config _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_ON & _MCLRE_ON & _CP_ON & _CPD_OFF & _BOREN_ON & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF
__config _CONFIG2, _WRT_OFF & _PLLEN_ON & _LVP_OFF & _STVREN_OFF & _BORV_25
#endconfig

But a few days ago, I updated to MPLAB 8.91 and the red part does not compile. Just because there is no reference in the *.inc file now.

Just curious about it.

Ioannis

HenrikOlsson
- 11th May 2013, 11:56
Hi Ioannis,
I can't help you with the file as I'm on v8.85 myself but why not change your CONFIG to & _BORV_HI? That should be the same thing as _BORV_25 as far as I can see. Or if you "must" stick with your current syntax add

_BORV_25 EQU H'FBFF' ; Brown-out Reset Voltage (Vbor), high trip point selected.
to the current .INC file? Doing the later will of course be "reversed" the next time you update.

/Henrik.

Sherbrook
- 11th May 2013, 14:03
This is from version 8.73a
Phil


;----- CONFIG2 Options --------------------------------------------------
_WRT_ALL EQU H'FFFC' ; 000h to FFFh write protected, no addresses may be modified by EECON control
_WRT_HALF EQU H'FFFD' ; 000h to 7FFh write protected, 800h to FFFh may be modified by EECON control
_WRT_BOOT EQU H'FFFE' ; 000h to 1FFh write protected, 200h to FFFh may be modified by EECON control
_WRT_OFF EQU H'FFFF' ; Write protection off

_PLLEN_OFF EQU H'FEFF' ; 4x PLL disabled
_PLLEN_ON EQU H'FFFF' ; 4x PLL enabled

_STVREN_OFF EQU H'FDFF' ; Stack Overflow or Underflow will not cause a Reset
_STVREN_ON EQU H'FFFF' ; Stack Overflow or Underflow will cause a Reset

_BORV_25 EQU H'FBFF' ; Brown-out Reset Voltage (VBOR) set to 2.5 V
_BORV_19 EQU H'FFFF' ; Brown-out Reset Voltage (VBOR) set to 1.9 V

_LVP_OFF EQU H'DFFF' ; High-voltage on MCLR/VPP must be used for programming
_LVP_ON EQU H'FFFF' ; Low-voltage programming enabled

Ioannis
- 11th May 2013, 14:29
Thanks both for the replies.

OK, now I can confirm that I am not hallucinated. I was sure that my file compiled fine before.

Now as Phil confirmed that specific line is omitted from the new version of the MPLAB 8.91.

Henrik, I have removed the & _BORV_25 from my configuration and all are fine, as I am sure, not specifing it is the same as having the old _BORV_25.

Just was annoyed by this things Microchip is doing now and then.

Ioannis

HenrikOlsson
- 11th May 2013, 15:51
Hi,
Yes, I'd assume (which is NEVER a good thing but I can't actually find it in the datasheet) that all CONFIG bits are zero by default so since the HI threshold requires the BORV bit to be zero simply not setting it would be the same as specifically clearing it. Personally I'd change my CONFIG to match the new name, ie BORV_HI instead of BORV_25.

I suspect Microchip found out that the thresholds may not have been as close to 1.9V and 2.5V to warrant having the voltage as part of the the constant names so they changed it to high and low instead. Or it might have caused users to assume (see, never a good a thing) that they could set the threshold to any arbitrary voltage by simply changing 19 to 33 or whatever - I don't know.

Anyway, glad you're back up and running. I'm currently playing with a 16F1825 for the first time, what a nice, cheap little chip it is.

/Henrik.

Darrel Taylor
- 11th May 2013, 17:18
Just like other flash memory in the chip, the config bits are all 1's when the chip is erased.
By not putting a BORV option in the code, it defaults to 1.9V.

Just change it to _BORV_HI

Ioannis
- 11th May 2013, 18:18
OK, thanks alot.

I still don't like that kind of surprises without warning.

Anyway, yes these chips are great! And they work from 1.8 to 5.5 Volts! Incredible!

And a lots of peripherals. I love them.

Ioannis