Moderadores: 51, guest2003, Renie, gpenga
fanl escreveu:Tenho quase certeza que o periférico EMC ajeitará o concatenamento dos bytes. Preste bem atenção para ligar a memória externa adequadamente.
Na sua plataforma de desenvolvimento configure o EMC como 16bits e teste a leitura e escrita a endereços, se os dados vão ser concatenados adequadamente.
Att.
0XA0000000 00 01 02 03 04 05 06 00 06 00 06 00 06 00 06 00 XX XX XX
EMC_DYN_CFG0 = 0x00005488;
O mesmo que:
EMC_DYN_CFG0=(0x00000000) | (1<<14 |1<<12 | 1<<9 | 1<<7| 1<<3);
1 1 010 01 128 MB (8Mx16), 4 banks, row length = 12, column length = 9.
fanl escreveu:Não configure a memória como lowpower. Ela não é lowpower.
Use esta configuração:
0 0 001 01 64 MB (4Mx16), 4 banks, row length = 12, column length = 8
Não sete o bit 3 do registrador em questão.
Lembre-se de fazer acessos a 32bits e 16 também à memória.
Att.
void SDRAMInit( void )
{
DWORD i, dummy = dummy;
/*************************************************************************
* Initialize EMC and SDRAM
*************************************************************************/
EMC_CTRL = 0x00000001; /*Disable Address mirror*/
PCONP |= 0x00000800; /* Turn On EMC PCLK */
PINSEL5 = 0x05010115;
PINSEL6 = 0x55555555;
PINSEL7 = 0x00000000;
PINSEL8 = 0x15555555;
PINSEL9 = 0x00040000;
EMC_DYN_RD_CFG = 1; /* Command delayed strategy */
EMC_DYN_RP = 2; /* command period: 3(n+1) clock cycles */
EMC_DYN_RAS = 3; /* RAS command period: 4(n+1) clock cycles */
EMC_DYN_SREX = 7; /* Self-refresh period: 8(n+1) clock cycles */
EMC_DYN_APR = 2; /* Data out to active: 3(n+1) clock cycles */
EMC_DYN_DAL = 5; /* Data in to active: 6(n+1) clock cycles */
EMC_DYN_WR = 1; /* Write recovery: 2(n+1) clock cycles */
EMC_DYN_RC = 5; /* Active to Active cmd: 6(n+1) clock cycles */
EMC_DYN_RFC = 5; /* Auto-refresh: 6(n+1) clock cycles */
EMC_DYN_XSR = 7; /* Exit self-refresh: 8(n+1) clock cycles */
EMC_DYN_RRD = 1; /* Active bank A->B: 2(n+1) clock cycles */
EMC_DYN_MRD = 2; /* Load Mode to Active cmd: 3(n+1) clock cycles */
/* Default setting, RAS latency 2 CCLKs, CAS latenty 2 CCLKs. */
EMC_DYN_RASCAS0 = 0x00000202;
/* 32MB, 8Mx16, 4 banks, row=12, column=9 */
EMC_DYN_CFG0 = 0x00005488;
//EMC_DYN_CFG0 = (0x00000000) | (1<<14 |1<<12 | 1<<9 | 1<<7/* | 1 << 3*/);
delayMs(1, 100); /* use timer 1 */
/* Mem clock enable, CLKOUT runs, send command: NOP */
EMC_DYN_CTRL = 0x00000183;
delayMs(1, 200); /* use timer 1 */
/* Send command: PRECHARGE-ALL, shortest possible refresh period */
EMC_DYN_CTRL = 0x00000103;
/* set 32 CCLKs between SDRAM refresh cycles */
EMC_DYN_RFSH = 0x00000002; //2
for(i = 0; i < 0x40; i++); /* wait 128 AHB clock cycles */
/* set 70 x 16CCLK = 1120CCLK = 15.556uS(@72MHz) between SDRAM refresh cycles */
EMC_DYN_RFSH = 70;
EMC_DYN_CTRL = 0x00000083;
dummy = *((volatile DWORD *)(SDRAM_BASE_ADDR | (0x22 << 11)));
EMC_DYN_CTRL = 0x00000000; /* Send command: NORMAL */
EMC_DYN_CFG0 |= 0x00080000; /* Enable buffer */
delayMs(1, 1); /* Use timer 1 */
return;
}
Usuários navegando neste fórum: Nenhum usuário registrado e 1 visitante