完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好
如何正确设置FX3频率到400 MHz? 因为我现在测试GPIO纯输出0和1,我看到我的示波器上的45.9kHz。 这是我的FX3固件: BulkPopthTraceRead(): 空BulkPopthTraceEnter(UtiT32×T输入) { CYU3PGPIOCROCKILT GPIOCROCK; GPIOCROC.FASTLKDIV=2; 速度慢=0; SimeDIV= CYU-U3PGGPIOSIMPLE和DIVYBYY2; CKYSRC= CYU-U3PySysLCK; 半英寸=0; CYU3PGPIOIIT(和GPIOCROCK,NULL); CYU3PGPIOSLIVIGICONFIGHTGPIOCOFIG; GPIOCONTION.OUTVAIL = CyTress; GPIOCONTION IMPUTEN = CyFLUE; GPIO构型。 GPIO配置。 GPIOCONTIONIN模式= CYU-U3PGPIOONIONITER; CYU3PGPIOSETSimuleFig(45,GPIOCONFIG); 为(;;){ CYU3PGPIOSET值(45,CyFalse); CYU3PGPIOSET值(45,CyTrue); } } CyFxApplicationDefine(); 无效CyFxApplicationDefine(空) { 空白* PTR=NULL; UIT32 32 T ReTrdReCyt = CyuU3pl成功; PtR=CYU3pMeMeloC(CyfxxBulkpl thRead堆栈); ReTrdCudio= Cyu3pthRead Cube(和BulkPAPPthLoad) “21:BulkyLoopyAuto.” BulkPAPTHeRead条目, 0, PTR CyfxxBulkpLthRead堆栈, CyfxfxBulkpLthRead优先级 CyfxfxBulkpLthRead优先级 Cyu3PyNoiTimeIn切片, CYU3PYAutoSoad ; 如果(ReTrdDebug)!= 0) { (1); } } 主体:() int(空){/1 CYU3PRESTROSTATUS SWT状态= CYU-U3PY成功; Cyu3PysCyClinux配置时钟; CysTysCLK400 = Cytru; CopyToCcLo.CPULKDIV=2; 组态CcLo.dMaCLKDIV=2; 组态CcLo.MmioCLKDIV=2; CopyCcLo.USTEnand ByCLK=CyFLY; CythUncL.CKSRC= CyuU3PySysLCK; 状态= CYU3PDEVICEIIT(&配置文件时钟); 如果(状态)!= CYU-U3PY成功 { Goto Houel-FATALL错误; } 状态= CYU3PDEVICECACHECL(Cyress,Cyrtrut,CyFalse); 如果(状态)!= CYU-U3PY成功 { Goto Houel-FATALL错误; } CYU3PIOMATAXXCONTILT IOFCFG; CYU3PMESET((UIT88T**)和;IOIF CFG,0,SIZEOF(IO-CFG); IOFCFG.ISDQ32位=CyFLY; IOFCFG.S0MODE=CYU-U3PL运动活性; IOFCFG S1MODE=CYU-U3PL运动活性; IOFCFG.UUEART=CyFLY; IOFCFG.UIE2C=CyFrE; IOFCFGUSE2S=CyFrE; IOFCFG.UESSPI= CyFLY; IOFCFG.LPPMODE=CyuU3pIIO-MatRIX-LPPH默认; IopyCFG.GPIOSLIMEN〔0〕=0x00亿;// 0~31 IOICFG.GPIOSLIMEN〔1〕=0X000 000; IOFCFG。GPIO-络合〔0〕=0; IOFCFG。GPIO-络合〔1〕=0; 状态= CYU3PDEVICECOMPIORIICOMATRIX(和;IOYCFG); 如果(状态)!= CYU-U3PY成功 { Goto Houel-FATALL错误; } CYU3pKelnEnter(); 返回0; HANDLY-FATALL错误: (1); } 我遗漏了什么东西吗? 以上来自于百度翻译 以下为原文 Hello, everyone How do I set the FX3 frequency to 400Mhz correctly? Because I now test GPIO for pure output of 0 and 1, I see 459.39Khz on my oscilloscope. Here is my FX3 firmware: BulkLpAppThread_Entry(): void BulkLpAppThread_Entry ( uint32_t input) { CyU3PGpioClock_t gpioClock; gpioClock.fastClkDiv = 2; gpioClock.slowClkDiv = 0; gpioClock.simpleDiv = CY_U3P_GPIO_SIMPLE_DIV_BY_2; gpioClock.clkSrc = CY_U3P_SYS_CLK; gpioClock.halfDiv = 0; CyU3PGpioInit(&gpioClock, NULL); CyU3PGpioSimpleConfig_t gpioConfig; gpioConfig.outValue = CyTrue; gpioConfig.inputEn = CyFalse; gpioConfig.driveLowEn = CyTrue; gpioConfig.driveHighEn = CyTrue; gpioConfig.intrMode = CY_U3P_GPIO_NO_INTR; CyU3PGpioSetSimpleConfig(45, &gpioConfig); for (;;){ CyU3PGpioSetValue (45,CyFalse); CyU3PGpioSetValue (45,CyTrue); }} CyFxApplicationDefine (); void CyFxApplicationDefine (void) { void *ptr = NULL; uint32_t retThrdCreate = CY_U3P_SUCCESS; ptr = CyU3PMemAlloc (CY_FX_BULKLP_THREAD_STACK); retThrdCreate = CyU3PThreadCreate (&BulkLpAppThread, "21:Bulk_loop_AUTO", BulkLpAppThread_Entry, 0, ptr, CY_FX_BULKLP_THREAD_STACK, CY_FX_BULKLP_THREAD_PRIORITY, CY_FX_BULKLP_THREAD_PRIORITY, CYU3P_NO_TIME_SLICE, CYU3P_AUTO_START ); if (retThrdCreate != 0) { while(1); }} main(): int main (void){ //1 CyU3PReturnStatus_t status = CY_U3P_SUCCESS; CyU3PSysClockConfig_t CONFIG_CLOCK; CONFIG_CLOCK.setSysClk400 = CyTrue; CONFIG_CLOCK.cpuClkDiv = 2; CONFIG_CLOCK.dmaClkDiv = 2; CONFIG_CLOCK.mmioClkDiv = 2; CONFIG_CLOCK.useStandbyClk = CyFalse; CONFIG_CLOCK.clkSrc = CY_U3P_SYS_CLK; status = CyU3PDeviceInit (&CONFIG_CLOCK); if (status != CY_U3P_SUCCESS) { goto handle_fatal_error; } status = CyU3PDeviceCacheControl (CyTrue, CyTrue, CyFalse); if (status != CY_U3P_SUCCESS) { goto handle_fatal_error; } CyU3PIoMatrixConfig_t io_cfg; CyU3PMemSet ((uint8_t *)&io_cfg, 0, sizeof(io_cfg)); io_cfg.isDQ32Bit = CyFalse; io_cfg.s0Mode = CY_U3P_SPORT_INACTIVE; io_cfg.s1Mode = CY_U3P_SPORT_INACTIVE; io_cfg.useUart = CyFalse; io_cfg.useI2C = CyFalse; io_cfg.useI2S = CyFalse; io_cfg.useSpi = CyFalse; io_cfg.lppMode = CY_U3P_IO_MATRIX_LPP_DEFAULT; io_cfg.gpioSimpleEn[0] = 0x00000000; //0~31 io_cfg.gpioSimpleEn[1] = 0x00002000; //45 on io_cfg.gpioComplexEn[0] = 0; io_cfg.gpioComplexEn[1] = 0; status = CyU3PDeviceConfigureIOMatrix (&io_cfg); if (status != CY_U3P_SUCCESS) { goto handle_fatal_error; } CyU3PKernelEntry (); return 0;handle_fatal_error: while (1);} Am I missing something set? |
|
相关推荐
2个回答
|
|
使用CYU3PGPIOSLoSeStEValk();而不是CYU3PGPIOSETValuy();这将给你大约1兆赫的时钟。这是你可以通过FX3软件实现的最大值。
以上来自于百度翻译 以下为原文 Use CyU3PGpioSimpleSetValue (); instead of CyU3PGpioSetValue ();. This will give you around 1 MHz clock. This is the max you can achieve through software in FX3. |
|
|
|
wuerywds 发表于 2018-11-15 19:48 非常感谢你的回答。 以上来自于百度翻译 以下为原文 Thank you very much for your answer. |
|
|
|
只有小组成员才能发言,加入小组>>
752个成员聚集在这个小组
加入小组2071 浏览 1 评论
1827 浏览 1 评论
3639 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1761 浏览 6 评论
1513 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
511浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
361浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
410浏览 2评论
357浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
858浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-25 02:36 , Processed in 0.945218 second(s), Total 79, Slave 63 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号