FMC Controller: Write 8 SIMPLE data bits (no address mux)
Hi,
I want to configure the FMC such, that it should just write 8 data bits in a VERY SIMPLE way - without any switching.
I use the following code:
#define RAM_D1_FMC_SRAM3(off) __attribute((at(0x68000000+off)))
//global variables:
int iDebugFMC;
int iFMC RAM_D1_FMC_SRAM3(0);
RCC->AHB3ENR |= RCC_AHB3ENR_FMCEN;
FMC_Bank1->BTCR[0]=
FMC_Bank1->BTCR[2]=
FMC_Bank1->BTCR[4]= FMC_BCR3_WREN |
FMC_BCR3_EXTMOD |
(0 << FMC_BCR3_MWID_Pos) |
(0 << FMC_BCR3_MTYP_Pos) |
(0 << FMC_BCR3_MUXEN_Pos) |
FMC_BCR3_MBKEN;
FMC_Bank1->BTCR[0] |= FMC_BCR1_FMCEN |
FMC_BCR1_WFDIS;
FMC_Bank1->BTCR[1]=
FMC_Bank1->BTCR[3]=
FMC_Bank1->BTCR[5]= (3 << FMC_BTR3_ACCMOD_Pos) |
(15 << FMC_BTR3_DATLAT_Pos) |
(1 << FMC_BTR3_CLKDIV_Pos) |
(0 << FMC_BTR3_BUSTURN_Pos) |
(255 << FMC_BTR3_DATAST_Pos) |
(15 << FMC_BTR3_ADDHLD_Pos) |
(0 << FMC_BTR3_ADDSET_Pos);
for( iDebugFMC= 0; iDebugFMC < 5; iDebugFMC++){
// iDebugFMC++;
iFMC= iDebugFMC;
SCB_CleanDCache_by_Addr( (uint32_t*)&iFMC, 32);
for( jDebug= 0; jDebug< 10; jDebug++); // just some delay...
}Then I would expect on my Data line FD0 a signal interchanging between 0 and 1 every some usec... (as I increment iDebugFMC upwards for every "iFMC write event").
But instead I see a series of 5 low pulses on FD0 line with successivly changing "low time": 5usec, 4usec, 5usec, 4usec, 5usec.
As I expect the FD0 signals 0, 1, 0, 1, 0 for these 5 pulses, I think that the first usec always is my data signal.
I tried many changes, especially for the BTR settings above (please recognize that I put BTR_ADDSET to zero and BCR_MUXEN to zero) to avoid any address - data multiplexing of this FD0 line ... but somehow anyway I get the data only for 1usec and then "something strange" happening.
Is there possibly some FMC expert here who could bring some light into my dark mind?
