cancel
Showing results for 
Search instead for 
Did you mean: 

STM8L Interrupt

dsaulheimer
Associate
Posted on October 29, 2014 at 17:07

Hello,

I'm using the STM8L151 using IAR workbench without ST Firmware Library and I'm trying to use an SPI Interrupt. Unfortunatey it doesn't work.

SPI is already running, the receiving flag is set, but i don't get an Interrupt:

This is the configuration:

  SYSCFG_RMPCR1=0x00;                          //MIS0->PB7, MOSI->PB6, SCK->PB5, NSS->PB4

  CLK_PCKENR1=0x10;                             //enable SPI clock

  SPI1_CR1=0x30;                                 //enable SPI, Baurate

  SPI1_CR1_CPOL=0;

  SPI1_CR1_CPHA=1;

  SPI1_CR1_LSBFIRST=0;

  SPI1_CR2_SSM=1;

  SPI1_CR2_SSI=1;

  SPI1_CR1_MSTR=1;

  SPI1_CR1_SPE=1;

  SPI1_ICR_RXIE=1;                    Enable SPI Interrupt

And the Interrupt vector:

&sharppragma vector=SPI_RXNE_vector

__interrupt __root void SPI(void)

{

int a=0;

}

Do i have to enable the Interrupts globally in any Kind?

#spi #stm8l #interrupts
1 REPLY 1
projnikdroid
Associate II
Posted on December 05, 2014 at 10:29

Yes u need to enable the global interrupts