PDA

View Full Version : PICKit2 - warning about configuration words



flotulopex
- 17th July 2008, 15:37
Hello,

I'm using a 16F88 PIC and every time I program it with my PICKit2, I get this warning:
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2744&stc=1&d=1216305160">
The programming will succeed anyway.

My prog starts like this:
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2746&stc=1&d=1216305400">

Something missing/wrong?

Acetronics2
- 17th July 2008, 17:08
Hi, Roger

Generally, you don't care about some fuses cause general use of Pic do not involve their use.

Each have a DEFAULT setting ( ON or OFF ... type of osc ....)

Here Pickit just warns you, coz' you didn't care with some ... that's all.

MPLAB show you the full window ... just look at those you didnt set or clear.

OR Open the MPLAB 16F88.inc file ( Not the PbP one !!! ) ... you'll find everything there !!!

Alain

Archangel
- 17th July 2008, 17:09
Hi Roger,
Just off the top of my head, doesn't microchip software use MPASM assembler? If so then you need MPASM formatted config statement, or possibly I am all wet :)

skimask
- 17th July 2008, 17:35
Hi Roger,
Just off the top of my head, doesn't microchip software use MPASM assembler? If so then you need MPASM formatted config statement, or possibly I am all wet :)
Yes, but the output of that assembler (be it PM or MPASM) that the PICKIT2 cares about is the .HEX file, which, for all practical purposes, should be identical to each other.

Archangel
- 18th July 2008, 03:44
Yes, but the output of that assembler (be it PM or MPASM) that the PICKIT2 cares about is the .HEX file, which, for all practical purposes, should be identical to each other.
See, I don't have a PICKIT2, and what he posted wasn't hex, therefore my MISTAKE was logical. Sorry Roger. Here is the configs avail. for 16f88:


_CONFIG1 EQU H'2007'
_CONFIG2 EQU H'2008'

;Configuration Byte 1 Options
_CP_ALL EQU H'1FFF'
_CP_OFF EQU H'3FFF'
_CCP1_RB0 EQU H'3FFF'
_CCP1_RB3 EQU H'2FFF'
_DEBUG_OFF EQU H'3FFF'
_DEBUG_ON EQU H'37FF'
_WRT_PROTECT_OFF EQU H'3FFF' ;No program memory write protection
_WRT_PROTECT_256 EQU H'3DFF' ;First 256 program memory protected
_WRT_PROTECT_2048 EQU H'3BFF' ;First 2048 program memory protected
_WRT_PROTECT_ALL EQU H'39FF' ;All of program memory protected
_CPD_ON EQU H'3EFF'
_CPD_OFF EQU H'3FFF'
_LVP_ON EQU H'3FFF'
_LVP_OFF EQU H'3F7F'
_BODEN_ON EQU H'3FFF'
_BODEN_OFF EQU H'3FBF'
_MCLR_ON EQU H'3FFF'
_MCLR_OFF EQU H'3FDF'
_PWRTE_OFF EQU H'3FFF'
_PWRTE_ON EQU H'3FF7'
_WDT_ON EQU H'3FFF'
_WDT_OFF EQU H'3FFB'
_EXTRC_CLKOUT EQU H'3FFF'
_EXTRC_IO EQU H'3FFE'
_INTRC_CLKOUT EQU H'3FFD'
_INTRC_IO EQU H'3FFC'
_EXTCLK EQU H'3FEF'
_HS_OSC EQU H'3FEE'
_XT_OSC EQU H'3FED'
_LP_OSC EQU H'3FEC'

;Configuration Byte 2 Options
_IESO_ON EQU H'3FFF'
_IESO_OFF EQU H'3FFD'
_FCMEN_ON EQU H'3FFF'
_FCMEN_OFF EQU H'3FFE'


I think errors are lines 16,22,23

skimask
- 18th July 2008, 04:07
See, I don't have a PICKIT2, and what he posted wasn't hex, therefore my MISTAKE was logical. Sorry Roger. Here is the configs avail. for 16f88:
No biggie... Most programmer software needs a HEX file to do the actual programming of the PIC itself. I really can't think of any other file type, other than a straight binary file, that a programmer would use.

If you look in the P16F88.INC file in your MPASM directory, you'll find all of the various config options listed near the end of that file.
OR...near the beginning of the M16F88.INC file in your PBP directory if your using the PM assembler rather than MPASM.

flotulopex
- 18th July 2008, 07:24
I tried to use the config settings as visible in post#5 (original MPASM .INC file). MCS will give me syntax errors when using some of those.

I.e., instead of "CCP1_RB0", I will have to use "CCPMX_OFF" (see code post #1 for more).

Then, I compared with the .DEV file found in MPASM too. Looks like this:

# <!-- XML:DCRs:Begin() -->
cfgbits (key=CONFIG addr=0x2007 unused=0x0)
field (key=OSC mask=0x13 desc="Oscillator")
setting (req=0x13 value=0x13 desc="EXTRC-OSC2 as Clock Out" freqmin=32000 freqmax=4000000)
setting (req=0x13 value=0x12 desc="EXTRC-OSC2 as RA6" freqmin=32000 freqmax=4000000)
setting (req=0x13 value=0x11 desc="INTRC-OSC2 as Clock Out")
setting (req=0x13 value=0x10 desc="INTRC-OSC2 as RA6")
setting (req=0x13 value=0x3 desc="EXTCLK as Port IO" freqmin=32000 freqmax=40000000)
setting (req=0x13 value=0x0 desc="LP" freqmin=32000 freqmax=200000)
setting (req=0x13 value=0x1 desc="XT" freqmin=200000 freqmax=4000000)
setting (req=0x13 value=0x2 desc="HS" freqmin=4000000 freqmax=25000000)
field (key=WDT mask=0x4 desc="Watchdog Timer" min=1)
setting (req=0x4 value=0x4 desc="On")
setting (req=0x4 value=0x0 desc="Off")
field (key=PUT mask=0x8 desc="Power Up Timer")
setting (req=0x8 value=0x8 desc="Off")
setting (req=0x8 value=0x0 desc="On")
field (key=MCLRE mask=0x20 desc="RA5/MCLR Pin Function Select")
setting (req=0x20 value=0x20 desc="MCLR")
setting (req=0x20 value=0x0 desc="RA5")
field (key=BODEN mask=0x40 desc="Brown Out Detect")
setting (req=0x40 value=0x40 desc="On")
setting (req=0x40 value=0x0 desc="Off")
field (key=LVP mask=0x80 desc="Low Voltage Program")
setting (req=0x80 value=0x80 desc="Enabled")
setting (req=0x80 value=0x0 desc="Disabled")
field (key=CPD mask=0x100 desc="Data EE Read Protect")
setting (req=0x100 value=0x100 desc="Off")
setting (req=0x100 value=0x0 desc="On")
field (key=WRT_ENABLE mask=0x600 desc="Flash Program Write")
setting (req=0x600 value=0x600 desc="Write Protect Off")
setting (req=0x600 value=0x400 desc="0000 to 00FF write protected")
setting (req=0x600 value=0x200 desc="0000 to 07FF write protected")
setting (req=0x600 value=0x0 desc="0000 to 0FFF write protected")
field (key=BACKBUG mask=0x800 desc="Background Debug" flags=h)
setting (req=0x800 value=0x800 desc="Disabled")
setting (req=0x800 value=0x0 desc="Enabled")
field (key=CCP1MUX mask=0x1000 desc="CCP1 Mux")
setting (req=0x1000 value=0x1000 desc="RB0")
setting (req=0x1000 value=0x0 desc="RB3")
field (key=CP mask=0x2000 desc="Code Protect")
setting (req=0x2000 value=0x2000 desc="Off")
checksum (type=0x0 protregion=0x0-0x0)
setting (req=0x2000 value=0x0 desc="All")
checksum (type=0x20 protregion=0x0-0xfff)
cfgbits (key=CONFIG2 addr=0x2008 unused=0x3ffc)
field (key=FCMEN mask=0x1 desc="Fail-Safe Clock Monitor Enable")
setting (req=0x1 value=0x1 desc="Enabled")
setting (req=0x1 value=0x0 desc="Disabled")
field (key=IESO mask=0x2 desc="Internal External Switch Over Mode")
setting (req=0x2 value=0x2 desc="Enabled")
setting (req=0x2 value=0x0 desc="Disabled")
# <!-- XML:DCRs:End() -->

Where's the truth?

I couldn't find any MCS file about those CONFIG settings syntax correspondances. Maybe the fish is here.

Acetronics2
- 18th July 2008, 09:08
Hi, Roger

With MPASM used ... you're to use MPASM syntax !
With PM used ... you're to use PM syntax !

That written ...

MPASM .INC files give you ALL the settings available ... in the MPASM syntax, of course !!!

... capito ???

and, first of all CCPMX_OFF doesn't exist ... you've to CHOOSE your output Pin ...

yes ... D.A.T.A.S.H.E.E.T. !!!

Dur, dur ...

Alain

flotulopex
- 18th July 2008, 15:29
MPASM .INC files give you ALL the settings available ... in the MPASM syntax, of course !!! ... capito ???¡Si Señor! I think I know that. So where can I find the correct syntax for MCS then??? Me parece qué esto es más difícil.

first of all CCPMX_OFF doesn't exist ... you've to CHOOSE your output Pin..Hereunder, I highlighted the parameters I replaced by the ones I use normally (in comment) and see what happens (error msg) when the program is compiled by MCS.

Ah?
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2753&stc=1&d=1216390341">
Oh!
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2754&stc=1&d=1216390341">
Hmmmm...
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2755&stc=1&d=1216390341">
As you can see, some "original" syntax from the MicroChip file won't be accepted in MCS. I understand MCS is not using "as is" all or part of the content of .INC files. Am I really wrong?

skimask
- 18th July 2008, 15:56
So where can I find the correct syntax for MCS then???
It's not so much the correct syntax for MCS, it's more the correct syntax for the compiler/assembler you are using.
If it's MPASM, the config registers are listed in that particular MCUs INC file in the MPASM directory near the end of the file (usually).
If it's PM, their listed in that particular MCUs INC file in the PBP INC directory near the beginning of the file (usually).

bcd
- 20th July 2008, 01:29
OK - first things first.

Are you compiling with MPASM or the PM assembler ? A look at the Compile and Program Options from the View menu in MCS.

Here is an example of a config line from a project that uses MPASM:
@ __CONFIG _CONFIG1H, _IESO_OFF_1H & _FCMEN_OFF_1H & _OSC_INTIO2_1H

I have also founds that the PicKit2 will complain about this if you do not define every single CONFIG register. I normally define what I know I need to set and leave the rest. It burns and runs fine.

there are a series of defaults in the .INC file in the PBP folder for each chip.

For the 16F87 it looks like :
<code>
;************************************************* ***************
;* 16F87.INC *
;* *
;* By : Leonard Zerman, Jeff Schmoyer *
;* Notice : Copyright (c) 2004 microEngineering Labs, Inc. *
;* All Rights Reserved *
;* Date : 01/07/04 *
;* Version : 2.45 *
;* Notes : *
;************************************************* ***************
NOLIST
ifdef PM_USED
LIST
include 'M16F87.INC' ; PM header
*** device pic16F87, hs_osc, wdt_on, lvp_off, protect_off
XALL
NOLIST
else
LIST
LIST p = 16F87, r = dec, w = -302
INCLUDE "P16F87.INC" ; MPASM Header
*** __config _CONFIG1, _HS_OSC & _WDT_ON & _LVP_OFF & _CP_OFF
NOLIST
endif
LIST

</code>

It have put *** to hi light the default the compiler will insert. Using PM the program will use the ones you specify in your code rather than the ones in the INC file. Using MPASM you will get warning about over-writing the contents of the CONFIG bits.

When I moved to MPASM I had to spent a bit of time working out what things were called as some of the names changed. Check out the MPASM INC files to workout what things are called.


bill

EDIT: Looking at you original post you are using PM. Just ignore the warnings - its just the PicKit2 being anal about making sure everything is defined.

flotulopex
- 21st July 2008, 21:24
I use PM.

Thanks for this clarification.

PICkit2 is really great and I was just wondering about those warning I don't get with other PICs.

botsmaker
- 31st July 2009, 06:51
I too sometimes have a problem with pickit2 recognizing the 16f88. It will state that the device is unsupported. It always has a problem with the hex file not having a complete configuration. I gave up using the 16F88 with pickit2.

Darrel Taylor
- 31st July 2009, 07:32
The missing CONFIG words are because the 16F88 has two CONFIG words.

When using PM, DEVICE sets CONFIG1 and DEVICE2 sets CONFIG2.

@ DEVICE HS_OSC, WDT_OFF, PWRT_ON ; etc
@ DEVICE2 FCMEN_OFF, IESO_OFF


I too sometimes have a problem with pickit2 recognizing the 16f88. It will state that the device is unsupported.
Hmmm, that's odd.
No idea for that one.
<br>

Dave
- 31st July 2009, 11:41
botsmaker, and others... Have any of you out there updated the OS for the pickit2? I havent had any problems with it programming 16F88 or any other pic's...

Dave Purola,
N8NTA

botsmaker
- 31st July 2009, 15:38
Just updated application software to 2.61 and updated OS to 2.32. I get the same response. It will recon the device when I connect it, then when I load the hex file I get the warning. "Device Error-hex file not loaded", "Unsupported part". I'm using micro studio and PBP.

botsmaker
- 31st July 2009, 15:43
This is the warning message I get from pickit2http://home.comcast.net/~botronics/pickit2warning.jpg

botsmaker
- 1st August 2009, 01:29
I gave up trying to program the 16f88 with the pickit2 application program. Just use the mplab ide and select pickit2 as the programmer. I was able to program the 16f88 just fine with MPLAB. I used the same ic in both cases, so the ic is ok. I don't know what the problem is, but I need to get back to work.

Archangel
- 1st August 2009, 06:17
This is the warning message I get from pickit2http://home.comcast.net/~botronics/pickit2warning.jpg

I have gotten that error too, and when it does so it usually sets code protection too!
The fine print in the pickit2 docs say to reselect the chip ( select another pic and then reselect the one you are using) and then write the chip without selecting a hex, then select your hex and write.

botsmaker
- 2nd August 2009, 01:48
I went back to using the pickit2 with the 16f88 and now it will program. Still get a "hex file not loaded error", but at the end of programming I get the green box.

The problem is intermittent. I got less failure when running power of the board instead of powering through the pickit2. In other words, it always programmed.

I did manage to build my own 4 digit meter with a 16f88 and PBP using some of the example code at MEL about driving led displays (http://www.melabs.com/resources/articles/ledart.htm). This meter will display from 0 to 100.0 volts if you use a rail to rail opamp instead of the LT1077 I got in it now. Below are links to drawing and code.
Hex (http://home.comcast.net/~botronics/volt3.HEX)
Code (http://home.comcast.net/~botronics/volt3.bas)
Drawing (http://home.comcast.net/~botronics/4digMultiboard.pdf)

mackrackit
- 2nd August 2009, 02:17
The problem is intermittent. I got less failure when running power of the board instead of powering through the pickit2. In other words, it always programmed.
Back when I was using a PIC Start I had to add a couple of capacitors across VDD-VSS or it would not program some of the 18Fs.

Maybe a similar problem???

botsmaker
- 2nd August 2009, 02:59
I added a photo of the meter at my profile album. I designed a pcb to make up the circuit and had Expresspcb make it. The board can be configured into a frequency counter or event counter. Just load a different program for a new function. Its a multipurpose board. You can also bring out the ports through a 16 pin ribbon connector instead of a 4 digit display.

mackrackit
- 2nd August 2009, 04:16
Looks like a useful piece of work! I like the dual function idea.

flotulopex
- 3rd August 2009, 08:23
DEVICE sets CONFIG1 and DEVICE2 sets CONFIG2.
Darrel,

Where a hell did you find this information? Come on, tell us, you're working for the NSA or ex-KGB people, no? :D

Anyway, thanks a lot!!!

Bruce
- 3rd August 2009, 14:16
Where a hell did you find this information?
It's explained in the PM assembler manual. PM.TXT.

Darrel Taylor
- 3rd August 2009, 19:30
Bruce knew where it was...


Come on, tell us, you're working for the NSA or ex-KGB people, no? :D

I'd tell you, but then I'd have to kill you. :eek:
<br>

flotulopex
- 4th August 2009, 14:01
Brrrrr!!!

Some freezing sweat drops fall along my back. Okay then, I better never ever ask this question again :D

NB: just a shame this info was not in some help file (MCS or PBP); would have been easier to find for me.