RT-Thread RT-Spark Development Board wired for Lab 10, with oscilloscope probes connected to the DAC output (PA4) and SW1 button (PB2) for signal monitoring.
25 Hz sine wave output captured during busy-wait playback. The waveform immediately flatlines upon pressing SW1, demonstrating how blocking the main loop directly halts signal generation with no buffering.
25 Hz sine wave output captured during interrupt-driven playback. The waveform continues for approximately 10 ms after pressing SW1 before stopping, showing the queue buffer absorbing the delay before underflow occurs.
STM32CubeMX clock configuration set to 168 MHz using HSI as the PLL source. This clock frequency is referenced in delay.c as CLK_FREQ for accurate microsecond and millisecond timing calculations.
TIM2 configured with Internal Clock source and Channel 1 set to Output Compare No Output mode. The timer interrupt is enabled in NVIC settings and its period is set dynamically at runtime by timer_init() in platform.c.
DAC Channel 1 configured with no trigger and output buffer enabled. The DAC output on PA4 serves as the analog waveform output, updated each timer ISR firing via dac_set() with 12-bit resolution (0–4095).
GPIO configuration showing PF8, PF9, and PF10 as push-pull outputs for the onboard RGB LED, and PB2 configured as a pull-up input for the SW1 button used to simulate processing interference.
Main program configured for Section 4.3 interrupt-driven mode, generating a 25 Hz sine wave with a 40, 000 µs period. The BUSY_WAIT macro is commented out to select interrupt-driven playback using the queue-buffered tone_play_with_interrupt() function.


Comments