
This project is a digital audio playback controller that streams 8-bit PCM audio samples from an external QSPI Flash memory (such as a W25Qxx series chip) and outputs them using a Pulse Width Modulation (PWM) audio driver.
EF_QSPI_XIP_CTRL):
0x66, 0x99) to ensure the flash is in standard 1-bit SPI mode.0xEB) instruction to fetch audio data in 8-byte (64-bit) chunks.playback_ctrl):
ui_in[1:0]):
00 $\rightarrow$ 0.5x speed (repeats each sample twice).01 $\rightarrow$ 1x speed (normal playback).10 $\rightarrow$ 1.5x speed (alternates between playing sample normally and skipping every 2nd sample).11 $\rightarrow$ 2x speed (skips every other sample).pwm):
uo_out[7] and bidirectional pin uio_out[7].You can run the provided Cocotb test bench locally using make in the test/ directory. The test simulates:
ui_in[1:0] inputs:
ui_in[1:0] = 2'b01 for normal speed.uo_out[7] or uio_out[7]. Since the output is digital PWM, pass the signal through a low-pass filter (see External Hardware) before feeding it to an audio amplifier or speaker.List external hardware used in your project (see Tiny Tapeout Pinout Specs)
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | playback_speed[0] | flash_cs_n | |
| 1 | playback_speed[1] | flash_sd0 | |
| 2 | flash_sd1 | ||
| 3 | flash_sck | ||
| 4 | flash_sd2 | ||
| 5 | flash_sd3 | ||
| 6 | |||
| 7 | pwm_out | audio_out |