AVR mod player using ATmega325 microcontroller

Summary of AVR mod player using ATmega325 microcontroller


In 2006, the author participated in a Dutch forum competition to create demos on home-built hardware without using full PCs. The project aimed to generate vector graphics via an oscilloscope and audio using a custom MOD player. While the video component remained unfinished due to design flaws and noise, the audio subsystem was successfully built using an ATmega325 microcontroller, parallel flash memory, and an operational amplifier. The system played MOD files by reading samples and notes from memory, initially prototyped with an ATmega32 before upgrading to the final microcontroller for better performance.

Parts used in the Home-Built Demo Project:

  • Oscilloscope
  • ATmega325 microcontroller
  • 4MBit parallel flash memory (AT49F040A)
  • Op-amp
  • ATmega32 microcontroller
  • Breadboard
  • C# program

In 2006, I took part in an electronic demo competition on a Dutch forum (see this topic). Because computer demos like they used to have on old machines like the Amiga or Commodore are harldy made anymore since hardware has come such a long way, someone had the idea to do the same, but on home built hardware. You could use things like a simple microcontroller but not a complete PC or powerful development board, and had to make something with cool graphics, audio, etc.
The competition never really ended properly since most contestants did not have enough time to finish their projects. I came a long way, at least the audio part was working very well but the video part was both poorly designed and never finished.
My idea was to use an oscilloscope as the video output device to show some vector graphics, and create a mod player to provide the audio. The video part of the project had some design flaws and terrible noise in the DACs so I never really finished that part. Also, the audio part was much more fun. The modplayer was built using an ATmega325, an 4MBit parallel flash memory (AT49F040A) and an op-amp to amplify the audio.

MOD file format

The MOD file format is a combination of audio samples and a set of notes on a timeline. FastTracker was one of the programs you could use to edit MOD files, although it was mainly used for the superior XM format.
fasttracker avr
A maximum of four channels can be used in a MOD, each can play one sample at a time from the sample set. The sample is played at a specific pitch depending on the note in the channel. Additionally, effects can be added to the notes such as volume or pitch fades.
To get familiar with the details of the MOD format I first wrote a C# program that displayed the patterns in the MOD and could also play the MOD file:
modreader

Prototype

After that I wrote a converter for the MOD into a slightly different format that was nearly the same format but in an easier to handle structure. Then I built a prototype with an ATmega32 on a breadboard. Because no external flash was used in the prototype the MOD had to fit in the 32KB flash of the AVR along with the firmware which limited the prototype to very small MOD files. But it worked.
For more detail: AVR mod player using ATmega325 microcontroller

Quick Solutions to Questions related to Home-Built Demo Project:

  • What was the goal of the 2006 electronic demo competition?
    The goal was to create demos with cool graphics and audio on home-built hardware like simple microcontrollers instead of complete PCs.
  • How was the video output intended to be displayed?
    The video part was designed to use an oscilloscope to show vector graphics.
  • Why was the video part of the project never finished?
    The video part had poor design flaws and terrible noise in the DACs, so it was never completed.
  • Which microcontroller was used for the working audio mod player?
    The audio mod player was built using an ATmega325 microcontroller.
  • What type of memory was used to store the audio data?
    A 4MBit parallel flash memory specifically the AT49F040A was used.
  • Can you play MOD files with four channels simultaneously?
    Yes, a maximum of four channels can be used in a MOD file, each playing one sample at a time.
  • What limited the size of MOD files in the initial prototype?
    The prototype used an ATmega32 without external flash, limiting MOD files to fit within its 32KB internal flash.
  • What software was mentioned for editing MOD files?
    FastTracker was one of the programs mentioned that could be used to edit MOD files.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top