这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » FPGA » 我的程序进入不了中断,请高手指教

共5条 1/1 1 跳转至

我的程序进入不了中断,请高手指教

菜鸟
2010-05-18 19:19:45     打赏

typedef unsigned int unt;
ioport unt port10;
ioport unt port1;
unt keyvalue=2;
unt data[]={0x80fc,0x8060,0x80da,0x80f2,0x8066,0x80b6,0x80be,0x80e0};
void delay();
void main()
{
 *(volatile unt *)SWWSR=0x7208;
 *(volatile unt *)SWCR = 0x0000;
 *(volatile unt *)BSCR= 0xf800;
 *(volatile unt *)ST0 = 0x0000;
 *(volatile unt *)ST1 = 0x2b00;
 *(volatile unt *)PMST=0x2fe4;
 *(volatile unt *)IFR=0xffff;
 *(volatile unt *)IMR=0x0002;
 *(volatile unt *)ST1=(*(volatile unt *)ST1)&0xf7ff;//start int1 global
 
 while(1)// 等待中断来显示数字
 {
  port10=data[keyvalue];
 }
 
}

interrupt void Get_KeyValue()
{
 keyvalue=3;
 *(volatile unt *)IFR=0x00ff;
 *(volatile unt *)IMR=0x0002;
 *(volatile unt *)ST1=(*(volatile unt *)ST1)&0xf7ff;//start int1 global
 
}
 .sect ".vectors"
  .ref  _Get_KeyValue
        .ref  _c_int00      ; main progrom
        ;.ref timer0 ,hpisys,usb_read

        .align  0x80            ; must be aligned on page boundary

RESET:                          ; reset vector
        B _c_int00              ; branch to main progrom
    NOP
          NOP
nmi:    RETE                    ; enable interrupts and return from one
                NOP
                NOP
                NOP                                     ;NMI~

                ; software interrupts
sint17 .space 4*16
sint18 .space 4*16
sint19 .space 4*16
sint20 .space 4*16
sint21 .space 4*16
sint22 .space 4*16
sint23 .space 4*16
sint24 .space 4*16
sint25 .space 4*16
sint26 .space 4*16
sint27 .space 4*16
sint28 .space 4*16
sint29 .space 4*16
sint30 .space 4*16

int0:   RETE
                NOP
                NOP
                NOP
int1:  
                NOP
                B  _Get_KeyValue
                RETE          
               
int2:   RETE
                NOP
                NOP
                NOP
tint:   RETE
    NOP
          NOP
    NOP
rint0:  RETE
                NOP
                NOP
                NOP
xint0:  RETE
                NOP
                NOP
                NOP
DMAC0: RETE
    NOP
    NOP
    NOP
DMAC1: RETE      ;tint1
    NOP   
    NOP
    NOP
      
int3:   RETE
                NOP
                NOP
                NOP

HPINT: RETE  
    NOP
    NOP
    NOP 
DMAC2:  RETE      ;rint1
    NOP   
                NOP
                NOP
    
                NOP
xint1:  RETE 
    
          NOP
    NOP
    NOP
DMAC4: RETE
    NOP
    NOP
    NOP

DMAC5: RETE
    NOP
    NOP
    NOP
                .end




关键词: 我的     程序     进入     不了     中断     高手     指教     vola    

高工
2010-05-18 20:18:50     打赏
2楼

没有更详细的描述吗?这样别人怎么帮你。


专家
2010-05-19 08:25:20     打赏
3楼
楼主把现象描述得详细一点!

专家
2010-05-19 11:36:51     打赏
4楼
楼主port10显示的现象是什么?

菜鸟
2010-05-19 16:55:21     打赏
5楼

NOP空操作时间够么? 程序结构? 工程库文件齐全否?


共5条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]