beautypg.com

Maxim Integrated 71M6521BE Energy Meter IC Family Software User Manual

Page 52

background image

71M652X Software User’s Guide

Revision 1.7

TERIDIAN Proprietary

52 of 138

© Copyright 2005-2007 TERIDIAN Semiconductor Corporation

tmr0_isr()

Reset tmr0 SW watchdog

yes

no

Restart timer?

Reload with TH0, TL0

Run timer routine for

application

END

Stop timer

application needs

timer0?

no

yes

tmr1_isr()

Reset tmr1 SW watchdog

yes

no

Restart timer?

Reload with TH1, TL1

Run timer routine for

application

END

Stop timer

application needs

timer1?

no

yes

Figure 5-6: Timer ISRs

pTimers =

&Timers[NUM_TIMERS)

i = NUM_TIMERS

stm_run()

N

tick_cnt<>0

Timer present?

Timer expired?

Timer expired

function?

execute Timer expired

function.

N

N

--i == 0

N

pTimers =

&Timers[NUM_TIMERS)

i = NUM_TIMERS

tmr_stop

i == 0 ?

Timer present?

N

--i == 0 ?

N

N

END

Y

Figure 5-7: stm_run() - Process Software Timers (non-ISR)