Skip to main content
Visitor II
December 11, 2007
Question

Timer2 ST7

  • December 11, 2007
  • 4 replies
  • 1104 views
Posted on December 11, 2007 at 11:09

Timer2 ST7

    This topic has been closed for replies.

    4 replies

    oroviraAuthor
    Visitor II
    December 11, 2007
    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

    Visitor II
    December 11, 2007
    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

    oroviraAuthor
    Visitor II
    December 11, 2007
    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 :-?

    oroviraAuthor
    Visitor II
    December 11, 2007
    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;

    }

    }