|
2010年最后一天的心情就像股票一样郁闷,很相信STM32的,仔细看了最新AN2784文档、勘误表等,没发现说103VC不支持Muxed Mode或有什么Bug,
按照AN2784:5.2 Interfacing the FSMC with a NOR Flash memory所述,至少应该支持NOR吧,于是将设置改为:
/*-- FSMC Configuration ----------------------------------------------------
p.FSMC_AddressSetupTime = 2;
p.FSMC_AddressHoldTime = 2;
p.FSMC_DataSetupTime = 6;
p.FSMC_BusTurnAroundDuration = 0;
p.FSMC_CLKDivision = 0;
p.FSMC_DataLatency = 0;
p.FSMC_AccessMode = FSMC_AccessMode_B;
FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM1;
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Enable;
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_NOR;
FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait = FSMC_AsynchronousWait_Disable;
FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low;
FSMC_NORSRAMInitStructure.FSMC_WrapMode = FSMC_WrapMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState;
FSMC_NORSRAMInitStructure.FSMC_WriteOperation = FSMC_WriteOperation_Enable;
FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable;
FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Enable; // 必须要使能
FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &p;
FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &p;
FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);
/*!< Enable FSMC Bank1_SRAM Bank */
FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM1, ENABLE);
在主程序中用下面循环测试:
while (1) {
*(uint16_t *) (0x60001234) = 0x5555;
*(uint16_t *) (0x60005678) = 0xAAAA;
val = *(uint16_t *) (0x60005678);
}
理论上说:在AD[0..15]线上应该出现相应的低16位地址和16位数据的!
用示波器观察,只看到数据线上的数据是正确的,出现在nADV为低时的低16位地址却不是循环测试设置的低16位地址值!!!!!!
亲爱的版主啊,怎么看不到你的身影了!ST的技术支持到哪里去找啊!
只看到你强烈建议用103ZE来驱动SRAM/NOR,却没有说个为什么???
难道ST就不认为这是个Bug???
或许是我对设置参数理解不透,但我确实从ST文档上看不明白!!! |
|