📄 init_int_pins.s
字号:
;START_HEADER
;
; dsPIC30F6014 Demo Source File
; (c) Copyright 2005 Microchip Technology, All rights reserved
;
; --------------------------------------------------------------------------
; File Revision History:
; --------------------------------------------------------------------------
;
; $Log: init_int_pins.s,v $
; Revision 1.3 2005/04/04 23:44:30 VasukiH
; Updates to comments in file header
;
; Revision 1.2 2005/04/04 23:16:04 VasukiH
; Updates for MPLAB C30 v1.30 compatiblity
;
; Revision 1.1.1.1 2003/08/23 00:38:32 VasukiH
; First import of demo source into CVS Repository
;
;
;
; --------------------------------------------------------------------------
;
; Software and Development Tools Info:
; --------------------------------------------------------------------------
; Tool Version
; --------------------------------------------------------------------------
; MPLAB IDE 7.0
; MPLAB C30 Toolsuite 1.30
; dsPICDEM(TM) Processor Board 1.10
; --------------------------------------------------------------------------
;
; File Notes:
; 1. This file contains 2 subroutines for initializing external interrupt
; pins.
; 2. _init_int_pins will set up the interrupt priorities of pins INT1-4
; and disable ISR processing. After this subrouine is executed, the
; _main routine will stall execution until switch S1(INT1) is pressed.
; 3. _init_int_pins_isr will sclear interrupt flag status bits of pins INT1-4
; and enable ISR processing
;
;END_HEADER
.include "p30fxxxx.inc"
;Global Declarations for routines in Program Memory
.global _init_int_pins
;User code section in Program Memory
.section .text
_init_int_pins:
bset INTCON2, #INT4EP ;Set up INT pins to detect falling edge
bset INTCON2, #INT3EP
bset INTCON2, #INT2EP
bset INTCON2, #INT1EP
bclr IPC4, #INT1IP2 ;Set up interrupt pin priorities
bset IPC4, #INT1IP1 ;All priorities set to 5
bclr IPC4, #INT1IP0
bclr IPC5, #INT2IP2
bset IPC5, #INT2IP1
bclr IPC5, #INT2IP0
bclr IPC9, #INT3IP2
bset IPC9, #INT3IP1
bclr IPC9, #INT3IP0
bclr IPC9, #INT4IP2
bset IPC9, #INT4IP1
bclr IPC9, #INT4IP0
bclr IFS1, #INT1IF ;Clear associated interrupt flag bits
bclr IFS1, #INT2IF
bclr IFS2, #INT3IF
bclr IFS2, #INT4IF
bset IEC1, #INT1IE ;Enable ISR processing for INT pins
bset IEC1, #INT2IE ;at this time
bset IEC2, #INT3IE
bset IEC2, #INT4IE
return ;Return to calling routine
.end ;EOF
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -