23.04.2013 Views

TMPM330 - Keil

TMPM330 - Keil

TMPM330 - Keil

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

(2) Writing clock data<br />

Under development<br />

<strong>TMPM330</strong> (rev0.4) 15-11<br />

<strong>TMPM330</strong><br />

A carry during writing ruins correct data writing. The following procedure ensures the<br />

correct data writing.<br />

1. Using 1Hz interrupt<br />

The count-up of the internal data synchronizes with 1Hz interrupt. Data can be written<br />

correctly if writing data after 1Hz interrupt occurred.<br />

2. Resetting counter<br />

The RTC incorporates 15-stage counter that generates a 1Hz clock from 32,768 KHz.<br />

After resetting the counter, the data is written.<br />

If clearing the counter, an interrupt is output only first writing at half of the setting time.<br />

To ensure the correct clock counting, enable the 1Hz-interrupt after clearing the counter.<br />

And then set the time after the first interrupt (occurs at 0.5Hz) occurs.<br />

Start<br />

PAGER=“0” then<br />

select PAGE0<br />

RESTR=“1” then<br />

reset counter<br />

RESTR=“0” then<br />

enable 1Hz interrupt<br />

First interrupt (After 0.5S)<br />

YES<br />

Time setting<br />

End<br />

Fig. 15-3 Flowchart of the clock data writing<br />

NO<br />

Real Time Clock

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

Saved successfully!

Ooh no, something went wrong!