'ZEL' electronics
little home page
last modify 21.december 1999.
This page is built for fast information about our work, and we represent our:
IDE controller principals
Contents:
1. Initial idea & introduction
5. IDE Commands and command cycle
........1. Initial idea and introduction:
Our first idea was to connect IDE disk to some microcontroller (exactly Atmel's 89C52 what we using).First step was to find datasheets about IDE.On the internet you can find much of that, but all of this is very detailed (like ata3-r6.doc, very detailed desription, but this text have 185 pages with much of details what we dont need), or very small texts (like some non-finished project to connect LPT => 8255 => IDE with schematic and some Pascal source with autor's appendix that this project never works, and dont ask him why???).
Note: Our text will no explain some things like 'What is cylinder?' or 'What is Master?'.
Anyway, in this moment we have this:
To make this controller, we dont use ALL IDE pins, so this description is only for used pins.
17,15,13,11,9,7,5,3......D0..D7 (lo byte for data transfers)
2,19,22,24,26,30,40.............GROUND
39......../ACTIVE - useful for LED - activity indicator.
Note: only first register in the table is 16 bit, all other are 8 bit.
Detailed differences between CHS and LBA we will not present.
Most important differences are:
LBA sector numbering comes from sector1 to max.
Number of sectors on IDE disk is (sectors per track)*(number of tracks)*(number of heads).
........4. Register desription:
Upper two tables telling everything about registers except about two status registers.
Most important bits in device status register:
6 - RDY........This bit is 1 when hard reset is finished.
7 - BSY........This bit is 1 when disk is busy.You must wait to be 0 before any command.
Most important bits in secondary status register:
Here is NO explanation for error control.
Note2: any reading/writing to registers you must do by this way:
- set /CS0,/CS1,A0,A1,A2 adress on IDE
- give the /READ or /WRITE signal.
........5. IDE Commands and command cycle:
Note: This is three most important commands, without error control.
First thing is to check RDY bit in status register.
- wait to busy bit in status register go to 0,
- fill the LBA number to registers sector,cyl.lo, cyl.hi, head,
- write the READ command to status register
- wait to DRQ bit in status register go to 1,
- sequentially read 256 words from buffer true data register.
- wait to busy bit in status register go to 0,
- fill the LBA number to registers sector,cyl.lo, cyl.hi, head,
- write the WRITE command to status register
- wait to DRQ bit in status register go to 1,
- sequentially write 256 words to buffer true data register.
First simple idea was to connect 8255 to IDE by this way:
8255 | IDE |
PA | /RST , /RD , /WR , /CS1 , /CS0 , A2 , A1 , A0 (connected by this way from PA7 to PA0 |
PB | D0-D7 |
PC | D8-D15 |
but, there was some little problem.
We invert this five signals (/RST , /RD , /WR , /CS1 and /CS0) by one 7404 and problem is solved.
We are Zlatko Kursar and Zeljko Vincic.Our small company 'ZEL electronics' is placed in Pula, Croatia.Our job is electronics, automatics, software for POS systems and audio equipment.
All summer we spend on the sea trying to learn english, like you can see in this page.
We recommend to visit Bascom Pool if you programming 8051's and so.
Send us a e-mail, or tel/fax : +385 52 21 03 09.
This page was visited times.Thanks.