![Toshiba TMPM3V4 Manual Download Page 113](http://html.mh-extra.com/html/toshiba/tmpm3v4/tmpm3v4_manual_428626113.webp)
7.5.2.2 Preparation
When preparing for an interrupt, you need to pay attention to the order of configuration to avoid any un-
expected interrupt on the way.
Initiating an interrupt or changing its configuration must be implemented in the following order basical-
ly. Disable the interrupt by the CPU. Configure from the farthest route from the CPU. Then enable the in-
terrupt by the CPU.
To configure the clock generator, you must follow the order indicated here not to cause any unexpec-
ted interrupt. First, configure the precondition. Secondly, clear the data related to the interrupt in the
clock generator and then enable the interrupt.
The following sections are listed in the order of interrupt handling and describe how to configure them.
1. Disabling interrupt by CPU
2. CPU registers setting
3. Preconfiguration (1) (Interrupt from external pin)
4. Preconfiguration (2) (Interrupt from peripheral function)
5. Preconfiguration (3) (Interrupt Set-Pending Register)
6. Configuring the clock generator
7. Enabling interrupt by CPU
(1)
Disabling interrupt by CPU
To make the CPU for not accepting any interrupt, write "1" to the corresponding bit of the PRI-
MASK Register. All interrupts and exceptions other than non-maskable interrupts and hard faults
can be masked.
Use "MSR" instruction to set this register.
Interrupt mask register
PRIMASK
←
"1" (interrupt disabled)
Note 1: PRIMASK register cannot be modified by the user access level.
Note 2:
If a fault causes when "1" is set to the PRIMASK register, it is treated as a hard fault.
(2)
CPU registers setting
You can assign a priority level by writing to <PRI_n> field in an Interrupt Priority Register of
the NVIC register.
Each interrupt source is provided with eight bits for assigning a priority level from 0 to 255, but
the number of bits actually used varies with each product.Priority level 0 is the highest priority lev-
el.If multiple sources have the same priority, the smallest-numbered interrupt source has the highest
priority.
TMPM3V6/M3V4
Page 91
2019-02-06
Summary of Contents for TMPM3V4
Page 1: ...32 Bit RISC Microcontroller TX03 Series TMPM3V6 M3V4 ...
Page 2: ... 2019 Toshiba Electronic Devices Storage Corporation ...
Page 7: ...Revision History Date Revision Comment 2019 02 06 1 First Release ...
Page 8: ......
Page 22: ...xiv ...
Page 52: ...TMPM3V6 M3V4 3 Processor Core 3 6 Exclusive access Page 30 2019 02 06 ...
Page 148: ...TMPM3V6 M3V4 7 Exceptions 7 6 Exception Interrupt Related Registers Page 126 2019 02 06 ...
Page 178: ...TMPM3V6 M3V4 9 Input Output port 9 2 Block Diagrams of Ports Page 156 2019 02 06 ...
Page 354: ...TMPM3V6 M3V4 14 Synchronous Serial Port SSP 14 6 Frame Format Page 332 2019 02 06 ...
Page 419: ...TMPM3V6 M3V4 Page 397 2019 02 06 ...
Page 462: ...TMPM3V6 M3V4 21 Watchdog Timer WDT 21 5 Control register Page 440 2019 02 06 ...
Page 544: ......