Pending registers for STM32F4 interrupt
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
Why there are two pending registers for interrupt? One of them is EXTI_PR and other one is Interrupt Set-pending Registers(ISPR) which is in NVIC controller registers.
EXTI unit pending register:
NVIC unit Pending Register:
Are these two having the same purpose? If not, what is the difference?
Also I am confused about Interrupt Set-enable Registers (ISER) in NVIC unit and Interrupt mask register in EXTI unit. What's the difference between them?
stm32 interrupts stm32f4
add a comment |Â
up vote
2
down vote
favorite
Why there are two pending registers for interrupt? One of them is EXTI_PR and other one is Interrupt Set-pending Registers(ISPR) which is in NVIC controller registers.
EXTI unit pending register:
NVIC unit Pending Register:
Are these two having the same purpose? If not, what is the difference?
Also I am confused about Interrupt Set-enable Registers (ISER) in NVIC unit and Interrupt mask register in EXTI unit. What's the difference between them?
stm32 interrupts stm32f4
1
@Michel Keijzers . thanks for your edits.
– Amin
4 hours ago
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Why there are two pending registers for interrupt? One of them is EXTI_PR and other one is Interrupt Set-pending Registers(ISPR) which is in NVIC controller registers.
EXTI unit pending register:
NVIC unit Pending Register:
Are these two having the same purpose? If not, what is the difference?
Also I am confused about Interrupt Set-enable Registers (ISER) in NVIC unit and Interrupt mask register in EXTI unit. What's the difference between them?
stm32 interrupts stm32f4
Why there are two pending registers for interrupt? One of them is EXTI_PR and other one is Interrupt Set-pending Registers(ISPR) which is in NVIC controller registers.
EXTI unit pending register:
NVIC unit Pending Register:
Are these two having the same purpose? If not, what is the difference?
Also I am confused about Interrupt Set-enable Registers (ISER) in NVIC unit and Interrupt mask register in EXTI unit. What's the difference between them?
stm32 interrupts stm32f4
stm32 interrupts stm32f4
edited 4 hours ago


Michel Keijzers
5,36862358
5,36862358
asked 4 hours ago


Amin
1308
1308
1
@Michel Keijzers . thanks for your edits.
– Amin
4 hours ago
add a comment |Â
1
@Michel Keijzers . thanks for your edits.
– Amin
4 hours ago
1
1
@Michel Keijzers . thanks for your edits.
– Amin
4 hours ago
@Michel Keijzers . thanks for your edits.
– Amin
4 hours ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
The NVIC is the core peripheral for handling interrupts. The nested vectored interrupt controller if memory serves me right.
The NVIC doesn't know about which peripheral does what, it just handles all the interrupt coming from them.
The NVIC_ISPR0-7 register are used to trigger interrupts by software, so you write a 1 to bit there and the corresponding interrupt will be pending and if the interrupt is enabled it will be handled.
Now the peripherals of the STM32 have their own capabilities to fine tune the interrupt sources. The external interrupt unit you are looking at, can trigger up to 22 different interrupts, only a part of them are mapped to own interrupt vectors of the NVIC. So to distinguish between those, you have to check the EXTI_PR register which interrupts you are currently handling.
If you look close, you can see that you cannot set bits in the EXTI_PR register just by writing a 1 to it, that will actually clear the bit (which you have to do in some cases).
The interrupt set enable register of the NVIC gives you the coarse level of enabling or disabling interrupts. For example you can enable the EXTI9_15 bit there, which will now enable all EXTI interrupts from line 9 to 15, but you maybe just want an interrupt from EXTI line 12. So to allow the fine tuning of this, the EXTI interrupt mask register allows you to only enable line 12 to trigger an interrupt.
You are the best. tnx for your absolute answer.
– Amin
4 hours ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
The NVIC is the core peripheral for handling interrupts. The nested vectored interrupt controller if memory serves me right.
The NVIC doesn't know about which peripheral does what, it just handles all the interrupt coming from them.
The NVIC_ISPR0-7 register are used to trigger interrupts by software, so you write a 1 to bit there and the corresponding interrupt will be pending and if the interrupt is enabled it will be handled.
Now the peripherals of the STM32 have their own capabilities to fine tune the interrupt sources. The external interrupt unit you are looking at, can trigger up to 22 different interrupts, only a part of them are mapped to own interrupt vectors of the NVIC. So to distinguish between those, you have to check the EXTI_PR register which interrupts you are currently handling.
If you look close, you can see that you cannot set bits in the EXTI_PR register just by writing a 1 to it, that will actually clear the bit (which you have to do in some cases).
The interrupt set enable register of the NVIC gives you the coarse level of enabling or disabling interrupts. For example you can enable the EXTI9_15 bit there, which will now enable all EXTI interrupts from line 9 to 15, but you maybe just want an interrupt from EXTI line 12. So to allow the fine tuning of this, the EXTI interrupt mask register allows you to only enable line 12 to trigger an interrupt.
You are the best. tnx for your absolute answer.
– Amin
4 hours ago
add a comment |Â
up vote
3
down vote
accepted
The NVIC is the core peripheral for handling interrupts. The nested vectored interrupt controller if memory serves me right.
The NVIC doesn't know about which peripheral does what, it just handles all the interrupt coming from them.
The NVIC_ISPR0-7 register are used to trigger interrupts by software, so you write a 1 to bit there and the corresponding interrupt will be pending and if the interrupt is enabled it will be handled.
Now the peripherals of the STM32 have their own capabilities to fine tune the interrupt sources. The external interrupt unit you are looking at, can trigger up to 22 different interrupts, only a part of them are mapped to own interrupt vectors of the NVIC. So to distinguish between those, you have to check the EXTI_PR register which interrupts you are currently handling.
If you look close, you can see that you cannot set bits in the EXTI_PR register just by writing a 1 to it, that will actually clear the bit (which you have to do in some cases).
The interrupt set enable register of the NVIC gives you the coarse level of enabling or disabling interrupts. For example you can enable the EXTI9_15 bit there, which will now enable all EXTI interrupts from line 9 to 15, but you maybe just want an interrupt from EXTI line 12. So to allow the fine tuning of this, the EXTI interrupt mask register allows you to only enable line 12 to trigger an interrupt.
You are the best. tnx for your absolute answer.
– Amin
4 hours ago
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
The NVIC is the core peripheral for handling interrupts. The nested vectored interrupt controller if memory serves me right.
The NVIC doesn't know about which peripheral does what, it just handles all the interrupt coming from them.
The NVIC_ISPR0-7 register are used to trigger interrupts by software, so you write a 1 to bit there and the corresponding interrupt will be pending and if the interrupt is enabled it will be handled.
Now the peripherals of the STM32 have their own capabilities to fine tune the interrupt sources. The external interrupt unit you are looking at, can trigger up to 22 different interrupts, only a part of them are mapped to own interrupt vectors of the NVIC. So to distinguish between those, you have to check the EXTI_PR register which interrupts you are currently handling.
If you look close, you can see that you cannot set bits in the EXTI_PR register just by writing a 1 to it, that will actually clear the bit (which you have to do in some cases).
The interrupt set enable register of the NVIC gives you the coarse level of enabling or disabling interrupts. For example you can enable the EXTI9_15 bit there, which will now enable all EXTI interrupts from line 9 to 15, but you maybe just want an interrupt from EXTI line 12. So to allow the fine tuning of this, the EXTI interrupt mask register allows you to only enable line 12 to trigger an interrupt.
The NVIC is the core peripheral for handling interrupts. The nested vectored interrupt controller if memory serves me right.
The NVIC doesn't know about which peripheral does what, it just handles all the interrupt coming from them.
The NVIC_ISPR0-7 register are used to trigger interrupts by software, so you write a 1 to bit there and the corresponding interrupt will be pending and if the interrupt is enabled it will be handled.
Now the peripherals of the STM32 have their own capabilities to fine tune the interrupt sources. The external interrupt unit you are looking at, can trigger up to 22 different interrupts, only a part of them are mapped to own interrupt vectors of the NVIC. So to distinguish between those, you have to check the EXTI_PR register which interrupts you are currently handling.
If you look close, you can see that you cannot set bits in the EXTI_PR register just by writing a 1 to it, that will actually clear the bit (which you have to do in some cases).
The interrupt set enable register of the NVIC gives you the coarse level of enabling or disabling interrupts. For example you can enable the EXTI9_15 bit there, which will now enable all EXTI interrupts from line 9 to 15, but you maybe just want an interrupt from EXTI line 12. So to allow the fine tuning of this, the EXTI interrupt mask register allows you to only enable line 12 to trigger an interrupt.
answered 4 hours ago


Arsenal
11.9k11240
11.9k11240
You are the best. tnx for your absolute answer.
– Amin
4 hours ago
add a comment |Â
You are the best. tnx for your absolute answer.
– Amin
4 hours ago
You are the best. tnx for your absolute answer.
– Amin
4 hours ago
You are the best. tnx for your absolute answer.
– Amin
4 hours ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f404198%2fpending-registers-for-stm32f4-interrupt%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
@Michel Keijzers . thanks for your edits.
– Amin
4 hours ago