Microchip
直播中

梅宁琛

8年用户 246经验值
私信 关注
[问答]

用PicKit3调试dsPIC33FJ32MC304有问题吗?

DSPIC3FJ32 MC304支持用PICtiT3调试(单步执行、放置断点等)吗?看来我可以使用PACIT3作为程序员来编程发布可执行文件——这是不起作用的,并且我不能使用PICTIT3作为调试器来调试调试可执行文件并进行任何调试。我得到了各种错误和怪异的行为,这似乎暗示着无法与设备通信。有时我们可以擦除设备,但我有一种感觉,皮卡并没有真正检查设备是否被擦除。它只报告它被擦除成功。有时它被卡住了。连接到皮克特3……“而且它永远不会到达任何地方。PICIT3状态灯是红色的。有时它试图编程,但回来说臭名昭著的“下列内存区域未能正确编程:程序内存地址:00000000预期值:00001303接收值:00000000编程失败”连接到设备:PicKit引脚1 MCLR连接到设备引脚18 MCLR。它被拉到电路板的VCC通过4.7K欧姆电阻。皮卡引脚2 VCC连接到电路板的VCC(3.3V)皮卡引脚3 GND连接到电路板的GndPcIIT引脚4 PGD连接到设备引脚21 PGED1KPIIT引脚5 PGEC连接到设备引脚22 PGEC1PIKIT引脚6 LVP是除了MC7R上4.7K欧姆上拉之外,MCLR、PGED、PGEC线路上没有其他电阻器、电容器、二极管或其他任何东西,没有外部时钟或振荡器。引脚30 / OSC1和31 / OSC2没有连接到任何东西。我们打算启动内部7.37 MHz的FRC,并在软件初始化切换到40兆赫FCY/FP使用此代码:但我相信我们永远不会走那么远,因为我们似乎不能把代码放在设备中。这是一个新的自定义板。工具版本:MPLAIDID.90.0配置位:非常感谢任何帮助。

以上来自于百度翻译


      以下为原文

    Does dsPIC33FJ32MC304 support debugging (single-stepping, placing breakpoints, etc.) with PicKit3?

It seems I am able to use the PicKit3 as a programmer to program a release executable -- which is NOT working -- and I am NOT able to use the PicKit3 as a debugger to program a debug executable and do any debugging. I get all sorts of errors and weird behavior that seem to suggest a failure to communicate with the device.

Sometimes we can erase the device but I have a feeling the PicKit does not actually check if the device is erased or not. It only reports that it erased successfully. Sometimes it is stuck on "PICkit3 detected. Connecting to PICkit3..." and it never gets anywhere. The PicKit3 status light is red. Sometimes it tries to program but comes back saying the infamous "The following memory regions failed to program correctly: Program Memory Address: 00000000 Expected Value: 00001303 Received Value: 00000000 Programming failed"

Connections to the device:

PicKit pin 1 MCLR is connected to device pin 18 MCLR. It is pulled up to the board's VCC through a 4.7k ohm resistor.

PicKit pin 2 VCC is connected to the board's VCC (3.3v)

PicKit pin 3 GND is connected to the board's GND

PicKit pin 4 PGED is connected to the device pin 21 PGED1

PicKit pin 5 PGEC is connected to the device pin 22 PGEC1

PicKit pin 6 LVP is not connected at all.

Other than the 4.7k ohm pull-up on MCLR, there are no other resistors, capacitors, diodes, or anything else, on the MCLR, PGED, PGEC lines.

There is no external clock or oscillator. Pins 30/OSC1 and 31/OSC2 are not connected to anything. We intend to startup with the internal 7.37 MHz FRC and during software initialization switch to 40 MHz Fcy/Fp using this code:


  // Use internal 7.37 MHz FRC with PLL to achieve:
  // 40 MHz CPU clock (Fcy)
  // 40 MHz Peripheral clock (Fp)
  CLKDIVbits.FRCDIV = 0; // Internal Fast RC oscillator divide by 1 (7.37 MHz)
  CLKDIVbits.PLLPRE = 1; // N1 PLL prescaler = 3 (divide input clock of 7.37 MHz by 3 to give 2.463 MHz)
  CLKDIVbits.PLLPOST = 0; // N2 PLL postscaler = 2 (divide 160.12 MHz by 2 to give 80.05 MHz Fosc = 40 MHz Fcy and 40 MHz Fp)
  PLLFBDbits.PLLDIV = 63; // M PLL multiplier = 65 (multiply 2.463 MHz by 65 to give 160.12 MHz)

  // Wait for new clock to stabilize
  while (OSCCONbits.OSWEN) {
  }


But I believe we never get that far because we can't seem to put the code in the device.

This is a new custom board. Tool version: MPLAB IDE 8.90.

Configuration bits:


// Register FBS (0xf80000):
// - Boot Segment may be written
// - No Boot program Flash segment
_FBS(BWRP_WRPROTECT_OFF & BSS_NO_BOOT_CODE)


// Register FGS (0xf80004):
// - User program memory is not write-protected
// - User program memory is not code-protected
_FGS(GWRP_OFF & GCP_OFF)


// Register FOSCSEL (0xf80006):
// - FNOSC_FRC Internal Fast RC (FRC)
// - IESO_OFF Start-up device with user-selected oscillator source
_FOSCSEL(FNOSC_FRC & IESO_OFF)


// Register FOSC (0xf80008):
// - Primary oscillator disabled (using internal FRC)
// - OSC2 pin is general purpose I/O
// - Peripheral Pin Select: Allow multiple reconfigurations
// - Clock switching is enabled, Fail-Safe Clock Monitor is disabled
_FOSC(POSCMD_NONE & OSCIOFNC_ON & IOL1WAY_OFF & FCKSM_CSECMD)


// Register FWDT (0xf8000a):
// - Watchdog Timer enabled/disabled by user software
_FWDT(FWDTEN_OFF)


// Register FPOR (0xf8000c):
// - POR Timer Disabled (no delay at power up)
// - I2C mapped to SDA1/SCL1 pins
// - PWM module low side output pins have active-high output polarity
// - PWM module high side output pins have active-high output polarity
// - PWM module pins controlled by PORT register at device Reset
_FPOR(FPWRT_PWR128 & ALTI2C_OFF & LPOL_ON & HPOL_ON & PWMPIN_ON)


// Register FICD (0xf8000e):
// - Communicate on PGC1/EMUC1 and PGD1/EMUD1
// - JTAG is Disabled
_FICD(ICS_PGD1 & JTAGEN_OFF)


Any help is appreciated very much.

回帖(19)

王璨

2018-9-28 11:18:20
如果您提供在编程过程中显示的消息(无论成功与否)可能与PICTIT3有关。基本上,DSPIC33 FJ32 MC304应该是可编程的和可调试的与PICkit -不确定关于MPLAB 8。(我使用MPLAX X -除了偶尔的用户错误以外没有其他问题。)

以上来自于百度翻译


      以下为原文

    Might help if you provide the messages displayed during programming (whether successful or not) with the PICkit3.
 
Basically the dsPIC33FJ32MC304 should be programmable and debuggable with the PICkit - not sure about MPLAB 8.x. (I'm using MPLAB X - no problems other than the occasional user's error.)
举报

陈晨

2018-9-28 11:33:07
什么版本的MPLAB?

以上来自于百度翻译


      以下为原文

    What version of MPLab?
举报

乔丽娜

2018-9-28 11:42:25
我在我原来的文章中说:MPLAB IDE 8.90。

以上来自于百度翻译


      以下为原文

   


I said in my original post: MPLAB IDE 8.90.
 
举报

乔丽娜

2018-9-28 11:49:27
我会很快的。关于类似问题的其他帖子表明,MCLR的上拉不应超过10K。我们正在将4.7K更改为10K,不久将再次尝试。谢谢您确认。

以上来自于百度翻译


      以下为原文

   
 
I will soon.
 
Other posts about similar issues suggest that the pull-up on MCLR should not be stronger than 10k. We are changing our 4.7k to a 10k and will try again shortly. 
 



Thank you for confirming that.
 
举报

更多回帖

发帖
×
20
完善资料,
赚取积分