AnsweredAssumed Answered

simple Interrupt example

Question asked by brahimi.salvador on Sep 5, 2010
Latest reply on Jan 8, 2011 by howard.chris
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

Outcomes