September 20th, 2024

One-chip sound player – Dmitry.GR

The project develops a single-chip audio player using the PIC12F1840 microcontroller, featuring a custom SD card driver, PWM audio output, and support for uncompressed WAV files with future enhancements planned.

Read original articleLink Icon
One-chip sound player – Dmitry.GR

The project described involves the development of a single-chip audio player using the PIC12F1840 microcontroller, which operates at a clock rate of up to 33 MHz. The design utilizes a hardware SPI module to facilitate communication with an SD card, allowing for efficient audio data retrieval. The audio output is generated through a PWM waveform, amplified by a MOSFET, and the system is designed to enter a low-power sleep mode when not in use. The custom SD card driver supports various card types and operates at a bus speed of 8 MHz. A simple circular buffer is implemented to manage audio data streaming, while a minimal FAT16 filesystem (uFAT) is used to handle file management. The audio playback mechanism relies on a timer interrupt to adjust the PWM duty cycle based on audio sample values. The system is capable of playing uncompressed WAV files, with a focus on 8-bit samples for optimal performance. The project also includes a random number generator to ensure varied audio playback. Future updates may enhance filesystem support and improve code efficiency. The project is currently in a state where feedback is welcomed, and the code will be released after further refinement.

- The audio player is built on the PIC12F1840 microcontroller.

- It uses a custom SD card driver and a minimal FAT16 filesystem for file management.

- Audio playback is achieved through PWM output and a circular buffer for data streaming.

- The system can play uncompressed WAV files, optimized for 8-bit samples.

- Future updates may expand filesystem capabilities and improve code structure.

Related

Link Icon 1 comments