Overview

Ameba series products provide multiple timers for user applications:

  • 10 Basic Timers:

    • TIM0-TIM7: Low-frequency Basic Timers (SDM32K clock source)

    • TIM10-TIM11: High-frequency Basic Timers (XTAL40M clock source)

  • 1x 8-channel PWM Timer: TIM8

  • 1x 1-channel Capture Timer: TIM9

  • 1x 32-bit Debug Timer

  • 2 sets of PMC Timers

Basic Timer

Features

  • 32-bit up-counter

  • Overflow interrupt generation

  • Preloadable auto-reload register

  • Sleep mode operation with interrupt wakeup capability

Application Examples

SDK provides two implementation types for Basic Timer:

  • mbed Examples

    • Path: {SDK}\component\example\peripheral\mbed\Timer\mbed_gtimer\{demo}

    • Demonstrates Basic Timer control in mbed environment

  • raw Examples

    • Path: {SDK}\component\example\peripheral\raw\Timer\raw_gtimer\{demo}

    • Demonstrates direct register-level Basic Timer control

Note

Check example’s README.md for supported chip information.

PWM Timer

Features

  • 16-bit up-counter

  • Preloadable auto-reload register

  • 16-bit programmable prescaler

  • Independent PWM generation per channel

  • Supported interrupts:

    • Counter overflow

    • Software update event

    • Channel counter overflow

    • Channel capture/compare

  • Operation modes:

    • PWM mode: Configurable duty cycle and period

    • Input capture: Edge-triggered counter capture

    • One-pulse mode: Programmable delayed pulse generation

Application Examples

SDK provides two implementation types for PWM Timer:

  • mbed Examples

    • Path: {SDK}\component\example\peripheral\mbed\Timer\mbed_pwm

    • Demonstrates PWM control in mbed environment

  • raw Examples

    • Path: {SDK}\component\example\peripheral\raw\Timer\{demo}

    • Demonstrates direct register-level PWM control

Key implementations:

Note

Check example’s README.md for supported chip information.

Capture Timer

Features

  • 16-bit up-counter

  • 16-bit programmable prescaler

  • Preloadable auto-reload register

  • Operation modes:

    • Pulse width measurement

    • Pulse counting within configurable window

Application Examples

SDK provides raw implementation examples for Capture Timer:

  • Path: {SDK}\component\example\peripheral\raw\Timer\{demo}

  • Demonstrates direct register-level capture control

Key implementations:

Note

Check example’s README.md for supported chip information.

Debug Timer

Features

  • Dual clock sources:

    • XTAL40M: 1μs resolution (1MHz from 40MHz crystal)

    • SDM32K: 31μs step per 30.5μs period

  • Sleep mode persistence

  • A lock-free counter: atomic counter access for multi-core systems

PMC Timer

Features

  • 2 sets of PMC Timers (each set contains 4 counters):

    • Sleep countdown counter

    • Deepsleep countdown counter

    • Wakeup counter

    • Reserved counter

  • 32-bit width down counter (stops automatically when reaching 0)

  • Configurable interrupt generation upon reaching 0

  • SDM32K clock source

  • Timer countdown value can be reset during operation