How to write a value into the memory location of 8051 microcontroller in C program using KEIL IDE. To enable watchdog timer in AT89S52, in the memory location 0xa6, we need to write 0x1e followed by ox0e1 to activate watchdog timer. I am able to do the same with assembly. How to do it with C Program is the question.
sfr WDTRST = 0xA6; . . . WDTRST = 0x1E; WDTRST = 0xE1;
If you have a proper header file for your device, use this instead of defining SFRs on your own.
Thanks a lot. It's working
Thanks a lot. It's working in Hardware too.