This application note describes initialization, general
rules, programming model and performance analysis for
the MPC5200 ATA interface, mainly from a software
perspective. The main focus is to help system architects
understand which mode under what circumstances is
optimal for the final product. Detailed software examples
can be found on the publicly available CD with sample
code for the MPC5200. The MPC5200B microcontroller
is based on an e300
instruction set.
The ATA interface is used to connect:
•Hard disks
•CD-ROMs
•DVDs
•Flash storage devices
The MPC5200 ATA interface is fully compatible with
AT A/AT API-4 specification (A T Attachment with Packet Interface Extension, ANSI NCITS 317-1998) supporting
all three groups of modes:
•PIO (from PIO-0 to PIO-4) – up to 16.7 MBytes/sec
•Multiword DMA (from MDMA-0 to MDMA-2) – up to 16.7 MBytes/sec
•Ultra DMA (from UDMA-0 to UDMA-2) – up to 33 MBytes/sec
MPC5200 supports 27-bit and 48-bit LBA addressing on every device.
2ATA Interface
The MPC5200 ATA interface includes three groups of registers:
•AT A host registers – host configuration, timing values for all modes (from PIO, MDMA, UDMA)
•ATA FIFO registers – control ATA FIFO for DMA modes (MDMA, UDMA)
•ATA drive registers – access to the registers physically located on the ATA drive
Figure 1 illustrates basic components of the MPC5200 ATA interface internal to the MPC5200. Data
transfer is driven either by MPC5200 core (PIO) or by the BestComm DMA engine (MDMA, UDMA).
BestComm is designed to offload the MPC5200 core and can transfer data to/from different peripherals
simultaneously. The MPC5200 ATA interface is clocked by the IPBI clock of the MPC5200 processor
(66/132 MHz). MPC5200 acts as an ATA host and can control up to two ATA devices as defined in
ATA/ATAPI-4 specification. Pin ATA_ISOLATION of the MPC5200 (not defined as a signal by
ATA/ATAPI-4 spec) connects to the transceiver’s OE pin to control the direction (high = write to drive,
low = read from drive) of the transfer.
BestComm
(higher priority)
IPBI
(lower priority)
ATA device 0
(e.g. DVD drive)
MPC5200
ATA Rx/Tx FIFO
Interface
(MDMA/UDMA)
Arbiter
IPBI Interface
IPBI clock (66/132 MHz)
ATA 40-pin cable
(PIO)
ATA
Line
Drivers
3.3 V – 5 V
ATA Host Interface
ATA_ISOLATION
ATA device 1
(e.g. CompactFlash)
Figure 1. ATA Architecture
MPC5200 ATA Interface, Rev. 0
Freescale Semiconductor2
ATA Interface
2.1Electrical Characteristics
AT A is a vo ltage level interface and the table below defines the voltage levels fo r logical ones and zeroes
or input and output values.
Table 1. ATA DC Characteristics
DescriptionMinMax
Driver sink current1
I
oL
I
V
V
V
V
NOTES:
1
IoL for DASP shall be 12 mA minimum to meet legacy timing and signal integrity.
2
IoH value at 400 mA is insufficient in the case of DMARQ that is typically pulled low by a 5.6 kW
resistor.
Driver source current
oH
Voltage input high (logical one)2.0 Vdc—
iH
Voltage input low (logical zero)—0.8 Vdc
iL
Voltage output high (IoH=-400 µA, logical one)2.4 Vdc—
oH
Voltage output low (IoL= 12 mA, logical zero)—0.5 Vdc
oL
2.2Signals
ATA SignalATA Acronym MPC5200 PinDirection
Cable selectCSEL—>28
Chip select 0CS0-ATA_CSB0>37
Chip select 1CS1-ATA_CSB1>38
Data bus bit 0DD0ATA_DATA_0<>17
Data bus bit 1DD1ATA_DATA_1<>15
2
Table 2. ATA Signals
4mA—
400 µA—
40-Pin
ATA Cable
Data bus bit 2DD2ATA_DATA_2<>13
Data bus bit 3DD3ATA_DATA_3<>11
Data bus bit 4DD4ATA_DATA_4<>9
Data bus bit 5DD5ATA_DATA_5<>7
Data bus bit 6DD6ATA_DATA_6<>4
Data bus bit 7DD7ATA_DATA_7<>3
Data bus bit 8DD8ATA_DATA_8<>4
Data bus bit 9DD9ATA_DATA_9<>6
Data bus bit 10DD10ATA_DATA_10<>8
Data bus bit 11DD11ATA_DATA_11<>10
Data bus bit 12DD12ATA_DATA_12<>12
Data bus bit 13DD13ATA_DATA_13<>14
MPC5200 ATA Interface, Rev. 0
Freescale Semiconductor3
ATA Interface
Table 2. ATA Signals (continued)
ATA SignalATA Acronym MPC5200 PinDirection
Data bus bit 14DD13ATA_DATA_14<>16
Data bus bit 15DD14ATA_DATA_15<>18
Device active or slave (Device 1)
present
Device address bit 0DA0ATA_SA_0>35
Device address bit 1DA1ATA_SA_1>33
Device address bit 2DA2ATA_SA_2>36
DMA acknowledgeDMACK-ATA_DACK_B>29
DMA requestDMARQATA_DRQ<21
Interrupt requestINTRQATA_INTRQ<31
I/O read
DMA ready during Ultra DMA data in
bursts
Data strobe during Ultra DMA data
out bursts
I/O ready
DMA ready during Ultra DMA data
out bursts
Data strobe during Ultra DMA data in
bursts
I/O write
Stop during Ultra DMA data bursts
Passed diagnostics
Cable assembly type identifier
DASP-—>39
DIOR-
HDMARDY-
HSTROBE
IORDY-
DDMARDY-
DSTROBE
DIOW-
STOP
PDIAGCBLID-
ATA _IO R _ B>
>
>
ATA_IOCHRDY<
<
<
ATA _ IO W _B>
>
-<>34
40-Pin
ATA Cable
25
27
23
ResetRESET-HRESET_B>1
GroundGND2,19,22,24,
26,
30,40
2.3IO Cable
The cable specification impacts system integrity and the maximum length that shall be supported in any
application. Cable total length shall not exceed 0.46 m (18 in.). Cable capacitance shall not exceed 35 pF.
80-pin grounded cable helps to avoid problems with noise and inductance although 40-pin cable is
sufficient for modes up to UDMA-2 as in the ATA/ATAPI-4 spec. Also ATA/ATAPI-4 compliant
termination is a must; otherwise, CRC checksum error may randomly occur.
MPC5200 ATA Interface, Rev. 0
Freescale Semiconductor4
ATA Interface
2.4Byte Ordering
Assuming a block of data contains "n" bytes of information, the bytes are labeled Byte(0) through
Byte(n-1), where Byte(0) is the first byte of the block, and Byte(n-1) is the last byte of the block. Table 3
shows the order of the bytes on the ATA interface.
This section describes the generation of the actual address (CSn-, DAn) that is present on the physical A TA
interface to address an ATA drive register by means of operations on internal registers of the MPC5200.
Table 4 shows how internal registers are decoded to ATA bus operations.
Table 4. ATA Register Address/Chip Select Decoding
.
AddressesFunctions
MPC5200
register
address
—11xxxData bus high impedanceNot used
—100xxData bus high impedanceNot used
—1010xData bus high impedanceNot used
0x3A5C10110Drive alternate statusDrive device control
—10111ObsoleteNot used
0x3A6001000Drive dataDrive data
0x3A6401001Drive errorDrive features
0x3A6801010Drive sector countDrive sector count
0x3A6c01011Drive sector numberDrive sector number
0x3A7001100Drive cylinder lowDrive cylinder low
0x3A7401101Drive cylinder highDrive cylinder high
CS0- CS1- DA2DA1DA0
READ (DIOR-)WRITE (DIOW-)
Control Block Registers
Drive LBA bits 0-7*Drive LBA bits 0-7*
Drive LBA bits 8-15*Drive LBA bits 8-15*
Drive LBA bits 16-23*Drive LBA bits 16-23*
Freescale Semiconductor5
MPC5200 ATA Interface, Rev. 0
ATA Interface
Table 4. ATA Register Address/Chip Select Decoding (continued)
0x3A7801110Drive device/headDrive device/head
Drive LBA bits 24-27*Drive LBA bits 24-27*
0x3A7C01111Drive device statusDrive command
—00xxxInvalid addressInvalid address
*Mapping of registers in LBA mode
2.6Sector Addressing
The addressing of data sectors recorded on the device's media is performed by a logical sector address.
Two modes are supported:
•Cylinder/head/sector addressing (CHS)
•Logical block addressing (LBA)
The MPC5200 host system may select either CHS translation addressing or LBA addressing on a
command-by-command basis by using the LBA bit in the ATA drive device/head register. The LBA bit
must be set if the host uses LBA addressing mode. The MPC5200 allows 27-bit LBA addressing per
device.
2.7ATA Programming Model
Figure 2 describes the typical structure and sequence of steps needed to initialize and issue ATA
commands for MPC5200.
MPC5200 ATA Interface, Rev. 0
Freescale Semiconductor6
Loading...
+ 14 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.