writing exception handlers for mcf5485

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

writing exception handlers for mcf5485

1,590 Views
gerry77
Contributor I
Hi,
 
in order to the on-chip usb controller of an mcf5485 work (with a cml5485 board from axman and CodeWarrior IDE 5.7.0), I need to write a few exception handlers.
 
I set a breakpoint in the asm_exception_handler and tried debugging. When polling the MCF_USB_USBISR register within the main loop, I see that the interrupt fires, but the breakpoint in the exception hanlder isn't reached. But the readme.txt of the project says that the vectors _are_ used with the M5485 UART SRAM Build. Why?
Another breakpoint in asm_set_ipl in the same file is reached.
 
Can anyone tell me a tutorial for integrating new exception handlers?
 
gerry
 
Labels (1)
0 Kudos
1 Reply

218 Views
mccPaul
Contributor I
Hi Gerry,
 
Coldfire exception processing is explained in detail in the interrupt controller module chapter of the user guides, but it can be a bit confusing.
 
There are a number of steps that you need to complete to enable, trigger and service interrupts properly.
 
1.You need to configure the peripheral so that it generates interrupts for the condition you are looking for. This usually involves setting register flags for the peripheral.
 
2. You then unmask the interrupt source in the interrupt controller and set a unique level and priority for that source.
 
3. When the interrupt fires, the interrupt controller module identifies the source of the interrupt and the vector for that source. If the interrupt source is not masked, it will then call the interrupt service routine pointed to by the vector. All interrupts at or below the level of this source are automatically masked, but your ISR can mask higher levels by setting the CPU's status register mask. The interrupt controller uses the priority to decide which interrupt to service first when more than one interrupt is active simultaneously.
 
 
Specifically for the case you talk about, I suspect that you need to unmask the interrupt in the interrupt controller, but you should write a specific ISR and don't use the catch-all asm_exception_handler.
 
Cheers,
 
Paul.
0 Kudos