Home About Writings Projects Other nthpulse.net

< Return to ATAPIctrl

ATAPIctrl development log

Page created: 15APR2026

Entry III - 10MAY2026

I have implemented drive detection and identification. The firmware first checks for the ATAPI signature (0x14 in the Byte Count HI register and 0xEB in the Byte Count LO register of the connected drive), then issues the IDENTIFY PACKET DEVICE command (opcode 0xA1) and reads the contents of the data register. The firmware can theoretically detect if a hard disk has been connected instead of an optical drive by recognising the absence of the ATAPI signature and the presence of 0x00 instead, but I don't currently have an IDE hard disk with me to test this.

At this stage, I am able to read from and write to the ATA taskfile registers, which is a pre-requirement for being able to send command and data packets to the optical drive. Memory is now becoming a concern as having too many strings in the program will cause printed text to be incorrect, or in some cases, the firmware crashes and resets. I need to move all strings out of RAM (storing constant, unchanging strings in RAM is poor practice to begin with) and into program memory, where ATAPI packets will need to be stored too.

Entry II - 02MAY2026

I have managed to get the UART part of the firmware working and I have implemented a simple command line interface and command interpreter.

Entry I - 16APR2026

Over the past month or so, I drew a schematic and designed a PCB for this project in KiCad, then had it fabricated by JLCPCB. Nearly two weeks passed while the boards were being fabricated and shipped (the manufacturing takes 2-3 days, but the cheapest shipping option brings the wait up to about two weeks). I assembled a board and put together the prototyping setup. The disc drive and ATAPIctrl board are powered through a splitter by a cheap power supply with a molex plug that outputs +5V and +12V. A USBasp programmer is connected to the SPI programming header, which will be the means of uploading the firmware to the board. On the breadboard is a FT232 module (wired to the transmit, receive and ground pins of the ATAPIctrl), which is a USB to UART adapter that will allow me to communicate with the ATAPIctrl over USB from a terminal emulator on my laptop.

I designed the ATAPIctrl board for an ATmega8515 chip in a DIP package as this made the trace routing easier (routing lots of signals from a large connector to a tiny chip is a pain, and many signals conveniently just lined up when using the larger DIP part). I instead installed a TQFP-44 package on a DIP breakout board I made because the TQFP-44 variant was easier to acquire. I did not install a crystal oscillator and load capacitors (parts Y1, C2, C3) for now as I want to get this working with the ATmega8515's internal clock source first. I implemented those footprints as insurance in case I need to run the 8515 at a higher frequency than the internal oscillator.

The quick and easy part is complete. Now comes the long process of writing the firmware...