/adc-dac-baremetal
Bare-metal ADC and DAC skill. Use when configuring analog sampling, DMA-driven ADC, calibration, or DAC output on MCUs. Activates on queries about ADC bare-metal, sampling time, DMA ADC, or DAC channel setup.
$ npx -y skills add mohitmishra786/low-level-dev-skills --skill adc-dac-baremetal --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/adc-dac-baremetal
Context preview
The summary Claude sees to decide when to auto-load this skill.
Bare-metal ADC and DAC skill. Use when configuring analog sampling, DMA-driven ADC, calibration, or DAC output on MCUs. Activates on queries about ADC bare-metal, sampling time, DMA ADC, or DAC channel setup.
SKILL.md
adc-dac-baremetal.SKILL.mdname: adc-dac-baremetal
description: Bare-metal ADC and DAC skill. Use when configuring analog sampling, DMA-driven ADC, calibration, or DAC output on MCUs. Activates on queries about ADC bare-metal, sampling time, DMA ADC, or DAC channel setup.
ADC and DAC (Bare-Metal)
Purpose
Configure ADC and DAC peripherals: channel selection, sampling times, calibration sequences, DMA circular buffers, and DAC static/dynamic output.
When to Use
- Reading analog sensors (temperature, voltage)
- Audio or control voltage output via DAC
- Continuous sampling with DMA
- Post-reset ADC calibration on STM32
Workflow
1. STM32 ADC single conversion
/* Enable ADC1 and GPIOA clock; PA0 analog mode */
ADC1->CR2 |= ADC_CR2_ADON;
for (volatile int i = 0; i < 10000; i++); /* stabilization — RM value */
ADC1->SMPR2 |= ADC_SMPR2_SMP0_2; /* 84 cycles sample time ch0 */
ADC1->SQR3 = 0; /* channel 0, 1 conversion */
ADC1->CR2 |= ADC_CR2_SWSTART;
while (!(ADC1->SR & ADC_SR_EOC))
;
uint16_t sample = ADC1->DR;Run `ADC_Calibration()` / `ADC_CR2_RSTCAL/CAL` per RM on F1/F4 families.
2. DMA circular ADC
/* ADC1 → DMA2 Stream0, circular mode into buffer[64] */
/* Configure DMA: periph-to-mem, halfword, increment mem, circular */
ADC1->CR2 |= ADC_CR2_DMA | ADC_CR2_CONT;
DMA2_Stream0->CR |= DMA_SxCR_EN;
Half-transfer / transfer-complete IRQs for double buffering.
3. DAC output (STM32)
RCC->APB1ENR |= RCC_APB1ENR_DACEN;
DAC->CR |= DAC_CR_EN1;
DAC->DHR12R1 = 2048; /* mid-scale 3.3V reference */
4. Agent usage
/adc-dac-baremetal Set up ADC1 channel 0 with DMA circular buffer
Common Problems
| Symptom | Cause | Fix | |---------|-------|-----| | Noisy readings | Short sample time | Increase SMP bits | | Stuck EOC | Clock not enabled | RCC ADC enable | | Wrong voltage | Vref not 3.3V | Measure VDDA; calibrate | | DMA corrupt | Buffer alignment | Use `uint16_t` aligned buffer |
Related Skills
- `skills/baremetal/dma-baremetal` — ADC DMA streams
- `skills/baremetal/timers-pwm-baremetal` — ADC external trigger
- `skills/baremetal/gpio-baremetal` — analog pin mode
Read more
name: adc-dac-baremetal description: Bare-metal ADC and DAC skill. Use when configuring analog sampling, DMA-driven ADC, calibration, or DAC output on MCUs. Activates on queries about ADC bare-metal, sampling time, DMA ADC, or DAC channel setup.
ADC and DAC (Bare-Metal)
Purpose
Configure ADC and DAC peripherals: channel selection, sampling times, calibration sequences, DMA circular buffers, and DAC static/dynamic output.
When to Use
- Reading analog sensors (temperature, voltage)
- Audio or control voltage output via DAC
- Continuous sampling with DMA
- Post-reset ADC calibration on STM32
Workflow
1. STM32 ADC single conversion
/* Enable ADC1 and GPIOA clock; PA0 analog mode */
ADC1->CR2 |= ADC_CR2_ADON;
for (volatile int i = 0; i < 10000; i++); /* stabilization — RM value */
ADC1->SMPR2 |= ADC_SMPR2_SMP0_2; /* 84 cycles sample time ch0 */
ADC1->SQR3 = 0; /* channel 0, 1 conversion */
ADC1->CR2 |= ADC_CR2_SWSTART;
while (!(ADC1->SR & ADC_SR_EOC))
;
uint16_t sample = ADC1->DR;Run `ADC_Calibration()` / `ADC_CR2_RSTCAL/CAL` per RM on F1/F4 families.
2. DMA circular ADC
/* ADC1 → DMA2 Stream0, circular mode into buffer[64] */ /* Configure DMA: periph-to-mem, halfword, increment mem, circular */ ADC1->CR2 |= ADC_CR2_DMA | ADC_CR2_CONT; DMA2_Stream0->CR |= DMA_SxCR_EN;
Half-transfer / transfer-complete IRQs for double buffering.
3. DAC output (STM32)
RCC->APB1ENR |= RCC_APB1ENR_DACEN; DAC->CR |= DAC_CR_EN1; DAC->DHR12R1 = 2048; /* mid-scale 3.3V reference */
4. Agent usage
/adc-dac-baremetal Set up ADC1 channel 0 with DMA circular buffer
Common Problems
| Symptom | Cause | Fix | |---------|-------|-----| | Noisy readings | Short sample time | Increase SMP bits | | Stuck EOC | Clock not enabled | RCC ADC enable | | Wrong voltage | Vref not 3.3V | Measure VDDA; calibrate | | DMA corrupt | Buffer alignment | Use `uint16_t` aligned buffer |
Related Skills
- `skills/baremetal/dma-baremetal` — ADC DMA streams
- `skills/baremetal/timers-pwm-baremetal` — ADC external trigger
- `skills/baremetal/gpio-baremetal` — analog pin mode
A curated suite of AI agent skills for systems and low-level programming — C/C++, Rust, Zig, GPU, bare-metal firmware, Linux kernel/driver development, computer architecture, compiler internals, HPC, and more.
Repo: mohitmishra786/low-level-dev-skills
Other skills on low-level-dev-skills.
- /custom-allocators
Custom allocator skill for memory allocation strategies. Use when implementing pool/slab/arena allocators, tuning jemalloc/mimalloc, writing Rust GlobalAlloc, or benchmarking allocator performance. Activates on queries about jemalloc, mimalloc, tcmalloc, arena allocator,
Open skill - /numa-programming
NUMA programming skill for multi-socket memory locality. Use when detecting NUMA topology, binding processes with numactl, using libnuma API, building NUMA-aware data structures, or measuring remote access penalties. Activates on queries about numactl, libnuma, NUMA topology,
Open skill - /af-xdp
AF_XDP skill for high-performance XDP sockets. Use when creating AF_XDP sockets, configuring UMEM and XSK rings, XDP_REDIRECT programs, copy vs zero-copy mode, or comparing with DPDK. Activates on queries about AF_XDP, xsk_umem, XDP_REDIRECT, libbpf xsk, or zero-copy XDP.
Open skill - /dpdk
DPDK skill for userspace packet I/O. Use when initializing EAL, configuring PMD drivers, using mbuf pools and rte_ring, setting up huge pages, RSS, or testpmd validation. Activates on queries about DPDK, EAL, rte_eth_rx_burst, hugepages, PMD, or testpmd.
Open skill - /io-uring
io_uring skill for Linux async I/O. Use when building high-performance servers with liburing, multi-shot operations, provided buffers, fixed files, zero-copy send, or tokio-uring. Activates on queries about io_uring, SQE/CQE, liburing, IORING_OP_PROVIDE_BUFFERS, or io_uring vs
Open skill - /baremetal-startup
Bare-metal startup skill for reset-to-main bring-up. Use when writing startup code, vector tables, .data/.bss init, stack setup, or crt0 for Cortex-M/RISC-V. Activates on queries about reset vector, VTOR, startup.s, bss init, or bare-metal entry point.
Open skill

