cancel
Showing results for 
Search instead for 
Did you mean: 

Timer2 ST7

orovira
Associate II
Posted on December 11, 2007 at 11:09

Timer2 ST7

4 REPLIES 4
orovira
Associate II
Posted on December 11, 2007 at 07:23

Hi!!

I am new in this forum And I am new with ST7. I have problem when I want to return from an interrupt done by counter2 overflows. The bit TB2IE never return zero when I ''read'' the register.

How can I read the register? Do I need to change any others bit or register?

Thank in advance for your help :o

fggnrc
Associate II
Posted on December 11, 2007 at 08:52

orovia, it may be that I have not understood your request...

The TB2IE is an abilitation flag, which is set and cleared by software.

Perhaps you mean the TB2F bit which has generally the behaviuor you expect (btw, which micro do you use?).

Regards

EtaPhi

orovira
Associate II
Posted on December 11, 2007 at 10:18

I am wrong I have confused TB2IE with TB2F. I will try again.

I am sorry for my mistake :-?

orovira
Associate II
Posted on December 11, 2007 at 11:09

I have more problems.

I have done a bucle to wait an interrupt from counter2 overflow. I have bit I clear and the bit TB2IE set but I never go to interrupt_handle.

The counter increases and overflows but the bit TB2F does not change, always clear

I copy my part of code.

void moviment (void)

{

int tenp, ihall, espia;

rim(); //bit I del registre CC a 0.

ihall = 0x51;

LTCSR2 = 0x02; // activem interrupció comptador (bit TB2IE a 1)

while (ihall>0x26)

{

PADR = 0x08; //activar port de sortida

delayed();

PADR = 0x00; //desactivar port de sortida

delay();

espia = LTCSR2;

}

}