2014-07-10 5 views
0

PIC24F04KA200에서 코드를 디버깅하려고합니다. 하지만 디버깅을 시작하면 메시지가 나타납니다. 대상 장치가 디버깅 할 준비가되지 않았습니다. 진행하기 전에 구성 비트 설정을 확인하고 장치를 프로그래밍하십시오. 이 오류의 가장 일반적인 원인은 오실레이터 및/또는 PGC/PGD 설정입니다.PIC24 PicKit3을 디버그 할 수 없습니다.

PicKit3 사용 설명서를 읽었지만 답변을 찾을 수 없습니다. PicKit은 PGC2 및 PGD2 핀에 연결됩니다. 내 구성 비트 :

/* 
* File: config.h 
* 
*/ 

#ifndef CONFIG_H 
#define CONFIG_H 

#ifdef __cplusplus 
extern "C" { 
#endif 

#ifdef __cplusplus 
} 
#endif 

#endif /* CONFIG_H */ 


#include <p24F04KA200.h> 


// PIC24F04KA200 Configuration Bit Settings 

// 'C' source line config statements 

#include <xc.h> 

// FBS 

// FGS 
#pragma config GWRP = OFF    // General Segment Code Flash Write Protection bit (General segment may be written) 
#pragma config GCP = OFF    // General Segment Code Flash Code Protection bit (No protection) 

// FOSCSEL 
#pragma config FNOSC = FRCDIV   // Oscillator Select (8 MHz FRC oscillator with divide-by-N (FRCDIV)) 
#pragma config IESO = OFF    // Internal External Switch Over bit (Internal External Switchover mode disabled (Two-Speed Start-up disabled)) 

// FOSC 
#pragma config POSCMOD = NONE   // Primary Oscillator Configuration bits (Primary oscillator disabled) 
#pragma config OSCIOFNC = ON   // CLKO Enable Configuration bit (CLKO output disabled) 
#pragma config POSCFREQ = MS   // Primary Oscillator Frequency Range Configuration bits (Primary oscillator/external clock input frequency between 100 kHz and 8 MHz) 
#pragma config SOSCSEL = SOSCHP   // SOSC Power Selection Configuration bits (Secondary oscillator configured for high-power operation) 
#pragma config FCKSM = CSECMD   // Clock Switching and Monitor Selection (Clock switching is enabled, Fail-Safe Clock Monitor is disabled) 

// FWDT 
#pragma config WDTPS = PS32768   // Watchdog Timer Postscale Select bits (1:32,768) 
#pragma config FWPSA = PR128   // WDT Prescaler (WDT prescaler ratio of 1:128) 
#pragma config WINDIS = OFF    // Windowed Watchdog Timer Disable bit (Standard WDT selected; windowed WDT disabled) 
#pragma config FWDTEN = OFF    // Watchdog Timer Enable bit (WDT disabled (control is placed on the SWDTEN bit)) 

// FPOR 
#pragma config BOREN = BOR0    // Brown-out Reset Enable bits (Brown-out Reset disabled in hardware; SBOREN bit disabled) 
#pragma config PWRTEN = OFF    // Power-up Timer Enable bit (PWRT disabled) 
#pragma config BORV = LPBOR    // Brown-out Reset Voltage bits (Low-Power Brown-out reset occurs around 2.0V) 
#pragma config MCLRE = ON    // MCLR Pin Enable bit (MCLR pin enabled; RA5 input pin disabled) 

// FICD 
#pragma config ICS = PGx2    // Reserved (PGC2/PGD2 are used for programming the device) 

// FDS 
#pragma config DSWDTPS = DSWDTPSF  // Deep Sleep Watchdog Timer Postscale Select bits (1:2,147,483,648 (25.7 Days)) 
#pragma config DSLPBOR = OFF   // Deep Sleep Zero-Power BOR Enable bit (Deep Sleep BOR disabled in Deep Sleep) 
#pragma config DSWDTEN = OFF   // Deep Sleep Watchdog Timer Enable bit (DSWDT disabled) 

그리고 내 주요 파일 :

/* 
* File: main.c 
*/ 
#include "config.h" 
#include <stdio.h> 
#include <stdlib.h> 


int main(int argc, char** argv) 
{ 
    while(1) 
    { 
     ; 
    } 
} 

프로세서가 실행 중입니다. blinkerLed 프로그램을 실행하고 있습니다. 제안이있는 사람이 있습니까?

답변

0

마이크로 컨트롤러에는 디버깅 기능이 내장되어 있지 않습니다. 이 UC 용 응용 프로그램을 디버깅하려면 에뮬레이터 또는 시뮬레이터 (필자가 선호하지는 않지만 때때로 바인드에서 벗어날 수 있음)를 사용해야합니다. 마이크로 칩 웹 사이트에서

:.

배터리 애플리케이션 을위한 나노 와트 XLP 기술의 이상적인 특징 (에뮬레이션 및 디버그 지원 - AC244028에 대한 PIC24F16KA102 프로세서 증축 팩을 사용하십시오 을이 MCU에는없는 온칩 디버그 기능)