使用ICD2烧写PIC16F676内置晶振内置MCLR的问题

[复制链接]
 楼主| stonejust 发表于 2009-8-3 14:37 | 显示全部楼层 |阅读模式
今天突然遇到个问题,首次同时使用PIC16F676内置振荡器和内置MCLR,编译没有错误,但烧写时显示ICDWarn0033: MPLAB ICD 2 does not support programming this device if both the internal oscillator and internal MCLR are selected.  You may continue programming, but you are encouraged to cancel, reconfigure y**ice, and try again.
ICD0200: Operation Aborted (Warning 33).
ICD0275:  Programming failed.
改为外置MCLR后问题解决,但满足不了我的要求。想问下有什么解决方法?别的烧写器有这个问题吗?由于手头只有ICD2没法实验,请高手告知。谢谢!
XIEYUANBIN 发表于 2009-8-3 21:15 | 显示全部楼层
这样设置只要你不调试,只是烧写没问题.
yewuyi 发表于 2009-8-4 08:42 | 显示全部楼层
LZ是不是选择了DEBUG模式下的芯片编程?!
 楼主| stonejust 发表于 2009-8-4 09:42 | 显示全部楼层
不是DEBUG模式,开始我也是这么认为的,也试了下编程模式,还是不成的。刚看了下帮助,如下:
ICDWarn0033: You have selected Internal MCLR and Internal Oscillator in your configuration settings. If your code makes use of port pins that correspond to Clock and Data pins in programming mode, you may not be able to reprogram y**ice. See on-line help for this warning for more information. (OK/Cancel)

When Internal MCLR is used with MPLAB ICD 2 for programming, both Vpp and Vdd are powered together, and then Vpp is pulled high to Vihh to enter programming mode. This means that your code will be running before Vpp goes to Vihh. If that code makes use of port pins that correspond to Clock and Data pins in programming mode, there is a chance their values may not be 0, as necessary to enter programming mode. Therefore, the device could not be reprogrammed.

Click OK to continue programming or click Cancel to cancel the programming operation.

Work-Around

When External MCLR is used, this is not a problem, as Vpp can go directly to Vihh. Also, if External Oscillator is used, the external oscillator can be kept from running, thus keeping the code from running, until Vpp is at Vihh.

Please refer to the Programming Specification for y**ice to determine which port pins correspond to the Clock and Data pins used in device programming. E.g., for PIC16F627A, the pins are RB6 and RB7 respectively.

英文水平有限就不翻译了,我的理解就是由于上电复位时由于MCLR与VDD内部相连,编程及运行状态就不确定了,造成程序启动,所以PIC16F676是不能同时使用内置振荡和内置MCLR的,只能选择其他的IC,例如PIC16F627A。
不知可否这样理解。感谢各位大师的帮助。
yewuyi 发表于 2009-8-4 10:10 | 显示全部楼层
16F676没用过,但16F677是用过的,印象中没见此类要求。
yewuyi 发表于 2009-8-4 10:13 | 显示全部楼层
如下是我在16F690上的CONFIG配置,690和677基本上差不多,你可以参照DATASHEET对一下看看。
---------------------------------------------------------------------------------------------------------------
#ifdef               debug
__CONFIG(MCLRDIS&INTIO&WDTDIS&PWRTDIS&BORDIS&IESODIS&FCMDIS);
#else
__CONFIG(MCLRDIS&INTIO&WDTEN &PWRTEN &BOREN &IESODIS&FCMDIS&CP&CPD);
#endif
----------------------------------------------------------------
如上的配置是没有问题的。
headwolf_83 发表于 2009-8-4 11:24 | 显示全部楼层
ICD2烧双内部是有问题,0033就是这个意思。你换PK2或者PK3去烧吧.
leo-lin 发表于 2009-8-4 11:56 | 显示全部楼层
1# stonejust
PICkit2可以支持双内,价格也便宜。
 楼主| stonejust 发表于 2009-8-4 12:23 | 显示全部楼层
谢谢大家,一直想搞个PICKIT2玩玩,这下有机会了,再次感谢!
crazybee 发表于 2010-5-1 15:18 | 显示全部楼层
本帖最后由 crazybee 于 2010-5-1 15:19 编辑

如果是内部复位,外接振荡,这种情况编程就不受限制吗?奇怪外部晶振和内部RC有区别?

When External MCLR is used, this is not a problem, as Vpp can go directly to Vihh. Also, if External Oscillator is used, the external oscillator can be kept from running, thus keeping the code from running, until Vpp is at Vihh.
XIEYUANBIN 发表于 2010-5-2 08:46 | 显示全部楼层
只是在调试的时候,需要外部复位来控制单片机,
crazybee 发表于 2010-5-2 14:57 | 显示全部楼层
When External MCLR is used, this is not a problem, as Vpp can go directly to Vihh. Also, if External Oscillator is used, the external oscillator can be kept from running, thus keeping the code from running, until Vpp is at Vihh.

如何译?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

8

主题

72

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部