点击Debug菜单,注意选择点击“Disable debugWIRE and Close”,不要点击“Stop Debudding”,其实出现以上问题,就是因为选择的是“Stop Debudding”。
点击“Disable debugWIRE and Close”,退出仿真后,就可以进行正常的ISP编程,并可以获取熔丝位Fuses状态了。
原因是在仿真时用的是debuggWIRE接口,DWEN fuse被使能,ISP接口被禁止了,选择"Disable debugWIRE and Close"后DWEN fuse被禁止,ISP接口开放了。
1.In the Debug menu click Start Debugging and Break.
2. Atmel Studio will display an error message if the DWEN fuse in the ATmega328P is not enabled, click YES
to make Studio set the fuse using the ISP interface.
3. A debug session is started with a break in main, debugging can start.
4. When exiting debug mode select "Disable debugWIRE and Close" in the Debug menu, this will disable the
DWEN fuse.