RENESAS TECHNICAL UPDATE



Similar documents
APPLICATION NOTE. Atmel AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Atmel AVR 8-bit Microcontroller. Introduction.

Hello, and welcome to this presentation of the STM32L4 reset and clock controller.

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.

Software Real Time Clock Implementation on MC9S08LG32

AVR1321: Using the Atmel AVR XMEGA 32-bit Real Time Counter and Battery Backup System. 8-bit Microcontrollers. Application Note.

AN974 APPLICATION NOTE

AVR134: Real Time Clock (RTC) using the Asynchronous Timer. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

APPLICATION. si32library. Callback CMSIS HARDWARE. Figure 1. Firmware Layer Block Diagram

AN LPC1700 RTC hardware auto calibration. Document information. RTC, Hardware Auto Calibration, LPC1700, Graphic LCD

High-Stability Time Adjustment with Real-Time Clock Module

V850E2/ML4 APPLICATION NOTE. Performance Evaluation Software. Abstract. Products. R01AN1228EJ0100 Rev Aug. 24, 2012

Old Company Name in Catalogs and Other Documents

AN3332 Application note

AN3371 Application note

Hello, welcome to this presentation of the low power timer, or LPTMR, module for Kinetis MCUs. In this session you ll learn about the LPTMR, it s

Freescale Semiconductor, Inc. Product Brief Integrated Portable System Processor DragonBall ΤΜ

Hello and welcome to this training module for the STM32L4 Liquid Crystal Display (LCD) controller. This controller can be used in a wide range of

Section 29. Real-Time Clock and Calendar (RTCC)

AVR Timer/Counter. Prof Prabhat Ranjan DA-IICT, Gandhinagar

ARM Cortex STM series

Pulse Output Forced Cutoff Using the Clock Alarm Function and ELC CC-RL

AVR1003: Using the XMEGA Clock System. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AN4646 Application note

Section 7. Oscillator

Backup Power Domain. AN Application Note. Introduction

AVR131: Using the AVR s High-speed PWM. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

GCLK (Generic Clock Management) PM (Power Management) SYSCTRL (Clock Source Control) The following devices can use this module:

Real-Time Clock. * Real-Time Computing, edited by Duncan A. Mellichamp, Van Nostrand Reinhold

ETEC Digital Controls PIC Lab 10 Pulse Width Modulation

Lesson-16: Real time clock DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK

HT46R14A Single Phase AC Induction Motor Frequency Converter Application

Microtronics technologies Mobile:

AN3265 Application note

TURBO PROGRAMMER USB, MMC, SIM DEVELOPMENT KIT

AN2604 Application note

DP8570A DP8570A Timer Clock Peripheral (TCP)

Am186ER/Am188ER AMD Continues 16-bit Innovation

8-bit Microcontroller. Application Note. AVR400: Low Cost A/D Converter

DS1307ZN. 64 x 8 Serial Real-Time Clock

Comparison of MC9S08QE128 and MCF51QE128 Microcontrollers Scott Pape and Eduardo Montanez Systems Engineering, Freescale Microcontroller Division

Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

Using the HT46R46 I/O Ports to Implement Half-Duplex SPI Communication

AN3252 Application note

ontroller LSI with Built-in High- Performance Graphic Functions for Automotive Applications

SAMA5D2. Scope. Reference Documents. Atmel SMART ARM-based MPU ERRATA

AVR32788: AVR 32 How to use the SSC in I2S mode. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

Implementing a Real-Time Clock on the MSP430

General Porting Considerations. Memory EEPROM XRAM

Interfacing Of PIC 18F252 Microcontroller with Real Time Clock via I2C Protocol

SIM SYSTEM INTEGRATION MODULE REFERENCE MANUAL

Fujitsu Microelectronics Europe Application Note MCU-AN E-V10 FR FAMILY 32-BIT MICROCONTROLLER MB91460 CLOCK SUPERVISOR APPLICATION NOTE

HT1632C 32 8 &24 16 LED Driver

Evaluating the Accuracy of Maxim Real-Time Clocks (RTCs)

PCF General description. 2. Features and benefits. 3. Applications. Real-Time Clock (RTC) and calendar

2.0 System Description

AN2868 Application note

AN108 IMPLEMENTING A REALTIME CLOCK. Relevant Devices. Introduction. Key Points. Overview

Figure 1. CodeWarrior IDE with Processor Expert Workspace

IRTC Compensation and 1 Hz Clock Generation

AT15007: Differences between ATmega328/P and ATmega328PB. Introduction. Features. Atmel AVR 8-bit Microcontrollers APPLICATION NOTE

ET-BASE AVR ATmega64/128

Application Note AN_299. FT800_FT801_Internal_Clock _Trimming

ECP & ECP240-32EX

How to maintain safety and reliability in your MCU design

Serial Communications

Flexible Active Shutter Control Interface using the MC1323x

8-bit Microcontroller. Application Note. AVR415: RC5 IR Remote Control Transmitter. Features. Introduction. Figure 1.

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

Atmel Norway XMEGA Introduction

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

Section 14. Compare/Capture/PWM (CCP)

PCF85263A. 1. General description. 2. Features and benefits. 3. Applications

Section bit A/D Converter

Design of a High Speed Communications Link Using Field Programmable Gate Arrays

1/22/16. You Tube Video. Definitions. Duty Cycle: on-time per period (specified in per cent)

Microprocessor & Assembly Language

71M6521 Energy Meter IC. Real Time Clock Compensation. The Challenge. The RTC in the 71M6521D/F. Theory of Operation APPLICATION NOTE

AN LPC1700 timer triggered memory to GPIO data transfer. Document information. LPC1700, GPIO, DMA, Timer0, Sleep Mode

Quick Start Guide. MRB-KW01 Development Platform Radio Utility Application Demo MODULAR REFERENCE BOARD

A Lesson on Digital Clocks, One Shots and Counters

PAC52XX Clock Control Firmware Design

Hello, and welcome to this presentation of the STM32 SDMMC controller module. It covers the main features of the controller which is used to connect

Freescale Semiconductor, I

STM32F411xC STM32F411xE

A Lesson on Digital Clocks, One Shots and Counters

AVR319: Using the USI module for SPI communication. 8-bit Microcontrollers. Application Note. Features. Introduction

STM32L. Ultra-low-power Cortex -M3 devices

R8C/13 Group Hardware Manual

AN1229. Class B Safety Software Library for PIC MCUs and dspic DSCs OVERVIEW OF THE IEC STANDARD INTRODUCTION

Lab Experiment 1: The LPC 2148 Education Board

STM32 F-2 series High-performance Cortex-M3 MCUs

Lab 4: Pulse Width Modulation and Introduction to Simple Virtual Worlds (PWM) (PWM)

ARM Thumb Microcontrollers. Application Note. Software ISO 7816 I/O Line Implementation. Features. Introduction

Z8 Encore! XP F082A Series Development Kit

It should be corrected as indicated by the shading below.

Embedded Patient Monitoring System

AN2586 Application note

HyperAccess Access Control System

Transcription:

RENESAS TECHNICAL UPDATE TN-RX*-A***A/E RENESAS TECHNICAL UPDATE 1753, Shimonumabe, Nakahara-ku, Kawasaki-shi, Kanagawa 211-8668 Japan Renesas Electronics Corporation Date: Apr. 1, 2013 Product Category MPU & MCU Document No. TN-RX*-A A/E Rev. 1.00 Title Notes on Realtime Clock Initialization after Power-on in the RX63N Group and the RX631 Group Information Category Technical Notification Applicable Product RX63N Group, RX631 Group Lot No. All Reference Document RX63N Group, RX631 Group User s Manual: Hardware Rev.1.60 (R01UH0041EJ0160) 1. Notes Due to the realtime clock (RTC) specifications, registers in the RTC module are not reset by MCU reset signals, including the RES# pin reset and watchdog timer reset. The register values are retained after a reset. Since register values in the RTC module are undefined after power-on, an appropriate initialization procedure is required. Table 1.1 lists notes on initialization of the RTC described in the user s manual. 2013. Renesas Electronics Corporation, All rights reserved. Page 1 of 8

Table 1.1 Notes on RTC Initialization Item Value after reset Notes General The peripheral module clock (PCLK) frequency must be equal to or higher than the count source frequency. Oscillation of the sub-clock is controlled with both bits SOSCCR.SOSTP and RCR3.RTCEN. When using the sub-clock as the RTC count source, control the sub-clock with the RCR3.RTCEN bit. Before oscillating the sub-clock, make sure to also set the RCR3.RTCDV[2:0] bits. The sub-clock starts oscillating immediately after power-on. Even when stopping the oscillation, the sub-clock starts oscillating again after a reset. When using the main clock as the RTC count source, the main clock oscillation frequency cannot be above 16.777216 MHz. Oscillation of the main clock is controlled with both bits MOSCCR.MOSTP and MOFCR.MOFXIN. MOFCR.MOFXIN bit 0 After modifying this bit, make sure that the value has been updated and then execute the next process. When setting this bit to 1, the main clock does not stop oscillating even in software standby mode. RCR2.RESET bit 0 Once 1 is written to this bit, make sure that this bit has been modified to 0 and then execute the next instruction. When a count source is not supplied, an RTC software reset cannot be used. RCR3.RTCEN bit Undefined After modifying this bit, make sure that the value has been updated and then execute the next process. When the RCR4.RCKSEL bit is 1, oscillation of the sub-clock cannot be controlled with this bit. When setting this bit to 1, the sub-clock does not stop oscillating even in software standby mode. RCR3.RTCDV[2:0] bits Undefined During oscillation of the sub-clock, do not modify these bits. After modifying these bits, make sure that the value has been updated and then execute the next process. RCR4.RCKSEL bit Undefined Set this bit only once after power-on. Page 2 of 8

2. RTC Initialization Procedure After power-on, perform the following procedure to initialize the RTC. Power-on Is the RTC used? No Yes Which clock is used? Main clock Sub-clock Case A Oscillate the sub-clock (Refer to A or B in TN-RX*-A052A/E) Configure the system clock Stop and reset the RTC Initialize the RTC the RTC Case B Oscillate the main clock Configure the system clock Stop and reset the RTC Initialize the RTC the RTC Sub-clock Which clock is used? Main clock No clock Case C Oscillate the sub-clock (Refer to C in TN-RX*-A052A/E) Case D Oscillate the main clock Case E Stop the sub-clock (Refer to D in TN-RX*-A052A/E) Configure the system clock Configure the system clock Stop and reset the RTC Stop and reset the RTC Stop the RTC Disable interrupt requests Disable interrupt requests Disable interrupt requests Figure 2.1 RTC Initialization Flowchart Page 3 of 8

A. When operating the RTC with the sub-clock The following is the procedure to operate the RTC using the sub-clock as a count source. Oscillate the sub-clock For the sub-clock settings, refer to A. When using the sub-clock as a count source of the RTC in Technical Update Notes on Sub-clock Initialization in the RX630 Group, RX63N Group, and RX631 Group (TN-RX*-A052A/E). When using the sub-clock only as the RTC count source, it is also possible to use the procedure described in B. When using the sub-clock only as an RTC count source. Configure the system clock After a reset, the LOCO clock is selected as a system clock. Since the LOCO clock frequency is higher than the sub-clock frequency, the system clock does not need to be changed. If the system clock needs to be changed, configure the system clock while making sure that the PCLK frequency is not lower than sub-clock frequency. Stop and reset the RTC Registers in the RTC are undefined after power-on. Before using the RTC, perform an RTC software reset to initialize these registers. (4) Initialize the RTC Set each RTC-associated register and then set the time and alarm. For details, refer to the user s manual. (5) the RTC Set the RTC to start. Figure 2.2 shows a flowchart of the procedure described above. Oscillate the sub-clock Configure the system clock if required Set the RCR2.START bit to 0 (counters and prescaler are stopped) SOSCCR. SOSTP bit RCR3. RTCEN bit Confirm that the RCR2.START bit is 0 Set the RCR2.RESET bit to 1 (reset) Wait for the RCR2.RESET bit to become 0 See note 1 1 (4) Set each RTC-accociated register (5) Set the RCR2.START bit to 1 (counters and prescaler operate normally) Confirm that the RCR2.START bit is 1 Note 1. The value depends on the sub-clock settings. Figure 2.2 Initialization Flowchart When Operating the RTC with the Sub-clock Page 4 of 8

B. When operating the RTC with the main clock The following is the procedure to operate the RTC with the main clock as a count source. Oscillate the main clock Refer to the user's manual to set the main clock oscillation, and then wait until oscillation stabilizes. The MOFCR.MOFXIN bit must be set to 1 (the main clock oscillator is forcedly oscillated) so as not to stop the main clock in software standby mode. Configure the system clock After a reset, the LOCO clock is selected as a system clock. Since the LOCO clock frequency is lower than the main clock frequency, the system clock must be changed. Stop and reset the RTC Registers in the RTC are undefined after power-on. Before using the RTC, perform an RTC software reset to initialize these registers. (4) Initialize the RTC Set each RTC-associated register and then set the time and alarm. For details, refer to the user s manual. (5) the RTC Set the RTC to start. Figure 2.3 shows a flowchart of the procedure described above. Set the RCR4.RCKSEL bit to 1 (the main clock is selected) Oscillate the main clock Wait for main clock oscillator stabilization wait time Configure the system clock *1 Set the RCR2.START bit to 0 (counters and prescaler are stopped) MOSCCR. MOSTP bit 1 0 MOFCR. MOFXIN bit (4) (5) Confirm that the RCR2.START bit is 0 Set the RFRH/RFRL register to generate a 128-Hz clock Set the RCR2.RESET bit to 1 (reset) Wait for the RCR2.RESET bit to become 0 Set each RTC-associated register Set the RCR2.START bit to 1 (counters and prescaler operate normally) Confirm that the RCR2.START bit is 1 See note 2 1 Note 1. Make sure that the PCLK frequency is not lower than the main clock oscillation frequency. Note 2. When using the main clock also as a system clock, set this bit to 0. When using the main clock only for the RTC, set it to 1. Figure 2.3 Initialization Flowchart when Operating the RTC with the Main Clock Page 5 of 8

C. When not using the RTC (when the sub-clock can be used as a count source) The following is the procedure to stop the RTC using the sub-clock as a count source. Oscillate the sub-clock Oscillate the sub-clock according to the procedure described in C. When using the sub-clock only as a system clock of Technical Update Notes on Sub-clock Initialization in the RX630 Group, RX63N Group, and RX631 Group (TN-RX*-A052A/E). Configure the system clock After a reset, the LOCO clock is selected as a system clock. Since the LOCO clock frequency is higher than the sub-clock frequency, the system clock does not need to be changed. If the system clock needs to be changed, configure the system clock while making sure that the PCLK frequency is not lower than the sub-clock frequency. Stop and reset the RTC Registers in the RTC are undefined after power-on. Perform an RTC software reset to initialize these registers. (4) Disable RTC interrupt requests Initialize the RCR1 register as it was not initialized in step above. Figure 2.4 shows a flowchart of the procedure described above. SOSCCR. SOSTP bit RCR3. RTCEN bit Oscillate the sub-clock Configure the system clock if required Set the RCR2.START bit to 0 (counters and prescaler are stopped) Confirm that the RCR2.START bit is 0 Set the RCR2.RESET bit to 1 (reset) Wait for the RCR2.RESET bit to become 0 0 0 (4) Set the RCR1 register to 00h Confirm that the RCR1 register is 00h Figure 2.4 Initialization Flowchart When Not Using the RTC (When the Sub-clock Can Be Used) Page 6 of 8

D. When not using the RTC (when the main clock can be used as a count source) The following is the procedure to stop the RTC using the main clock as a count source. Oscillate the main clock Refer to the user's manual to set the main clock oscillation, and then wait until oscillation stabilizes. Configure the system clock After a reset, the LOCO clock is selected as the system clock. Since the LOCO clock frequency is lower than the main clock frequency, the system clock must be changed. Stop and reset the RTC Registers in the RTC are undefined after power-on. Perform an RTC software reset to initialize these registers. (4) Disable RTC interrupt requests Initialize the RCR1 register as it was not initialized in step above. Figure 2.5 shows a flowchart of the procedure described above. Set the RCR4.RCKSEL bit to 1 (the main clock is selected) Oscillate the main clock Wait for main clock oscillator stabilization wait time Configure the system clock *1 MOSCCR. MOFCR. MOSTP bit MOFXIN bit 1 Set the RCR2.START bit to 0 (counters and prescaler are stopped) Confirm that the RCR2.START bit is 0 Set the RCR2.RESET bit to 1 (reset) 0 0 Wait for the RCR2.RESET bit to become 0 (4) Set the RCR1 register to 00h Confirm that the RCR1 register is 00h Note 1. Make sure that the PCLK frequency is not lower than the main clock oscillation frequency. Figure 2.5 Initialization Flowchart When Not Using the RTC (When the Main Clock Can Be Used) Page 7 of 8

E. When not using the RTC (when neither the main clock nor sub-clock can be used) When neither the main clock nor sub-clock can be used, an RTC software reset cannot be used. Perform the following procedure to stop the RTC. Stop the sub-clock Even when there is no crystal for the sub-clock, the SOSCCR.SOSTP bit is 0 (sub-clock oscillator is operating) and the RCR3.RTCEN bit is undefined after power-on. It is required to set these bits to stop the oscillation. For details, refer to the procedure described in D. When not using the sub-clock of Technical Update Notes on Sub-clock Initialization in the RX630 Group, RX63N Group, and RX631 Group (TN-RX*-A052A/E). Stop the RTC The RCR2.START bit value is undefined after power-on. Set this bit to 0 (counters and prescaler are stopped) to stop the RTC. Disable RTC interrupt requests Since a count source is not supplied, an RTC software reset cannot be used. Even if writing a value to the RCR1 register, the register value is not updated. Interrupt requests are disabled by the ICU. Since time capture events cannot be disabled, make sure to set pins RTCIC0 to RTCIC2 not to be in the high-impedance state. Figure 2.6 shows a flowchart of the procedure described above. Stop the sub-clock Write 0 to the RCR2.START bit (counters and prescaler are stopped) *1 Set bits IER0B.IEN4 (ALM) and IER0B.IEN5 (PRD) to 0 Set bits IR92.IR (ALM) and IR93.IR (PRD) to 0 Note 1. Since a count source is not supplied, the RCR2 register value is not updated. Do not confirm a written value. Figure 2.6 Initialization Flowchart When Not Using the RTC (When Neither the Main Clock nor the Sub-clock Can Be Used) Page 8 of 8