我使用PIT中断,控制M口输出点灯,单步调试的时候发现没有进入中断,我是初学者,刚刚接触freescale,用的XDP512,
希望有人能指点一下,再初学的路上点亮一盏灯,帮我过了这道坎,感激不尽。
我的代码:#include <hidef.h> /* common defines and macros */
#include <mc9s12xdp512.h> /* derivative information */
#pragma LINK_INFO DERIVATIVE "mc9s12xdp512"
void SetupPITimer (void)
{
/* time-out period = (PITMTLD0 + 1) * (PITLD0 + 1) / Fbus */
PITCFLMT = 0x81; /* PFLMT0=1 (reload MT0) */
PITFLT = 0x01; /* force reload of PIT channel 0 */
PITMUX = 0x00;
PITCE = 0x01;
PITINTE = 0x01; /* enable PIT channel 0 interrupt */
PITTF = 0x01; /* clear PIT interrupt */
PITMTLD0 = 0x02; /* MT0 load value (divides bus clock) */
PITLD0 = 0X0001; /* T0 load value (5 ms) */
PITCFLMT |= 0x80;
}
/********************************************************/
/*********************** main *********************************/
void main(void)
{
DDRM=0XFF;
PTM=0x00;
SetupPITimer();
EnableInterrupts;
for(;;)
{
}
}
/********************************************************/
/* interrupt handler for PIT 0 */
#pragma CODE_SEG __NEAR_SEG NON_BANKED
void interrupt 73 ISR_PIT0(void)
{
PITINTE &= 0xfe;
PITTF |= 0x01;
PTM=~PTM;
}
而且下载的时候在command window中有以下的警告,说有俩个文件不纯在,不知道是不是问题所在。昨天版主指导说中断地址的问题,不晓得map文件在什么地方。希望能进一步的指正,小弟拜谢。
IO registers loaded for MC9S12XDT256 from C:\Program Files\Freescale\CW for HC12 V4.5\prog\REG\MCU03F0.REG
Reset command file does not exist.
Postload command file does not exist.
STARTED
RUNNING
Startup command file does not exist.
Target Ready