Hot!Strange debug problem with PIC16F1454

Author
MasBat1969
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2018/11/08 01:52:30
  • Location: 0
  • Status: offline
2018/11/08 09:22:46 (permalink)
0

Strange debug problem with PIC16F1454

Hello,
 
I'm developing a program using PIC16F1454 VDD=5V . I use Mplab X IDE V4.15 with XC8 V1.33.
For debugging I use ICD3 connected using RC0/RC1 lines. I was able to enter debug mode and do some debugging.
Then when I tried to modify the program I wasn'able to re-enter debug because of this error:

"Target Device ID (0x0) is an Invalid Device ID. Please check your connections to the Target Device."
 
After some test I found that if I erase the chip using IPE (I get the same error but ignore it) it is possible to program the chip and enter debug mode again using MPLAB IDE.
 
After erasing MPLAB reports correct Device ID:
"Connecting to MPLAB ICD 3...

Currently loaded firmware on ICD 3
Firmware Suite Version.....01.51.08
Firmware type..............Enhanced Midrange

Target voltage detected
Target device PIC16F1454 found.
Device ID Revision = 1006 "
 
I tried several times this beaviour is repetable.
 
Very strange. Any ideas?
 
Thank you.
#1

6 Replies Related Threads

    Jim Nickerson
    User 452
    • Total Posts : 5847
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: online
    Re: Strange debug problem with PIC16F1454 2018/11/09 10:19:15 (permalink)
    +1 (1)
    I wonder what value you have set in CONFIG2 ?
    #2
    MasBat1969
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2018/11/08 01:52:30
    • Location: 0
    • Status: offline
    Re: Strange debug problem with PIC16F1454 2018/11/12 00:42:29 (permalink)
    0
    Hi,
    I used MCC to configure the chip, here the setup:
     
    // CONFIG1
    #pragma config FOSC = INTOSC    // Oscillator Selection Bits->INTOSC oscillator: I/O function on CLKIN pin
    #pragma config WDTE = ON    // Watchdog Timer Enable->WDT enabled
    #pragma config PWRTE = OFF    // Power-up Timer Enable->PWRT disabled
    #pragma config MCLRE = ON    // MCLR Pin Function Select->MCLR/VPP pin function is MCLR
    #pragma config CP = OFF    // Flash Program Memory Code Protection->Program memory code protection is disabled
    #pragma config BOREN = ON    // Brown-out Reset Enable->Brown-out Reset enabled
    #pragma config CLKOUTEN = OFF    // Clock Out Enable->CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin
    #pragma config IESO = ON    // Internal/External Switchover Mode->Internal/External Switchover Mode is enabled
    #pragma config FCMEN = ON    // Fail-Safe Clock Monitor Enable->Fail-Safe Clock Monitor is enabled

    // CONFIG2
    #pragma config WRT = OFF    // Flash Memory Self-Write Protection->Write protection off
    #pragma config CPUDIV = CLKDIV2    // CPU System Clock Selection Bit->CPU system clock divided by 2
    #pragma config USBLSCLK = 48MHz    // USB Low SPeed Clock Selection bit->System clock expects 48 MHz, FS/LS USB CLKENs divide-by is set to 8.
    #pragma config PLLMULT = 4x    // PLL Multipler Selection Bit->4x Output Frequency Selected
    #pragma config PLLEN = ENABLED    // PLL Enable Bit->3x or 4x PLL Enabled
    #pragma config STVREN = ON    // Stack Overflow/Underflow Reset Enable->Stack Overflow or Underflow will cause a Reset
    #pragma config BORV = LO    // Brown-out Reset Voltage Selection->Brown-out Reset Voltage (Vbor), low trip point selected.
    #pragma config LPBOR = OFF    // Low-Power Brown Out Reset->Low-Power BOR is disabled
    #pragma config LVP = OFF    // Low-Voltage Programming Enable->High-voltage on MCLR/VPP must be used for programming


    Regards.
    #3
    qhb
    Superb Member
    • Total Posts : 9681
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: Strange debug problem with PIC16F1454 2018/11/12 01:10:34 (permalink)
    +1 (1)
    Does it behave any differently of you leave LVP on?
     
    #4
    MasBat1969
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2018/11/08 01:52:30
    • Location: 0
    • Status: offline
    Re: Strange debug problem with PIC16F1454 2018/11/12 04:20:05 (permalink)
    0
    Hello,
    I didn't try it. I 'll try again as soon as possible and reply.
    #5
    MasBat1969
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2018/11/08 01:52:30
    • Location: 0
    • Status: offline
    Re: Strange debug problem with PIC16F1454 2018/11/13 09:50:11 (permalink)
    0
    hello,
    I tried with LVP OFF but I get the same results....
    #6
    MasBat1969
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2018/11/08 01:52:30
    • Location: 0
    • Status: offline
    Re: Strange debug problem with PIC16F1454 2018/11/14 03:16:28 (permalink)
    0
    I meant with LVP ON!
    Sorry.
    #7
    Jump to:
    © 2019 APG vNext Commercial Version 4.5