Solved! Go to Solution.
Hello, and welcome to the forum.
I assume that you are using a SCI module to communicate with the keyboard/display. If so, I assume that the interrupt that you refer to is the SCI receive interrupt.
It would seem that you are attempting to implement a nested interrupt, with the additional complexity that this requires. But I don't think that this is necessary for your application.
If it is likely that the SCI module will immediately be ready to send (there has been no prior send operation for a while), and the display turn-on command is a single byte, simply send the command byte from within the SCI receive ISR.
Alternatively, if the display turn-on command is comprised of multiple bytes, and/or it is likely that the SCI module may not be immediately ready to send, set a flag bit from within the SCI receive ISR, and exit the ISR. Then poll the flag status from within the main loop, and initiate the command send from there, should the flag be set. Don't forget to clear the flag bit.
Regards,
Mac
Following Bigmac's suggestion, I put the display turn-on commands in the main loop after every instance of keypad read. Works great but more complex as there are multiple software modules that access the keypad. The display is used in the dark and a software timer turns it off after two minutes to conserve power.
Thank you for a prompt and clear reply.
Hello, and welcome to the forum.
I assume that you are using a SCI module to communicate with the keyboard/display. If so, I assume that the interrupt that you refer to is the SCI receive interrupt.
It would seem that you are attempting to implement a nested interrupt, with the additional complexity that this requires. But I don't think that this is necessary for your application.
If it is likely that the SCI module will immediately be ready to send (there has been no prior send operation for a while), and the display turn-on command is a single byte, simply send the command byte from within the SCI receive ISR.
Alternatively, if the display turn-on command is comprised of multiple bytes, and/or it is likely that the SCI module may not be immediately ready to send, set a flag bit from within the SCI receive ISR, and exit the ISR. Then poll the flag status from within the main loop, and initiate the command send from there, should the flag be set. Don't forget to clear the flag bit.
Regards,
Mac