⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pitimer12_1int.asm

📁 详细的无线键盘,鼠标,无线桥 开发文档.包含电路原理图,电路板光汇文件.FIREWALL, 驱动程序等.有此文档,就可以完全直接生产出来无线键盘,鼠标,无线桥.整个一套完整的解决方案.
💻 ASM
字号:
;;*****************************************************************************
;;*****************************************************************************
;;  FILENAME: PITIMER12_1INT.asm
;;   Version: 1.1, Updated on 2005/10/05 at 11:30:23
;;  Generated by PSoC Designer ver 4.3  b1884 : 23 June, 2006
;;
;;  DESCRIPTION:
;;    Interrupt handler routine for PITIMER user module instance: PITIMER12_1.
;;-----------------------------------------------------------------------------
;;  Copyright (c) Cypress Semiconductor 2004. All Rights Reserved.
;;*****************************************************************************
;;*****************************************************************************
include "m8c.inc"
include "memory.inc"
include "PITIMER12_1.inc"

;-----------------------------------------------
;  Global Symbols
;-----------------------------------------------
export  _PITIMER12_1_ISR

AREA InterruptRAM (RAM,REL,CON)

;@PSoC_UserCode_INIT@ (Do not change this line.)
;---------------------------------------------------
; Insert your custom declarations below this banner
;---------------------------------------------------

;------------------------
; Includes
;------------------------
	
;------------------------
;  Constant Definitions
;------------------------

;------------------------
; Variable Allocation
;------------------------
export  _tick
export   tick

export  usec_tick

export  _ticks_per_sleep


AREA bss

_tick:
 tick:              BLK     4       ; 32 bit 1ms counter

usec_tick:          BLK     1       ; 1ms counter

_ticks_per_sleep:   BLK     2       ; # ticks per sleep ISR

;---------------------------------------------------
; Insert your custom declarations above this banner
;---------------------------------------------------
;@PSoC_UserCode_END@ (Do not change this line.)

AREA UserModules (ROM, REL)
;-----------------------------------------------------------------------------
;  FUNCTION NAME: _PITIMER12_1_ISR
;
;  DESCRIPTION: Calls the UM specified Callback function if it was enabled
;
;-----------------------------------------------------------------------------
_PITIMER12_1_ISR:
   ;@PSoC_UserCode_BODY_1@ (Do not change this line.)
   ;---------------------------------------------------
   ; Insert your custom code below this banner
   ;---------------------------------------------------
   ;   NOTE: interrupt service routines must preserve
   ;   the values of the A and X CPU registers.
    push    A

    dec     [usec_tick]             ; decrement us tick counter
    jnz     .exit

    mov     A, 4                    ; count 4 interrupts @ 250us
    mov     [usec_tick], A

    inc     [tick + 3]              ; increment 1ms tick counter
    adc     [tick + 2], 0
    adc     [tick + 1], 0
    adc     [tick + 0], 0

.exit:
    pop     A
    reti


export  Sleep_ISR

Sleep_ISR:

    ; If tick timer is disabled then add ticks_per_sleep to tick
    tst     reg[INT_MSK1], INT_MSK1_PIT
    jnz     .exit

    push    A
    mov     A, [_ticks_per_sleep + 1]
    add     [tick + 3], A
    mov     A, [_ticks_per_sleep]
    adc     [tick + 2], A
    adc     [tick + 1], 0
    adc     [tick + 0], 0
    pop     A

.exit:

   ;---------------------------------------------------
   ; Insert your custom code above this banner
   ;---------------------------------------------------
   ;@PSoC_UserCode_END@ (Do not change this line.)
   RETI
; end of file PITIMER12_1INT.asm

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -