Re: I need some consultancy from someone with ATAPI design expertise

From: Toby Thain (toby_at_telegraphics.com.au)
Date: 11/04/04


Date: 3 Nov 2004 22:10:07 -0800

cs_posting@hotmail.com (Chris Stratton) wrote in message news:<ae2ff5ca.0411030936.3e1dc8a8@posting.google.com>...
> calin_dorohoi@yahoo.com (Calin Dorohoi) wrote in message news:<a1cf1181.0411010400.979fb9d@posting.google.com>...
> >
> > I have this project that involves interfacing with an ATAPI CD-ROM.
> > The device will read audio CD's (nb: CD-DA CD's not data CD's with
> > MP3's) using the READ CD command (rip CD's). The device will be
> > autonomous, independent from any PC.
> >
>
> Why not try to get it working on an older stipped down PC under dos or
> linux, writing all the drivers to talk directly to the hardware (on an
> old board, the IDE interface is scarcely more than some buffer chips).

This is not a bad idea but would likely entail doing it twice - and I
don't recommend debugging an IDE driver twice :). It's not really
feasible to make the code portable between the two unless you already
know your target MCU, the quirks of its compiler, and you're adept at
making C portable under very difficult conditions.

> This will give you a handle on the complexity of the task, in
> particular any 'gotchas' with regard to getting CD-DA working
> reliably. Then you can choose a suitable micocontroller, and either
> port your c code from the PC or implement all or part of it in the
> apporpriate assembly language.

I can confirm that the PIC18 can do it; I've just got direct-connected
ATA and ATAPI working with a PIC18F6680 (40MHz external clock, but it
could be much slower). Program size for my driver, including error
checking, many text strings, a simple RS232 command monitor and
utility routines such as ASCII formatting, is around 3Kb, with RAM use
<100 bytes excluding the 2048+ byte sector buffer (the buffer is
unavoidable if there is a data rate mismatch, as sounds likely). It's
1800 lines of PIC18 assembler; the higher level parts of my project
will probably be in C. With unused and debugging code removed, I am
sure it could be trimmed to something like half the size.

>
> My personal preference would be to use linux as a development platform
> will a full human interface and convince the IDE driver to ignore the
> second IDE interface so that you can do your experiments there. Just
> don't copy any of the linux IDE or ATAPI code unless you are willing
> to GPL your project too.

It would be practically impossible to re-use even tiny fragments of
O/S drivers on a PIC. If licensing is an issue, there is of course
much BSD code available for reference, and I intend for my project to
be released GPL in any case...

--T

>
> Chris



Relevant Pages