Hello, I have faced a problem with a function pointer variable. I have separated the uart module in two parts: HAL, which abstracts the hardware, and Service, which provides the uart service to the application. The interrupt routine is in HAL module, which has a function pointer variable that is called into the interrupt routine as interrupt handler. The actual interrupt handler function is in Service module. This function is assigned to the function pointer variable through a install function in the init routine. It works in debug simulation, but when I load the hex file to the microcontroller the application does not work. Anyone can help me?
This really doesn't sound like an appropriate way to be programming for an 8051!
If you really need to program this way, then a different target would probably be better for you; Or, if you really need to use an 8051, then a different programming approach would probably be appropriate!
Have you looked at the UART driver examples provided by Keil? They should be perfectly adequate:
http://www.keil.com/download/docs/200.asp
http://www.keil.com/download/docs/71.asp
second the motion
Erik