完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
您好,我试过这个(修改MCC中的引导加载程序)代码:所以在数据表中找不到任何关于软件擦除IDLOCS的信息,并且在18F66K80家庭闪存编程数据表中也没有确切可理解的关于软件擦除的信息。他们给出了许多引用,这类似于代码存储器擦除……所以我尝试使用代码存储器擦除代码……怎么了?
以上来自于百度翻译 以下为原文 Hello I try this (modify the bootloader from MCC) code: ; Here we have 0x200000 in TBLPTR register movlw b'10010100' ; Setup writes movwf EECON1 clrwdt movf EE_KEY_1,w ; Unlock // EE_KEY_1, EE_KEY_2 is a 55 AA constants movwf EECON2 movf EE_KEY_2,w movwf EECON2 bsf EECON1, WR ; Start the write nop ; The MCU reboots on on this NOP (in simulator). (in hardware it may be reboots not right here, but rebooting is the fact) So i can not find any information about software erasing IDLOCS in datasheet, and also there is no exactly understandable information in 18F66K80 Family Flash Programing Datasheet, about erasing from software. They are give many references that this is similar to code memory erase...so i try to use code memory erase code...what's wrong? |
|
相关推荐
5个回答
|
|
错误的指令,应该是MOVLW,而不是MOVF。
以上来自于百度翻译 以下为原文 movf EE_KEY_1,w ; Unlock // EE_KEY_1, EE_KEY_2 is a 55 AA constants Wrong instruction. That should be movlw, not movf. |
|
|
|
你确信那是NoP指令的重启/重置吗?中断是否已启用?
以上来自于百度翻译 以下为原文 Are you sure that is really a reboot/reset at that NOP instruction? Is the interrupt enabled? |
|
|
|
1)中断禁用。关于重启/重置。嗯,如果它能工作,它必须发送ACK或错误。但是没有收到任何应答,但是Bootloader成功地接收并执行下一个命令。因此它或重新启动了另一种方式。在模拟器中,在“步进”时“停止”NoP,如果我尝试“跨过”,则重新启动。2)2 QHB。不,这不是错的。你看到TE MCC生成的引导加载程序代码了吗?它需要KEY1和KEY2在PC-GT;Bootloader消息中。因此,IDLOClook的擦除命令是:03010055AA 00 00 20 00(我修改引导加载程序代码,因此它检查ADDRESS_U==20,然后仍然运行EraseProgMem和WriteProgMem函数以允许写入/擦除IDLOC)。我可以看到重新启动MCU。
以上来自于百度翻译 以下为原文 1) Interrupt disabled. About reboot/reset. Hm...if this would work it must send ack or error. but no any answer was received, but bootloader receives and executes next command successfully. So it thus or another way was rebooted. In simulator it "stops" on nop while "step in", and reboots if i try to "step over". 2) 2 qhb. No this is not wrong. Are you see te MCC Generated bootloader code? it require KEY_1 and KEY_2 in PC->bootloader message. So the erase command for IDLOC looks like: 03 01 00 55 AA 00 00 20 00 ( i modify bootloader code, so it check if the ADDRESS_U == 20 then still run EraseProgMem and WriteProgMem function to allow write/erase IDLOCs ), So Write works fine, but erase (only when addres = 0x200000) does not send any ack and as i can see reboots the mcu.. |
|
|
|
我以前从来没有在运行时写过PIC18设备的ID位置。据我所知,这些位置通过TBLRD和TBLWT指令既可读又可写。因此,不需要擦除它们或者使用魔法解锁序列。
以上来自于百度翻译 以下为原文 I have never written to the ID Locations of a PIC18 device at run-time before. As I understand it, these locations are both readable and writable through the TBLRD and TBLWT instructions. |
|
|
|
如果要修改ID位置,也需要擦除,这与代码内存非常相似(编程规范文档对此有更多的信息)。我怀疑模拟器是否完全处理它,并且如果使用ICD调试器,则必须采取特殊的预防措施来调试它。位置是从0x200000-0x200007开始的,因此您必须擦除页面@0x200000。64字节页面的一部分包括特殊的调试器bkbgvectmem位置,如果擦除,调试器将崩溃。当在18K系列中重新编程ID时,我总是复制64字节页面@0x200000,对前8个字节进行更改,并重新编程整个64字节页面。你不能一步一步地通过这一切…你必须跑过去。
以上来自于百度翻译 以下为原文 The ID locations require erasing too if you want to modify them, pretty much like code memory (the programming spec doc has more info on this). I doubt that the simulator handles this at all, and if you use an ICD debugger you have to take special precautions in order to debug this. The eight-byte ID locations are from 0x200000-0x200007 so you have to erase the page @ 0x200000. Part of that 64-byte page includes the special debugger bkbgvectmem locations, and if you erase it the debugger will crash. When reprogramming the ID in the 18K series I've always copied the 64-byte page @ 0x200000, made changes to the first 8 bytes, and reprogrammed the entire 64-byte page. You can't single-step through any of this... you have to run through it. |
|
|
|
只有小组成员才能发言,加入小组>>
5244 浏览 9 评论
2035 浏览 8 评论
1955 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3214 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2261 浏览 5 评论
780浏览 1评论
676浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
602浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
684浏览 0评论
581浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-26 03:53 , Processed in 2.499107 second(s), Total 86, Slave 70 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号