完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
使用MPLABX、XC8 V 1.41和PIC18F67 K40。我试图在汇编文件中写一个中断处理程序,并把它连接到一个C程序中。我之所以这样做,而不是在提供的C中断包装器中放置ASM指令是因为速度的原因,代码可以运行在32千赫。在C包装器中有太多的保存/恢复指令。我已经能够在地图文件中看到结果(部分和代码放置看起来是正确的),但是在列表文件中没有代码出现,这是用C18工作的,但是我已经移动到C18不支持的新的部分。任何人都有这个或指针的经验吗?
以上来自于百度翻译 以下为原文 Using MPLABX, xc8 V 1.41 and PIC18F67K40. I am trying to write an interrupt handler in an assembler file and link it into a C program. The reason I am doing this and not putting asm instructions in the C interrupt wrapper supplied is for speed reasons, the code can run at 32kHZ. There are just too many save/ restore instructions in the C wrapper. I have been able to see the results in the map file (the sections and code placement seem correct) but no code shows up in the listing file, This worked using C18, but I have moved to a new part not supported by C18. Anyone have any experience with this or pointers? Attachment(s) sr_asm.asm (1.62 KB) - downloaded 95 times |
|
相关推荐
2个回答
|
|
|
几年前,有一个关于XC8中断延迟的线索。基本上,你可以编写自己的IR例程,而不需要在C中进行任何上下文保存/恢复。
以上来自于百度翻译 以下为原文 There was a thread about xc8 interrupt latency some years ago. Basically you can write your own IR routine without any context saving/restore in C like this: asm("global _myIR"); // to avoid removal by optimizer void myIR(void) @0x0008 { ... asm("RETFIE F"); } |
|
|
|
|
|
谢谢Vioki,这让我走上了正确的轨道,因为我的程序也使用了低优先级中断,所以我不得不使用你所描述的函数将Goto In函数()调用放置在高优先级向量中,然后把我的服务例程的主汇编器部分放到第二个函数中。没有上下文保存或恢复。
以上来自于百度翻译 以下为原文 Thanks Vioki, that got me on the right track, because my program uses low priority interrupts too, I had to use the function you described to have a goto intfunctionbody() call to be placed at the high priority vector. Then put the main assembler part of my service routine into the second function. No context save or restore. Cheers |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1122浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
872浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-1 22:36 , Processed in 0.468663 second(s), Total 42, Slave 35 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2761