在线时间393 小时
UID123826
注册时间2009-4-22
NXP金币2
TA的每日心情 | 难过 2021-12-15 16:01 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]初来乍到
中级会员
 
- 积分
- 377
- 最后登录
- 2023-8-16
|
发表于 2010-7-15 15:15:29
|
显示全部楼层
RE:请教:MC9S12XEP100 定时器溢出中断进不了~
下列是串口SCI中断的设置,建议参考一下。
/************************* Macros ******************************************/
#define ROUTE_INTERRUPT(vec_adr, cfdata) \
INT_CFADDR= (vec_adr) & 0xF0; \
INT_CFDATA_ARR[((vec_adr) & 0x0F) >> 1]= (cfdata)
#define SCI0_VEC 0xD6 /* vector address= $xxD6 */
//Initialise the XGATE
static void SetupXGATE(void)
{
/* initialize the XGATE vector block and
set the XGVBR register to its start address */
XGVBR= (unsigned int)(void*__far)(XGATE_VectorTable - XGATE_VECTOR_OFFSET);
/* switch SCI0 interrupt to XGATE */
ROUTE_INTERRUPT(SCI0_VEC, 0x81); /* RQST=1 and PRIO=1 */
/* enable XGATE mode and interrupts */
XGMCTL= 0xFBC1; /* XGE | XGFRZ | XGIE */
} |
|