我做的2407的板子,仿真时主程序中运行正常,能点亮led灯.但是打死就是不进入定时器中断,pwm也无输出; 程序在合众达的开发板上运行没问题的呀.我把我的cmd文件和asm文件贴出来,分析一下吧.(我的板是利用strb做片选扩展的一片cy7c1021)
cmd文件
MEMORY { /*PAGE0通常规定程序存储区*/ PAGE 0: VECS origin = 0000h, length = 0040h FLASH: origin = 100h, length = 7F00h PVECS: origin = 50h, length = 50h /* VECS origin = 8000h, length = 0040h FLASH: origin = 8040h, length = 4000h */ /*SARAM_P: origin = 8000h, length = 7ffh*/ /*PAGE1规定数据存储区*/ PAGE 1: MMRS: origin = 0h , length = 40h B2: origin = 0060h, length = 020h B0: origin = 200h, length = 100h B1: origin = 300h, length = 100h SARAM: origin = 800h, length = 800h SARAM_D: origin = 8000h, length = 2000h }
SECTIONS { rsvect: > VECS PAGE 0 vectors: > VECS PAGE 0 pvecs: > VECS PAGE 0 .text: > FLASH PAGE 0 .cinit: > FLASH PAGE 0 .switch: > FLASH PAGE 0 .bss: > SARAM PAGE 1 .stack: > SARAM PAGE 1 .stack: > B1 PAGE 1 .sysmem: > SARAM_D PAGE 1 }
asm文件
.mmregs .def rsvect .ref _c_int0 ;.ref _adint ;.ref _UartInt .ref _Time1Int .ref _T2PInt ;.ref _GRISS .ref _PHANTOM
.sect "vectors"
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ;Interrupt vector table for core ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rsvect B _c_int0 ;00h reset0 int1: B int1 ;_c_int1 ;02h INT1 int2: B _Time1Int ;int2 ;04h INT2 int3: B _T2PInt ;06h INT3 int4: B int4 ;08h INT4 int5: B int5 ;0Ah INT5 int6: B int6 ;0Ch INT6 int7: B int7 ;0Eh reserved int8: B int8 ;10h INT8 user-defined int9: B int9 ;12h INT9 user-defined int10: B int10 ;14h INT10 user defined int11: B int11 ;16h INT11 user defined int12: B int12 ;18h INT12 user defined int13: B int13 ;1Ah INT13 user defined int14: B int14 ;1Ch INT14 user defined int15: B int15 ;1Eh INT15 user defined int16: B int16 ;20h INT16 user defined int17: B int17 ;22h TRAP int18: B _PHANTOM ;24h NMI |