Breakdown of ADC and RTC
ADC and RTC in Renesas MCU — how they work, features, use cases, and things to watch out for. Use this for interviews and real firmware design.
Breakdown of ADC and RTC
I pulled up specs and driver info, so here’s a breakdown of ADC and RTC in RA6E1 MCU (Renesas) — how they work, features, use cases, and things to watch out for. Use this for interviews and real firmware design.
RA6E1 — Quick Context
- RA6E1 is a Renesas MCU group based on Arm Cortex-M33, runs up to 200 MHz. (Renesas)
- It has built-in analog peripherals including an ADC (12-bit) (Renesas)
- Also includes a Real-Time Clock (RTC) with battery backup area and calendar features. (Mouser Electronics)
- The RA Flexible Software Package (FSP) includes drivers:
r_adcfor ADC andr_rtcfor RTC. (Renesas GitHub)
ADC on RA6E1
Features & Capabilities (from r_adc driver doc)
- Supports resolution: up to 12, 14, or 16 bits (depending on MCU) (Renesas GitHub)
- You can scan multiple analog channels in one conversion sequence. (Renesas GitHub)
It supports special channels like:
- Temperature sensor channel
- Voltage sensor channel
Trigger options:
- Software trigger
- Hardware trigger (e.g. timer)
- External trigger on ADC start pin (ADTRGn) (Renesas GitHub)
Modes:
- Single scan: every trigger runs one conversion cycle
- Continuous scan: repeated conversions automatically
- Group scan: you can divide channels into Group A / B and assign priority and triggers (Renesas GitHub)
Supports features like:
- Adding and averaging multiple sample results
- Sample-and-hold (to stabilize signal during conversion)
- Double trigger (e.g. two conversions back to back)
- Hardware comparator (interrupt or event when threshold crossed) (Renesas GitHub)
Use cases & configuration
- ADC is used to read analog sensors (voltage, current, temperature).
- You’ll often start in single-scan mode or triggered mode, especially in embedded system with timers.
- Be careful about sampling time and input source impedance: high impedance sources require longer sample states.
- Use averaging to reduce noise.
- You can calibrate / offset to correct systematic error. (Renesas GitHub)
Things to watch out
- Conversion time depends on sample state count + resolution.
- Interrupt latency: ADC completion interrupt should be fast if you do post-processing.
- Group prioritization: If Group A is active, it may suspend Group B scans.
- If using multi-channel scanning, ordering and timing matters.
RTC on RA6E1
Features & Description
- It’s a calendar RTC, meaning it keeps track of date and time (seconds, minutes, hours, day, month, year). (Mouser Electronics)
- It supports battery backup (VBATT domain) so the clock continues when main VCC is off. (Mouser Electronics)
- There is backup memory and a switch between
VCCandVBATTso that RTC and some data remain powered in low-power modes. (Mouser Electronics) - It is integrated with the low-speed oscillator (SOSC, typically 32.768 kHz) as the clock source for RTC. (Renesas)
- The FSP has an
r_rtcdriver that manages RTC operations. (Renesas GitHub)
Use & Operation
- On startup, you configure the RTC with initial date/time.
- The RTC increments seconds, minutes, hours, days, etc., with proper wrap-around and handling of leap years etc.
- You can configure interrupts / alarms: e.g. alarm match, periodic interrupt.
- Because it’s in VBATT domain, you must consider domain switching (when power falls or rises).
- In low-power modes, RTC continues while other peripherals are off — useful for waking up on scheduled time.
Things to watch out
- Drift / accuracy: dependent on accuracy of 32.768 kHz oscillator (crystal or internal).
- Power supply switching: ensure proper switching logic between VCC and VBATT so RTC isn’t lost.
- Alarm interrupts: make sure to clear flags and set proper mask so you don’t get spurious interrupts.
- Backup domain write protection: some registers may be protected and need unlocking before writing.
How they compare
| Peripheral | Purpose | Clock source | Key features | Use in low power |
|---|---|---|---|---|
| ADC | Analog-to-digital sensor reading | system clock (derived) | multi-channel, triggers, averaging, comparators | disable when idle to save power |
| RTC | Real-time clock & calendar | low-speed oscillator (32.768 kHz) | calendar, alarm, VBATT domain, backup memory | runs during deep sleep using battery |
References
This post is licensed under CC BY 4.0 by the author.
