Skip to main content
Visitor II
September 4, 2010
Question

simple Interrupt example

  • September 4, 2010
  • 1 reply
  • 602 views
Posted on September 05, 2010 at 00:17

Hallo @ All,

I'm just starting with microcontrollers, and my first one is stm8s-Discovery.

GPIO, PWM and some functions of Timers I already understood,

but what I still would like to learn is to write in C is an interrupt.

Is it possible to write an interrupt without a timer?

Could someone give me simple example for an capcom interrupt with this specification:

lets say

PD0 is Output, Hight (LED onboard is off at the begining)

And PE6 is Input ( GPIO_Init(GPIOD, GPIO_PIN_0, GPIO_MODE_OUT_PP_HIGH_FAST);)

And the interrupt should check, if the PE6 is LOW or Hight and set PD0 to LOW or hight.

I would be very thankfull for your help.

Best regards - Salvador

    This topic has been closed for replies.

    1 reply

    Visitor II
    January 8, 2011
    Posted on January 08, 2011 at 17:36

    Brahimi,  the Application Note AN3266 and the accompanying code has an example of simple interrupt processing.

    Chris