完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我使用CY3684板来测试我的代码。我想写一些关于EEPROM(C2负载128)的数据。代码应该是最简单的,但它不起作用。我在这里张贴我的主要代码。我还尝试在CyPress提供的I2C。C中调试“EZUBSEEEEPROFREST”函数,但没有任何效果。所以我也附上了I2C.C作为附件。我使用KEIL UV3编译代码。
//将数据写入LGEPROM的主要代码。数据是任意的数据。 G2;包括:“I2C.C”空main(空隙){EZUBSRIG2I2C.();EZUBSWAX0X01,0x00;EZUBSWAY PROTER PROFWORD(0xC2);EZUBSWRIGEI2C(0xC2,0x01,0x02);EZUBSWAITEORYEPROFREST(0xC2);EZUBSWRIGEI2C(0xC2,0x01,0x01);EZUBSWAITEPROEPROFREST(0xC2);EZUS包含和lt;fx2.h & gt;;EZUBSWRIGEI2C(0xC2,0x01,0x02);EZUBSWORYEPROMEDROWION(0xC2);EZUBSWORIGII2C(0xC2,0x01,0x01);EZUBSWAITEORYEPROFFREST(0xC2);EZUBSWRIGEI2C(0xC2,0x01,0x03);EZUBSWAITEORYEPROFFREST(0xC2);EZUBSWRIGEI2C(0xC2,0x01,0x00);EZUBBWAWItiOPREPRO bxWrute2c(0xc2,0x01,0x09);EuSubsWrute2c(0xC2,0x01,0x00);EZUBSWAITEORYEPROFFREST(0xC2);EZUBSWRUGII2C(0xC2,0x01,0x02);EZUBSWAITEORYEPROFFREST(0xC2);EZUBSWRIGEI2C(0xC2,0x01,0x12);EZUBSWAITEPROEPROFREST(0xC2);EZUBSWRUGII2C(0xC2,0x01,0x00);McWrand(0xC2);EZUBSWRUGII2C(0xC2,0x01,0x10);EZESBWAWAITezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x02);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x14);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x01);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0xe2);ezu***_waitforeepromwrite(0xC2);ezu***_writei2C(0xc2,0x01,0x16);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x02);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x82);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x20);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x00);ezu***_waitforeepromwrite(0xc2);ezu***_writei2c(0xc2,0x01,0xd0);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0xc2);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x00);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x08);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x25);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x06);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x26);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x5b);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x27);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x9a);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x30);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x10);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x31);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x10);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x32);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x10);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x33);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x10);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x34);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x17);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x35);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x7f);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x40);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0xff);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x41);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x7f);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x42);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x7f);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x43);ezu***_waitforeepromwrite(0xC2);ezu***_writei2c(0xc2,0x01,0x7f);ezu***_waitforeepromwrite(0xC2);} 谢谢! 以上来自于百度翻译 以下为原文 I am using CY3684 board to test my code. I want to write some data on EEPROM(C2 load on 128). The code is supposed to be the simplest but it does not work.. I am posting my main code here. I also tried tweaking 'EZUSB_EEPROMWrite' function inside i2c.c provided by cypress, but that does not have any effect. So i am also including i2c.c for reference as attachment. I am using Keil uV3 to compile the code. //Main code for writing data into LgEEPROM. The data is any random data #include #include #include "i2c.c" void main(void) { EZUSB_InitI2C(); EZUSB_WriteI2C(0xC2,0x01,0x00);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x02);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x01);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x09);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x02);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x01);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x03);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x00);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x10);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x00);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x02);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x12);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x00);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x02);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x14);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x01);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0xe2);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x16);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x02);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x82);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x20);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x00);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0xd0);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0xC2);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x00);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x08);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x25);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x06);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x26);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x5B);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x27);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x9A);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x30);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x10);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x31);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x10);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x32);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x10);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x33);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x10);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x34);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x17);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x35);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x7F);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x40);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0xFF);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x41);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x7F);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x42);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x7F);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x43);EZUSB_WaitForEEPROMWrite(0xC2); EZUSB_WriteI2C(0xC2,0x01,0x7F);EZUSB_WaitForEEPROMWrite(0xC2); } Thanks ! |
|
相关推荐
1个回答
|
|
请删除这个帖子,因为我尝试附加一个*.c文件,它产生了一个错误。最后我创造了一个名字相同的新帖子…请在那里回复
谢谢! 以上来自于百度翻译 以下为原文 Please delete this post as I tried attaching a *.c file which generated an error. And I ended up creating a new post with the same name... Please reply there Thanks ! |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2113 浏览 1 评论
1858 浏览 1 评论
3673 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1793 浏览 6 评论
1540 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
579浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
432浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
443浏览 2评论
391浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
984浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-29 18:03 , Processed in 1.007179 second(s), Total 79, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号