摘要
单片机在应用中编程IAP(InApplicationProgramming)是单片机应用的新技术,可以实现用户应用程序对FLASH存储器编程、擦除和读存储器等功能,但是,使用单片机高级语言C51编程开发应用程序时不容易直接调用IAP功能。介绍了P89C51RD2单片机闪存的操作特点及其IAP功能实现原理。结合C51调用汇编语言子程序时的参数传递规律,分析应用C51与汇编语言混合编程向特定寄存器中写入相应参数调用IAP功能子程序的方法。通过实例,给出了向IAP子程序传递参数的C51程序及相应的汇编程序,实现了IAP功能。在KeilμVision2下仿真和实验,该方法切实可行。
In-Application Programming(lAP) is developed as the newest technique in design or development for microcontroller application system. User program can erase Flash program memory block ,program byte and verify byte. However ,it is difficult to call the lAP routines directly in application developed with microcontroller's high level language C51. The basic principle of lAP in P89C51RD2 microcontroller is introduced,as well as the characteristics of Flash program memory with lAP. The method for lAP by C51 and assembler program is analysed,which achieves the aim for communicating with the lAP routines by delivering parameters to special registers based on the regulation of parameters delivers. This paper demonstrates the application instance which is developed by C51 and corresponding assembler program,realizs the IAP function. The simulation and test result show that the scheme is correct and effective.
出处
《现代电子技术》
2005年第23期106-108,共3页
Modern Electronics Technique