0% found this document useful (0 votes)
80 views7 pages

Interfacing A Hard Disk Drive To An AT91RM9200 Microcontroller

AT91RM9200 embeds a CompactFlash(r) Glue Logic that can be adapted to support such a peripheral. AT91RM920-based microcontroller can be used to access a Hard Disk Drive. External Bus interface signals are needed to connect the drive to the microcontroller.

Uploaded by

mehdij80
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views7 pages

Interfacing A Hard Disk Drive To An AT91RM9200 Microcontroller

AT91RM9200 embeds a CompactFlash(r) Glue Logic that can be adapted to support such a peripheral. AT91RM920-based microcontroller can be used to access a Hard Disk Drive. External Bus interface signals are needed to connect the drive to the microcontroller.

Uploaded by

mehdij80
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Interfacing a Hard Disk Drive to an AT91RM9200

Microcontroller

AT91 ARM®
1. Scope
Thumb®
This Application Note describes the AT91RM9200 hardware and software interface
for a hard disk drive. The AT91RM9200 embeds a CompactFlash® Glue Logic that Microcontrollers
can be adapted to support such a peripheral.

1.1 Reference Documents


Application Note
The following table gives the references of the documents and their denominations in
this Application Note.

Table 1-1. Reference Document Table


Owner - Reference Denomination
Atmel Literature Number 1768 AT91RM9200 Datasheet
AT Attachment Interface Document, American National Standards
Institute, X3.221-1994

6023B–ATARM–06-Jan-06

1
2. Hardware Interface

2.1 External Bus Interface Signals


The External Bus Interface integrates circuitry to interface with CompactFlash devices using
Attribute, Memory and I/O modes. Most of these signals can be used to connect a hard disk
drive to the AT91RM9200.
Note: For a full description of external bus interface signals, refer to the EBI Programmer Datasheet.
This document only contains information relevant to accessing a hard disk drive.
Note: The External Bus Interface does not allow DMA accesses.

Table 2-1. EBI Signals for HDD Support


EBI Name HDD Name Function Type Active Level
CFIOR _IOR HDD I/O Read Signal Output Low
CFIOW _IOW HDD I/O Write Signal Output Low
CFRNW HDD Read Not Write Output
CFCS HDD Chip select Output Low
A0-A2 A0-A2 Address Bus Output
D0-D15 D0-D15 Data Bus Input/Output
NWAIT IORDY HDD Ready Signal Input High

2.2 Other AT91RM9200 Signals


In addition to the External Bus interface signal, the hard disk drive requires the signals shown
in Table 2-2.

Table 2-2. Other AT91RM9200 Signals for HDD Support


AT91RM9200
Name HDD Name Function Type Active Level
PC11-PC12 _CS0-_CS1 HDD Chip Select Output Low
(1)
PC5 _RESET HDD Reset Output Low

Note: 1. Or any free PIO.


Other HDD signals are not handled by the AT91RM9200 microcontroller.

2 Application Note
6023B–ATARM–06-Jan-06
Application Note
2.3 HDD Application Example

Figure 2-1. HDD Application Example


AT91RM9200 IDE Connector

D[15:0] D[15:0]

DIR /OE

A25/CFRNW
CSEL
NCS4/CFCS

/OE
A[2:0] A[2:0]

NWR1/CFIOR _IORD

NWR3/CFIOW _IOWR

PC11 _CS0

PC12 _CS1

PC6/NWAIT IORDY

PC5 _RESET

3
6023B–ATARM–06-Jan-06
3. Software Interface

3.1 External Bus Interface Signal Handling


The EBI CompactFlash Glue Logic integrates a fourth memory space that can be accessed
through NCS4 (i.e., between 0x5000 0000 and 0x5FFF FFFF).
This memory space, True IDE Mode Space, is intended to access CompactFlash in True IDE
Mode (Hard Disk Drive, so).

Table 3-1. Address Map


True IDE Mode Space
Offset 0x00C0 0000
I/O Mode Space
Offset 0x0080 0000
Common Memory Mode Space
Offset 0x0040 0000
Attribute Memory Mode Space
Offset 0x0000 0000

To use the CompactFlash Glue Logic feature, the following PIOs must be set as peripherals:
– PC6 that enables NWAIT
– PC7 that enables A23
– PC9 that enables A25_CFRNW
– PC10 that enables NCS4_CFCS
Moreover, the CompactFlash Glue Logic must be activated via the Chip Select 4 Assignment
Field in the EBI User Interface.

3.2 Handling Other AT91RM9200 Signals


In Attribute, Memory and I/O modes, PC11 - PC12 signals that are connected to CS0 - CS1
HDD signals are used by the EBI to manage CFCE1 - CFCE2 to enable upper-byte and lower-
byte access on the data bus of the CompactFlash.
As this behavior is not compatible with IDE accesses, these signals must be configured as
PIOs, i.e., PC11 and PC12.
PC11 and PC12 levels must be set by software before the access to the HDD.

4 Application Note
6023B–ATARM–06-Jan-06
Application Note
Data Bus Width must be set depending on the access needed. See Table 3-2.

Table 3-2. Signals Depending on Access Type


Access PC11 PC12 Offset D[15:8] D[7:0] SMC_CSR4 (DBW)
Byte R/W Task File Register Access 0 1 1 - 7h Don’t Care/High Z Odd/Even Byte 8-bit
Half-word R/W Task File Data
0 1 0h Odd Byte Even Byte 16-bit
Register Access
Byte W Control Register
Byte R Alt Status Register 1 0 6 - 7h Don’t Care/High Z Odd/Even Byte 8-bit
Byte R/W Drive Access Register

3.3 Timings
The SMC2_CSR4 Chip Select is to be programmed depending on the HDD timing accesses.
Typical values are listed in Table 3-3.

Table 3-3. Timing Parameter Values


Parameter Value
NWS 10
TDF 0
RWS 5
RWH 3

3.4 Software Example


An example HDD driver describing signal management with the AT91 software package can
be downloaded from the Atmel web site http://www.atmel.com.

4. Warranty
All delivered sources are free of charge and can be copied or modified without authorization.
The software is delivered "AS IS" without warranty or condition of any kind, either express,
implied or statutory. This includes without limitation any warranty or condition with respect to
merchantability or fitness for any particular purpose, or against the infringements of intellectual
property rights of others.

5
6023B–ATARM–06-Jan-06
5. Revision History
Table 5-1. Revision History
Document Ref. Comments Change Request
6023A First issue.
6023B Updated referenced documents in Table 1-1, “Reference Document Table,” on page 1. 04-312

6 Application Note
6023B–ATARM–06-Jan-06
Atmel Corporation Atmel Operations
2325 Orchard Parkway Memory RF/Automotive
San Jose, CA 95131, USA 2325 Orchard Parkway Theresienstrasse 2
Tel: 1(408) 441-0311 San Jose, CA 95131, USA Postfach 3535
Fax: 1(408) 487-2600 Tel: 1(408) 441-0311 74025 Heilbronn, Germany
Fax: 1(408) 436-4314 Tel: (49) 71-31-67-0
Fax: (49) 71-31-67-2340
Regional Headquarters Microcontrollers
Europe 2325 Orchard Parkway 1150 East Cheyenne Mtn. Blvd.
Atmel Sarl San Jose, CA 95131, USA Colorado Springs, CO 80906, USA
Route des Arsenaux 41 Tel: 1(408) 441-0311 Tel: 1(719) 576-3300
Case Postale 80 Fax: 1(408) 436-4314 Fax: 1(719) 540-1759
CH-1705 Fribourg
Switzerland La Chantrerie Biometrics/Imaging/Hi-Rel MPU/
Tel: (41) 26-426-5555 BP 70602 High Speed Converters/RF Datacom
Fax: (41) 26-426-5500 44306 Nantes Cedex 3, France Avenue de Rochepleine
Tel: (33) 2-40-18-18-18 BP 123
Asia Fax: (33) 2-40-18-19-60 38521 Saint-Egreve Cedex, France
Room 1219 Tel: (33) 4-76-58-30-00
Chinachem Golden Plaza ASIC/ASSP/Smart Cards Fax: (33) 4-76-58-34-80
77 Mody Road Tsimshatsui Zone Industrielle
East Kowloon 13106 Rousset Cedex, France
Hong Kong Tel: (33) 4-42-53-60-00
Tel: (852) 2721-9778 Fax: (33) 4-42-53-60-01
Fax: (852) 2722-1369
1150 East Cheyenne Mtn. Blvd.
Japan Colorado Springs, CO 80906, USA
9F, Tonetsu Shinkawa Bldg. Tel: 1(719) 576-3300
1-24-8 Shinkawa Fax: 1(719) 540-1759
Chuo-ku, Tokyo 104-0033
Japan Scottish Enterprise Technology Park
Tel: (81) 3-3523-3551 Maxwell Building
Fax: (81) 3-3523-7581 East Kilbride G75 0QR, Scotland
Tel: (44) 1355-803-000
Fax: (44) 1355-242-743

Literature Requests
www.atmel.com/literature

Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any
intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN ATMEL’S TERMS AND CONDI-
TIONS OF SALE LOCATED ON ATMEL’S WEB SITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY
WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDEN-
TAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT
OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no
representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications
and product descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically provided
otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel’s products are not intended, authorized, or warranted for use
as components in applications intended to support or sustain life.

© Atmel Corporation 2006. All rights reserved. Atmel ®, logo and combinations thereof, Everywhere You Are ® and others are registered trade-
marks or trademarks of Atmel Corporation or its subsidiaries. ARM ®, the ARMPowered logo ® and others are the registered trademarks of ARM
Ltd. Other terms and product names may be trademarks of others.

Printed on recycled paper.

6023B–ATARM–06-Jan-06

You might also like