cancel
Showing results for 
Search instead for 
Did you mean: 

How to program a Interrupt for a stop watch

adrian239955_stm1
Associate
Posted on June 25, 2008 at 17:30

How to program a Interrupt for a stop watch

1 REPLY 1
adrian239955_stm1
Associate
Posted on May 17, 2011 at 09:54

Hi everybody!

I know this must be a small problem but as a beginner I just don't know how to configure an Interrupt. The interrupt should inkrement a variable every 0.1 ms. The variable would then serve me as basic for my stop watch.

Code:

if (Interrupt)

overflow++;

if(overflow>=10){

overflow=0;

millisec++;}

if(millisec>=100)

overflow=0;

sec++;}

and so on

My board: MCBSTR-9

Best wishes

adrian