×

SH66系列编程指南

消耗积分:1 | 格式:pdf | 大小:64KB | 2017-09-08

阿联

分享资料个

SH66 Series programming Notice

  I. Instructions for Interrupt Operation: 1. If “IE” instruction (interrupt enable) is set outside the interrupt processing program and there is “HALT” or “STOP” instruction, this two instructions should be followed “IE” instruction closely. 2. After CPU responding to an interrupt, IRQ should be cleared before resetting IE in order to avoid many responses to one interrupt. 3. Interrupt Enable instruction will be automatically cleared after entering interrupt-processing program. If setting IE too early, there is a possibility of re-entry the interrupt. So the Interrupt Enable instruction should be placed at the end and followed closely by two instructions include “RTNI”。 4. During the two successive instruction cycles next to Interrupt Enable instruction, CPU will not respond to any interrupts. 5. After CPU responding to interrupts, each bit of IE will be cleared by hardware while IRQ should be cleared by software.

  Examples: Users should pay attention to some problems when writing program according to the above points. Here are some examples for the software application: Case One: Description: CPU will be activated when running to “HALT” or “STOP” instruction. Program: Interrupt Enable instruction is set outside the interrupt processing program …… LDI IE, 0FH ; enable interrupt NOP NOP HALT Analysis: After two “NOP” instructions, if an interrupt pulse comes or IRQ is non-zero during the third instruction cycle, CPU will respond to the interrupt and IE will be cleared. Then when returning to main program, CPU begins to execute “HALT” or “STOP” and will not be activated, because IE is cleared to zero and all interrupts are disabled now. Solution: “HALT” or “STOP” are put closely behind “LDI IE, 0FH” (According to point 1)

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

评论(0)
发评论

下载排行榜

全部0条评论

快来发表一下你的评论吧 !