2007-12-11 02:09 AM
2007-12-10 10:23 PM
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 :o2007-12-10 11:52 PM
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 EtaPhi2007-12-11 01:18 AM
I am wrong I have confused TB2IE with TB2F. I will try again.
I am sorry for my mistake :-?2007-12-11 02:09 AM
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; } }