完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,我正试图从微芯片上获得数据EEPROM仿真器,(不知何故,我不允许张贴适当的链接,但谷歌的“EEPROM仿真器PIC24”)。为了测试的目的,我想存储和读取一个Unt1616t,它每增加一次,然后再从闪存中写入和读取。代码看起来是这样的:但是,在1022次写入和读取之后,下一个写调用调用打包例程,之后,当读回Th中的值时。E地址为0xFFFF,ADDR未找到标志被设置。之后,它进行第二轮的写入和读取,但在1022×2调用之后,它只返回0xFFFF。为什么会这样?包装不正常吗?谢谢,Jo
以上来自于百度翻译 以下为原文 Hi everyone, I am trying to get the data EEPROM emulator from Microchip to work, (somehow I am not allowed to post the appropriate link, but google for "eeprom emulator pic24") . For testing purposes, I want to store and read an uint16_t that increases every time and is written and read from the flash memory again. The code looks like this: int main() { setup(); Byte input_byte = {0}; Byte warnings = {0}; uint32_t current_time = 0; TESTING( uint16_t testvariable = 0; uint16_t testvariable2 = 0; while (1) { DataEEInit(); DataEEWrite(testvariable, 0); DataEEInit(); testvariable2 = DataEERead(0); printf(" Wrote: %d, read: %dn", testvariable, testvariable2); if (testvariable != testvariable2) { printDataEEFlags(); } testvariable++; } ) } However, after 1022 writes and reads, the next call to write calls the packing routine, and after that, when reading back the value in the address it says 0xFFFF, and the addr not found flag is set. After that it does the second round of write and reads, but after 1022*2 calls it only returns 0xFFFF. Why is that? Does the packing not work properly? Thanks, Jo |
|
相关推荐
2个回答
|
|
我找到了解决方法:仿真器.h文件包含一些定义:但是代码应该是:在代码中看到注释。如果其他人有这个问题,请看这里。此外,这应该被归档为Microchip上的一张罚单,因为这显然是他们软件中的一个错误。
以上来自于百度翻译 以下为原文 I found the solution: The emulator .h file contains some defines:#if defined(__dsPIC33E__) || defined(__PIC24E__) #define NUMBER_OF_INSTRUCTIONS_IN_PAGE 512 #define NUMBER_OF_INSTRUCTIONS_IN_ROW 64 #elif defined(__PIC24F__) #define NUMBER_OF_INSTRUCTIONS_IN_PAGE 1024 #define NUMBER_OF_INSTRUCTIONS_IN_ROW 128 #elif defined(__dsPIC33F__) || defined(__PIC24H__) #define NUMBER_OF_INSTRUCTIONS_IN_PAGE 512 #define NUMBER_OF_INSTRUCTIONS_IN_ROW 64 #endif But the code should be: #if defined(__dsPIC33E__) || defined(__PIC24E__) #define NUMBER_OF_INSTRUCTIONS_IN_PAGE 512 #define NUMBER_OF_INSTRUCTIONS_IN_ROW 64 #elif defined(__PIC24F__) #define NUMBER_OF_INSTRUCTIONS_IN_PAGE 512 //here the error happens #define NUMBER_OF_INSTRUCTIONS_IN_ROW 64 // some data is lost since the packing routine tries to write bigger rows than there actually are #elif defined(__dsPIC33F__) || defined(__PIC24H__) #define NUMBER_OF_INSTRUCTIONS_IN_PAGE 512 #define NUMBER_OF_INSTRUCTIONS_IN_ROW 64 See annotation in the code. In case someone else has this problem, look here. Furthermore, this should be filed as a ticket at Microchip, since this is clearly a bug in their software. Jo |
|
|
|
你没有提到你使用的是哪种PIC24F设备。现在,来自不同家庭的PIC24FJ设备有不同的程序存储器擦除页大小和不同的行大小。例如,我现在使用的PIC24FJ256GA705系列中的设备的行大小等于128指令A。ND擦除页大小等于1024条指令。(见数据表第6.2部分)许多其他设备具有64和512指令各自的值。(例如,PIC24FJ128GB204系列,我也使用过)现在……正如你所提到的,“DEE仿真16位H”标头已经定义了这些值(方便我们的GA705用户):(你忽略了你的帖子中的主要评论---这是重要的事情。)然而……在DEE仿真器中在文档中,DS01095D——提供了该库,它说,除其他外[编辑]改变了底线[/Ed],我认为文档可能已经提到过,您还应该验证擦除和写常量。(也许当文档生成时,它们都具有相同的大小。但是,头中的注释确实告诉你要验证。注意,头文件也定义了HasyECC,它恰好对“GA705”有效,但对于GB204无效。在文档中没有提到:你必须检查头文件中的所有内容。底线:如果没有一个库与你一起工作,你必须在尝试之前读取数据表。事实上,我很少需要DEE库的所有功能,有时我需要一些额外的特性,所以我通常会滚动自己的RTSP函数。起始点和最后一个词总是数据表。[最终编辑---我保证]图书馆的演示程序有一个PIC24FJ1024GB610的配置。我从来没有使用过这个设备,也没有测试的方法,但是我觉得这个文件的头文件定义是正确的。
以上来自于百度翻译 以下为原文 You didn't mention which PIC24F device you are using. Now, it happens that PIC24FJ devices from different families have different Program Memory Erase page sizes and different Row sizes. For example devices in the PIC24FJ256GA705 family, which I am now using, have row size equal to 128 instructions and erase page size equal to 1024 instructions. (See Section 6.2 of the data sheet.) Many other devices have respective values of 64 and 512 instructions. (For example the PIC24FJ128GB204 family, which I have also used.) Now... As you mentioned, the "DEE Emulation 16-bit.h" header has these values defined (conveniently for us 'GA705 users) as: // Modify the following constants based on the specific device being used #if defined(__dsPIC33E__) || defined(__PIC24E__) #define NUMBER_OF_INSTRUCTIONS_IN_PAGE 512 #define NUMBER_OF_INSTRUCTIONS_IN_ROW 64 #elif defined(__PIC24F__) #define NUMBER_OF_INSTRUCTIONS_IN_PAGE 1024 #define NUMBER_OF_INSTRUCTIONS_IN_ROW 128 #elif defined(__dsPIC33F__) || defined(__PIC24H__) #define NUMBER_OF_INSTRUCTIONS_IN_PAGE 512 #define NUMBER_OF_INSTRUCTIONS_IN_ROW 64 #endif (You left out that leading comment in your post---That's the Important Thing here.) However... In the DEE Emulation document, DS01095D---provided with the library, it says, among other things [Edit]Changed bottom line[/Edit] I think the document might have mentioned that you should verify erase and write constants also. (Maybe when the document was generated, they all had the same sizes. Don't know.) But the comment in the header does tell you to verify. Note, also that the header file defines HAS_ECC, which happens to be valid for a 'GA705, but not for a 'GB204. Not mentioned in the document: It's necessary for you to review Everything in the header file. Bottom line: If you didn't have a library to work with you would have to read the Data Sheet before trying it. In fact, I rarely need all of the features of the DEE library, and I sometimes need some extra features, so I (usually) roll my own RTSP functions. The starting point as well as the final word is always the Data Sheet. [Final Edit---I Promise] The demo program for the library has a configuration for a PIC24FJ1024GB610. I have never used this device and have no way to test, but I perceive that the header file definitions are correct for this chip. [/Final Edit] Regards, Dave |
|
|
|
只有小组成员才能发言,加入小组>>
5189 浏览 9 评论
2009 浏览 8 评论
1933 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3181 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2232 浏览 5 评论
743浏览 1评论
629浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
512浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
642浏览 0评论
538浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-30 06:32 , Processed in 1.426833 second(s), Total 80, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号