搜索
bottom↓
回复: 4

MPLAB C30的头文件好像有一个关于器件配置位的bug

[复制链接]

出0入0汤圆

发表于 2008-5-16 17:39:36 | 显示全部楼层 |阅读模式
在“p30f2010.h”中,对于配置位中的FICD寄存器是这样定义的:

#define _FICD(x) __attribute__((section("__FICD.sec, code"))) int _FICD = (x);
#define ICS_NONE         0xFFFC
#define ICS_PGD3         0xFFFD
#define ICS_PGD2         0xFFFE
#define ICS_PGD1         0xFFFF

但是,如果在程序代码中设置配置位的话:
_FICD(ICS_NONE);
在MPLAB的“Configuration Bits”窗口中的“Comm Channel Select”显示的却是“Use EMUC3 and EMUC3”。

MPLAB与C30中常量的意义不一致。我试了一下,在MPLAB中,0xFFFF对应“Use PGC/EMUC and PGD/EMUD”,0xFFFE对应“Use EMUC1 and EMUC1”,0xFFFD对应“Use EMUC2 and EMUC2”,0xFFFC对应“Use EMUC3 and EMUC3”

其他30F系列器件的头文件中对于FICD,有的像2010一样定义,有的是这样定义:
#define ICS_NONE         0xFFFF
#define ICS_PGD3         0xFFFF
#define ICS_PGD2         0xFFFD
#define ICS_PGD1         0xFFFE
不知道这个有没有问题。

我的C30版本是3.10,MPLAB版本是8.00。

出0入0汤圆

发表于 2008-5-29 22:41:08 | 显示全部楼层
在代码里写配置位的时候  

MPLAB的“Configuration Bits”是应该关闭的   

否则“Configuration Bits“显示的配置不一定是实际的配置

另外换mplab8.10

出0入0汤圆

 楼主| 发表于 2008-5-30 13:03:30 | 显示全部楼层
谢谢楼上。8.10跟8.00比都有什么改进?

是关闭的,但是程序编译后configuration bits里的内容会同步更新。

出0入0汤圆

发表于 2008-5-30 17:49:56 | 显示全部楼层
MPLAB IDE v8.10 新特性一览(在Release Notes里有最新支持的芯片型号):


芯片调试资源工具栏(Silicon Debug Resource Toolbar) – A new toolbar details the number of silicon debug features (trace, HW breaks) in the currently selected device for in-circuit emulation or in-circuit debugging.  The toolbar indicates if software breakpoints are supported in the device, and whether they are enabled or disabled.


强化的跟踪功能(Trace Improvements) – The disassembled instruction at the trace point is now displayed, and new buttons allow “trace step back “and “trace step forward.”


数据监视与控制接口数据实时更新(DMCI Run-time Data Monitor) –DMCI (in concert with a target-resident monitor and a serial connection) can change application variables during run-time.


PIC18数据捕捉(PIC18 Data Capture )– PIC18-family devices can now stream data off of the device at run time to be displayed in the run-time watch window or the DMCI.


PIC32跟踪启停触发控制(Triggered Control of PIC32 Trace Start/Stop) – New capabilities have been added to the MPLAB REAL ICE to start or stop the collection of trace data based on trigger criteria.


工程目录管理(Project Folder Management) – Project files not tied directly to the current project directory structure can be organized and managed along with other project files.


PIC18软件断点(Software Breakpoints for PIC18) – PIC18-family devices can use software breakpoints with MPLAB REAL ICE.


默认PIC18连接器(Default Linker Script for PIC18 )– Eliminates linker script confusion by automatically using a default linker script.  No longer does the engineer need to switch linker scripts when using an in-circuit emulator or debugger.  Additionally, the linker wizard doesn’t ask to select a linker script, which reduces the complexity of making projects. Additionally, the PIC18 family has a generic setting for building libraries that will work with any PIC18-family device.


工程符号集快速切换(Fast Swapping Between Project Symbol Sets) – This eases debugging of applications that are built using two projects, such as those with a bootloader.


自动更新(Automated Updates) – MPLAB IDE checks the Microchip web site to see if a newer version is available and notifies the user..

出0入0汤圆

发表于 2010-4-24 16:44:52 | 显示全部楼层
大哥我也在学pic30f的但是有很多不懂的,我要向你们学习可以吗,我的QQ是346099918,chuyu111 刘抗抗 大哥加我好吗,谢谢了
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-5-9 11:16

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表