beautypg.com

Maxim Integrated 71M6513H Power Meter IC Family Software User Manual

Page 48

background image

71M651x Software User’s Guide

function in the main loop of the background task (see Figure 5-7). Eight software timers can be simultaneously
running.

There is an issue with this type of timer processing: The CE_update() routine takes about 400ms,
and when it is executing, it is not checking the tick_tock variable, resulting in the software timers
running slow.
The process_timers() routine was fixed in firmware revision 3.05, where timer0 increments a
count, and the process_timers() routine processes the count, not just the presence of the timer
tick.

timer1 is used for delay functions, e.g. for EEPROM or RTC access control. Timer 1 is enabled and starts functioning
by calling the “Add_Delay_Func()” function as defined in the timer.c module.

TH0 load

TL0 load

tick_tock = TRUE

JUMP

to Init

timer0_isr

reload Timer/counter high byte

reload Timer/counter low byte

Set softwware flag

TR1 = 0

ET1 = 0

(*delay_func) ()

JUMP

to Init

timer1_isr

Execute a timer function

Stop Timer 1

Disable Timer 1

Figure 5-6: Timer ISRs

Revision 2.4

TERIDIAN Proprietary

48 of 137

© Copyright 2005-2006 TERIDIAN Semiconductor Corporation