Hi, I tried this example but the isr doent seem to be getting executed.
In the isr i m calling a function to display on 7-segment displays. Otherwise the normal program flow is based on Receiving and Sending data on UART0(using timer1 in 8-bit auto-reload for 9600 baud generation)
"the isr doent seem to be getting executed."
How do you know that? What debugging have you done? Have you tried it in the simulator?
"In the isr i m calling a function to display on 7-segment displays"
There's nothing about 7-segment displays in the application note - so this must be the first thing to check:
Does the interrupt work without your extra code? Does your display code actually work? Is something in your other code disabling the interrupt?
"Otherwise the normal program flow is based on Receiving and Sending data on UART0"
Again, there's none of that in the example.
Go back to the example, and make sure that it works as-is; then add functionality a small step at a time, verifying that it still al works at each step...
how can i configure the time for interrupt occurence?? in the example they have used 10ms. if i reduce the time it will increase the brightness of display but it will interfere with serial interrupts, isnt it? of course serial interrupts have a higher priority. It seems my display which is flickering is because of this reason only.
"if i reduce the time it will increase the brightness of display but it will interfere with serial interrupts, isnt it?"
It probably also interferes with the timer interrupt.
Calling functions from interrupts is generally a bad idea; you generally want the ISR to do just the bare minimum to recognise the event, then leave any handling of the event (including displaying stuff) to the "main" code...
how else can i call the display function? previously i used it like following: . while(RI!=0) {display();} . . while(TI!=0) {display();} .
You talk about a faint display.
Is it LED or LCD?
If LED, you really should drive the display between the interrupts. You can't (or most definitely shouldn't) be in the interrupt long enough to give enough light.
If LCD, the update frequency affects the "strength" of the display.
View all questions in Keil forum