|
技术交流 | 电路欣赏 | 工控天地 | 数字广电 | 通信技术 | 电源技术 | 测控之家 | EMC技术 | ARM技术 | EDA技术 | PCB技术 | 嵌入式系统 驱动编程 | 集成电路 | 器件替换 | 模拟技术 | 新手园地 | 单 片 机 | DSP技术 | MCU技术 | IC 设计 | IC 产业 | CAN-bus/DeviceNe |
各位大侠帮个忙 ? STR912的EMI总线问题 ? |
作者:yjf1979yjf 栏目:MCU技术 |
请问谁有ST的STR912的EMI访问的例子? 我自己弄了半天 也没成工 我把程序给大家看下 main( void ) { SCU_Configuration(); GPIO_DeInit(GPIO7); GPIO_InitStructure.GPIO_Direction = GPIO_PinOUTPUT; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 ; //GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All ; GPIO_InitStructure.GPIO_Type = GPIO_OUTPUTAlt3 ; GPIO_Init (GPIO7, &GPIO_InitStructure); GPIO_DeInit(GPIO7); GPIO_InitStructure.GPIO_Direction = GPIO_PinOUTPUT; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 ; //GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All ; GPIO_InitStructure.GPIO_Type = GPIO_OUTPUTAlt2 ; GPIO_Init (GPIO7, &GPIO_InitStructure); GPIO_DeInit(GPIO8); GPIO_InitStructure.GPIO_Direction = GPIO_PinOUTPUT; //GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All ; GPIO_InitStructure.GPIO_Type = GPIO_OUTPUTAlt2 ; GPIO_Init (GPIO8, &GPIO_InitStructure); GPIO_DeInit(GPIO9); GPIO_InitStructure.GPIO_Direction = GPIO_PinOUTPUT; //GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All ; GPIO_InitStructure.GPIO_Type = GPIO_OUTPUTAlt2 ; GPIO_Init (GPIO9, &GPIO_InitStructure); /* GPIO Configuration --------------------------------------------------------*/ EMI_InitStruct.EMI_Bank_IDCY =0x6; EMI_InitStruct.EMI_Bank_WSTRD =0x6; EMI_InitStruct.EMI_Bank_WSTWR =0x6; EMI_InitStruct.EMI_Bank_WSTROEN=0x6; EMI_InitStruct.EMI_Bank_WSTWEN=0x08; EMI_InitStruct.EMI_Bank_MemWidth=EMI_Width_HalfWord; //EMI_InitStruct.EMI_Bank_WriteProtection= EMI_Bank_NonWriteProtect; //EMI_InitStruct.EMI_PageModeRead_TransferLength=EMI_4Data; //EMI_InitStruct.EMI_PageModeRead_Selection=EMI_NormalMode; EMI_Init(EMI_Bank1,&EMI_InitStruct); while( 1 ) for( count= 0 ; count<14 ; count++ ) { while( 1 ) { (*((volatile u16 *)0x7000c000)) = 0x6666 ; Delay(0x00FF); (*((volatile u16 *)0x70008000 ))= 0xcccc ; Delay(0x00FF); } } /*}*/ } } /******************************************************************************* * Function NAME : SCU_Configuration * DESCRIPTION : Configures the SYSTEM clocks. * Input : None * OUTPUT : None * Return : None *******************************************************************************/ void SCU_Configuration(void) { /* Enable the __GPIO9 */ SCU_APBPeriphClockConfig(__GPIO7 ,ENABLE); SCU_APBPeriphClockConfig(__GPIO8 ,ENABLE); SCU_APBPeriphClockConfig(__GPIO9 ,ENABLE); SCU_AHBPeriphClockConfig(__EMI ,ENABLE); EMI_DeInit(); EMI_StructInit(&EMI_InitStruct); SCU_EMIModeConfig(SCU_EMI_MUX); SCU_EMIALEConfig(SCU_EMIALE_LEN2, SCU_EMIALE_POLHigh); SCU_EMIBCLKDivisorConfig(SCU_EMIBCLK_Div2); } |
2楼: | >>参与讨论 |
作者: STF 于 2006/10/11 16:48:00 发布:
各位大侠帮个忙 ? STR912的EMI总线问题 ? Hi, 我会试一下。 好像你再用mux模式。请问,你的数据是8位还是16位?地址是多少位? 你有没有CAPS的软件?你可以用CAPS做一个新的配置,然后看一下跟你自己做的配置又没有区别。 Stephane |
3楼: | >>参与讨论 |
作者: STF 于 2006/10/11 17:45:00 发布:
各位大侠帮个忙 ? STR912的EMI总线问题 ? Hi, 我刚刚用过CAPS,我没办法用你的配置: 如果我用: ... EMI_InitStruct.EMI_Bank_WSTWR =0x6; ... EMI_InitStruct.EMI_Bank_WSTWEN=0x08; CAPS 找到了一个问题:NUMBER of "write wait state" has to be greater than or equal to "write enable assertion delay" 因为: Furthermore, the EMI bus wait states must meet the following timing rules to be functional: 1. The NUMBER of Read wait states must be greater than or equal to the OUTPUT Enable wait states (WSTRD => WSTOEN) 2. The NUMBER of OUTPUT Enable wait states must be greater than the Address Latch Enable time in mux mode (WSTOEN> ALE) 3. The NUMBER of Write wait states must be greater than or equal to the Write Enable wait states (WSTWR=>WSTWEN) 4. The NUMBER of Write Enable wait states must be greater than the Address Latch Enable time in mux mode (WSTOEN> ALE) Stephane |
4楼: | >>参与讨论 |
作者: musich 于 2006/10/12 0:51:00 发布:
关注, 学着以后用. |
5楼: | >>参与讨论 |
作者: yjf1979yjf 于 2006/10/12 9:16:00 发布:
我就是用CAPS 不是啊 这个就是我用CAPS上移植到ADS下 我是在 CAPS上配置好的 |
6楼: | >>参与讨论 |
作者: 香水城 于 2006/10/12 10:58:00 发布:
yjf1979yjf: 好像你的CAPS配置有错误,请把你CAPS配置的图贴出来 STF 发现你的配置有错。 |
7楼: | >>参与讨论 |
作者: STF 于 2006/10/12 12:14:00 发布:
emi的地址 Hi, yjf1979yjf:你用一个oscilloscope(示波器)的话,在GPIO7-9有没有信号? 我不很清楚,你为使么用的地址是0x7000xxxx? emi bank1 的地址应该是0x38000000-0x3C000000? Stephane * - 本贴最后修改时间:2006-10-12 12:37:21 修改者:香水城 |
8楼: | >>参与讨论 |
作者: yjf1979yjf 于 2006/10/12 15:22:00 发布:
不可能啊 我都测试了 没有啊 我都用示波器测试过了 可是没有信号输出 如果这点都不知道我也就不用做电子工程师了 我看到他的说 地址输出要右移一位 所以我扩大了两倍 但是这个不能影响读写和锁存信号 . |
9楼: | >>参与讨论 |
作者: yjf1979yjf 于 2006/10/12 15:26:00 发布:
我的CAPS配置图 |
10楼: | >>参与讨论 |
作者: yjf1979yjf 于 2006/10/12 15:27:00 发布:
caps1 |
11楼: | >>参与讨论 |
作者: yjf1979yjf 于 2006/10/12 15:28:00 发布:
caps2 |
12楼: | >>参与讨论 |
作者: yjf1979yjf 于 2006/10/12 15:30:00 发布:
cap3 |
13楼: | >>参与讨论 |
作者: STF 于 2006/10/12 16:43:00 发布:
新的代码 Hi, 你试一下这个代码, 我用这个的话我有信号出来: /* GPIO Setup */ SCU_APBPeriphClockConfig( __GPIO0, ENABLE ); SCU_APBPeriphClockConfig( __GPIO7, ENABLE ); SCU_APBPeriphClockConfig( __GPIO8, ENABLE ); SCU_APBPeriphClockConfig( __GPIO9, ENABLE ); GPIO_DeInit( GPIO0 ); GPIO_StructInit( &GPIO_InitStruct ); GPIO_InitStruct.GPIO_Pin = GPIO_Pin_4; GPIO_InitStruct.GPIO_Direction = GPIO_PinOutput; GPIO_InitStruct.GPIO_Type = GPIO_Type_PushPull; GPIO_InitStruct.GPIO_Alternate = GPIO_OutputAlt2; GPIO_Init( GPIO0, &GPIO_InitStruct ); GPIO_DeInit( GPIO7 ); GPIO_StructInit( &GPIO_InitStruct ); GPIO_InitStruct.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3; GPIO_InitStruct.GPIO_Direction = GPIO_PinOutput; GPIO_InitStruct.GPIO_Type = GPIO_Type_PushPull; GPIO_InitStruct.GPIO_Alternate = GPIO_OutputAlt2; GPIO_Init( GPIO7, &GPIO_InitStruct ); GPIO_InitStruct.GPIO_Pin = GPIO_Pin_6; GPIO_InitStruct.GPIO_Alternate = GPIO_OutputAlt3; GPIO_Init( GPIO7, &GPIO_InitStruct ); GPIO_DeInit(GPIO8); GPIO_InitStruct.GPIO_Direction = GPIO_PinOutput; GPIO_InitStruct.GPIO_Type = GPIO_Type_PushPull; GPIO_InitStruct.GPIO_Pin = GPIO_Pin_All ; GPIO_InitStruct.GPIO_Type = GPIO_OutputAlt2 ; GPIO_Init (GPIO8, &GPIO_InitStruct); GPIO_DeInit(GPIO9); GPIO_InitStruct.GPIO_Direction = GPIO_PinOutput; GPIO_InitStruct.GPIO_Type = GPIO_Type_PushPull; GPIO_InitStruct.GPIO_Pin = GPIO_Pin_All ; GPIO_InitStruct.GPIO_Type = GPIO_OutputAlt2 ; GPIO_Init (GPIO9, &GPIO_InitStruct); SCU_AHBPeriphClockConfig( __EMI, ENABLE ); SCU_EMIModeConfig( SCU_EMI_MUX ); SCU_EMIALEConfig( SCU_EMIALE_LEN2, SCU_EMIALE_POLHigh ); SCU_EMIBCLKDivisorConfig(SCU_EMIBCLK_Div2); GPIO_EMIConfig( ENABLE ); /* Enable EMI clock */ EMI_DeInit(); EMI_StructInit( &EMI_InitStruct ); EMI_InitStruct.EMI_Bank_MemWidth = EMI_Width_HalfWord; EMI_InitStruct.EMI_Bank_IDCY =0x6; EMI_InitStruct.EMI_Bank_WSTRD =0x6; EMI_InitStruct.EMI_Bank_WSTWR =0x6; EMI_InitStruct.EMI_Bank_WSTROEN=0x6; EMI_InitStruct.EMI_Bank_WSTWEN=0x08; EMI_InitStruct.EMI_Bank_MemWidth=EMI_Width_HalfWord; EMI_Init( EMI_Bank1, &EMI_InitStruct ); while( 1 ) for( count= 0 ; count<14 ; count++ ) { while( 1 ) { (*((volatile u16 *)0x38000044)) = 0xbb00 ; Delay(0x00FF); } Stephane |
14楼: | >>参与讨论 |
作者: STF 于 2006/10/12 17:10:00 发布:
对不起 hi, "如果这点都不知道我也就不用做电子工程师了", 你不要生气,中文不是我的母语。所以我用比较简单的句子,对不起。 Stephane |
15楼: | >>参与讨论 |
作者: yjf1979yjf 于 2006/10/13 0:59:00 发布:
很感谢你 STF STF 我没有其他的意思 不过很感谢你的指点 你的大度叫我感到我很不好意思 也许人水平越高 也越谦虚 再这里我给你说声SORRY 你说的方法我明天早晨到公司试一下 |
16楼: | >>参与讨论 |
作者: yjf1979yjf 于 2006/10/13 10:53:00 发布:
HI STF 你好STF 我早晨实验了你的代码 我是用 ADS在RAM中仿真 但是我一跑到AXD里面就出现了 错误 |
17楼: | >>参与讨论 |
作者: yjf1979yjf 于 2006/10/13 10:54:00 发布:
cuowu tu |
18楼: | >>参与讨论 |
作者: yjf1979yjf 于 2006/10/13 10:55:00 发布:
错误图 |
19楼: | >>参与讨论 |
作者: yjf1979yjf 于 2006/10/13 10:59:00 发布:
我把原程序贴出来 main() void Main() { //int LED_ARRY[14]={ 0x00 ,0x0f , 0x00 , 0x0f , 0x01 , 0x02 , 0x04 , 0x08 ,0x00 , 0x0f , 0x0e ,0x0d , 0x0b ,0x07 } ; u32 count ; #ifdef DEBUG debug(); #endif SCU_APBPeriphClockConfig( __GPIO0, ENABLE ); SCU_APBPeriphClockConfig( __GPIO7, ENABLE ); SCU_APBPeriphClockConfig( __GPIO8, ENABLE ); SCU_APBPeriphClockConfig( __GPIO9, ENABLE ); GPIO_DeInit( GPIO0 ); GPIO_StructInit( &GPIO_InitStruct ); GPIO_InitStruct.GPIO_Pin = GPIO_Pin_4; GPIO_InitStruct.GPIO_Direction = GPIO_PinOutput; GPIO_InitStruct.GPIO_Type = GPIO_Type_PushPull; GPIO_InitStruct.GPIO_Alternate = GPIO_OutputAlt2; GPIO_Init( GPIO0, &GPIO_InitStruct ); GPIO_DeInit( GPIO7 ); GPIO_StructInit( &GPIO_InitStruct ); GPIO_InitStruct.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3; GPIO_InitStruct.GPIO_Direction = GPIO_PinOutput; GPIO_InitStruct.GPIO_Type = GPIO_Type_PushPull; GPIO_InitStruct.GPIO_Alternate = GPIO_OutputAlt2; GPIO_Init( GPIO7, &GPIO_InitStruct ); GPIO_InitStruct.GPIO_Pin = GPIO_Pin_6; GPIO_InitStruct.GPIO_Alternate = GPIO_OutputAlt3; GPIO_Init( GPIO7, &GPIO_InitStruct ); GPIO_DeInit(GPIO8); GPIO_InitStruct.GPIO_Direction = GPIO_PinOutput; GPIO_InitStruct.GPIO_Type = GPIO_Type_PushPull; GPIO_InitStruct.GPIO_Pin = GPIO_Pin_All ; GPIO_InitStruct.GPIO_Alternate = GPIO_OutputAlt2 ; GPIO_Init (GPIO8, &GPIO_InitStruct); GPIO_DeInit(GPIO9); GPIO_InitStruct.GPIO_Direction = GPIO_PinOutput; GPIO_InitStruct.GPIO_Type = GPIO_Type_PushPull; GPIO_InitStruct.GPIO_Pin = GPIO_Pin_All ; GPIO_InitStruct.GPIO_Alternate = GPIO_OutputAlt2 ; GPIO_Init (GPIO9, &GPIO_InitStruct); SCU_AHBPeriphClockConfig( __EMI, ENABLE ); SCU_AHBPeriphClockConfig( __EMI, ENABLE ); SCU_EMIModeConfig( SCU_EMI_MUX ); SCU_EMIALEConfig( SCU_EMIALE_LEN2, SCU_EMIALE_POLHigh ); SCU_EMIBCLKDivisorConfig(SCU_EMIBCLK_Div2); GPIO_EMIConfig( ENABLE ); /* Enable EMI clock */ EMI_DeInit(); EMI_StructInit( &EMI_InitStruct ); EMI_InitStruct.EMI_Bank_MemWidth = EMI_Width_HalfWord; EMI_InitStruct.EMI_Bank_IDCY =0x6; EMI_InitStruct.EMI_Bank_WSTRD =0x6; EMI_InitStruct.EMI_Bank_WSTWR =0x6; EMI_InitStruct.EMI_Bank_WSTROEN=0x6; EMI_InitStruct.EMI_Bank_WSTWEN=0x08; EMI_InitStruct.EMI_Bank_MemWidth=EMI_Width_HalfWord; EMI_Init( EMI_Bank1, &EMI_InitStruct ); while( 1 ) for( count= 0 ; count<14 ; count++ ) { while( 1 ) { (*((volatile u16 *)0x38000044)) = 0xbb00 ; Delay(0x00FF); } } } |
20楼: | >>参与讨论 |
作者: yjf1979yjf 于 2006/10/13 11:01:00 发布:
我把原程序贴出来 config.h #ifndef __91x_CONF_H #define __91x_CONF_H /* To work in buffered mode just decomment the following LINE */ //#define Buffered /* Comment the LINE below to put the library in release mode */ #define DEBUG /************************* AHBAPB *************************/ #define _AHBAPB #define _AHBAPB0 #define _AHBAPB1 /************************* VIC *************************/ //#define _VIC //#define _VIC0 //#define _VIC1 /************************* DMA *************************/ //#define _DMA //#define _DMA_Channel0 //#define _DMA_Channel1 //#define _DMA_Channel2 //#define _DMA_Channel3 //#define _DMA_Channel4 //#define _DMA_Channel5 //#define _DMA_Channel6 //#define _DMA_Channel7 /************************* EMI *************************/ #define _EMI //#define _EMI_Bank0 #define _EMI_Bank1 //#define _EMI_Bank2 //#define _EMI_Bank3 /************************* FMI *************************/ //#define _FMI /************************* WIU *************************/ //#define _WIU /************************* TIM *************************/ //#define _TIM //#define _TIM0 //#define _TIM1 //#define _TIM2 //#define _TIM3 /************************* GPIO ************************/ #define _GPIO #define _GPIO0 //#define _GPIO1 //#define _GPIO2 //#define _GPIO3 //#define _GPIO4 //#define _GPIO5 //#define _GPIO6 #define _GPIO7 #define _GPIO8 #define _GPIO9 /************************* RTC *************************/ //#define _RTC /************************* SCU *************************/ #define _SCU /************************* MC **************************/ //#define _MC /************************* UART ************************/ //#define _UART //#define _UART0 //#define _UART1 //#define _UART2 /************************* SSP *************************/ //#define _SSP //#define _SSP0 //#define _SSP1 /************************* CAN *************************/ //#define _CAN /************************* ADC *************************/ //#define _ADC /************************* WDG *************************/ //#define _WDG /************************* I2C *************************/ //#define _I2C //#define _I2C0 //#define _I2C1 /************************ ENET *************************/ //#define _ENET /*---------------------------- _Main_Crystal frequency VALUE (KHz)------------*/ #ifndef _Main_Crystal #define _Main_Crystal 25000 #endif /*------------------------------------------------------------------------------*/ #endif /* __91x_CONF_H */ |
21楼: | >>参与讨论 |
作者: yjf1979yjf 于 2006/10/13 11:06:00 发布:
我说明下 1:我把GPIO_InitStruct.GPIO_Type = GPIO_OutputAlt2 ; 实验了下 不成功 我就改成了GPIO_InitStruct.GPIO_Alternate = GPIO_OutputAlt2 ; 结果是一个样 两个我都测试过了 2: 我的测试是在RAM中进行的 |
22楼: | >>参与讨论 |
作者: STF 于 2006/10/13 12:10:00 发布:
奇怪 hi, 我用IAR,我也看到一个问题。我以为是开发工具的问题,好像是我在配置GPIO9的时候有问题 (我配置的可能不对...)。 如果我用这个代码的话,问题没有了,你可以试一下。 SCU_APBPeriphClockConfig( __GPIO0, ENABLE ); SCU_APBPeriphClockConfig( __GPIO7, ENABLE ); SCU_APBPeriphClockConfig( __GPIO8, ENABLE ); SCU_APBPeriphClockConfig( __GPIO9, ENABLE ); GPIO_DeInit( GPIO0 ); GPIO_StructInit( &GPIO_InitStruct ); GPIO_InitStruct.GPIO_Pin = GPIO_Pin_4; GPIO_InitStruct.GPIO_Direction = GPIO_PinOutput; GPIO_InitStruct.GPIO_Type = GPIO_Type_PushPull; GPIO_InitStruct.GPIO_Alternate = GPIO_OutputAlt2; GPIO_Init( GPIO0, &GPIO_InitStruct ); GPIO_DeInit( GPIO7 ); GPIO_StructInit( &GPIO_InitStruct ); GPIO_InitStruct.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3; GPIO_InitStruct.GPIO_Direction = GPIO_PinOutput; GPIO_InitStruct.GPIO_Type = GPIO_Type_PushPull; GPIO_InitStruct.GPIO_Alternate = GPIO_OutputAlt2; GPIO_Init( GPIO7, &GPIO_InitStruct ); GPIO_InitStruct.GPIO_Pin = GPIO_Pin_6; GPIO_InitStruct.GPIO_Alternate = GPIO_OutputAlt3; GPIO_Init( GPIO7, &GPIO_InitStruct ); //GPIO_DeInit(GPIO8); //GPIO_InitStruct.GPIO_Direction = GPIO_PinOutput; //GPIO_InitStruct.GPIO_Type = GPIO_Type_PushPull; //GPIO_InitStruct.GPIO_Pin = GPIO_Pin_All ; //GPIO_InitStruct.GPIO_Alternate = GPIO_OutputAlt2 ; //GPIO_Init (GPIO8, &GPIO_InitStruct); //GPIO_DeInit(GPIO9); //GPIO_InitStruct.GPIO_Direction = GPIO_PinOutput; //GPIO_InitStruct.GPIO_Type = GPIO_Type_PushPull; //GPIO_InitStruct.GPIO_Pin = GPIO_Pin_All ; //GPIO_InitStruct.GPIO_Alternate = GPIO_OutputAlt2 ; //GPIO_Init (GPIO9, &GPIO_InitStruct); SCU_AHBPeriphClockConfig( __EMI, ENABLE ); SCU_AHBPeriphClockConfig( __EMI, ENABLE ); SCU_EMIModeConfig( SCU_EMI_MUX ); SCU_EMIALEConfig( SCU_EMIALE_LEN2, SCU_EMIALE_POLHigh ); SCU_EMIBCLKDivisorConfig(SCU_EMIBCLK_Div2); GPIO_EMIConfig( ENABLE ); /* Enable EMI clock */ EMI_DeInit(); EMI_StructInit( &EMI_InitStruct ); EMI_InitStruct.EMI_Bank_MemWidth = EMI_Width_HalfWord; EMI_InitStruct.EMI_Bank_IDCY =0x6; EMI_InitStruct.EMI_Bank_WSTRD =0x6; EMI_InitStruct.EMI_Bank_WSTWR =0x6; EMI_InitStruct.EMI_Bank_WSTROEN=0x6; EMI_InitStruct.EMI_Bank_WSTWEN=0x08; EMI_InitStruct.EMI_Bank_MemWidth=EMI_Width_HalfWord; EMI_Init( EMI_Bank1, &EMI_InitStruct ); ... Stephane |
23楼: | >>参与讨论 |
作者: yjf1979yjf 于 2006/10/13 17:51:00 发布:
回 STF 很感谢你的帮助 我终于调试通了EMI 我的点阵LED也好了 问你个问题 你当时程序有错误 怎么能在IAR下跑起来 并且能看到他的波形 我是在 MULTE ICE下跑的 可见IAR的仿真器对STR912的支持不是很好 |
24楼: | >>参与讨论 |
作者: STF 于 2006/10/16 10:09:00 发布:
回 yjf1979yjf 你好 我用emi,用过比较少,可能有错误可是那里我不很清楚。 请问,你可以给我看一看你的程序有什么区别? Stephane |
25楼: | >>参与讨论 |
作者: yjf1979yjf 于 2006/10/16 16:51:00 发布:
STE GEINI FA #ifdef DEBUG debug(); #endif SCU_PLLFactorsConfig(192, 25,2); // pll predividers SCU_PLLCmd(ENABLE); //pll Enable SCU_APBPeriphClockConfig( __GPIO7, ENABLE ); SCU_APBPeriphClockConfig( __GPIO8, ENABLE ); SCU_APBPeriphClockConfig( __GPIO9, ENABLE ); GPIO_EMIConfig( ENABLE ); GPIO_DeInit( GPIO7 ); GPIO_StructInit( &GPIO_InitStruct ); GPIO_InitStruct.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3; GPIO_InitStruct.GPIO_Direction = GPIO_PinOutput; GPIO_InitStruct.GPIO_Type = GPIO_Type_PushPull; GPIO_InitStruct.GPIO_Alternate = GPIO_OutputAlt2; GPIO_Init( GPIO7, &GPIO_InitStruct ); GPIO_InitStruct.GPIO_Pin = GPIO_Pin_6; GPIO_InitStruct.GPIO_Alternate = GPIO_OutputAlt3; GPIO_Init( GPIO7, &GPIO_InitStruct ); SCU_AHBPeriphClockConfig( __EMI, ENABLE ); SCU_AHBPeriphClockConfig( __EMI, ENABLE ); SCU_EMIModeConfig( SCU_EMI_MUX ); SCU_EMIALEConfig( SCU_EMIALE_LEN2, SCU_EMIALE_POLHigh ); SCU_EMIBCLKDivisorConfig(SCU_EMIBCLK_Div2); /* Enable EMI clock */ EMI_DeInit(); EMI_StructInit( &EMI_InitStruct ); //EMI_InitStruct.EMI_Bank_MemWidth = EMI_Width_HalfWord; EMI_InitStruct.EMI_Bank_IDCY =0x6; EMI_InitStruct.EMI_Bank_WSTRD =0x6; EMI_InitStruct.EMI_Bank_WSTWR =0x6; EMI_InitStruct.EMI_Bank_WSTROEN=0x6; EMI_InitStruct.EMI_Bank_WSTWEN=0x08; EMI_InitStruct.EMI_Bank_MemWidth=EMI_Width_HalfWord; EMI_Init( EMI_Bank1, &EMI_InitStruct ); Test_DA(); |
26楼: | >>参与讨论 |
作者: STF 于 2006/10/16 17:34:00 发布:
谢谢 我会试一下 |
27楼: | >>参与讨论 |
作者: mcu430 于 2006/11/26 16:56:00 发布:
关注 |
28楼: | >>参与讨论 |
作者: ZRF7098 于 2007/1/23 21:30:00 发布:
各位大侠 各位大侠你们好:有谁用过MCP6S28芯片,VFER引脚如何使用,请各位大侠赐教使用经验.急急急!谢谢各位! |
29楼: | >>参与讨论 |
作者: hq1025 于 2007/4/24 17:37:00 发布:
提一个问题 楼主,请注意的例子中的那个读写时序的设置.我试过了,如何按照你的那个数值设置的话,BANK1不会有WR信号出来的.大家如果调试EMI时参考这个例程的话要特别注意这个问题,否则有可能其他信号都出来但是会没有WR信号出来.我用的是STR912FW42x |
|
|
免费注册为维库电子开发网会员,参与电子工程师社区讨论,点此进入 |
Copyright © 1998-2006 www.dzsc.com 浙ICP证030469号 |