💡
为了及时响应、处理外界的异步事件,中断要求DSP暂停当前的工作,转而对外界异步事件作出处理,完成以后再继续当前的工作。

1.中断分类


notion image
notion image

2.PIE(外设中断扩展模块)


notion image
notion image
PIE单元将所有96个中断分为12个组,每个组负责8个外设或引脚中断。每个PIE单元都有一个中断标志寄存器PIEIFRx和中断使能寄存器PIEIERx,还有一个中断应答寄存器PIEACKx
PIE将中断请求发到CPU后,CPU中断标志寄存器IFR中对应INTx将被置位
PIE模块工作流程
notion image
 

⭐3.中断向量表


💡
中断矢量表,又称为中断地址,表明中断发生后, 若DSP响应中断,指令执行的地址。
 

4.PIE设置寄存器


  1. PIECTRL(控制寄存器)
notion image
notion image
  1. PIEACK(中断确认寄存器)
notion image
notion image
  1. PIEIERn(PIE组使能寄存器)
notion image
notion image
  1. PIEIFRn(PIF组标志寄存器)
notion image
notion image
#include “DSP2833x_Device.h” PieCtrlRegs.PIEIFR1.bit.INTx4 = 1; //manually set IFR for XINT1 in PIE group 1 PieCtrlRegs.PIEIER3.bit.INTx5 = 1; //enable EPWM5_INT in PIE group 3 PieCtrlRegs.PIEACK.all = 0x0004; //acknowledge the PIE group 3 PieCtrlRegs.PIECTRL.bit.ENPIE = 1; //enable the PIE
 
 

5.CPU中断设置寄存器


1.中断标志寄存器IFR
notion image
2.中断使能寄存器IER
notion image
 
3.全局中断使能位INTM
notion image
 

⭐6.中断服务程序ISR


💡
  • 中断服务程序是用户编写的,是对中断事件做出响应的子程序
  • CPU接收到中断请求并响应之后,就根据中断矢量内容转移到相应的中断服务程序ISR中。
  • ISR在为中断所要求的任务服务之前需要保存和恢复寄存器的值,并且还要管理中断嵌套。
 
 

taohu
taohu
一个普通的干饭人🍚
公告
type
Notice
status
Published
date
Jul 2, 2021
tags
slug
#
summary
类型为Notice的文章将被显示为公告,仅 hexo和next支持;仅限一个公告
category
password
icon
🎉这是Taohu的第一个网站🎉
-- 这个网站是干什么的? ---
分享学习笔记,还有一些知识碎片
您可以通过邮箱联系我哦!
我的邮箱:henryxu26@qq.com
-- 感谢您的访问 ---