> On Tue, 2006-03-14 at 13:31 -0800, Rob Robson wrote: >> Not being a "C" guy, I'm still a little unclear on the sector read >> process. >> When a "sector read" command (20h) is issued to a drive after feeding it >> the target sector's CHS or LBA address, does DRQ have to be polled before >> reading each word from the drive? How does the drive "know" that you've >> read a word from its buffer? And does it automatically place the next >> sector word on the data lines? In short, what is the step-by-step >> process >> to read 512 bytes through a 16-bit port? > > You can poll DRQ, I found though that at the speed of my PIC in carmon > it wasn't necessary. > > The drive knows you've read the data by you toggling the RDb line. Every > time you toggle that line the drive puts the next word on the line. You really should poll the DRQ line. In normal circumstances the drive will have the data ready long before the PIC can get around to reading it. However, if the drive has to do error correction, or recalibration before returning the data then it can be a bit before DRQ goes active. This is one of those things that will seem to work fine for a long time and then turn around and bite you leaving you wondering what hit you. Bob Ammerman RAm Systems -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist