完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,我在我的应用中使用PIC18F45控制器。我想在我的应用程序中添加异常处理例程。请给我一些参考,以便它帮助我完成它。我已经为PIC32控制器工作了异常处理程序。问候,Akshay。
以上来自于百度翻译 以下为原文 Hi, I am using PIC18F4550 controller in my application.I want to add exception handling routine in my application.Please send me some reference so that it will help me to get it done.I have worked on exception handling routine for PIC32 controller. Regards, Akshay. |
|
相关推荐
19个回答
|
|
这可能是具有挑战性的,因为PIC18F芯片没有“例外”。
以上来自于百度翻译 以下为原文 That could be challenging, as PIC18F chips do not have "exceptions". |
|
|
|
|
|
|
|
在PIC18F中没有异常处理例程吗?它会正常程序执行吗?
以上来自于百度翻译 以下为原文 In PIC18F as it doesn't have exception handling routine?Will it hault normal program execution? |
|
|
|
请告诉我你认为什么会导致PIC18F芯片中的“异常”。
以上来自于百度翻译 以下为原文 Please tell me what you think will cause an "exception" in a PIC18F chip. |
|
|
|
|
|
|
|
不管程序是否产生异常,固件中都有异常处理程序的好习惯。
以上来自于百度翻译 以下为原文 Its good habit to have Exception handler in our firmware regardless whether program generates exception or not |
|
|
|
听起来你在说一种高级语言,你没有提到。我假设你正在谈论XC8,在这种情况下,你应该在XC8论坛中询问。XC8没有例外。
以上来自于百度翻译 以下为原文 Sounds like you are talking about a high level language, which you did not mention. I assume you are talking about XC8, in which case you should have asked in the XC8 forum. XC8 does not have exceptions. |
|
|
|
我非常了解PIC32控制器(XC32编译器)的异常处理,为什么XC8没有异常?C有例外。问候,Akshay。
以上来自于百度翻译 以下为原文 I am very much aware about exception handling for PIC32 controller(XC32 compiler).Why XC8 doesn't have exception? C has exceptions. Regards, Akshay |
|
|
|
我测试了除以零的例外。它不会导致控制器GRIN中断:问候,Akshay。
以上来自于百度翻译 以下为原文 I tested divide by zero exception.It doesn't causes interrupt to controllergrin: Regards, Akshay. |
|
|
|
PIC18没有硬件用于分区,因此对于除以0没有硬件异常。这些PICS也没有硬件陷阱来访问未实现的内存,并且对奇数地址没有任何问题,因此,所有的错误(可能是,导致C级异常)都要在软件中检查,比如零除数或空指针。不确定如果XC8(也C18)有这样的东西…
以上来自于百度翻译 以下为原文 PIC18 have no hardware for divisions, so there is no hardware exception for a divide by 0. Those PICs also have no hardware traps for accessing unimplemented memory, and have no issues with odd addresses, so... All of the errors (which could, yes, result in a C-level exception) are to be checked in software, like a zero divisor or a null pointer. Not sure if XC8 (and also C18) have such stuff... |
|
|
|
如果在PIC32中发生异常,则说除以零,则控制器执行失败。它不应该发生在PIC18F中,因为它没有异常处理程序。
以上来自于百度翻译 以下为原文 If exception occurs in PIC32,lets say divide by zero,Then controller execution haults.It should not happen in PIC18F as it doesn't have exception handler. |
|
|
|
我们可能不知道例外原因和例外地址。
以上来自于百度翻译 以下为原文 We may not come to know exception causes and exception address. |
|
|
|
回到我之前的声明中,它没有例外,所以你是从坏的假设中工作。只需打开XC8用户指南,然后搜索“异常”。
以上来自于百度翻译 以下为原文 Going back to my earlier statement, it does not have exceptions, so you're working from bad assumptions. Simply open the XC8 User Guide, and do a search for "exception". |
|
|
|
在PIC18F上所做的任何事情都不会引起异常。它没有异常硬件。软件中的异常是C++的特性,而不是C.xC8不是C++编译器,也不会捕获像零除一样的东西。
以上来自于百度翻译 以下为原文 Nothing you can do on a PIC18F will cause an exception. It does not have exception hardware. There is nothing to know. Exceptions in software are a C++ feature, not C. XC8 is not a C++ compiler and does not trap things like divide-by-zero. |
|
|
|
是的,我的建议是添加一些简单的“探针”(测试),比如我在旧微软C编译器中看到的:在使用它们之前对空指针进行测试,或者在实际执行除法之前对除数进行测试。
以上来自于百度翻译 以下为原文 Yep, what I was suggesting was adding some simple "probes" (tests) such as those I saw in old Microsoft C compiler: a test for not-null pointers before using them, or a test for divisor before actually performing the division |
|
|
|
因此,我将编写固件,假设C异常不会中断我的固件。
以上来自于百度翻译 以下为原文 So I will write firmware supposing that C-exception will not interrupt my firmware.grin: wink: |
|
|
|
在C89/C90(XC8编译的语言)的标准中,这些异常究竟在哪里被描述?
以上来自于百度翻译 以下为原文 In the Standard for C89 / C90 (the language compiled by XC8), where exactly are these exceptions described? |
|
|
|
在XC8用户指南中,这是一个除以零的结果:由我添加的页面575强调。
以上来自于百度翻译 以下为原文 In the XC8 USer Guide this is found for the result of a divide by zero: page 575 emphasis added by me. |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
5237 浏览 9 评论
2026 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3201 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
771浏览 1评论
659浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
589浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
671浏览 0评论
571浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-21 03:30 , Processed in 2.322504 second(s), Total 113, Slave 97 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号