View previous topic :: View next topic |
Author |
Message |
Gavin_Minion
Joined: 18 Apr 2012 Posts: 10
|
Verification error on programming |
Posted: Fri Nov 09, 2012 8:35 am |
|
|
I am using an ICD-U40 and version 4.122 of the PCW software.
When I enable the debugger with a new target 18F8722 device (i.e. brand new board), the code loads, but then reports a verification error.
The verification results window highlights configuration word 4 in red on the left (Actual 0004, Expected 0000)
There is also a fuse highlighted on the right which I believe is from config word 4 (Actual ' ', Expected RESERVED)
Now, from the PIC18F8722 datasheet, this fuse should be the LVP bit (set 1 to enable low voltage programming). I have this bit set to 0 in my code (#FUSE NOLVP) and it is already verified in the same fuse window (Actual NOLVP, Expected NOLVP) whereas the fuse listed in red is reserved.
This does not make sense.
Furthermore, when I use CCSLOAD to try and program the device, I get the same error, but there are no fuses highlighted in red on the right of the verification resulst window. When I use CCSLOAD to try and clear the LVP fuse, it does not work (the fuse remains set.)
To summarise, it appears that the LVP fuse cannot be cleared in my application. But the debugger will not work when the LVP fuse is set - what is going on?
Regards |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Fri Nov 09, 2012 9:19 am |
|
|
Have you tried the 'erase target chip' button?.
LVP, like the protection fuses, cannot be cleared by a simple block erase. Only a full chip erase will clear it. The programmer is meant to 'know' this, but worth trying a manual erase and seeing what happens.
Best Wishes |
|
|
Gavin_Minion
Joined: 18 Apr 2012 Posts: 10
|
|
Posted: Fri Nov 09, 2012 9:34 am |
|
|
Hi Ttelmah,
Yes, I have tried this several times. I did wonder if the erase chip was doing what it was supposed to do as I can read back the erased chip and the fuse is still set.
Am I right in thinking that, as the fuse is set by default then this is the correct behaviour?
I would not be concerned, but the debugger does not seem to work with the LVP fuse programmed (although it should not make a difference as far as I can tell?)
Regards. |
|
|
Gavin_Minion
Joined: 18 Apr 2012 Posts: 10
|
|
Posted: Fri Nov 09, 2012 10:05 am |
|
|
Ok, I have found the issue.
There was a short across a diode which linked the reset line (from an external reset generator.) to the MCLR. This prevented the MCLR line going above about 6v.
The chip could be programmed and read back because the PIC would still go into program mode with MCLR at 6v. But because the LVP bit would not clear, the debugger would throw up an error.
I am still not sure why the LVP bit needs to be cleared for the debugger to work, but it does!
Many thanks. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Fri Nov 09, 2012 3:38 pm |
|
|
Effectively it was doing LVP (since Vpp couldn't go to the full programming voltage), and full voltage programming is needed to erase the LVP fuse.
Fun.....
Best Wishes |
|
|
|