完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
我使用的是PIC18F4620。晶体12兆赫。我应该提供什么时间来读取每个内存的值?
以上来自于百度翻译 以下为原文 I'm using PIC18F4620. With Crystal 12 MHZ. What time i should provide to read the values per memory? |
|
相关推荐
19个回答
|
|
|
在数据表中,你认为你需要为EEPROM读操作提供一些特定的时间?
以上来自于百度翻译 以下为原文 What in the data sheet leads you to believe you need to provide some specific timing for EEPROM read operations? |
|
|
|
|
|
嗨,EEPROM读取发生在下一个指令周期。根据手册的第337页,擦除写通常需要4个MSECs。但是正如手册所暗示的,它最好在开发阶段进行实验。
以上来自于百度翻译 以下为原文 Hi, An EEPROM read happens on the next instruction cycle. According to page 337 of the manual an erase write takes typically 4 msecs. But as the manual implies, its probably best to experiment with this in the development phase. |
|
|
|
|
|
你的意思是擦除和写入,或者是4个MSESCs????对于我的水晶每指令周期需要33美元。那么,对于4毫秒,我可以使用延迟(100)吗??
以上来自于百度翻译 以下为原文 You mean both erase and Write or either one takes 4 msescs??? For my crystal per instruction cycle takes 33 us. So, for 4 ms can i use delay(100)?? Void delay(unsigned int a) { While(a--); } //For, example, tell me i am correct Val=eeprom_read(0); delay(100); |
|
|
|
|
|
您不添加延迟。您检查是否清除写入标志。
以上来自于百度翻译 以下为原文 You do not add a delay. You check to see if the write flag is cleared. |
|
|
|
|
|
如果我不检查,这不会是有效的写还是读?
以上来自于百度翻译 以下为原文 If I don't check this, will this won't be effective write or read? |
|
|
|
|
|
如果我不检查,这不会是有效的写还是读?您仍然难以阅读数据表吗?就在那里。如上所述,一个读发生在下一个周期,你不必等待它,只要没有正在进行中的写入!一个写可以占用4ms。你不应该使用一个延迟,只要检查状态位看看它是否已经完成。你可以在写的时候去做其他事情,但是在忙写的时候你不能再做另一个EEPROM读写。
以上来自于百度翻译 以下为原文 If I don't check this, will this won't be effective write or read? Are you still having trouble reading datasheets? It's all there. As mentioned above, a read happens on the next cycle, you don't have to wait for it at all, SO LONG AS THERE IS NO WRITE IN PROGRESS! A write can take UP TO 4ms. You should NOT use a delay, just check the status bit to see if it has finished. You can go and do other things while it is writing, but you can NOT do another EEPROM read or write while it is busy writing. |
|
|
|
|
|
|
|
|
|
|
|
如果我不检查,这不会是有效的写还是读?如数据表中所述,EEPROM擦除/写入周期时间通常为4毫秒,这仅用于设计指导,并且未被测试。数据表没有指定最小或最大值,这意味着它可以缩短或更长的写入周期时间。因此,你可以等待很长时间的未指定的延迟,在写的时候继续做其他事情,或者检查WR位或EEIF位以完成写入。我建议在EEPROM读写之前或在EEPROM写入之后检查WR位。哪个最好,取决于你的应用程序。
以上来自于百度翻译 以下为原文 If I don't check this, will this won't be effective write or read? As stated in the datasheet, the EEPROM erase/write cycle time is typically 4 ms, and this is for design guidance only and is not tested. The datasheet does not specify the minimum or the maximum; that means it can take shorter or longer time for the write cycle. So, you can wait a long unspecified delay, go on to do other things while it's writing, or check the WR bit or EEIF bit for completion of a write. I'd suggest to check the WR bit either before both EEPROM read and write, or just after the EEPROM write. Which is best will depend on your application. |
|
|
|
|
|
时机甚至比这更糟。它随温度、芯片数量和年龄而变化。
以上来自于百度翻译 以下为原文 The timing is even worse than that. It varies with temperature, chip lot and age. |
|
|
|
|
|
1、我用的是12兆赫的晶体。18F4620由1024字节的EEPROM存储器组成。我应该使用EEPROMIX写(地址,数据),模板吗?这里,我可以使用0到1023的地址吗?2、我主要使用4兆赫的晶体。我什么也没检查过。它对我起作用。虽然这不是一个好的编程方法。现在我用12。所以,它的速度比4兆赫兹快3倍。所以,我必须检查一下。那很好。
以上来自于百度翻译 以下为原文 1.I'm using 12 MHZ crystal. 18F4620 consists EEPROM memory of 1024 bytes. Shall I use eeprom_write(address,data); template? Here, could i use address from 0-1023? 2.Mostly I am using 4 MHZ crystal. I never checked anything. It worked for me. Though it wasn't a good way of programming. Now I'm using 12. So, its 3 times faster than 4 MHZ.so, i have to check. That's fine. |
|
|
|
|
|
对。是的,看看什么?延迟时间?如果测试WEE-位以完成EEPROM写入,则晶振频率无关。编辑:从XC8用户指南:EEPROMYRADE()和EEPROMYROWREST()函数测试并等待对EEPROM的任何并发写入,以在执行所需操作之前结束。
以上来自于百度翻译 以下为原文 Yes. Yes. Check what? Delay time? If you test the WR bit for completion of an EEPROM write, then the crystal frequency is irrelevant. Edit: From the XC8 User's Guide: The eeprom_read() and eeprom_write() functions test and wait for any concurrent writes to EEPROM to conclude before performing the required operation. |
|
|
|
|
|
但写得不好。这可能不是正确地检查写入位。或者其他任何可能的原因?不耽误时间。正如你所说的,WR位。我用的是高科技的C编译器。
以上来自于百度翻译 以下为原文 But It didn't write properly. That may be not checking the write bit correctly. Or Any other reason possible? Not Delay time. As you said, WR bit. I'm using High Tech C Compiler. |
|
|
|
|
|
让我们看看你的代码,这样我们就可以看到你在做什么,而不是你认为你在做什么。如果没有,如果你的电源上升缓慢,如果你的代码一开始就试图写EEPROM,它可以在VDD达到写EEPROM所需的最小电压之前完成它。
以上来自于百度翻译 以下为原文 How about showing us your code, so we can see what you ARE doing, not what you think you are doing. Do you have Brown Out Reset enabled in your CONFIG word? You should. Without that, if your power supply rises slowly, and if your code attempts to write EEPROM as soon as it starts, it could do it before Vdd has reached the minimum voltage required to write to EEPROM. |
|
|
|
|
|
我启用了配置词中的BLUNOUT重置。我已经看过数据表了。现在,我有些疑虑。在数据表中,写入或读取EEPROM数据存储器应遵循一定的规则。对于读,我们应该写地址到EEADRH:EEADRH寄存器对,清除EEPGD控制位,然后设置控制位,RD.,然后数据在下一个指令周期可用。对于写,通常的地址必须首先写入EEADRH:EEADRH寄存器对和写入的数据。EdEATA寄存器。必须遵循示例6-2中的序列来启动写入周期。当我们遵循Eclipse=EEPROMYRADE(地址);EEPROMYWORD(地址,数据);这两个模板时,究竟发生了什么????这是根据数据表解释的吗?!!!这是怎么回事?谁能深入解释?我只是想知道这个模板是如何工作的?正如你们所说的,我需要监视鹪鹩位,知道写操作已经完成。写模板后是否足够了,还是我必须按照数据表解释?EPEGD和CFGS应该被清除进入数据EEPROM存储器,但是WRRR应该被清除。我应该写一个自己的函数来写和读取EEPROM数据存储器吗?完全混乱。阅读它只需要一个指令周期。对于写,它的所有关于片上定时器。它是不可预测的。我曾看到过一个声明,“过度的写入可以强调接近规范限制的比特”。它能给我们带来多大的影响?我能用下面的代码吗?在那里我会检查写完成位。
以上来自于百度翻译 以下为原文 I enabled brownout reset in configuration word. I have read the data sheet. Now, i have some doubts. In the data sheets there are certain rules that should be followed to write or read Eeprom data memory. For Read, we should write address to the EEADRH:EEADRH register pair, clear the EEPGD control bit and then set control bit, RD. Then the data is available on the very next instruction cycle. For Write, as usual address must first be written to the EEADRH:EEADRH register pair and the data written to the EEDATA register. The sequence in Example 6-2 must be followed to initiate the write cycle. What actually happens when we follow receive=eeprom_read(address); eeprom_write(address,data); these two templates??? Is this follows what data sheets explains?!!! What it does?? Anyone can explain in depth? I just want to know how this templates work? As you all said i need to monitor the WREN bit to know the Write operation is complete. Is it enough after writing write template or else i have to follow as per data sheet explains? EEPGD and CFGS should be cleared to enter the data EEPROM memory but WRERR should be cleared. Should i write a own function to write and read Eeprom data memory?? Totally confusing. For Read it take just one instruction cycle. For Write, its all about on chip timer. Its unpredictable. I have seen one statement that says "excessive writes can stress bits near the specification limit". How much impact it can gives ? Can i use the below code(for example)... Where I will check write completion bit.. eeprom_write(10,10); while(WREN); eeprom_write(11,10); while(WREN); |
|
|
|
|
|
如果你使用了一个适当的函数,比如EEPROMYWREST(),那么它会为你处理所有这些。假设使用的XC8版本包含了函数的实际工作版本。并不是所有人都这么做。如果是这样的话,你可以在数据表中使用这个例子,或者使用MCC。
以上来自于百度翻译 以下为原文 If you are using a proper function like eeprom_write() then it takes care of all this for you. This assumes the version of XC8 you are using contains a real working version of the function. Not all do. If that is the case you can use the example in the data sheet, or use MCC. |
|
|
|
|
|
从我的文章第12页读“编辑”语句。它是WR位,而不是鹪鹩位。
以上来自于百度翻译 以下为原文 Read the "Edit" statement from my Post #12. And it is the WR bit, not the WREN bit. |
|
|
|
|
|
好的,先生。让我试试XC8,因为我用的是高科技C:)
以上来自于百度翻译 以下为原文 Yeah Ok sir. Let me try xc8 since i'm using high tech c. :) |
|
|
|
|
|
|
|
|
|
|
|
如果你使用高科技C,它工作,你不需要任何其他代码。只需使用EEPROMLADE()和EEPROMYWRITE()函数即可。这就是你需要做的。
以上来自于百度翻译 以下为原文 If you are using Hi-tech C it works, and you do not need any other code. Just use the eeprom_read() and eeprom_write() functions. That is all you need to do. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475 浏览 0 评论
5794 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1125浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1098浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 14:20 , Processed in 1.302271 second(s), Total 110, Slave 93 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
549