[求助]请教一下,如何用PE在56f8013VFAE中检测中断

- UID
- 118024
- 性别
- 男
|
[求助]请教一下,如何用PE在56f8013VFAE中检测中断
本人刚刚接触这方面的知识,请各位高手们尽可能的说的详细一些,谢谢了。 |
|
|
|
|
|

- UID
- 109211
- 性别
- 男
|

先在PE的介面中将相关接口的中断enable,然后用PE产生code ( Generate Code),这时PE就产生另一个C文件 "Events.c", 中断的skeleton就在这个文件中,下面就是一个PWM故障中断1的例子. 这个function 就是PE产生在"Events.c" 中。
/*
** ===================================================================
** Event : PWMC1_OnFault0 (module Events)
**
** From bean : PWMC1 [PWMMC]
** Description :
** This event is called when fault 0 occurs. (only when the
** bean is enabled - and the events are enabled -
** ). (event is available only if interrupt
** service/event is enabled). The event clears Fault flag
** only when the Fault is set to manual clearing mode. When
** the Fault is set to the automatic clearing mode, the
** Fault flag must be cleared by the user using
** ClearFaultFlag() method.
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
#pragma interrupt called /* Comment this line if the appropriate 'Interrupt preserve registers' property */
/* is set to 'yes' (#pragma interrupt saveall is generated before the ISR) */
void PWMC1_OnFault0(void)
{
/* Write your code here ... */
} |
|
|
|
|
|