мда лекция по уфологии...
а я удевляюсь тому что вместо производственной практики у химика-технолога(!!!) перепись...
roboforum.ruТехнический форум по робототехнике. |
|
|
Errata sheet LPC2378 Rev. 08 — 1 April 2010 писал(а):EMC.1: Write operation cannot be performed on the external memory
bus
Introduction:
The External Memory Controller supports asynchronous static memory device support
including RAM, ROM, and flash, with or without asynchronous page mode.
Problem:
Write operation is not operational.
Work-around:
Using all the EMC pins as GPIO pins, the write operation can be simulated in software.
DWORD MCI_Send_ACMD_Bus_Width( DWORD buswidth )
{
DWORD i, retryCount;
DWORD respStatus;
DWORD respValue[4];
retryCount = 0x20; /* reset retry counter */
while ( retryCount > 0 )
{
if ( MCI_Send_ACMD() == FALSE )
{
continue;
}
/* Send ACMD6 command to set the bus width */
MCI_SendCmd( SET_ACMD_BUS_WIDTH, buswidth, EXPECT_SHORT_RESP, 0 );
respStatus = MCI_GetCmdResp( SET_ACMD_BUS_WIDTH, EXPECT_SHORT_RESP, (DWORD *)&respValue[0] );
if ( !respStatus && ((respValue[0] & (0x0F << 8)) == 0x0900) )
{
return ( TRUE ); /* response is back and correct. */
}
for ( i = 0; i < 0x20; i++ );
retryCount--;
}
return( FALSE );
}
/* Due to reversed H/W logic in the MCB2300 board, the MCI power pin
needs to be configured as GPIO pin that I need to set it active low manually,
once it's set as MCI power pin, it will be active high. */
/*connect MCI signals to P0.19-P0.22, and P2.11-P2.13*/
PINSEL1 = 0x2A80;
PINSEL4 = 0x0A800000;
#if MCB2300_VERSION_0
SCS |= 0x08;
#if 0
PINSEL1 = 0x2280;
PINSEL4 = 0x0A800000;
IODIR0 = 1 << 21; /* MCI_PWR as GPIO output */
IOCLR0 = 1 << 21;
#endif
#else
SCS &= ~0x08;
#if 0
PINSEL1 = 0x2A80;
PINSEL4 = 0x0A800000;
#endif
#endif
#define TRUE (1)
#define FALSE (0)
if (Flag == TRUE) {do_something();}
if (Flag != FALSE) {do_something();}
#if MCI_DMA_ENABLED
do {
// TODO: avoid copy
memcpy((void *)DMA_SRC, buff, 512);
buff += 512;
GPDMA_INT_TCCLR = 0x01;
GPDMA_INT_ERR_CLR = 0x01;
GPDMA_CH0_SRC = DMA_SRC;
GPDMA_CH0_DEST = DMA_MCIFIFO;
GPDMA_CONFIG = 0x01;
/* Enable DMA channels, little endian */
while ( !(GPDMA_CONFIG & 0x01))
;
/* The burst size is set to 8, the size is 8 bit too. */
/* Terminal Count Int enable */
GPDMA_CH0_CTRL = (DMA_SIZE & 0x0FFF) | (0x04 << 12) | (0x02 << 15)
| (0x02 << 18) | (0x02 << 21) | (1 << 26) | 0x80000000;
//DMA_Move( 0, M2P );
GPDMA_CH0_CFG |= 0x10001 | (0x00 << 1) | (0x04 << 6) | (0x05 << 11);
/* Write, block transfer, DMA, and data length */
DataCtrl |= ((1 << 0) | (1 << 3) | (DATA_BLOCK_LEN << 4));
#else
/* Write, block transfer, and data length */
DataCtrl |= ((1 << 0) | (DATA_BLOCK_LEN << 4));
#endif
MCI_DATA_CTRL = DataCtrl;
for (i = 0; i < 0x10; i++) {
;
}
} while (count--);
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 3