搜索
bottom↓
回复: 6

如何解决PIC24F系列的Address error问题?

[复制链接]

出0入31汤圆

发表于 2009-7-1 16:17:43 | 显示全部楼层 |阅读模式
调试发现偶尔会重启,后来才搞清楚不用的中断和不可屏蔽陷阱默认都是执行reset指令,后来发现是“地址错误”,如何解决这种问题呢?

阿莫论坛20周年了!感谢大家的支持与爱护!!

曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……

出0入31汤圆

 楼主| 发表于 2009-7-1 16:51:12 | 显示全部楼层
Datasheet上有这么一段:
All word accesses must be aligned to an even address. Misaligned word data fetches are not supported, so care must be taken when mixing byte and word operations, or translating from 8-bit MCU code. If a misaligned read or write is attempted, an address error trap will be generated. If the error occurred on a read, the instruction underway is completed; if it occurred on a write, the instruction will be executed but the write will not occur. In either case, a trap is then executed, allowing the system and/or user to examine the machine state prior to execution of the address Fault.

请问什么是mixing byte and word operations?

出0入31汤圆

 楼主| 发表于 2009-7-6 08:12:53 | 显示全部楼层
基本找到原因了,进一步验证中

出0入0汤圆

发表于 2013-9-10 09:04:31 | 显示全部楼层
zchong 发表于 2009-7-6 08:12
基本找到原因了,进一步验证中

兄弟
   我的MCU:PIC24F
      也发生了Address Error
         请问你的是什么问题
            最后怎么解决

出0入31汤圆

 楼主| 发表于 2013-9-10 13:18:10 | 显示全部楼层
642142533 发表于 2013-9-10 09:04
兄弟
   我的MCU:PIC24F
      也发生了Address Error

我的是字节对齐问题,你可以检查一下你的程序看是否是这个问题

出0入0汤圆

发表于 2013-10-8 09:59:58 | 显示全部楼层
zchong 发表于 2013-9-10 13:18
我的是字节对齐问题,你可以检查一下你的程序看是否是这个问题

找到问题了
   字节地址的问题

出0入0汤圆

发表于 2014-1-3 14:52:09 | 显示全部楼层
642142533 发表于 2013-10-8 09:59
找到问题了
   字节地址的问题

能详细描述下么,关于字节对齐
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-6-3 06:58

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

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