完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
最近在调STM32F4的FMC有个奇怪的现象,NOE管脚一致是低电平,好奇怪,是不是我FMC配置有误,大家帮忙看看:
void FMC_GPIO_Init(void) { GPIO_InitTypeDef GPIO_InitStructure; RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB|RCC_AHB1Periph_GPIOD|RCC_AHB1Periph_GPIOE|RCC_AHB1Periph_GPIOF|RCC_AHB1Periph_GPIOG, ENABLE);//ʹÄÜPD,PE,PF,PGʱÖÓ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;//PB15 ÍÆÍìÊä³ö,¿ØÖƱ³¹â GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;//ÆÕͨÊä³öģʽ GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;//ÍÆÍìÊä³ö GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;//100MHz GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;//ÉÏÀ GPIO_Init(GPIOB, &GPIO_InitStructure);//³õʼ»¯ //PB15 ÍÆÍìÊä³ö,¿ØÖƱ³¹â GPIO_InitStructure.GPIO_Pin = (3<<0)|(3<<4)|(7<<8)|(3<<14);//PD0,1,4,5,8,9,10,14,15 AF OUT GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;//¸´ÓÃÊä³ö GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;//ÍÆÍìÊä³ö GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;//ÉÏÀ GPIO_Init(GPIOD, &GPIO_InitStructure);//³õʼ»¯ GPIO_InitStructure.GPIO_Pin = (0X1FF<<7);//PE7~15,AF OUT GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;//¸´ÓÃÊä³ö GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;//ÍÆÍìÊä³ö GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;//ÉÏÀ GPIO_Init(GPIOE, &GPIO_InitStructure);//³õʼ»¯ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;//PF12,FSMC_A6 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;//¸´ÓÃÊä³ö GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;//ÍÆÍìÊä³ö GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;//ÉÏÀ GPIO_Init(GPIOG, &GPIO_InitStructure);//³õʼ»¯ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12;//PG12,FSMC_NE4 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;//¸´ÓÃÊä³ö GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;//ÍÆÍìÊä³ö GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;//ÉÏÀ GPIO_Init(GPIOG, &GPIO_InitStructure);//³õʼ»¯ GPIO_PinAFConfig(GPIOD,GPIO_PinSource0,GPIO_AF_FMC);//PD0,AF12 GPIO_PinAFConfig(GPIOD,GPIO_PinSource1,GPIO_AF_FMC);//PD1,AF12 GPIO_PinAFConfig(GPIOD,GPIO_PinSource4,GPIO_AF_FMC); GPIO_PinAFConfig(GPIOD,GPIO_PinSource5,GPIO_AF_FMC); GPIO_PinAFConfig(GPIOD,GPIO_PinSource8,GPIO_AF_FMC); GPIO_PinAFConfig(GPIOD,GPIO_PinSource9,GPIO_AF_FMC); GPIO_PinAFConfig(GPIOD,GPIO_PinSource10,GPIO_AF_FMC); GPIO_PinAFConfig(GPIOD,GPIO_PinSource14,GPIO_AF_FMC); GPIO_PinAFConfig(GPIOD,GPIO_PinSource15,GPIO_AF_FMC);//PD15,AF12 GPIO_PinAFConfig(GPIOE,GPIO_PinSource7,GPIO_AF_FMC);//PE7,AF12 GPIO_PinAFConfig(GPIOE,GPIO_PinSource8,GPIO_AF_FMC); GPIO_PinAFConfig(GPIOE,GPIO_PinSource9,GPIO_AF_FMC); GPIO_PinAFConfig(GPIOE,GPIO_PinSource10,GPIO_AF_FMC); GPIO_PinAFConfig(GPIOE,GPIO_PinSource11,GPIO_AF_FMC); GPIO_PinAFConfig(GPIOE,GPIO_PinSource12,GPIO_AF_FMC); GPIO_PinAFConfig(GPIOE,GPIO_PinSource13,GPIO_AF_FMC); GPIO_PinAFConfig(GPIOE,GPIO_PinSource14,GPIO_AF_FMC); GPIO_PinAFConfig(GPIOE,GPIO_PinSource15,GPIO_AF_FMC); GPIO_PinAFConfig(GPIOG,GPIO_PinSource0,GPIO_AF_FMC);//PF12,AG6 GPIO_PinAFConfig(GPIOG,GPIO_PinSource12,GPIO_AF_FMC); } void FMC_Init(void) { FMC_NORSRAMInitTypeDef FMC_NORSRAMInitStructure; FMC_NORSRAMtimingInitTypeDef readWriteTiming; FMC_NORSRAMTimingInitTypeDef writeTiming; RCC_AHB3PeriphClockCmd(RCC_AHB3Periph_FMC,ENABLE);//ʹÄÜFSMCʱÖÓ writeTiming.FMC_AddressSetupTime =9; //µØÖ·½¨Á¢Ê±¼ä£¨ADDSET£©Îª9¸öHCLK =54ns writeTiming.FMC_AddressHoldTime = 0x00; //µØÖ·±£³Öʱ¼ä£¨A writeTiming.FMC_DataSetupTime = 8; //Êý¾Ý±£´æʱ¼äΪ6ns*9¸öHCLK=54ns writeTiming.FMC_BusTurnAroundDuration = 0x00; writeTiming.FMC_CLKDivision = 0x00; writeTiming.FMC_DataLatency = 0x00; writeTiming.FMC_AccessMode = FMC_AccessMode_A; //ģʽA FMC_NORSRAMInitStructure.FMC_Bank = FMC_Bank1_NORSRAM4;// ÕâÀïÎÒÃÇʹÓÃNE4 £¬Ò²¾Í¶ÔÓ¦BTCR[6],[7]¡£ FMC_NORSRAMInitStructure.FMC_DataAddressMux = FMC_DataAddressMux_Disable; // ²»¸´ÓÃÊý¾ÝµØÖ· FMC_NORSRAMInitStructure.FMC_MemoryType =FMC_MemoryType_NOR;// FSMCEnable_MemoryType_SRAM; //SRAM FMC_NORSRAMInitStructure.FMC_MemoryDataWidth = FMC_NORSRAM_MemoryDataWidth_16b;//´æ´¢Æ÷Êý¾Ý¿í¶ÈΪ16bit FMC_NORSRAMInitStructure.FMC_BurstAccessMode =FMC_BurstAccessMode_Disable;// FSMC_BurstAccessMode_Disable; FMC_NORSRAMInitStructure.FMC_WaitSignalPolarity = FMC_WaitSignalPolarity_Low; FMC_NORSRAMInitStructure.FMC_AsynchronousWait=FMC_AsynchronousWait_Disable; FMC_NORSRAMInitStructure.FMC_WrapMode = FMC_WrapMode_Disable; FMC_NORSRAMInitStructure.FMC_WaitSignalActive = FMC_WaitSignalActive_BeforeWaitState; FMC_NORSRAMInitStructure.FMC_WriteOperation = FMC_WriteOperation_Enable; // ´æ´¢Æ÷дʹÄÜ FMC_NORSRAMInitStructure.FMC_WaitSignal = FMC_WaitSignal_Disable; FMC_NORSRAMInitStructure.FMC_ExtendedMode = FMC_ExtendedMode_Enable; // ¶ÁдʹÓò»Í¬µÄʱÐò FMC_NORSRAMInitStructure.FMC_AsynchronousWait = FMC_AsynchronousWait_Disable; FMC_NORSRAMInitStructure.FMC_WriteBurst = FMC_WriteBurst_Disable; FMC_NORSRAMInitStructure.FMC_ContinousClock = FMC_CClock_SyncOnly; FMC_NORSRAMInitStructure.FMC_ReadWriteTimingStruct = &readWriteTiming; //¶ÁдʱÐò FMC_NORSRAMInitStructure.FMC_WriteTimingStruct = &writeTiming; //дʱÐò FMC_NORSRAMInit(&FMC_NORSRAMInitStructure); //³õʼ»¯FSMCÅäÖà FMC_NORSRAMCmd(FMC_Bank1_NORSRAM4, ENABLE); // ʹÄÜBANK1 } 这个是读操作: 第一个是写寄存器地址,第二个是读操作,但是整个过程NOE都是低电平!好不理解啊! |
|
相关推荐
7个回答
|
|
typedef struct
{ u16 LCD_REG; u16 LCD_RAM; } LCD_TypeDef; //我使用的是16Bit A10作为RS ,以下是配置 #define LCD_BASE ((u32)(0x6C000000 | 0x00000800)) #define LCD ((LCD_TypeDef *) LCD_BASE) |
|
|
|
|
|
|
|
|
|
这是用的什么软件?
|
|
|
|
不懂帮顶 ,
|
|
|
|
|
|
|
|
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
991 浏览 0 评论
AD7686芯片不传输数据给STM32,但是手按住就会有数据。
970 浏览 2 评论
2080 浏览 0 评论
如何解决MPU-9250与STM32通讯时,出现HAL_ERROR = 0x01U
1177 浏览 1 评论
hal库中i2c卡死在HAL_I2C_Master_Transmit
1599 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 22:12 , Processed in 0.630811 second(s), Total 52, Slave 46 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号