AN2292 Freescale Semiconductor / Motorola, AN2292 Datasheet - Page 10

no-image

AN2292

Manufacturer Part Number
AN2292
Description
8-Bit Software Development Kit
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2292
Interrupts
Interrupt Callbacks
Interrupt Flag Service
Interrupt Debug
Strobes
10
NOTE:
You can assign any application function to an interrupt by callback definition in
“appconfig.h”:
#define INT_PWM_RELOAD_CALLBACK_1 IsrPWM_Reload
In this example the “IsrPWM_Reload” is the name of the user function. This
name can be an arbitrary string. The “INT_PWM_RELOAD_CALLBACK_1”
determines in which interrupts the user function will be called and the type of
the callback. In this case the PWM interrupt callback type 1 is defined by the
suffix _1 at the end. It means that the IsrPWM_Reload() user function will be
called first, then the PWM Interrupt flag is cleared.
You can also define their own callback after the 68HC08 SDK ISR
#define INT_PWM_RELOAD_CALLBACK_2 IsrPWM_Reload
In this example the PWM Interrupt flag will be cleared and then the
IsrPWM_Reload() user function will be called.
Most interrupts use flags, which signal the request of the interrupt. New
interrupt cannot be requested until the flag is cleared. The constant
INT_FlagName_FLAG defined in the “appconfig.h”, determines if the flag is
cleared by the 68HC08 SDK or if you will take care of this flag by yourself:
#define INT_PWM_RELOAD_CALLBACK_1 IsrPWM_Reload
#define INT_PWM_RELOAD_FLAG CLEAR_USER
This definition leaves the flag service to you. In this case, you are responsible
for servicing the interrupt flag.
The callback definition can be copied from the “callback.txt” file.
The IDS (interrupt debug strobes) can be used during the development of the
application. It indicates the interrupt duration to the developer. The selected I/O
pin is set at the beginning of the interrupt and cleared at the end of the interrupt.
The required I/O port and the pin have to be defined in the “appconfig.h” by the
definition:
/* definition of PORT for debug signal */
#define INT_InterruptName_STROBE_PORT PORTx
and
/* definition of PIN for debug signal on specified port */
#define INT_InterruptName_STROBE_PIN n
where “x” is the port identifier (A,B,C,E,F) and the “n” is the number of the pin
(0,1,2,3,4,5,6,7).
Freescale Semiconductor, Inc.
For More Information On This Product,
8-Bit Software Development Kit
Go to: www.freescale.com
MOTOROLA

Related parts for AN2292