cancel
Showing results for 
Search instead for 
Did you mean: 

how to use ST7262 timer interrupt.....

top3971
Associate II
Posted on September 27, 2003 at 00:04

how to use ST7262 timer interrupt.....

2 REPLIES 2
top3971
Associate II
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!!
yu-jun
Associate II
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

}

}