完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,我正在为我的PIC32 MX530F128H开发工具包开发一个程序设计器。我可以获得芯片ID、状态、擦除闪存,但是不能执行XFEXTEDION()函数。从来没有设置位18。ICSPXXFEDATA(32,0x000 04C000)总是返回0x000 098000 -位18是“0”。DS601145U,你能帮我检查一下这个问题吗?谢谢您!
以上来自于百度翻译 以下为原文 Hi all, I'm developing an onboard programmer for my PIC32MX530F128H Dev Kit. I can get chip ID, status, erase flash but can not execute Xferinstruction() function. Bit 18 is never set. bool Icsp_XferInstruction(uint32_t Instruction) { uint8_t try=0; uint32_t controlVal; Icsp_SendCommand(ETAP_CONTROL); do { controlVal=Icsp_XferData(32, 0x0004C000);// always return 0x00098000 controlVal&=0x00040000; try++; } while((controlVal!=0x00040000)&&(try<100)); if(try>=100) return 1; // error Icsp_SendCommand(ETAP_DATA); Icsp_XferData(32, Instruction); Icsp_SendCommand(ETAP_CONTROL); Icsp_XferData(32, 0x0000C000); return 0; // success } Icsp_XferData(32, 0x0004C000) always returns 0x00098000 - Bit 18 is '0'. Ref doc: PIC32 Flash Programming Specification - DS60001145U. Could you help me check this issue? Thank you! Attachment(s) ICSP32.X.zip (193.47 KB) - downloaded 31 times |
|
相关推荐
5个回答
|
|
您所做的一切都是在进入串行执行模式之前的“敲击”命令。我遇到了一些问题(不记得是哪一个)PIC32没有进入SE模式,我通过在ActuoSeSee模式的开始添加TopyRead和在同一函数中的EJTAGBOOT命令之前的另一个右边来修复。不确定两者是否需要,因为尝试了很多事情让我的程序员工作,我留下足够好,一旦它是。注意:这似乎表明你的龙头是不同步的1位。TAP-Read命令可以修复这一点。
以上来自于百度翻译 以下为原文 Everything you have working are "tap" commands that are before you enter the serial execution mode. I had problems with some (can't remember which though) PIC32s not entering the SE mode that I fixed by adding a TAP_RESET right at the start of enter_SE_mode and another right before the EJTAGBOOT command in the same function. Not sure if both are required as a tried a lot of things to get my programmer working and I left good enough alone once it was. Notice that: 0x00098000 = 0x0004C000 << 1 This seems to indicate that your tap is out of sync by 1 bit. TAP-RESET commands may fix this. |
|
|
|
非常感谢!我在CIPIT2和3的C源中发现,它们使用0x000 04D000而不是0x000 04C000。我使用这个代码并添加了ICSPOSsEndEn指令(MtAppSWSWETAP):它工作!现在,我可以写和读PFM。我觉得如此矛盾,同时阅读PIC32 Flash编程规范文件。
以上来自于百度翻译 以下为原文 Thank you so much! I found in C source of PICkit2&3, they use 0x0004D000 instead of 0x0004C000. I use this code and add Icsp_SendCommand(MTAP_SW_ETAP) like this: bool Icsp_XferInstruction(uint32_t Instruction) { uint8_t try=0; uint32_t controlVal; Icsp_SendCommand(MTAP_SW_ETAP); Icsp_SendCommand(ETAP_CONTROL); do { controlVal=Icsp_XferData(32, 0x0004D000);// instead of 0x0004C000 controlVal&=0x00040000; try++; } while((controlVal!=0x00040000)&&(try<100)); if(try>=100) return 1; // error Icsp_SendCommand(ETAP_DATA); Icsp_XferData(32, Instruction); Icsp_SendCommand(ETAP_CONTROL); Icsp_XferData(32, 0x0000C000); return 0; // success } It works! Now, I can write and read PFM. I feel so conflicted while reading PIC32 Flash Programming Specification document. |
|
|
|
感谢您发布您的解决方案,并做好了工作。我仍然使用0x000 04C000,它工作。但是,我做了两个程序员,一个使用16F1454,另一个使用PIC32。当我尝试与PIC32版本相同的算法时,我发现了与进入SE模式相同的问题,但它不在下面的16F1454版本中。EJTAGBOOT命令与向控制寄存器发送0x000 04D000相同,但它是事先完成的,对于程序员来说,EJTAGRBK只需要设置一次,但必须在目标PIC退出复位时设置。问题似乎是定时。在目标PIC已经退出复位之前,更快的程序员可以开始对控制寄存器进行轮询。在这种情况下,必须保持EJTAGTBRK位(0B10000 0000、0000、0100、11010000、0000、0000)(0x000 04D000),而不重写EJTAGBOOT命令放在那里的“1”的EJTAGBRK值。情况下,目标PIC还没有开始执行代码,EJTAGBRK还没有被看到。我不认为编程规范对0x000 04C000值肯定是错误的,但是发送0x000 04D000是最好的,因为它起到了故障安全的作用。
以上来自于百度翻译 以下为原文 Thank-you for posting your solution and well done on getting it to work. I still use 0x0004c000 and it works. However, I made two programmers, one using a 16F1454 and the other using a PIC32. When I tried the same algorithm with the PIC32 version I found the same problem as you entering into the SE mode, but it was not there with the slower 16F1454 version. The EJTAGBOOT command is the same as sending 0x0004d000 to the control register but it is done beforehand and, for a programmer, the EjtagBrk really only needs to be set once, but it must be set when the target PIC comes out of reset. The problem seems to be timing. A faster programmer may start polling the CONTROL register before the target PIC has come out of reset. In this case, the EjtagBrk bit (0b0000 0000 0000 0100 1101 0000 0000 0000) (0x0004d000) must be kept set and not overwrite the EjtagBrk value of '1' that the EJTAGBOOT command put there. Setting the EjtagBrk bit (0b0000 0000 0000 0100 1101 0000 0000 0000) in a loop ensures that it always remains set in case the target PIC has yet to start code execution and the EjtagBrk has not been seen yet. I do not think the programming spec is necessarily wrong with the 0x0004c000 value but sending 0x0004d000 is best as it acts as a failsafe. |
|
|
|
我使用0x000 04C000,它在6MHz信令速率下工作良好。
以上来自于百度翻译 以下为原文 I use 0x0004c000 and it works fine at 6MHz signaling rate. |
|
|
|
新的问题发生了,函数UIT32 32 T ICSPYRADFLASH(UTIT32×T地址)将在第四调用中返回不正确的数据。如果在ICSPXXFLASDATA(32,and data)之后添加函数ICSPYTIAL SESEMODEE(),数据总是正确的,但是读取任务的错误是如此缓慢。
以上来自于百度翻译 以下为原文 New problem occurred, function uint32_t Icsp_ReadFlash(uint32_t Address) will be return an incorrect data in the 4th calling. uint32_t Icsp_ReadFlash(uint32_t Address) { uint32_t haddress, laddress, data; haddress=(Address>>16)&0x0000FFFF; laddress=Address&0x0000FFFF; data=0x00000000; Icsp_XferInstruction(0x3C13FF20); Icsp_XferInstruction(0x3C080000|haddress); Icsp_XferInstruction(0x35080000|laddress); Icsp_XferInstruction(0x8D090000); Icsp_XferInstruction(0xAE690000); Icsp_XferInstruction(0x00000000); Icsp_SendCommand(ETAP_FASTDATA); Icsp_XferFastData(32, &data); return data; } if add function Icsp_Enter_SE_Mode() after Icsp_XferFastData(32, &data), data is always correct but read-task excecution is so slow. |
|
|
|
只有小组成员才能发言,加入小组>>
5184 浏览 9 评论
2005 浏览 8 评论
1932 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3179 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2230 浏览 5 评论
742浏览 1评论
628浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
512浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
640浏览 0评论
538浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-28 20:17 , Processed in 1.537880 second(s), Total 84, Slave 68 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号