Home About Writings Projects Other nthpulse.net

< Return to Projects

ATAPIctrl - control an IDE disc drive using UART

Project development log

This project is an adapter that allows sending track control commands to and retrieving track information from an IDE disc drive, over a serial interface. The board will contain a microcontroller that listens to the serial interface for textual keywords such as "PLAY" or "SKIP", and then send the appropriate ATA packets to the disc drive to perform these functions. The board will also be able to print current track information and time back over the serial interface.

This project is similar to, and inspired by, the ATAPIduino project by Carlos Durandal, with a few differences. The ATAPIduino requires additional chips to provide more IO pins, and the connected Arduino bit-bangs the ATAPI protocol, while being able to simultaneously show track information on a display and read button inputs, effectively making a complete CD player. My ATAPIctrl project will be a single-chip board, and intended to be a drop-in module that simplifies communication with an IDE disc drive, but cannot be a CD player on its own and requires an external microcontroller to coordinate the operation. The benefit of my solution is that it is a general-case module that makes developing a DIY CD player easier, or can alternatively be connected to a vintage computer over a RS232 serial port, which will then be an interface for the CD player. Below are two diagrams of how it might be used/how I intend on using it.

I have been studying the ATAPI interface in order to understand how I would bring this to fruition, and I have written a small article to both help others understand and to reinforce my own understanding. Read it here if interested: Understanding the ATAPI interface.

For this project, I require a microcontroller with a large number of inputs/outputs. I am slightly biased towards AVR chips because I have the most experience with them, I like the documentation and have programmed them in bare-metal C before. I inspected this ATmega chip comparison table to decide on a microcontroller to use. Futurlec have comparison tables for various microcontroller series that I recommend for deciding on a part to use. I initially decided upon the ATmega32A, but changed my mind a few days later for the ATmega8515, which has 3 more I/O pins and is £1 cheaper, but has a quarter of the program memory and RAM of the 32A.

With the ATmega8515, I have 35 I/O pins to use, which is enough to accommodate: the ATA bus signals; the transmit, receive and flow control signals for UART; and in-circuit programming pins, while leaving some spare pins that can be used as configuration bits.

Page created: 15APR2026
Last modified: 16APR2026