Dear all, when i write 0xfe into HCR0 register using startup.a51 my program works fine.. whereas when i wanted to write into program memory i have to enable PML bit. ie i wrote 0xbe into HCR register.My program gets reset again and again .. I thought this might be problem with watchdog timer and disabled it in the same register (writing 0xb6 ). Now there is no Response from the program what is the issue??? can any expert help me in this ??
In my opinion the problem is not in HCR register. Does the problem occur when you write to the flash ?
NO ..It does not occur when i write into Flash..( I agree ...) but.I am really amazed with HCR register How it is mapped to 807EH address ?? my startup it is like .... org 807EH HCR1: db 0E3H ; HCR0: db 0BEH ; My program gets reset again and again. Is there anything for this to do with Watchdog reset ?? or should i configure any other bits ?? ( my intention is to write into program memory by configuring these bits )
"I am really amazed with HCR register How it is mapped to 807EH address ??" Presumably, that's in XDATA - what does the Datasheet say?
HCRx are hardware configuration registers that are mapped into the code space (configured by HWCfr.a51 which is part of the Keil examples). You may program them only during Flash initialization. Take a look to one of the example applications that we provide. For example: ..\C51\EXAMPLES\TI MSC121x\AD4Input. The ISD51 (In-System Debugger) includes a CWRITE function that alters program memory. You may take out the required function from ISD51.A51. Reinhard
Hi, Are you writing to flash memory using rom routines or your own routines located in XRAM (ram/code addressable) ? If this is the case you shouldn't have that behavior. Regards Viktor
Thanks to all, Problem has been solved. (I was trying to update flash memory from my routine..!)