|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
本帖最后由 cjsb37 于 2013-4-29 09:09 编辑
我用汇编写的2812dsp汇编程序,但不知道为什么进不去中断,苦苦检查好几天但还是看不出哪儿不对,开中断应该没问题,串口发动接受使能我也检查过。但看不出有什么问题,有请各位大侠帮我看看,谢谢啦!所有程序附上,这个汇编程序可以作为2812的汇编模板程序,里面所有的中断入口及2812寄存器地址我都定义好了,可以作为初学者的入门汇编模板。
********************************************
.INCLUDE "reg2812asm.h"
.INCLUDE "IEVECTOR.H"
.GLOBAL START
.title "FIR_DEC2812"
FLASHREG .SET 04000H
.DATA
LIGHT .WORD FLASHREG
.text
START: SETC AMODE
C28OBJ
SETC SXM
SETC VMAP ; IV位于程序空间高端地址
CLRC DBGM ; DEBUG ENABLE
SETC INTM ; CLOSE ALL INTERRUPT
EALLOW
MOV SP,#400H
MOVL XAR4,#0
.lp_amode
;------------------------------------------------
; SETUPT CLOCK
NOP *,ARP1
MOVL XAR1,#WDCR
MOV *,#068H ; CLOSE WATCHDOG
MOVL XAR1,#PLLCR
MOV *XAR1,#0x0A ; PLL*5
MOVL XAR1,#PCLKCR
MOV *AR1,#0C00H ;
MOVL XAR1,#HISPCP
MOV *AR1,#01H ; HISPCLK = CLKOUT/1/2
MOVL XAR1,#LOSPCP
MOV *,#02H ; LOSPCLK = CLKOUT/2/2
*-------------------------------------------------
* SETUP SCIA
MOVL XAR1,#SCICCR_A
MOV *XAR1,#07H;SCI字符长度为8位
MOVL XAR1,#SCICTL1_A
MOV *XAR1,#03H
MOVL XAR1,#SCICTL2_A
MOV *XAR1,#03H
MOVL XAR1,#SCIHBAUD_A
MOV *XAR1,#00H
MOVL XAR1,#SCILBAUD_A
MOV *XAR1,#0F3H
MOVL XAR1,#SCICTL1_A
MOV *XAR1,#023H
*----------------------------------------------------
* SETUP GPIO
MOVL XAR1,#GPFMUX
MOV *XAR1++,#0030H ;SET GPIOF.4 =SCITXDA,GPIOF.5 =SCIRXDA,ELSE DIO
*----------------------------------------------------
* 设置中断
MOVL XAR1,#PIECTRL;ENPIE=1
MOV *AR1,#01H
MOVL XAR1,#PIEIER9
MOV *AR1,#03H
OR IER,#100H
MOVL XAR1,#PIEACK
MOV *AR1,#0FFFFH
CLRC INTM
EDIS
XB $,UNC
************************************************************************
************INTERRUPT SERVERCE ROUTINE**********************************
RSTISR
IRET
INTISR1
IRET
INTISR2
IRET
INTISR3
IRET
INTISR4
IRET
INTISR5
IRET
INTISR6
IRET
INTISR7
IRET
INTISR8
IRET
INTISR9
IRET
INTISR10
IRET
INTISR11
IRET
INTISR12
IRET
INTISR13
IRET
INTISR14
IRET
DTLOGISR
IRET
RTSISR
IRET
EMUISR
IRET
NMIISR
IRET
ILLISR
IRET
USRISR1 IRET
USRISR2 IRET
USRISR3 IRET
USRISR4 IRET
USRISR5 IRET
USRISR6 IRET
USRISR7 IRET
USRISR8 IRET
USRISR9 IRET
USRISR10 IRET
USRISR11 IRET
USRISR12 IRET
PDPAISR IRET
PDPBISR IRET
XINT1ISR IRET
XINT2ISR IRET
ADCISR IRET
TINT0ISR IRET
WAKEISR IRET
CMP1ISR IRET
CMP2ISR IRET
CMP3ISR IRET
T1PISR IRET
T1CISR IRET
T1UFISR IRET
T1OFISR IRET
T2PISR IRET
T2CISR IRET
T2UFISR IRET
T2OFT
CAPISR1 IRET
CAPISR2 IRET
CAPISR3 IRET
CMP4ISR IRET
CMP5ISR IRET
CMP6ISR IRET
T3PISR IRET
T3CISR IRET
T3UFISR IRET
T3OFISR IRET
T4PISR IRET
T4CISR IRET
T4UFISR IRET
T4OFISR IRET
CAPISR4 IRET
CAPISR5 IRET
CAPISR6 IRET
SPIRXISR IRET
SPITXISR IRET
MRISR IRET
MXISR IRET
SCIARXISR:
MOVL XAR1,#SCIRXBUF_A
MOVB AL.LSB,*XAR1
MOVL XAR1,#PIEACK
OR *XAR1,#100H
IRET
SCIATXISR:
MOVL XAR2,#SCITXBUF_A
MOV *XAR2,#1H;AL
MOVL XAR1,#PIEACK
OR *XAR1,#100H
IRET
SCIBRXISR IRET
SCIBTXISR IRET
ECAN0ISR IRET
ECAN1ISR IRET
.END
|
-
-
SCI_INT.rar
13.43 KB, 下载次数: 67
, 下载积分:
资产 -2 信元, 下载支出 2 信元
|