大家好,STM32单片机FMC接口,初始化为SRAM,使能了异步通信NWAIT功能,同步通信NWAIT禁止,低电平有效,设置为等待周期前一个数据有效。NWAIT接有上拉电阻,所以默认状态高电平。这些配置都配置完毕后,由于NWAIT是高电平,STM32应该是读不到数据的,但是实际上并不影响STM32读到数据,很奇怪,请教一个大家,谢谢大家。 SRAM_HandleTypeDef CPLD_sram;
FMC_NORSRAM_TimingTypeDef Timing;
CPLD_sram.Init.NSBank = FMC_NORSRAM_BANK1;
CPLD_sram.Init.DataAddressMux = FMC_DATA_ADDRESS_MUX_DISABLE;
CPLD_sram.Init.MemoryType = FMC_MEMORY_TYPE_SRAM;
CPLD_sram.Init.MemoryDataWidth = FMC_NORSRAM_MEM_BUS_WIDTH_16;
CPLD_sram.Init.BurstAccessMode = FMC_BURST_ACCESS_MODE_DISABLE;
CPLD_sram.Init.WaitSignalPolarity = FMC_WAIT_SIGNAL_POLARITY_LOW;
CPLD_sram.Init.WaitSignalActive = FMC_WAIT_TIMING_BEFORE_WS;
CPLD_sram.Init.WriteOperation = FMC_WRITE_OPERATION_ENABLE;
CPLD_sram.Init.WaitSignal = FMC_WAIT_SIGNAL_DISABLE;
CPLD_sram.Init.ExtendedMode = FMC_EXTENDED_MODE_DISABLE;
CPLD_sram.Init.AsynchronousWait = FMC_ASYNCHRONOUS_WAIT_ENABLE;
CPLD_sram.Init.WriteBurst = FMC_WRITE_BURST_DISABLE;
CPLD_sram.Init.ContinuousClock = FMC_CONTINUOUS_CLOCK_SYNC_ONLY;
CPLD_sram.Init.WriteFifo = 0;
CPLD_sram.Init.PageSize = 0;
CPLD_sram.Instance = FMC_NORSRAM_DEVICE;
CPLD_sram.Extended = FMC_NORSRAM_EXTENDED_DEVICE;
Timing.AddressSetupTime = 0;
Timing.AddressHoldTime = 0;
Timing.DataSetupTime = 3;
Timing.BusTurnAroundDuration = 1;
Timing.CLKDivision = 0;
Timing.DataLatency = 0;
Timing.AccessMode = FMC_ACCESS_MODE_A;
HAL_SRAM_DeInit(&CPLD_sram);
HAL_SRAM_Init(&CPLD_sram, &Timing, &Timing);
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>