用定时器Terminalcountout中断控制 一个发光二极管每一秒钟闪烁一次,但是程序下进后二极管一直亮着,是不是没有响应中断啊?
我的程序代码:
#include <m8c.h> // part specific constants and macros
#include "PSoCAPI.h" // PSoC API definitions for all User Modules
#pragma interrupt_handler Timer8_ISR_C
/*
extern void Timer8_EnableInt(void);
extern void Timer8_DisableInt(void);
extern void Timer8_Start(void);
extern void Timer8_Stop(void);
extern BYTE Timer8_bReadTimer(void);
extern BYTE Timer8_bReadTimerSaveCV(void);
extern void Timer8_WritePeriod(BYTE bPeriod);
extern BYTE Timer8_bReadCompareValue(void);
extern void Timer8_WriteCompareValue(BYTE bCompareValue);
*/
void main()
{
// Insert your main routine code here.
//Timer8_WritePeriod(183);
M8C_EnableGInt;
Timer8_EnableInt();
Timer8_Start();
while(1);
}
void Timer8_ISR_C()
{
PRT0DR^ =0x02;
} |