Skip to main content
Visitor II
October 29, 2014
Question

STM8L Interrupt

  • October 29, 2014
  • 1 reply
  • 845 views
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
    This topic has been closed for replies.

    1 reply

    Visitor II
    December 5, 2014
    Posted on December 05, 2014 at 10:29

    Yes u need to enable the global interrupts