关于RH850的中断/异常方法,RH850有直接矢量方式和表参照方式两种中断/例外。 1、直接矢量方式是根据发生因素,跳转到固定的处理地址,执行跳转目的地的代码。将RBASE或EBASE作为基本地址,加上发生原因的偏移值,得到的值作为处理地址。 2、表引用方式是读取处理程序地址中存储的字数据,跳转到该字数据指向的地址。将INTBP作为基本寄存器,加上信道号*4的偏移值,得到的值作为处理程序地址。 在瑞萨RH850微控制器中,中断系统是一个关键特性,它允许处理器在执行正常程序的同时响应外部事件。RH850支持两种中断/异常处理机制:直接矢量方式和表参照方式。 1. 直接矢量方式: 在这种方式下,中断处理程序的地址是预先确定的。当一个中断发生时,处理器根据中断源直接跳转到相应的固定处理地址执行代码。这个地址是通过将RBASE或EBASE寄存器作为基础地址,然后加上中断源的偏移值计算得出的。例如,如果PSW.EBV(中断向量选择位)为0,则使用RBASE;若为1,则使用EBASE。这种方式简单且快速,但可能导致内存空间的浪费,因为每个中断源都有固定大小的预留空间。 2. 表参照方式: 与直接矢量方式相比,表参照方式更加灵活。它使用INTBP(中断基址寄存器)作为基础,加上中断通道号乘以4的偏移值来计算处理程序地址。中断发生时,处理器会读取这个地址处的字数据,然后跳转到该数据所指向的地址执行处理程序。这种方法节省了内存,因为可以动态地改变中断处理程序的地址,但增加了处理中断的开销,因为它需要额外的读取操作。 实现RH850中断系统的步骤通常包括以下两部分: ① 使用`#pragma interrupt`指令定义中断/异常函数: 在使用CC-RH编译器时,开发者可以利用`#pragma interrupt`指令在C语言中声明中断服务函数。这告诉编译器该函数应该作为中断处理程序。例如,你可以定义一个名为`_intp0`的中断服务函数来处理特定的中断。 ```c #pragma interrupt (_intp0, vector=INTERRUPT_VECTOR) void _intp0(void) { // 这里编写中断处理代码 } ``` ② 定义中断/异常向量: 中断/异常向量是处理器查找中断处理程序地址的入口点。对于直接矢量方式,需要在固件中设置好RBASE或EBASE寄存器对应的中断处理程序地址;对于表参照方式,需要在内存中的中断向量表中为每个中断通道分配并初始化相应的处理程序地址。 这两种中断处理方式各有优缺点,开发者需要根据应用需求选择合适的方法。直接矢量方式适合对响应时间有严格要求且中断源数量固定的情况,而表参照方式适用于中断源较多且可能需要动态调整处理程序地址的情况。 RH850的中断系统提供了一种高效的方式来管理外部事件的响应,通过灵活选择中断处理机制,开发者可以优化系统的实时性能和资源利用率。理解并熟练掌握这两种中断处理方式对于开发RH850微控制器的应用至关重要。
2024-07-25 13:57:06 786KB
1
RH850 CAN 配置流程资料
2023-03-20 15:40:48 2.12MB CAN
1
内容概要: 瑞萨RH850_F1K单片机例程 适合人群:需要Demo的码农
2022-12-17 00:07:41 15.88MB RH850 汽车电子 Demo
1
RH850 D1系列Datasheet
2022-11-28 17:21:36 59.93MB RH850 D1
1
RH850 CAN发送流程资料
2022-08-24 12:06:59 956KB CAN
1
RH850 P1x 的用户手册,很难找的。 RH850/P1x Group User’s Manual: Hardware
2022-05-12 22:24:37 91.81MB RH850
1
很详细的瑞萨renesas RH850 RH850F1L 数据手册 datasheet。
2022-03-31 10:58:41 42.36MB 瑞萨renesas RH850 RH850F1L 数据手册
1
Renesas RH850_F1L单片机硬件手册,附代Cflash,Dfalsh编程手册。开发必须的文档,找了很久才找到。
2022-03-24 08:57:42 24.64MB Renesas RH850
1
RH850 D1汇编指令
2022-03-23 15:26:22 3.05MB RH850 D1汇编指令
1
官方原版资料 RH850 Family 32 User’s Manual: Software Renesas microcontroller RH850 Family CHAPTER 1 OVERVIEW ...............................................................................................................1 1.1 V850E3v5 Architecture Features ...........................................................................................1 1.1.1 Multi-processing environment .....................................................................................2 1.1.2 Virtual machines...........................................................................................................2 1.1.3 Hardware multithreading..............................................................................................2 1.2 V850E3v5 Architecture Class ................................................................................................3 1.3 Changes from the V850E2v3 Architecture ............................................................................4 CHAPTER 2 PROCESSOR MODEL ................................................................................................5 2.1 Resource Management ...........................................................................................................5 (1) 3-layer control system..................................................................................................6 (2) 2-layer control system..................................................................................................7 2.2 CPU Operating Modes............................................................................................................8 2.2.1 Definition of CPU operating modes.............................................................................9 (1) Native mode (NM).......................................................................................................9 (2) Virtual machine mode (VM) .......................................................................................9 (3) Supervisor mode (SV) .................................................................................................9 (4) User mode (UM)..........................................................................................................9 2.2.2 CPU operating mode transition .................................................................................... 10 (1) Change due to acknowledging an exception ...............................................................10 (2) Change due to a return instruction...............................................................................10 (3) Change due to a system register instruction................................................................10 2.2.3 CPU operating modes and privileges...........................................................................11 (1) Hypervisor privilege (HV privilege) ...........................................................................12 (2) Supervisor privilege (SV privilege).............................................................................12 (3) Coprocessor use permissions.......................................................................................12 (4) Operation when there is a privilege violation .............................................................13 2.3 Hardware Thread ....................................................................................................................14 2.3.1 Thread status.................................................................................................................14 (1) Enabled/disabled..........................................................................................................14 (2) Stopped/running...........................................................................................................14 2.3.2 Stopping a thread by executing the HALT instruction ................................................15 2.3.3 Pausing a thread by executing the SNOOZE instruction.............................................15 2.4 Instruction Execution..............................................................................................................16 2.5 Exceptions and Interrupts .......................................................................................................17 2.5.1 Types of exceptions......................................................................................................17 (1) Terminating exceptions ...............................................................................................17 (2) Resumable exceptions .................................................................................................17 (3) Pending exceptions ......................................................................................................17 2.5.2 Exception level ................................................................................................................18 2.6 Coprocessors..............................................................................................................................18 2.6.1 Coprocessor use permissions...........................................................................................18 2.6.2 Correspondences between coprocessor use permissions and coprocessors ...................19 2.6.3 Coprocessor unusable exceptions....................................................................................19 2.6.4 System registers...............................................................................................................19 2.7 Registers.....................................................................................................................................20 2.7.1 Program registers.............................................................................................................20 2.7.2 System registers...............................................................................................................20 2.7.3 Register updating.............................................................................................................22 (1) LDSR and STSR..........................................................................................................22 (2) LDTC and STTC .........................................................................................................25
2022-03-16 18:41:51 13MB 嵌入式 RH850 瑞萨
1