Need Help Determining Clock Frequencies for RL78 MCU Configuration

Hi everyone,

I am working on configuring the McuClockReferencePoint container for my RL78-based project as part of the AUTOSAR MCU module setup. The goal is to define all necessary clock frequencies required by various modules and peripherals. While I’ve reviewed the RL78 datasheet, I’m facing challenges in determining the exact configurations due to the dependencies and restrictions outlined in the documentation. I would greatly appreciate guidance or examples to clarify the following:


What I’m Trying to Configure

Below are the specific clock frequencies I need to define, along with their purposes:

  1. Main System Clock Frequency:

    • Used as the primary clock source for the CPU and the system.
    • This is typically derived from the high-speed on-chip oscillator (HSI) or an external crystal oscillator.
    • I need confirmation on the frequency range supported for the main clock and recommendations for optimal configurations.
  2. PLL Clock Frequency:

    • A high-speed derived clock for peripherals like CAN, UART, or SPI.
    • I need to understand:
      • How to configure PLL multipliers/dividers for RL78.
      • Any constraints on maximum supported frequencies or dependencies on the main clock.
  3. Timer Clock Frequency:

    • Used for timer-based operations, especially in low-power modes for tasks like periodic wake-ups or timeouts.
    • What are typical frequencies for timers in RL78, and how are they derived from the main or subsystem clock?
  4. Subsystem Clock Frequency:

    • A low-speed clock typically used for RTCs or other energy-efficient operations.
    • This is derived from the low-speed on-chip oscillator (LSI) or an external 32.768 kHz crystal oscillator.
    • Are there any restrictions or configurations required to ensure compatibility with the RTC or peripherals?

Issues I’m Facing

  1. Dependency Between Clocks:

    • The datasheet mentions that certain clocks (e.g., PLL) are derived from the main system clock. However, the exact dependencies and constraints are not entirely clear.
    • Are there fixed relationships between these clocks that I need to follow?
  2. Configuration Registers:

    • While the datasheet outlines registers for clock settings, consolidating all configurations into a single container is challenging.
    • For example:
      • Which specific registers control the clock dividers and multipliers for the PLL and timers?
      • How are subsystem clocks configured?
  3. Low-Power Mode Compatibility:

    • I need to ensure that the clock configuration supports low-power modes (e.g., halt, stop, snooze) while keeping essential peripherals (like RTC and timers) active.
    • Are there specific settings or frequencies recommended to achieve this?
  4. Documentation Clarity:

    • While I’ve referred to the Clock Generator section of the RL78 documentation, I find it difficult to piece together exact configurations due to scattered details and terminology differences. A consolidated explanation or example would be immensely helpful.

What I Need Help With

I’m looking for:

  1. Recommended Clock Frequencies:

    • Typical values for the main clock, PLL, timer clock, and subsystem clock in RL78-based projects.
    • Any best practices for choosing these frequencies, especially in automotive applications.
  2. Dependencies and Constraints:

    • A clear explanation of how these clocks depend on each other and any limitations imposed by the hardware (e.g., divider/multiplier settings).
  3. Registers or Configuration Steps:

    • Specific details on which registers control the clock settings and how to program them for the required frequencies.
  4. Examples:

    • If anyone has example configurations for McuClockReferencePoint or similar setups on RL78, I would greatly appreciate it.

Additional Context

  • I’m working on an RL78 board and need this configuration as part of the McuClockReferencePoint container in an AUTOSAR-compliant MCU module.
  • Tools in use: Renesas e² studio for development and debugging.
  • Specific peripherals in use: CAN, UART, timers, and RTC.

Any advice, references to relevant sections of the RL78 documentation, or example configurations would be highly valuable. Thank you in advance for your help!

Best regards,

Roshan 

  • Hello Roshan,

    The RL78/F13 Hardware Manual provides detailed information on clock configuration, particularly in Chapter 5, "Clock Generator." This chapter outlines various clock sources like the High-Speed On-Chip Oscillator (HSI), external crystal oscillators, and the Low-Speed On-Chip Oscillator (LSI). It also explains how to use the Phase-Locked Loop (PLL) to generate higher-frequency clocks for peripherals. Chapter 13, "Low-Power Mode," discusses clock settings for different low-power modes, ensuring optimal power consumption. By understanding these chapters and considering factors like frequency range, power consumption, and peripheral requirements, you can effectively configure the McuClockReferencePoint container. The specific configuration steps involve using registers like the Clock Control Register (CCR), Clock Source Selection Register (CSSR), and PLL Control Register (PLLCR). Renesas e² studio provides a user-friendly interface to simplify this process. Remember to consult the RL78/F13 datasheet for device-specific information and limitations.

    RL78/F13, F14 User's Manual: Hardware Rev.2.20

    Kind Regards,

    Payodhi

  • Fig 5-1 of the HW U/M is a nice summary of the clock circuits

    The Applilet tool provides a convenient way to graphically select the clock parameters.  It might be useful to wrap the code generated by this tool with the AUTOSAR compliant API.