AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Timers Pwm Baremetal

skill-mohitmishra786-low-level-dev-skills-timers-pwm-baremetal · by mohitmishra786

Bare-metal timer and PWM skill. Use when configuring general-purpose timers for PWM, input capture, or periodic ticks without RTOS. Activates on queries about timer prescaler, PWM duty cycle, input capture, or SysTick bare-metal.

No reviews yet
0 installs
7 views
0.0% view→install

Install

$ agentstack add skill-mohitmishra786-low-level-dev-skills-timers-pwm-baremetal

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-mohitmishra786-low-level-dev-skills-timers-pwm-baremetal)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Timers Pwm Baremetal? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Timers and PWM (Bare-Metal)

Purpose

Configure MCU timers for PWM output, input capture, and periodic scheduling: prescaler/ARR setup, compare channels, and SysTick as a simple tick source.

When to Use

  • Motor/LED dimming via PWM
  • Measuring pulse width (input capture)
  • Bare-metal millis() without FreeRTOS
  • Hardware periodic sampling trigger

Workflow

1. PWM on TIM2 CH1 (STM32)

f_pwm = f_timer_clk / ((PSC+1) * (ARR+1))
duty = (CCR / (ARR+1)) * 100%
RCC->APB1ENR |= RCC_APB1ENR_TIM2EN;

TIM2->PSC  = 83;      /* 84MHz / 84 = 1 MHz tick */
TIM2->ARR  = 999;     /* 1 kHz PWM */
TIM2->CCR1 = 500;     /* 50% duty */
TIM2->CCMR1 |= (6U CCER  |= TIM_CCER_CC1E;
TIM2->CR1   |= TIM_CR1_CEN;

GPIO: PA0 AF1 TIM2_CH1.

2. SysTick tick

volatile uint32_t tick_ms;

void SysTick_Handler(void) {
    tick_ms++;
}

void systick_init(uint32_t hz) {
    SysTick_Config(SystemCoreClock / hz);
}

3. Input capture

Configure channel in CCMR as input, set CCER polarity, read CCR on interrupt when edge captured.

4. Agent usage

/timers-pwm-baremetal 1 kHz 25% duty PWM on TIM2 channel 1

Common Problems

| Symptom | Cause | Fix | |---------|-------|-----| | Wrong frequency | APB timer clock doubling | Check RM timer clock x2 rule | | No PWM output | CCER/CCMR not enabled | Enable channel output | | Jittery tick | SysTick overridden | One owner for SysTick |

Related Skills

  • skills/baremetal/gpio-baremetal — timer pin AF
  • skills/embedded/freertos — replace SysTick with RTOS tick
  • skills/baremetal/adc-dac-baremetal — timer TRGO for ADC trigger

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.