Need to know where to save contents of SR2 to test flags RDRF and IDLE in order to determine source of interrupt.triojection
You didn't need to post a new thread for that question.
Nobody seems to have volunteered any code yet, so I'll make a suggestion.
The UART in that part is "Serial Communication Interface (S08SCIV4)". These MCF51 parts are basically MCS08 parts with the CPU replaced with a Coldfire core.
If there was any sample code for this SCI it will have been for the MCS08 parts that used this SCI. So I suggest that you go search for App Notes in that area. A quick search finds "AN4752.pdf", which may be what you want, or may not. The URLs in that app note (to the source code) may not work any more. Of course you'll have to translate S08 assembly into Coldfire assembly, but that should be pretty easy.
There's nothing complicated about the SCI interrupts. If you have receive interrupts working, then adding handling of the Idle interrupt shouldn't take more than a couple of lines of code. Just enable ILIE in SCIxC2 and test for the IDLE bit in SCIxS1 as well as testing it (the copy of SCSxS1 you read into a register) for RDRF when you take the interrupt. This is real simple stuff.
Retrieving data ...