最近在调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都是低电平!好不理解啊! |
读æä½
STM32F407 定时器触发DMA 求助大神
【MCU实战经验】基于STM32F407的音频播放器设计
盘古UE-STM32F407工控板原理图
【STM32F429心得\疑问】+STM32F4之FSMC和FMC
STM32F429读取IO口传输的数据速率
STM32F407ZGT6 手摸芯片背部重启
STM32F4 SPI 动作时,软件片选信号被拉高,IO口程序逻辑失控
STM32F401RE NUCLEO求助,串口一直不能进中断
读取STM32F407内部温度传感器值错误
STM32F429多路内部ADC独立采集的办法
{
u16 LCD_REG;
u16 LCD_RAM;
} LCD_TypeDef;
//我使用的是16Bit A10作为RS ,以下是配置
#define LCD_BASE ((u32)(0x6C000000 | 0x00000800))
#define LCD ((LCD_TypeDef *) LCD_BASE)
#define LCD_BASE ((u32)(0x6C000000 | 0x000007FE))试试看
Seale逻辑分析仪
哦哦,三克油。