智能车制作
标题:
dg128单片机定时中断向量怎么搞
[打印本页]
作者:
zgyo888
时间:
2009-6-27 18:28
标题:
dg128单片机定时中断向量怎么搞
请哪位大侠指教一下dg128的定时中断向量怎么搞???不甚感激 急!!!!
作者:
yala1987
时间:
2009-6-28 10:05
dg128的中断向量表:
/**************** interrupt vector numbers ****************/
#define VectorNumber_VReserved63 63
#define VectorNumber_VReserved62 62
#define VectorNumber_VReserved61 61
#define VectorNumber_VReserved60 60
#define VectorNumber_VReserved59 59
#define VectorNumber_VReserved58 58
#define VectorNumber_Vpwmesdn 57
#define VectorNumber_Vportp 56
#define VectorNumber_Vcan4tx 55
#define VectorNumber_Vcan4rx 54
#define VectorNumber_Vcan4err 53
#define VectorNumber_Vcan4wkup 52
#define VectorNumber_VReserved51 51
#define VectorNumber_VReserved50 50
#define VectorNumber_VReserved49 49
#define VectorNumber_VReserved48 48
#define VectorNumber_VReserved47 47
#define VectorNumber_VReserved46 46
#define VectorNumber_VReserved45 45
#define VectorNumber_VReserved44 44
#define VectorNumber_VReserved43 43
#define VectorNumber_VReserved42 42
#define VectorNumber_VReserved41 41
#define VectorNumber_VReserved40 40
#define VectorNumber_Vcan0tx 39
#define VectorNumber_Vcan0rx 38
#define VectorNumber_Vcan0err 37
#define VectorNumber_Vcan0wkup 36
#define VectorNumber_Vflash 35
#define VectorNumber_Veeprom 34
#define VectorNumber_VReserved33 33
#define VectorNumber_Vspi1 32
#define VectorNumber_Viic 31
#define VectorNumber_VReserved30 30
#define VectorNumber_Vcrgscm 29
#define VectorNumber_Vcrgplllck 28
#define VectorNumber_Vtimpabovf 27
#define VectorNumber_Vtimmdcu 26
#define VectorNumber_Vporth 25
#define VectorNumber_Vportj 24
#define VectorNumber_Vatd1 23
#define VectorNumber_Vatd0 22
#define VectorNumber_Vsci1 21
#define VectorNumber_Vsci0 20
#define VectorNumber_Vspi0 19
#define VectorNumber_Vtimpaie 18
#define VectorNumber_Vtimpaaovf 17
#define VectorNumber_Vtimovf 16
#define VectorNumber_Vtimch7 15
#define VectorNumber_Vtimch6 14
#define VectorNumber_Vtimch5 13
#define VectorNumber_Vtimch4 12
#define VectorNumber_Vtimch3 11
#define VectorNumber_Vtimch2 10
#define VectorNumber_Vtimch1 9
#define VectorNumber_Vtimch0 8
#define VectorNumber_Vrti 7
#define VectorNumber_Virq 6
#define VectorNumber_Vxirq 5
#define VectorNumber_Vswi 4
#define VectorNumber_Vtrap 3
#define VectorNumber_Vcop 2
#define VectorNumber_Vclkmon 1
#define VectorNumber_Vreset 0
作者:
173001145
时间:
2010-1-17 16:43
/**************** interrupt vector table ****************/
#define VReserved63 0x0000FF80 //63
#define VReserved62 0x0000FF82 //62
#define VReserved61 0x0000FF84 //61
#define VReserved60 0x0000FF86 //60
#define VReserved59 0x0000FF88 //59
#define VReserved58 0x0000FF8A //58
#define Vpwmesdn 0x0000FF8C //57
#define Vportp 0x0000FF8E //56
#define Vcan4tx 0x0000FF90 //55
#define Vcan4rx 0x0000FF92 //54
#define Vcan4err 0x0000FF94 //53
#define Vcan4wkup 0x0000FF96 //52
#define VReserved51 0x0000FF98 //51
#define VReserved50 0x0000FF9A //50
#define VReserved49 0x0000FF9C //49
#define VReserved48 0x0000FF9E //48
#define VReserved47 0x0000FFA0 //47
#define VReserved46 0x0000FFA2 //46
#define VReserved45 0x0000FFA4 //45
#define VReserved44 0x0000FFA6 //44
#define VReserved43 0x0000FFA8 //43
#define VReserved42 0x0000FFAA //42
#define VReserved41 0x0000FFAC //41
#define VReserved40 0x0000FFAE //40
#define Vcan0tx 0x0000FFB0 //39
#define Vcan0rx 0x0000FFB2 //38
#define Vcan0err 0x0000FFB4 //37
#define Vcan0wkup 0x0000FFB6 //36
#define Vflash 0x0000FFB8 //35
#define Veeprom 0x0000FFBA //34
#define VReserved33 0x0000FFBC //33
#define Vspi1 0x0000FFBE //32
#define Viic 0x0000FFC0 //31
#define VReserved30 0x0000FFC2 //30
#define Vcrgscm 0x0000FFC4 //29 Self Clock Mode
#define Vcrgplllck 0x0000FFC6 //28 PLLLock
#define Vtimpabovf 0x0000FFC8 //27
#define Vtimmdcu 0x0000FFCA //26
#define Vporth 0x0000FFCC //25
#define Vportj 0x0000FFCE //24
#define Vatd1 0x0000FFD0 //23 Anolog to Digital Interrupt 1
#define Vatd0 0x0000FFD2 //22 Anolog to Digital Interrupt 0
#define Vsci1 0x0000FFD4 //21
#define Vsci0 0x0000FFD6 //20
#define Vspi0 0x0000FFD8 //19
#define Vtimpaie 0x0000FFDA //18 Pulse Accumulator Interrupt Edge
#define Vtimpaaovf 0x0000FFDC //17 Pulse Accumulator A OverFlow Interrupt
#define Vtimovf 0x0000FFDE //16 TimeOverFlow
#define Vtimch7 0x0000FFE0 //15 TimeChannal7
#define Vtimch6 0x0000FFE2 //14 TimeChannal6
#define Vtimch5 0x0000FFE4 //13 TimeChannal5
#define Vtimch4 0x0000FFE6 //12 TimeChannal4
#define Vtimch3 0x0000FFE8 //11 TimeChannal3
#define Vtimch2 0x0000FFEA //10 TimeChannal2
#define Vtimch1 0x0000FFEC //9 TimeChannal1
#define Vtimch0 0x0000FFEE //8 TimeChannal0
#define Vrti 0x0000FFF0 //7 RealTime Interrupt
#define Virq 0x0000FFF2 //6
#define Vxirq 0x0000FFF4 //5
#define Vswi 0x0000FFF6 //4
#define Vtrap 0x0000FFF8 //3
#define Vcop 0x0000FFFA //2
#define Vclkmon 0x0000FFFC //1
#define Vreset 0x0000FFFE //0
作者:
jiao19880804
时间:
2010-3-19 20:55
Re:跪求一定时中断程序
用主定时器,好像用定时器的通道不行!
跳不出中断程序,主定时器就可以。以下是定时启动,定时停止,和测速程序段。
unsigned int main_cnt=0; //主定时器延时0.6s
/***********主定时器中断服务程序(实现0.6s的延时,测速)********/
#pragma CODE_SEG NON_BANKED
void interrupt int_timeroverflow(void){
if(main_cnt%100==0)
{
//main_cnt=0;
//speed_data0=speed_data1; //保存最近两次速度值(原来有问题)
//speed_data1=speed_cnt;
speed_data0=speed_cnt;
speed_cnt=0;
PORTB=0x00;
}
if(main_cnt==610) //610*65535=8M*5 实现5秒定时
{
speed(45); //速度太慢不能行走
PWMDTY01=motor_middle; //给通道0,1设置duty值(舵机正中)
go=1;
}
if(main_cnt==6100) //610*65535=8M*50 实现50秒定时
{
speed(0); //速度太慢不能行走
PWMDTY01=motor_middle; //给通道0,1设置duty值(舵机正中)
go=0;
}
main_cnt++;
TFLG2_TOF = 1; //clear timer overflow flag
}
/**********通道5捕捉中断(测速)*******************************/
#pragma CODE_SEG NON_BANKED
interrupt void timerinput5(void){
speed_cnt++;
TFLG1_C5F=1;
}
/************************************************************/
作者:
anjiayu
时间:
2010-3-25 20:32
我想问问,测速可不可以在实时中断里面进行,就不用定时器的溢出中断了?请各位赐教!!
作者:
姚先生
时间:
2010-4-21 13:08
在你安装的文件夹里搜 dg128 的头文件就好了
作者:
ll_0520
时间:
2010-4-22 16:39
ddddddd
作者:
qq451121549
时间:
2010-4-22 17:13
好像你没有加中断号?
作者:
七年之痒
时间:
2012-3-1 11:15
这个是全的哦,求贡献
欢迎光临 智能车制作 (http://dns.znczz.com/)
Powered by Discuz! X3.2