# US 2016/0259741 A1 · Microcontroller Or Microprocessor With Dual Mode Interrupt

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2016/0259741 A1
- Document ID: US20160259741A1
- Status: Published application
- Kind: A1
- Application number: 15/060,553
- Filed: 2016-03-03
- Published: 2016-09-08
- Earliest claimed: 2015-03-06
- Assignees: Microchip Technology Incorporated
- Applicants: Microchip Technology Incorporated
- Inventors: Keith Curtis; Ashish Senapati; Anthony Garcia; Vijay Sarvepalli; Prashanth Pulipaka; Kevin Kilzer; David Forst; Rob Kennedy; Primo Castro; Aaron Barton
- Web page: https://patentgrep.com/patent/US20160259741A1

## CPC

- G06F 13/26: with priority control
- G06F 9/22: Microcontrol or microprogram arrangements
- G06F 9/30036: {Instructions to perform operations on packed data, e.g. vector, tile or matrix operations}
- G06F 9/3013: {according to data content, e.g. floating-point registers, address registers}
- G06F 13/24: using interrupt (G06F13/32 takes precedence)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A microcontroller has a CPU with at least one interrupt input coupled with an interrupt controller, a plurality of peripherals, and a mode register comprising at least one bit controlling an operating mode of the microcontroller. The microcontroller is configured to operate in a first operating mode wherein upon assertion of an interrupt by a peripheral of the microcontroller, the interrupt controller forwards an interrupt signal to the CPU and the peripheral sets an associated interrupt flag, wherein the interrupt causes the CPU to branch to a predefined interrupt address associated with the interrupt input. In a second operating mode, upon assertion of an interrupt by a peripheral of the microcontroller, the interrupt controller forwards an interrupt signal to the CPU and the CPU receives additional interrupt information from the peripheral that generated the interrupt, wherein the additional interrupt information is used to generate a vector address.

## Claims

### Claim 1

microcontroller comprising:
a central processing unit comprising at least one interrupt input;
an interrupt controller configured to provide at least one interrupt signal to the at least one interrupt input of the central processing unit;
a plurality of peripherals coupled with the central processing unit and the interrupt controller;
a mode register comprising at least one bit controlling an operating mode of the microcontroller, wherein the microcontroller is configured to operate in a first and in a second mode, wherein in the first operating mode upon assertion of an interrupt by a peripheral of the microcontroller, the interrupt controller forwards an interrupt signal to the central processing unit and the peripheral sets an associated interrupt flag, wherein the interrupt causes the central processing unit to branch to a predefined interrupt address associated with the interrupt input;
and wherein in the second operating mode upon assertion of an interrupt by a peripheral of the microcontroller, the interrupt controller forwards an interrupt signal to the central processing unit and the central processing unit receives additional interrupt information from the peripheral that generated the interrupt, wherein the additional interrupt information is used to generate a vector address.

### Claim 2 (depends on 1)

The microcontroller according to claim 1, wherein in the second operating mode, after receiving an interrupt, the central processing unit is configured to perform a context save before entering a service routine and wherein a register of the central processing unit receives data configured to identify an interrupt source after said context save.

### Claim 3 (depends on 1)

The microcontroller according to claim 1, wherein the register is a working register of the arithmetic logic unit.

### Claim 4 (depends on 2)

The microcontroller according to claim 2, wherein said additional information provided by a peripheral that generated the interrupt is used to shift a constant value and wherein the shifted constant value is moved into the register.

### Claim 5 (depends on 2)

The microcontroller according to claim 2, wherein said additional information is an interrupt number which is directly stored in a working register of the CPU.

### Claim 6 (depends on 1)

The microcontroller according to claim 1, wherein in the second operating mode, a base register is provided that stores a base address and an offset address depending on an interrupt source is forwarded to the central processing unit, wherein an interrupt vector is generated by adding the vector address to the base address stored in the base register.

### Claim 7 (depends on 1)

The microcontroller according to claim 1, wherein in the second mode, the microcontroller is programmed to provide for an interrupt service routine that evaluates the content of the working register to branch to a respective service routine associated with an interrupt source that generated the interrupt.

### Claim 8 (depends on 1)

The microcontroller according to claim 1, wherein in the first mode, the microcontroller is programmed to provide for an interrupt service routine that polls an interrupt flag in a special function register to determine an interrupt source that generated the interrupt.

### Claim 9 (depends on 1)

The microcontroller according to claim 1, wherein the central processing unit comprises only a single interrupt input.

### Claim 10 (depends on 1)

The microcontroller according to claim 1, wherein the central processing unit comprises only a first and a second interrupt input, wherein the first interrupt input has a higher priority than the second interrupt input.

### Claim 11 (depends on 10)

The microcontroller according to claim 10, wherein when a higher priority interrupt interrupts a lower priority service routine, the higher priority interrupt is configured to clear a lower priority interrupt and an associated service routine returns directly to a main code without returning through the low priority service routine.

### Claim 12 (depends on 10)

The microcontroller according to claim 10, wherein when a higher priority interrupt interrupts a lower priority service routine, the higher priority interrupt is configured to return directly to the lower priority interrupt service routine without returning to a main code.

### Claim 13 (depends on 1)

The microcontroller according to claim 1, wherein interrupt controller comprises controllable logic to enable interrupts received from the peripherals.

### Claim 14

A method for providing interrupt functionality within a microcontroller comprising a central processing unit comprising at least one interrupt input and an interrupt controller configured to provide at least one interrupt signal to the at least one interrupt input of the central processing unit, the method comprising:
setting a first or a second operating mode;
receiving an interrupt by the interrupt controller; and
when operating in the first operating mode, forwarding by the interrupt controller an interrupt signal to the central processing unit and setting an associated interrupt flag, wherein the interrupt causes the central processing unit to branch to a predefined interrupt address associated with the interrupt input;
and when operating in the second operating mode, forwarding by the interrupt controller an interrupt signal to the central processing unit and receiving by the central processing unit additional interrupt information from the peripheral that generated the interrupt, wherein the additional interrupt information is used to generate a vector address.

### Claim 15 (depends on 14)

The method according to claim 14, wherein in the second operating mode, after receiving an interrupt, performing a context save before entering a service routine and receiving additional information by the central processing unit configured to identify an interrupt source after said context save and storing said additional information or data derived from said additional information in a register.

### Claim 16 (depends on 15)

The method according to claim 15, wherein said additional information is an interrupt number which is directly stored in a working register of the CPU.

### Claim 17 (depends on 15)

The method according to claim 15, further comprising: calculating an address after entering the service routine using said data and branching to said address to service said interrupt.

### Claim 18 (depends on 15)

The method according to claim 15, wherein said data is used to shift a constant value and wherein the shifted constant value is moved into the register.

### Claim 19 (depends on 18)

The method according to claim 18, further comprising: using said shifted value as an offset address to branch to an address to service said interrupt.

### Claim 20 (depends on 14)

The method according to claim 14, wherein in the second operating mode a base register is provided that stores a base address and an offset address depending on an interrupt source is forwarded to the central processing unit, and generating an interrupt vector by adding the vector address to the base address stored in the base register.

### Claim 21 (depends on 14)

The method according to claim 14, wherein in the second operating mode, an interrupt service routine evaluates the content of the working register to branch to a respective address providing instructions associated with an interrupt source that generated the interrupt.

### Claim 22 (depends on 14)

The method according to claim 14, wherein in the first mode, an interrupt service routine polls an interrupt flag in a special function register to determine an interrupt source that generated the interrupt.

### Claim 23 (depends on 14)

The method according to claim 14, wherein the central processing unit comprises only a single interrupt input.

### Claim 24 (depends on 14)

The method according to claim 14, wherein the central processing unit comprises only a first and a second interrupt input, wherein the first interrupt input has a higher priority than the second interrupt input.

### Claim 25 (depends on 24)

The method according to claim 24, wherein when a higher priority interrupt interrupts a lower priority service routine, the higher priority interrupt is configured to clear a lower priority interrupt and an associated service routine returns directly to a main code without returning through the low priority service routine.

### Claim 26 (depends on 24)

The method according to claim 24, wherein when a higher priority interrupt interrupts a lower priority service routine, the higher priority interrupt is configured to return directly to the lower priority interrupt service routine without returning to a main code.

### Claim 27

A microcontroller comprising:
a central processing unit comprising at least one interrupt input and a register coupled with an arithmetic logic unit;
an interrupt controller configured to provide at least one interrupt signal to the at least one interrupt input of the central processing unit;
a plurality of peripherals coupled with the central processing unit and the interrupt controller;
wherein upon assertion of an interrupt by a peripheral of the microcontroller, the interrupt controller forwards an interrupt signal to the central processing unit and the central processing unit receives additional interrupt information from the peripheral that generated the interrupt, wherein the additional interrupt information or data derived from the additional interrupt information is stored in said register.

### Claim 28 (depends on 27)

The microcontroller according to claim 27, wherein after receiving an interrupt, the central processing unit is configured to perform a context save before entering a service routine and wherein the register receives the additional interrupt information after said context save.

### Claim 29 (depends on 27)

The microcontroller according to claim 27, wherein said additional information is used to shift a constant value and wherein the shifted constant value is moved into the register.

### Claim 30 (depends on 27)

The microcontroller according to claim 27, wherein said additional information is an interrupt number which is directly stored in a working register of the CPU.

### Claim 31 (depends on 27)

The microcontroller according to claim 27, wherein the microcontroller is programmed to provide for an interrupt service routine that evaluates the content of the working register to branch to a respective service routine associated with an interrupt source that generated the interrupt.
