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
13 Basic Timers:
TIM0-TIM7: Low-frequency Basic Timers (SDM32K clock source)
TIM10-TIM14: High-frequency Basic Timers (XTAL40M clock source)
1x 8-channel PWM Timer: TIM8
1x 1-channel Capture Timer: TIM9
1x 32-bit Debug Timer
13 Basic Timers:
TIM0-TIM7: Low-frequency Basic Timers (SDM32K clock source)
TIM10-TIM14: High-frequency Basic Timers (XTAL40M clock source)
1x 8-channel PWM Timer: TIM8
1x 1-channel Capture Timer: TIM9
1x 32-bit Debug Timer
13 Basic Timers:
TIM0-TIM7: Low-frequency Basic Timers (SDM32K clock source)
TIM10-TIM14: High-frequency Basic Timers (XTAL40M clock source)
1x 8-channel PWM Timer: TIM8
1x 1-channel Capture Timer: TIM9
1x 32-bit Debug Timer
12 Basic Timers:
TIM0-TIM7: Low-frequency Basic Timers (SDM32K clock source)
TIM10-TIM13: High-frequency Basic Timers (XTAL40M clock source)
1x 6-channel PWM Timer: TIM8
1x 1-channel Capture Timer: TIM9
1x 32-bit Debug Timer
4 Basic Timers: TIM0-TIM3 with software-configurable clock source (SDM32K/XTAL40M)
4x 4-channel PWM Timers: TIM4-TIM7
1x 1-channel Capture Timer: TIM8
1x 64-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:
raw_pwm: PWM mode demo
raw_tim_capture_pwm_32k: Input capture demo
raw_tim_pwm_one_pulse: One-pulse mode demo
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:
raw_tim_pulse_width_32k: Pulse width measurement
raw_tim_pulse_num_32k: Pulse counting implementation
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
There is no PMC timer
There is no PMC timer
There is no PMC timer
There is no PMC timer
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