05.01.2015 Views

Measuring Duty Cycles with an Intel MCS-51 ... - Smartec

Measuring Duty Cycles with an Intel MCS-51 ... - Smartec

Measuring Duty Cycles with an Intel MCS-51 ... - Smartec

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

INITIALISING PART<br />

TIMER1=offset<br />

TIMER0=0<br />

Input signal = 1<br />

no<br />

yes<br />

Input signal = 0<br />

yes<br />

Interrupt enable<br />

Invoke IDLE<br />

TIMER0 run<br />

TIMER1 run<br />

Disable interrupt<br />

Input signal = 0<br />

no<br />

TIMER1 overflow<br />

yes<br />

no yes<br />

Input signal = 1<br />

interrupt<br />

Interrupt enable<br />

Invoke IDLE<br />

1-0 tr<strong>an</strong>sition of<br />

sensorsignal<br />

No<br />

yes<br />

Stop TIMER0<br />

Stop TIMER1<br />

Disable interrupt<br />

Subtract offset from TIMER1<br />

Calculate duty cycle<br />

Figure 2. Flow diagram of a duty-cycle measurement <strong>with</strong> a resolution of one machine cycle.<br />

3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!