Skip to main content
Visitor II
September 26, 2003
Question

how to use ST7262 timer interrupt.....

  • September 26, 2003
  • 2 replies
  • 784 views
Posted on September 27, 2003 at 00:04

how to use ST7262 timer interrupt.....

    This topic has been closed for replies.

    2 replies

    top3971Author
    Visitor II
    September 24, 2003
    Posted on September 24, 2003 at 04:33

    Hi! I have some problem in ST7262 programming...

    I want to use timer interrupt every 1sec.

    What register should I enable and how do I use timer function?

    If anyone know this in C language, plz tell me!.

    I will very appreciate your help!!
    Visitor II
    September 26, 2003
    Posted on September 27, 2003 at 00:04

    if you use the Hiware, you can do it

    /*-----------------------------------------------------------------------------

    ROUTINE NAME : INT_TIM

    DESCRIPTION : Comes from the TIM cell.

    -----------------------------------------------------------------------------*/

    #pragma TRAP_PROC // SAVE_REGS

    void INT_TIM(void)

    {

    if (TSR & 0x40)

    {

    asm LD A,OCLR1

    asm LD CRL, A // Reset the free counter

    Clock_Tick++;

    PDDR ^= 0x20;

    }

    else if (TSR & 0x20)

    {

    asm LD A, CRL; // Clear TOF anyway

    asm LD A, OCHR2

    asm LD A, OCLR2; // Clear OCF2 anyway

    }

    }