Motor de Búsqueda de Datasheet de Componentes Electrónicos
Selected language     Spanish  ▼

Delete All
ON OFF
ALLDATASHEET.ES

X  

Preview PDF Download HTML

UPD703103A Datasheet(PDF) 92 Page - NEC

No. de Pieza. UPD703103A
Descripción  32-Bit Single-Chip Microcontrollers
Descarga  99 Pages
Scroll/Zoom Zoom In 100% Zoom Out
Fabricante  NEC [NEC]
Página de inicio  http://www.nec.com/
Logo 

UPD703103A Datasheet(HTML) 92 Page - NEC

Zoom Inzoom in Zoom Outzoom out
 92 / 99 page
background image
CHAPTER 5 APPLICATION EXAMPLES
Application Note U17121EJ1V1AN
92
//
//
/////////////////////////////////////////////////////////////////////////
int ATA_PIO_dataout(ATA_COMMAND *atacom, UHWORD sector_count, void *buff)
{
UBYTE dev, idestat;
UWORD *buffp;
int i, j, status;
buffp = (UWORD*)buff;
dev = ( atacom->device_head >> 4 ) & 1;
status = ATA_Device_Selection(dev);
// DEVICE SELECTION
if ( status != 0 ) {
return STATUS_TIMEOUT_DEVICE_SELECTION;
// DEVICE SELECTION timeout
}
*IDEREG_FEATURES
= atacom->features;
// Features register
*IDEREG_SECTOR_COUNT
= atacom->sector_count;
// SectorCount register
*IDEREG_SECTOR_NUMBER = atacom->sector_number; // SectorNumber register
*IDEREG_CYLINDER_LOW
= atacom->cylinder_low;
// CylinderLow register
*IDEREG_CYLINDER_HIGH = atacom->cylinder_high; // CylinderHigh register
status = Wait_IDE_DRDY1();
// Loop until DRDY=1
if ( status != 0 ) {
return STATUS_TIMEOUT_DRDY1;
// DRDY timeout
}
*IDEREG_COMMAND = atacom->command;
// Command register
wait(TIMER400ns);
// Wait 400 ns
status = Wait_IDE_BSY0_DRQ0();
// Wait until BSY=0, DRQ=0
if ( status != 0 ) {
return STATUS_TIMEOUT_BSY0_DRQ0;
// BSY timeout error end
}
for ( i=0; i<sector_count; i++ ) {
for ( j=0; j<128; j++ ) {
// Data write
*IDEREG_DATA = *buffp;
buffp++;
}
status = Wait_IDE_INTRQ();
// Wait for INTRQ assert
if ( status != 0 ) {
return STATUS_TIMEOUT_INTRQ;
// INTRQ timeout error
}
idestat = *IDEREG_STATUS;
// Status register read (INTRQ clear)
}
if ( idestat & IDEREG_ERROR_ERR_BIT ) {


Html Pages

1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90  91  92  93  94  95  96  97  98  99 


Datasheet Download




Enlace URL




Privacy Policy
ALLDATASHEET.ES
Does ALLDATASHEET help your business so far?  [ DONATE ]  

Todo acerca de Alldatasheet   |   Publicidad   |   Contáctenos   |   Política de Privacidad   |   Favorito   |   Intercambio de Enlaces   |   Lista de Fabricantes
All Rights Reserved© Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn