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)
Alright let me correct my stand...there might not be a need to call display() in an ISR...or rather it is not recommended... BUt the method being used as of now(the code i posted) isnt the best way to do it, isnt it? Maybe i should try the following: An ISR for serial interrupt which will be responsible for interpreting the data received and putting it into the display_array, instead of doing "while(RI!=1){display();}" And apart from the ISR the program will do:
while(1) { display(); }
Please let me know what you think of it
"there might not be a need to call display() in an ISR...or rather it is not recommended..."
I suspect that it is both not recommended and not needed!
"the method being used as of now(the code i posted) isnt the best way to do it, isnt it?"
Clearly not - as it doesn't work!
"An ISR for serial interrupt which will be responsible for interpreting the data received and putting it into the display_array"
No - you've missed the point!
In general, an ISR should not interpret the data at all! Simply receive and buffer it. All interpretation and handling for display should generally be outside the ISR
Take a look at the interrupt-driven serial IO examples in the Downloads area...