打印
[STM32F4]

FSMC总线设置

[复制链接]
524|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
bumianren|  楼主 | 2024-5-14 09:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
各位,使用STM32F405读取挂在FSMC总线上的14位ADC,  设置位宽为16位,结果每次读取总线都会发出两次片选和读使能信号,不知为何,敬请指教!        readWriteTiming.FSMC_AddressSetupTime = 0x02;         //µØÖ·½¨Á¢Ê±¼ä£¨ADDSET£©Îª16¸öHCLK 1/168M=6ns*16=96ns       
        readWriteTiming.FSMC_AddressHoldTime = 0x00;         //µØÖ·±£³Öʱ¼ä£¨ADDHLD£©Ä£Ê½AδÓõ½       
        readWriteTiming.FSMC_DataSetupTime = 0x03;                        //Êý¾Ý±£´æʱ¼äΪ60¸öHCLK        =6*60=360ns
        readWriteTiming.FSMC_BusTurnAroundDuration = 0x00;
        readWriteTiming.FSMC_CLKDivision = 0x00;
        readWriteTiming.FSMC_DataLatency = 0x00;
        readWriteTiming.FSMC_AccessMode = FSMC_AccessMode_A;         //ģʽA

        FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM4;//  ÕâÀïÎÒÃÇʹÓÃNE4 £¬Ò²¾Í¶ÔÓ¦BTCR[6],[7]¡£
        FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable; // ²»¸´ÓÃÊý¾ÝµØÖ·
        FSMC_NORSRAMInitStructure.FSMC_MemoryType =FSMC_MemoryType_SRAM;// FSMC_MemoryType_SRAM;  //SRAM   
        FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;//´æ´¢Æ÷Êý¾Ý¿í¶ÈΪ16bit   
        FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode =FSMC_BurstAccessMode_Disable;// FSMC_BurstAccessMode_Disable;
        FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low;
        FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait=FSMC_AsynchronousWait_Disable;
        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_Disable; // ¶ÁдʹÓò»Í¬µÄʱÐò
        FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
        FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &readWriteTiming; //¶ÁдʱÐò
        FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &readWriteTiming;  //дʱÐò

        FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);  //³õʼ»¯FSMCÅäÖÃ

        FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM4, ENABLE);  // ʹÄÜBANK1





使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

5

主题

13

帖子

0

粉丝