04.03.2013 Views

RL78/D1A User's Manual: Hardware - Renesas

RL78/D1A User's Manual: Hardware - Renesas

RL78/D1A User's Manual: Hardware - Renesas

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.

Under development<br />

Preliminary document<br />

Specifications in this document are tentative and subject to change.<br />

<strong>RL78</strong>/<strong>D1A</strong> CHAPTER 7 REAL-TIME CLOCK<br />

Figure 7-23. Procedure for Writing Real-time Clock<br />

No<br />

No<br />

Start<br />

RWAIT = 1<br />

RWST = 1?<br />

Yes<br />

Writing SEC<br />

Writing MIN<br />

Writing HOUR<br />

Writing WEEK<br />

Writing DAY<br />

Writing MONTH<br />

Writing YEAR<br />

RWAIT = 0<br />

RWST = 0? Note<br />

End<br />

Yes<br />

Stops SEC to YEAR counters.<br />

Mode to read and write count values<br />

Checks wait status of counter.<br />

Writes second count register.<br />

Writes minute count register.<br />

Writes hour count register.<br />

Writes week count register.<br />

Writes day count register.<br />

Writes month count register.<br />

Writes year count register.<br />

Sets counter operation.<br />

Note Be sure to confirm that RWST = 0 before setting STOP mode.<br />

Caution 1. Complete the series of operations of setting the RWAIT bit to 1 to clearing the RWAIT bit to 0<br />

within 1 second.<br />

2. When changing the values of the SEC, MIN, HOUR, WEEK, DAY, MONTH, and YEAR register<br />

while the counter operates (RTCE = 1), rewrite the values of the MIN register after disabling<br />

interrupt servicing INTRTC by using the interrupt mask flag register. Furthermore, clear the<br />

WAFG, RIFG and RTCIF flags after rewriting the MIN register.<br />

Remark The second count register (SEC), minute count register (MIN), hour count register (HOUR), week count<br />

register (WEEK), day count register (DAY), month count register (MONTH), and year count register (YEAR)<br />

may be written in any sequence.<br />

All the registers do not have to be set and only some registers may be written.<br />

R01UH0317EJ0004 Rev. 0.04<br />

Feb. 22, 2013<br />

478

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

Saved successfully!

Ooh no, something went wrong!