所有,
谢谢您的帮助。事实证明我做错了一些事情。首先,我在调用_fctcpy时输入了一个拼写错误,因此我的flash编程例程没有加载到RAM中。然后,如上所述,我也忘了解锁EEPROM。此外,我正在使用一个工作在16 MHz以上的外部振荡器,所以我设置OPT7以添加数据表建议的等待状态。
我还发现在使用调试器加载程序时数据EEPROM会被清除。有道理,但我认为调试器只是重写程序闪存,而不是数据EEPROM。只需在不停止/启动调试器的情况下重新启动调试器,就不会重写数据EEPROM。一旦我完成了所有这一切,我就能够写入数据EEPROM并在电源循环时看到我的数据。
谢谢,
布赖恩
以上来自于谷歌翻译
以下为原文
All,
Thanks for the help. Turns out I was doing a few things wrong. First, I had a typo in my call to _fctcpy, so the flash programming routines of mine were not loaded into RAM. Then, as mentioned, I had also forgotten to unlock EEPROM. Also, I am using an external osciallator that operates above 16 MHz, so I set OPT7 to add a wait state as suggested by the datasheet.
I also discovered that the data EEPROM gets cleared upon loading the program with the debugger. Makes sense, but I thought the debugger just re-wrote program flash, not the data EEPROM. Just restarting the debugger without stopping/starting the debugger does not re-write data EEPROM. Once I got all that straight I was able to write to data EEPROM and see my data still there upon a power cycle.
Thanks,
Bryan
所有,
谢谢您的帮助。事实证明我做错了一些事情。首先,我在调用_fctcpy时输入了一个拼写错误,因此我的flash编程例程没有加载到RAM中。然后,如上所述,我也忘了解锁EEPROM。此外,我正在使用一个工作在16 MHz以上的外部振荡器,所以我设置OPT7以添加数据表建议的等待状态。
我还发现在使用调试器加载程序时数据EEPROM会被清除。有道理,但我认为调试器只是重写程序闪存,而不是数据EEPROM。只需在不停止/启动调试器的情况下重新启动调试器,就不会重写数据EEPROM。一旦我完成了所有这一切,我就能够写入数据EEPROM并在电源循环时看到我的数据。
谢谢,
布赖恩
以上来自于谷歌翻译
以下为原文
All,
Thanks for the help. Turns out I was doing a few things wrong. First, I had a typo in my call to _fctcpy, so the flash programming routines of mine were not loaded into RAM. Then, as mentioned, I had also forgotten to unlock EEPROM. Also, I am using an external osciallator that operates above 16 MHz, so I set OPT7 to add a wait state as suggested by the datasheet.
I also discovered that the data EEPROM gets cleared upon loading the program with the debugger. Makes sense, but I thought the debugger just re-wrote program flash, not the data EEPROM. Just restarting the debugger without stopping/starting the debugger does not re-write data EEPROM. Once I got all that straight I was able to write to data EEPROM and see my data still there upon a power cycle.
Thanks,
Bryan
举报