• AVR Freaks

Hot!Unable to debug PIC16LF18323 with PICkit3 using MPLABX

Author
Oooh_nice_shed
New Member
  • Total Posts : 7
  • Reward points : 0
  • Joined: 2019/04/10 10:04:20
  • Location: 0
  • Status: offline
2019/04/14 11:59:07 (permalink)
0

Unable to debug PIC16LF18323 with PICkit3 using MPLABX

Hi All,
I'm attempting to debug a PIC16LF18323 in MPLABX without success, repeatedly getting the following messages:
 
In the PICkit 3 dialogue tab:
"Programming/Verify complete
The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding. The most common causes for this failure are oscillator and/or PGC/PGD settings."


and in the Debugger Console dialog tab:
"Launching
Programming target
Failed to program the target device
The debugger could not be started.  Terminating debug session.
User program finished"
 
I've done a lot of forum trawling and re-read both the device datasheet and the document "PICkit™ 3 In-Circuit Debugger/Programmer User’s Guide For MPLAB® X IDE" looking for clues. I'm running out of things to try an now I'm a bit stumped. Other aspects of this which are/may be significant are as follows:
 
1.  Target operating voltage is 2.0V, power is supplied externally and the PICkit3 is configured accordingly.
2.  PICkit3 is connected to the PC with the standard short USB cable without any intervening hub.
3.  PICkit3 is connected to target with a short (~100mm) ribbon cable and short (~10mm) PCB tracks.
4.  MCLR, ICSPDAT and ICSPCLK pins on the PIC are not connected to anything other than the PICkit3.
5.  MPLAB is able to program code into the PIC and the PIC is able to execute the code correctly when not attempting to use debug mode.
6.  The PICkit is a late build standard and so the engineering technical note ETN-32 (PICkit 3 Operation at Low Voltage - Modification) does not apply. Just to be sure I've checked the internal components in the PICkit3.
7.  The following are disabled in configuration bits: watchdog, program memory protection, data memory protection, low voltage programming, background debugger (also tried debugger setting enabled - no joy).
8.  Configuration bits have been programmed using __CONFIG directives using the text strings generated by MPLAB. The .lst file generated by MPLAB shows the correct config word values at the correct addresses.
9.  System clock is HFINTOSC. Problem exists at all frequencies tried (4MHz, 8MHz, 16MHz).
10.  Same problem occurs with multiple new PICs.
11.  All connections are robust (ie no intermittent connections).
 
Any assistance would be gratefully received.
Thanks.
post edited by Oooh_nice_shed - 2019/04/14 12:01:16
#1

12 Replies Related Threads

    qhb
    Superb Member
    • Total Posts : 9979
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: online
    Re: Unable to debug PIC16LF18323 with PICkit3 using MPLABX 2019/04/14 13:51:32 (permalink)
    0
    It would be more reliable to actually show all your config settings rather than just describe them.
    Do you have the brown out reset enabled?
     
    #2
    Oooh_nice_shed
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2019/04/10 10:04:20
    • Location: 0
    • Status: offline
    Re: Unable to debug PIC16LF18323 with PICkit3 using MPLABX 2019/04/14 14:13:52 (permalink)
    0
    Thanks for the reply qhb,
     
    Config settings:
     
                          00008 ;
                          00009 ; CONFIG1
                          00010 ; __config 0x1FEC
    8007   1FEC           00011  __CONFIG _CONFIG1, _FEXTOSC_OFF & _RSTOSC_HFINT1 & _CLKOUTEN_OFF & _CSWEN_ON & _FCMEN_OFF
                          00012 ; CONFIG2
                          00013 ; __config 0x2733
    8008   2733           00014  __CONFIG _CONFIG2, _MCLRE_ON & _PWRTE_OFF & _WDTE_OFF & _LPBOREN_OFF & _BOREN_OFF & _BORV_LOW & _PPS1WA
                                Y_OFF & _STVREN_OFF & _DEBUG_OFF
                          00015 ; CONFIG3
                          00016 ; __config 0x1FFF
    8009   1FFF           00017  __CONFIG _CONFIG3, _WRT_OFF & _LVP_OFF
                          00018 ; CONFIG4
                          00019 ; __config 0x3FFF
    800A   3FFF           00020  __CONFIG _CONFIG4, _CP_OFF & _CPD_OFF
                          00021


    Brownout currently disabled and no change has been made to it since the code was running correctly on the target without debug (with target supplied at 2.0 volts).
    #3
    Ken_Pergola
    Super Member
    • Total Posts : 2157
    • Reward points : 0
    • Joined: 2003/11/07 12:48:48
    • Status: offline
    Re: Unable to debug PIC16LF18323 with PICkit3 using MPLABX 2019/04/14 17:38:50 (permalink)
    0
    Oooh_nice_shed
    ...I'm attempting to debug a PIC16LF18323 in MPLABX without success...



    Hello Dave,
     
    1) What version of MPLAB X IDE are you using?
    This is critical in terms of reproducing this issue.
     
    2) As a quick data point, do you have the liberty to raise Vdd on the target board (to say, 3.3 V) without damage to surrounding circuitry/components? I am not sure if you have a 2.0 V voltage regulator or not.
     
    3) Is this the first time you are having difficulty in debugging this part or was debugging  previously working fine and now you are in this state of not being able to debug?
     
    Best regards,
     
    Ken
     
    #4
    Oooh_nice_shed
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2019/04/10 10:04:20
    • Location: 0
    • Status: offline
    Re: Unable to debug PIC16LF18323 with PICkit3 using MPLABX 2019/04/14 23:47:20 (permalink)
    0
    Thanks for your reply Ken.
     
    This is a recent install of MPLAB - it reports the version as 5.15.
     
    Raising Vdd above 2.0V will probably be possible with a little careful work and after a bit of thinking (I'll need to put in place a couple of other hardware tweaks to get things running correctly).
     
    I have never debugged successfully with this part before. It worked like a dream through the usual initial steps of coaxing it into life and then systematically getting the various peripheral parts of the device to operate as required (using relatively simple bits of test code programmed without debug), until...... I attempted to use one of the comparators. I haven't made any progress at all with getting the comparator to do anything useful and so I thought I'd start to use debug.
     
    Thanks in advance and best regards.
    #5
    Ken_Pergola
    Super Member
    • Total Posts : 2157
    • Reward points : 0
    • Joined: 2003/11/07 12:48:48
    • Status: offline
    Re: Unable to debug PIC16LF18323 with PICkit3 using MPLABX 2019/04/15 00:39:10 (permalink)
    0
    Oooh_nice_shed
    ...Raising Vdd above 2.0V will probably be possible with a little careful work and after a bit of thinking (I'll need to put in place a couple of other hardware tweaks to get things running correctly)...



    Hi Dave,
     
    Thanks for all the details.
     
    I only suggested raising Vdd as a quick test thinking you might have a variable supply but based on your response I would abandon my suggestion because the part should be able to debug down to Vdd minimum up to 16 MHz Fosc.
     
    We will have to take a look to see if we can replicate this issue with MPLAB X IDE v5.15 and the MPLAB PICkit 3 tool.
     
    I'll try my best to report back here when I have something substantive to report back to you.
     
    Best regards,
     
    Ken
     
     
    #6
    Oooh_nice_shed
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2019/04/10 10:04:20
    • Location: 0
    • Status: offline
    Re: Unable to debug PIC16LF18323 with PICkit3 using MPLABX 2019/04/15 11:50:26 (permalink)
    0
    Hi Ken (and any other interested folk),
     
    Some progress to report.......
     
    I have now completed some various tests with the target operating with supply voltages above the 2.0V which this application will ultimately require. I can report the following findings:
     
    1.  If Vdd has always been 2.0V: Debug will not work.
    2.  If Vdd is increased to 3.3V: Debug works, apparently correctly.
    3.  If Vdd is reduced from 3.3V to 2.0V during debug operation: Debug continues to work for an indeterminate period of pehaps 30-60 seconds before failing.
    4.  The threshold of steady-state Vdd below which debug does not work is somewhere in the region of 2.0V to 3.3V. It appears to be variable, dependant amongst other factors upon the rate of fall of Vdd, and there seems to be an indeterminate delay (10-20 seconds??) before debug stops working.
     
    In short, it appears to me that there is a range of Vdd values where correct debug operation is not guaranteed and below this range debug does not work at all. I thought that I had previously discovered from published data that operation of PICkit3 debug should be correct over the entire Vdd range of the PIC I'm using but perhaps I've missed something.
     
    I now have a PICkit4 on order in the hope of improved performance.
     
    If what I've discovered is not as manufacturer-specified, is there some official Microchip channel where I should report my findings?
     
    Ken: thanks for your input and apologies if this has wasted your time. Of course if you've discovered anything which doesn't agree with my findings then I'd be interested to learn of it.
    #7
    qhb
    Superb Member
    • Total Posts : 9979
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: online
    Re: Unable to debug PIC16LF18323 with PICkit3 using MPLABX 2019/04/15 14:28:31 (permalink)
    +1 (1)
    Oooh_nice_shed
    ..
    If what I've discovered is not as manufacturer-specified, is there some official Microchip channel where I should report my findings?
     

    A "Support Ticket" via www.microchip.com/support
     
    #8
    Ken_Pergola
    Super Member
    • Total Posts : 2157
    • Reward points : 0
    • Joined: 2003/11/07 12:48:48
    • Status: offline
    Re: Unable to debug PIC16LF18323 with PICkit3 using MPLABX 2019/04/15 23:33:13 (permalink)
    0
    Hello Dave,
     
    Could you let me know if you are able to successfully enter debug mode and single-step through this minimalist project (attached)?
     
    I apologize I was not able to try to reproduce your issue today. I will do my best to try tomorrow.
     
    Best regards,
     
    Ken
    post edited by Ken_Pergola - 2019/04/15 23:48:02

    Attachment(s)

    Attachments are not available: Download requirements not met
    #9
    Howard Long
    Super Member
    • Total Posts : 663
    • Reward points : 0
    • Joined: 2005/04/04 08:50:32
    • Status: offline
    Re: Unable to debug PIC16LF18323 with PICkit3 using MPLABX 2019/04/16 00:44:00 (permalink)
    0
    Typically when I debug low voltage PIC16LF targets including the PIC16LF183xx series, I have to raise the voltage during programming. Once programmed, I can reduce the voltage again while debugging.
     
    Please see page 21 in the programming memory specification 40001738D.pdf.
     
    For a bulk erase, as used when programming these devices, Vddmin is 2,7V.
     
    Also, please see this subnote on the same page: "Bulk-erased devices default to brown-out enabled. VDDMIN is 2.85 volts when performing low-voltage programming on a bulk-erased device, to ensure that the device is not held in Brown-out Reset."
    #10
    Oooh_nice_shed
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2019/04/10 10:04:20
    • Location: 0
    • Status: offline
    Re: Unable to debug PIC16LF18323 with PICkit3 using MPLABX 2019/04/16 12:01:14 (permalink)
    0
    Thanks all for the assistance.
     
    Ken, your minimalist project behaves exatly as mine does. At Vdd=2.0V with a PICkit3 the target programs OK but fails to debug - all as I initially described. Increasing Vdd to 3.0V allows debug to work OK. Somewhere between 2.0V and 3.0V there is a woolly zone where debug sometimes works, but apparently with some time-related aspect which I haven't managed to quantify.
     
    Howard, your description of increasing Vdd for programming then debugging after decreasing it again is consistent with what I've been able to achieve.
     
    Today I took delivery of a PICkit4 in the hope that the low voltage debug aspect would improve. In fact things are worse in that it is not possible to program or debug at Vdd=2.0V (PK3 will program at 2.0V but not debug). However, with PK4 and 2.0V, MPLAB actually reports that Vdd=2.0V has been detected and that programming may not be possible and suggests raising Vdd to 2.3V. Sure enough, increasing Vdd to 2.3V achieves robust programming and debugging.
     
    Ken, you suggestion of ticking the "Use high voltage programming mode entry" in PICkit3 Program Options appears to make no difference. It initially wasn't ticked so I ticked it but then couldn't detect any change in behaviour.
     
    So..... my lesson here seems to be to make provision for powering a target with a voltage of at least 2.3V during code development.
     
    As a footnote, the comparator issue I was having which prompted me to start using debug is now solved - cured within about 2 minutes of getting debug to work - Hurrah.
     
    Thanks again.
     
    #11
    Ken_Pergola
    Super Member
    • Total Posts : 2157
    • Reward points : 0
    • Joined: 2003/11/07 12:48:48
    • Status: offline
    Re: Unable to debug PIC16LF18323 with PICkit3 using MPLABX 2019/04/16 18:23:42 (permalink)
    0
    Hello Dave,
     
    I found a PIC16LF18323 revision A2 part and was able to debug the minimalist project down to 2.2 V (w.r.t. Vss) with a PICkit 3 tool (Assy# ending with an revision '-R7' suffix).
     
    Bear in mind with your project/product that if you ever enable code protection in the future, the part will need 2.7 V minimum (w.r.t. Vss) supplied to it to reverse code protection with a bulk erase in high-voltage test mode.
     
    Best regards,
     
    Ken
     
    P.S. Sorry about the minimalist project using a PIC16F18323 part -- I locally changed it to PIC16LF18323 for the test above.
     
    #12
    Oooh_nice_shed
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2019/04/10 10:04:20
    • Location: 0
    • Status: offline
    Re: Unable to debug PIC16LF18323 with PICkit3 using MPLABX 2019/04/17 00:45:48 (permalink)
    +1 (1)
    Thanks again Ken.
     
    For as long as this project is initially on the bench for development purposes then I can make provision for elevated Vdd. When out in the wild, we'll probably invoke code protection but will also possibly need provision for code updates. This is my next challenge - how to occasionally circumvent the power supply arrangement in a final product having a tricky power supply and far too much stuff crammed into a space the size of of a very small thing on a really tiny day and constrained by all those things which the sales guys have demanded and which cause engineers to hang their heads in despair. I like a challenge!
    #13
    Jump to:
    © 2019 APG vNext Commercial Version 4.5