cancel
Showing results for 
Search instead for 
Did you mean: 

Need clarifications on NVIC IRQ

nanayakkaraan
Associate II
Posted on October 27, 2010 at 07:54

Need clarifications on NVIC IRQ

9 REPLIES 9
stforum2
Associate II
Posted on May 17, 2011 at 14:13

The NVIC (nested vectored interrupt controller) is part of the ARM Cortex-M3 core.

An interrupt must be enabled in the the NVIC otherwise it will be ignored.

Best regards

Crossware

http://www.crossware.com/

lowpowermcu
Associate II
Posted on May 17, 2011 at 14:13

Hi ANN,

I hope that ST engineer or someone else correct me if I am wrong.

EXTI means external interrupt controller and it is made by ST

NVIC means Nest vector interrupt controller and it is made by ARM.

EXTI is mainly used for external interrupt control: edge config(rising, falling or both), mode (event or interrupt)

To use let say PA0 as interrupt source:

you should configure EXTI0 line then connect PA0 to EXTI0 and finally configure NVIC correspnding to EXTI0 line.

I hope that EXTI controller is the same for both STM32F1xx and STM32L1xx.

I hope it is clear.

HErzlich,

MCU Lüfter

nanayakkaraan
Associate II
Posted on May 17, 2011 at 14:13

Hello Crossware,

Thanks for replying.

Can you please explain, how to enable an interrupt on NVIC?

The things given in the reference manual is not clear to me.

I believe that there is a set of registers in STM32L, which need to be configured.

Any support provided is highly appreciated.

Thank you.

nanayakkaraan
Associate II
Posted on May 17, 2011 at 14:13

Hello Lowpoermcu,

''You should configure EXTI0 line then connect PA0 to EXTI0 and finally configure NVIC correspnding to EXTI0 line.''

Can you please explain which registers of STM32 needs to be configured to achieve above configurations.

Thank you.

lowpowermcu
Associate II
Posted on May 17, 2011 at 14:13

Hi ANN,

1- GPIO configuration using GPIO registers

2- configure EXTI using EXTI registers

3- connect PA0 to EXTI0 using ''SYSCFG_EXTICR1'' In fact EXTI0  can be connected to PA0 or PB0 or PC0 or ..... and you have to select the pin through these registers.

4- configure NVIC

    NVIC_InitStructure.NVIC_IRQChannel = EXTI0_IRQn;

    NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x0F;

    NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F;

    NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;

    NVIC_Init(&NVIC_InitStructure);

    refer to ''Interrupt and exception vectors '' section in the reference manual.

That is my comprehension from documentation and I hope that I can get an STM32152-EVAL.

Herzlich,

MCU Lüfter

stforum2
Associate II
Posted on May 17, 2011 at 14:13

Hello Ann

We use Wizards for these configuration things.

In the image below you can see the NVIC code for EXTI0.  To start with you only need the first line.  You can set the priorty later when you know what you want it to be.

This is for the STM32F103.

0690X00000602iJQAQ.jpg

Best regards

Crossware

http://www.crossware.com/

Posted on May 17, 2011 at 14:13

If you have difficulty coping with direct register access, why don't you just use the ST Library??

lowpowermcu
Associate II
Posted on May 17, 2011 at 14:13

Hi,

because ST library doesn't support STM32L devices, STM32L152-EVAL isn't available and we are ''thirsty'' to use STM32L.

we start documentation from reference manual ans waiting for ST.

MCU Lüter

nanayakkaraan
Associate II
Posted on May 17, 2011 at 14:13

Hello all,

This is the solution I found.

In order to make the interrupt works on STM32L152 within IAR workbench I needed to included the following files, other than the header file stm32l1xx.h.

  • stm32l1xx_it.h
  • system_stm32l1xx.h
  • core_cm3.h
After that to invoke TIM4 interrupt i needed to have the expression in my main program.

 NVIC_EnableIRQ(TIM4_IRQn);

The ISR that needs to be implemented with TIM4 IRQ should be mentioned in stm32l1xx_it.c.

:)

Thank you.