cancel
Showing results for 
Search instead for 
Did you mean: 

simple Interrupt example

mischap
Associate
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

1 REPLY 1
chrischris9
Associate
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