3
\$\begingroup\$

I am trying to debug code on PIC16F677 using MPLAB X IDE (v3.10) and Pickit 3 and result is this message - 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.

Code looks like this.

#include <xc.h>
#include <stdbool.h>
#pragma config FOSC = INTRCIO
#pragma config WDTE = OFF // Watchdog Timer Enable bit
#pragma config PWRTE = OFF // Power-up Timer Enable bit
#pragma config MCLRE = OFF // MCLR Pin Function Select bit
#pragma config CP = OFF // Code Protection bit
#pragma config CPD = OFF // Data Code Protection bit
#pragma config BOREN = ON // Brown-out Reset Selection bits
#pragma config IESO = OFF // Internal External Switchover bit
#pragma config FCMEN = ON // Fail-Safe Clock Monitor Enabled bit
#define _XTAL_FREQ 8000000
void main(void)
{
 IRCF0 = 7;
 IRCF1 = 7;
 IRCF2 = 7;
 HTS = 1;
 SCS = 1;
 while (true)
 {
 }
}

I am not sure about those IRCF. Just tried out some things. I have tried without configuration bits in main function as well.

Do I need external oscillator for this? This poster http://ww1.microchip.com/downloads/en/DeviceDoc/50002010B.pdf says - Target device must be running with an oscillator for the debugger to function as a debugger. What does that even mean?

asked Nov 3, 2015 at 0:32
\$\endgroup\$
1
  • \$\begingroup\$ Is there anything connected to pins RA0 and RA1 besides the programmer? \$\endgroup\$ Commented Nov 3, 2015 at 0:44

1 Answer 1

1
\$\begingroup\$

This micro doesn't contain debug executive inside, you can only program it via PGC/PGD, not debug. In order to debug you need a special part AKA debug header, see here for exact part number -> http://ww1.microchip.com/downloads/en/DeviceDoc/51292R.pdf

answered Nov 3, 2015 at 2:05
\$\endgroup\$
1
  • \$\begingroup\$ My impression was that PICkit is all I need. \$\endgroup\$ Commented Nov 3, 2015 at 8:50

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.