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

📄 adc10_1int.asm

📁 CYPRESS的PSOC的AD转换编程
💻 ASM
字号:
;;*****************************************************************************
;;*****************************************************************************
;;  ADC10_1INT.asm
;;  Version: 1.1, Updated on 2007/03/15 at 12:42:35
;;  Generated by PSoC Designer ver 4.4  b1884 : 14 Jan, 2007
;;
;;  DESCRIPTION: ADC10_1 User Module ISR implementation file for the
;;               21xxx PSoC family of devices.
;;*****************************************************************************
;;*****************************************************************************

include "m8c.inc"
include "memory.inc"
include "ADC10_1.inc"

export _ADC10_1_ADC_ISR
export _ADC10_1_CNT_ISR

export  ADC10_1_bTempMSB
export _ADC10_1_iResult
export  ADC10_1_iResult
export _ADC10_1_bfStatus
export  ADC10_1_bfStatus

AREA InterruptRAM (RAM, REL)
   ADC10_1_bTempMSB:      BLK   1
  _ADC10_1_iResult:
   ADC10_1_iResult:       BLK   2  ;A/D value
  _ADC10_1_bfStatus:
   ADC10_1_bfStatus:      BLK   1  ;Data Valid Flag
AREA UserModules (ROM, REL)

_ADC10_1_ADC_ISR:
; ISR ,including jmptable takes 156 cpu cycles.)
   tst  reg[ADC10_1_CNTClrIntReg],ADC10_1_CNTMask
   jz NoPendingInterrupt;  Make sure counter has been serviced
   inc  [ADC10_1_bTempMSB]
   and  reg[ADC10_1_CNTClrIntReg],~(ADC10_1_CNTMask)
NoPendingInterrupt:
   push A
   tst  reg[ADC10_1_ADC_CR],80h
   jz   .InRange

; Read Counter
.OverRange:
   mov  [ADC10_1_iResult],ffh
   mov  [ADC10_1_iResult + 1],ffh
   jmp  .Done

.InRange:
   mov  [ADC10_1_iResult],[ADC10_1_bTempMSB]
   mov  A,reg[ADC10_1_CNT_DR0]
   mov  A,reg[ADC10_1_CNT_DR2]   ;A contains next prev value
   cpl  A
   mov  [ADC10_1_iResult+1],A
.Done:
   and  reg[ADC10_1_CNT_CR0], ~ADC10_1_ON 
   mov  reg[ADC10_1_CNT_DR1], 0xFF
   or   reg[ADC10_1_CNT_CR0], ADC10_1_ON

   mov  [ADC10_1_bfStatus],01h
   mov  [ADC10_1_bTempMSB], 00h

   ;@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.

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

   pop A
   reti

_ADC10_1_CNT_ISR:
   inc [ADC10_1_bTempMSB]

   ;@PSoC_UserCode_BODY_2@ (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.

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

⌨️ 快捷键说明

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