本帖最后由 feifan570 于 2014-1-8 17:37 编辑
由于STM32F207VC只有100个管脚的,所以FSMC需要使用地址数据复用模式外界SRAM(IS62WV51216),那么NADV将作为地址的锁存信号,但是目前是示波器观察到NADV信号一直不变,其他的信号(NE1,NOE)倒是可以的,这是什么原因啊?
下面的是初始化SRAM的代码:
/*
+-------------------+--------------------+------------------+------------------+
+ SRAM pins assignment +
+-------------------+--------------------+------------------+------------------+
| PD0 <--> FSMC_AD2 | PE0 <--> FSMC_NBL0 |
| PD1 <--> FSMC_AD3 | PE1 <--> FSMC_NBL1 |
| PD4 <--> FSMC_NOE | PE7 <--> FSMC_AD4 |
| PD5 <--> FSMC_NWE | PE8 <--> FSMC_AD5 |
| PD7 <--> FSMC_NE1 | PE9 <--> FSMC_AD6 |
| PD8 <--> FSMC_AD13 | PE10 <--> FSMC_AD7 |
| PD9 <--> FSMC_AD14 | PE11 <--> FSMC_AD8 |
| PD10 <--> FSMC_AD15 | PE12 <--> FSMC_AD9 |
| PD11 <--> FSMC_A16 | PE13 <--> FSMC_AD10 |
| PD12 <--> FSMC_A17 | PE14 <--> FSMC_AD11 |
| PD13 <--> FSMC_A18 | PE15 <--> FSMC_AD12 |
| PD14 <--> FSMC_AD0 | PB7 <--> FSMC_ALE
| PD15 <--> FSMC_AD1 |
+-------------------+--------------------+
*/
/* Enable GPIOD, GPIOE, GPIOB interface clock */
RCC->AHB1ENR = 0x0000001A;
GPIOB->AFR[0] = 0xc0000000;
/* Configure PBx pins in Alternate function mode */
GPIOB->MODER = 0x00008000;
/* Configure PBx pins speed to 100 MHz */
GPIOB->OSPEEDR = 0x0000c000;
/* Configure PBx pins Output type to push-pull */
GPIOB->OTYPER = 0x00000000;
/* No pull-up, pull-down for PBx pins */
GPIOB->PUPDR = 0x00000000;
/* Connect PDx pins to FSMC Alternate function */
GPIOD->AFR[0] = 0xc0cc00cc;
GPIOD->AFR[1] = 0xcccccccc;
/* Configure PDx pins in Alternate function mode */
GPIOD->MODER = 0xaaaa8a0a;
/* Configure PDx pins speed to 100 MHz */
GPIOD->OSPEEDR = 0xffffcf0f;
/* Configure PDx pins Output type to push-pull */
GPIOD->OTYPER = 0x00000000;
/* No pull-up, pull-down for PDx pins */
GPIOD->PUPDR = 0x00000000;
/* Connect PEx pins to FSMC Alternate function */
GPIOE->AFR[0] = 0xc00000cc;
GPIOE->AFR[1] = 0xcccccccc;
/* Configure PEx pins in Alternate function mode */
GPIOE->MODER = 0xaaaa800a;
/* Configure PEx pins speed to 100 MHz */
GPIOE->OSPEEDR = 0xffffc00f;
/* Configure PEx pins Output type to push-pull */
GPIOE->OTYPER = 0x00000000;
/* No pull-up, pull-down for PEx pins */
GPIOE->PUPDR = 0x00000000;
/*-- FSMC Configuration ------------------------------------------------------*/
/* Enable the FSMC interface clock */
RCC->AHB3ENR = 0x00000001;
/* Configure and enable Bank1_SRAM1 */
FSMC_Bank1->BTCR[0] = 0x00005017;
FSMC_Bank1->BTCR[1] = 0x0FFFFFFF;
FSMC_Bank1E->BWTR[0] = 0x0fffffff;
|