应使用哪些配置位来调试PIC16F1947?

时间:2011-03-14 08:02:21

标签: c configuration microcontroller pic microchip

我用PIC16F1947配置位。我是PIC编程的新手,所以请详细解答。

我有以下设置:

  • MPLAB 8.46
  • MPLAB ICD 3
  • HI-TECH C编译器9.81

PIC16F1947 PIM(插入模块)插在PICDEM LCD 2演示板上。电路板由3 V电池供电,J15跳线根据手册连接(1-3连接,J15连接2-4)。该项目编译为 debug build

以下是使用的配置位:

// Configuration word 1
__CONFIG(   FOSC_INTOSC &  // INTOSC oscillator: I/O function on CLKIN pin
            WDTE_OFF &      // WDT disabled
            PWRTE_OFF &     // PWRT disabled
            MCLRE_OFF &     // MCLR/VPP pin function is digital input
            CP_OFF &        // Program memory code protection is disabled
            CPD_OFF &       // Data memory code protection is disabled
            BOREN_OFF &     // Brown-out Reset disabled
            CLKOUTEN_OFF &  // CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin
            IESO_OFF &      // Internal/External Switchover mode is disabled
            FCMEN_OFF       // Fail-Safe Clock Monitor is disabled
);

// Configuration word 2
__CONFIG(   WRT_OFF &      // Write protection off
            VCAPEN_OFF &    // VCAP pin functionality is disabled
            PLLEN_OFF &     // 4x PLL disabled
            STVREN_OFF &    // Stack Overflow or Underflow will not cause a Reset
            BORV_19 &       // Brown-out Reset Voltage (VBOR) set to 1.9 V
            LVP_OFF         // High-voltage on MCLR/VPP must be used for programming
);

可以通过MPLAB编程(烧录固件) micro。但是当我尝试Debugger > Run时,输出窗口显示以下错误:

  

ICD3Err0040:目标设备不是   准备调试。请检查你的   配置位设置和程序   继续之前设备。

我查看了有关ICD3Err0040的文档,但在我看来一切都还好。

我做错了什么?请帮忙。

3 个答案:

答案 0 :(得分:0)

我已将MPLAB IDE从8.46升级到8.63,调试开始工作!!!

可能是他们遇到过以前版本的问题。

答案 1 :(得分:0)

IN CONFIG WORD 1 WRITE: - ICS_PGx2应该工作

答案 2 :(得分:0)

Debugger>Program

调用上面显示的msg框。 单击[ok],IDE将相应地修改配置位以允许调试。

对于那些看不到上面图片的人。 必须禁用单电源ICSP使能位 必须禁止看门狗定时器使能位

相关问题