Hello everybody.
I have a problem about writing the correct code to access the IAP routine in langage C, to write or read in the Flash memory of the microcontroleur P89V51RD2.
I know how doing this is assembleur like this :
For example this code allow to write the value 1 at the adress FFFFh of the flash memory. (This code works in assembleur).
MOV R1, #02h //Write to the flash MOV DPH, #0FFh //at the adress FFFFh MOV DPL, #0FFh MOV A, #1 //value=1 MOV 0B1h, #0 //Enter in IAP CALL 1FF0h MOV 0B1h, #1 //Exit from IAP
But I don't know how to write "CALL 1FF0h" in C langage, and I don't want to insert asm code into a program write in langage C.
And Keil don't know "R1" in langage C, the message error is : error C202: 'R1": undefined identifier.
Do you have an idea?
Sounds like someone really needs to read some documentation on how do to mixed C/assembler coding, creating routines in assembler you can call from C, and how to call things via pointers.
www.efton.sk/.../p89v51rd2 iap.pdf
http://www.keil.com/forum/184/ http://www.keil.com/support/man/docs/c51/c51_ap_ctoasm.htm http://www.keil.com/support/docs/1671.htm http://www.keil.com/support/docs/50.htm
I wouldn't start ruling out methods to achieve tasks until you get of good grasp of what can be done, how, and what the interface requirements are.
Using a "pure c" solution, whatever you think that is, is probably not the most effective solution here.