1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我试图以1分钟的时间间隔将adc值和数据从RTCC写到外部eeprom(24lc1026)。到我的EEPROM是1024千比特EEPROM,这1024千比特被分成8页128千比特,在数据表中还指出写缓冲区大小为128字节。一次只能写128个字节,如果要写超过128个字节,必须更新地址,否则会翻转。问题是在某些地址位置之后我无法读取数据。在从EEPROm读取数据的代码中,我声明了一个大小为1200字节的读取数组(IE Read阵列(1200)通过使用这个数组,我只能读取768个字节,其余的被指定为零。请帮我找到一个解决办法。
以上来自于百度翻译 以下为原文 hi, I am trying to write a adc value and data's from RTCC to a external eeprom(24lc1026) at a interval of one minute.coming to my EEPROM it is 1024 kilobits EEPROM,this 1024 kilobits is divided into 8 pages of 128 kilobits,in datasheet it is also pointed that write buffer is of size 128 bytes,ie we can write only 128 bytes at a time,if we want write more than 128 bytes,we must update the address,otherwise wise it will rollover. The problem is that i was not able to read data's after certain address locations.In my code to read data's from EEPROm,i have Declared a read array of size 1200bytes (ie read_array[1200]) by using this array i was able to read only 768 bytes,remaining are designated as zero. please help me to find a solution regards Sreegin k |
|
相关推荐
5个回答
|
|
你好,我用PIC18F26J50作为我的控制器。
以上来自于百度翻译 以下为原文 HI, i am using PIC18F26J50 as my controller. regards |
|
|
|
|
|
|
|
|
|
|
|
CorrectThis是垃圾。不完全正确。每一个写作都必须从起始地址开始。你可以在每次转换中发送超过1个字节,只要要写入的地址的底部7位不会改变。这就是说,如果你在EEPROM地址中使用所有七个零位(即在128的倍数)开始,那么你可以写一个完整的128字节。如果你总是写四个字节,而起始地址总是四的倍数,那么你就永远不会在写中跨越一个128字节的边界,所以它是W。一次写入128个字节比一次写入4个字节更有效率。编写代码看起来过于复杂。一次写入四个字节有什么意义?每个调用EEPROMYDATA()的读数是多少字节?将128字节的数据累积到一个数组中是非常有效的,一次写入128个,而不是一次只写四个。我也看不到其他所有“页面”代码的要点。这丝毫帮不上你的忙。
以上来自于百度翻译 以下为原文 Correct This is rubbish. Not totally correct. Every write must start with the start address. You can send more than 1 byte in each transation, so long as the bottom 7 bits of the address to be written does not change. That means if you start at an EEPROM address with all seven lower bits of zero (i.e. at a multiple of 128), then you can write a full 128 bytes. If you always write four bytes, and the start address is always a multiple of four, then you will never cross a 128 byte boundary within the write, so it will work fine. Writing 128 bytes at a time is more efficient than writing 4 bytes at a time. Your write code appears horribly overcomplicated. What is the point of writing four bytes at a time? Is that how many bytes are read by each call to eeprom_data()? It would be a lot more efficient to accumulate 128 bytes of data into an array, and write all 128 in one go, rather than just four at a time. I also can't see the point of all the rest of your "page" code. It's not helping you in the slightest. |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
5237 浏览 9 评论
2027 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3202 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
772浏览 1评论
662浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
590浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
672浏览 0评论
572浏览 0评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 01:49 , Processed in 1.453701 second(s), Total 83, Slave 67 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号