Communication Processor Module
MOTOROLA MPC823e REFERENCE MANUAL 16-512
CPIC
COMMUNICATION
16
PROCESSOR MODULE
16.15.6.2 USB INTERRUPT HANDLER EXAMPLE. In this example, the USB bit in the
CIPR remains set as long as one or more unmasked event bits remain in the USBE register.
This is an example of a handler for an interrupt source with multiple events. Notice that the
USB bit in the CIPR does not need to be cleared by the handler, but the USB bit in the CISR
does.
1. Set the IACK bit in the CIVR.
2. Read the vector to access the interrupt handler.
3. Immediately read the USBE register into a temporary location.
4. Choose the events in the USBE that will be handled in this handler and clear them.
The USBE bits are cleared by writing ones.
5. Handle the events in the USB RX or TX buffer descriptor tables.
6. Clear the USB bit in the CISR.
7. Execute the rfi instruction. If any unmasked bits (those not cleared by the software or
set by the MPC823e during the execution of this handler) in the USBE remain at this
time, this interrupt source is pending again after the rfi instruction.