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

📄 main4.lis

📁 Application Note Abstract This Application Note introduces a complete and detailed PSoC&reg project
💻 LIS
📖 第 1 页 / 共 4 页
字号:
 0000           ;---------------------------------
 0000           ;  Registers used by PWM16
 0000           ;---------------------------------
 002B           PWM16_2_CONTROL_LSB_REG:    equ 2bh              ;Control register LSB
 002F           PWM16_2_CONTROL_MSB_REG:    equ 2fh              ;Control register MSB
 0028           PWM16_2_COUNTER_LSB_REG:    equ 28h              ;Counter register LSB
 002C           PWM16_2_COUNTER_MSB_REG:    equ 2ch              ;Counter register MSB
 0029           PWM16_2_PERIOD_LSB_REG: equ 29h                  ;Period register LSB
 002D           PWM16_2_PERIOD_MSB_REG: equ 2dh                  ;Period register MSB
 002A           PWM16_2_PWDITH_LSB_REG: equ 2ah                  ;PulseWidth register LSB
 002E           PWM16_2_PWDITH_MSG_REG: equ 2eh                  ;PulseWidth register MSB
 0028           PWM16_2_FUNC_LSB_REG:   equ 28h                  ;Function register LSB
 002C           PWM16_2_FUNC_MSB_REG:   equ 2ch                  ;Function register MSB
 0029           PWM16_2_INPUT_LSB_REG:  equ 29h                  ;Input register LSB
 002D           PWM16_2_INPUT_MSB_REG:  equ 2dh                  ;Input register MSB
 002A           PWM16_2_OUTPUT_LSB_REG: equ 2ah                  ;Output register LSB
 002E           PWM16_2_OUTPUT_MSB_REG: equ 2eh                  ;Output register MSB
 0000           
 0000           ; end of file
 0000           
 0000           E2_WR_ARG_cTemperature:          equ      0        ; chip temperature
 0001           E2_WR_ARG_wByteCount:            equ      1        ; Byte Count to Write
 0003           E2_WR_ARG_pbData:                equ      3        ; Data buffer with data to write
 0005           E2_WR_ARG_wAddr:                 equ      5        ; Address offset in E2PROM to write
 0007           E2_WR_ARG_STACK_FRAME_SIZE:      equ      7        ; SIZE of the argument list in stack frame
 0007           E2_CALLER_RETURN_ADDRESS:        equ      7        ; callers return address - place holder
 0000           
 0000           ;-------------------------------------
 0000           ;  Return Values
 0000           ;-------------------------------------
 0000           NOERROR:                         equ      0        ; Successfull completion
 FFFFFFFF           FAILURE:                         equ     -1        ; Error condition
 FFFFFFFE           STACKOVERFLOW:                   equ     -2        ; Error Stack Overflow
 0000           
 0000           
 0000           
 0000           ;-----------------------------------------------------------------------------
 0000           ;  FUNCTION NAME: E2Read
 0000           ;
 0000           ;  DESCRIPTION:
 0000           ;     Reads the specified E2PROM data at offset=wAddr for wByteCount bytes  and
 0000           ;     places the data read into the RAM buffer pbDataDest.
 0000           ;
 0000           ;     On entry - NOTE two entry points!!!
 0000           ;           A must contain the E2PROM device First block Id
 0000           ;           X must point to calling arguments in the following offset from X:
 0000           ;              wByteCount  0  2-bytes
 0000           ;              pbDataDest  2  2-bytes
 0000           ;              wAddr:      4  2-bytes
 0000           ;
 0000           ;     Prototype in C is:
 0000           ;
 0000           ;        #pragma  fastcall E2Read
 0000           ;        void E2Read( BYTE bFirstBlockId, WORD wAddr, BYTE * pbDataDest, WORD wByteCount );
 0000           ;
 0000           ;           (!!!note that C places arguments Right-to-Left onto the stack!!!)
 0000           ;
 0000           ;     Easiest method to call from assembly is as follows:
 0000           ;           push  X
 0000           ;           mov   X, SP
 0000           ;           push  <wByteCount>
 0000           ;           push  <wByteCount+1>
 0000           ;           push  <0>                  ; MSB of pbDataDest is always 0 
 0000           ;           push  <pbDataDest>
 0000           ;           push  <wAddr>
 0000           ;           push  <wAddr+1>
 0000           ;           mov   A, <FirstBlockId>
 0000           ;           call  E2Read
 0000           ;           add   SP, -E2_RD_ARG_STACK_FRAME_SIZE 
 0000           ;           pop   X
 0000           ;
 0000           ;           where <> refers to any addressing mode or number of instructions to
 0000           ;              place the referenced data on the stack frame.
 0000           ;
 0000           ;           Other method is to create a stack frame using the defined equates and 
 0000           ;           load them into the stack frame using [X+E2_RD_ARG_*] offset addressing mode.
 0000           ;
 0000           ;  ARGUMENTS:
 0000           ;     
 0000           ;     bFirstBlockId  BYTE   - first block ID of E2PROM device
 0000           ;     wAddr:         WORD   - relative OFFSET in defined E2PROM to read data
 0000           ;     pbDataDest:    BYTE * - pointer to the RAM buffer to place read data
 0000           ;     wByteCount:    WORD   - number of bytes to read from E2PROM
 0000           ;
 0000           ;  RETURNS:       NONE.
 0000           ;
 0000           ;  SIDE EFFECTS:  NONE.
 0000           ;
 0000           ;-----------------------------------------------------------------------------
 0000           E2_RD_ARG_wByteCount:         equ      0           ; Byte Count to Read
 0002           E2_RD_ARG_pbDataDest:         equ      2           ; Data buffer to store read data
 0004           E2_RD_ARG_wAddr:              equ      4           ; Address offset in E2PROM to Read
 0006           E2_RD_ARG_STACK_FRAME_SIZE:   equ      6           ; SIZE of argument list in stack frame
 0000           
 0000           ;--------------------
 0000           ;  End of File
 0000           ;--------------------
 0000           
 0000           ;----------------------------------------
 0000           ;  E2PROM_1 instance parameters
 0000           ;----------------------------------------
 0040           E2PROM_1_START_BLOCK:            equ      40h                        ; Absolute address of E2PROM device    
 1000           E2PROM_1_START_ADDR:             equ      40h * 64                   ; Size of E2PROM device
 0000                        
 0000           ;-------------------------------------
 0000           ;  Return Values
 0000           ;-------------------------------------
 0000           NOERROR:                         equ      0                          ; Successfull completion
 FFFFFFFF           FAILURE:                         equ     -1                          ; Error condition
 FFFFFFFE           STACKOVERFLOW:                   equ     -2                          ; Error Stack Overflow
 0000           
 0000           
 0000           ; end of E2PROM_1.inc
 0080           bTX8_1_INT_MASK:        equ 80h  
 0000           ;TX8 interrupt address
 00E1           TX8_1_INT_REG:          equ 0e1h  
 0000           
 0000           ;------------------------------------
 0000           ;  Transmitter Parity masks
 0000           ;------------------------------------
 0000           TX8_PARITY_NONE:           equ   00h
 0002           TX8_PARITY_EVEN:           equ   02h
 0006           TX8_PARITY_ODD:            equ   06h
 0000           
 0000           ;------------------------------------
 0000           ;  Transmitter Status Register masks
 0000           ;------------------------------------
 0020           TX8_TX_COMPLETE:           equ   20h
 0010           TX8_TX_BUFFER_EMPTY:       equ   10h
 0000           
 0000           ;---------------------------------
 0000           ;  Registers used by TX8
 0000           ;---------------------------------
 003F           TX8_1_CONTROL_REG:  equ 3fh                      ;Control register
 003C           TX8_1_TX_SHIFT_REG: equ 3ch                      ;TX Shift Register register
 003D           TX8_1_TX_BUFFER_REG:    equ 3dh                  ;TX Buffer Register
 003C           TX8_1_FUNC_REG: equ 3ch                          ;Function register
 003D           TX8_1_INPUT_REG:    equ 3dh                      ;Input register
 003E           TX8_1_OUTPUT_REG:   equ 3eh                      ;Output register
 0000           
 0000           ; end of file
 0040           bRX8_1_INT_MASK:        equ 40h  
 0000           ;RX8 interrupt address
 00E1           RX8_1_INT_REG:          equ 0e1h  
 0000           
 0000           ;------------------------------------
 0000           ;  RX8 Parity masks
 0000           ;------------------------------------
 0000           RX8_PARITY_NONE:           equ   0h
 0002           RX8_PARITY_EVEN:           equ   2h
 0006           RX8_PARITY_ODD:            equ   6h
 0000           
 0000           ;------------------------------------
 0000           ;  RX8 Status Register masks
 0000           ;------------------------------------
 0000           
 0010           RX8_RX_ACTIVE:             equ   10h
 0008           RX8_RX_COMPLETE:           equ   08h
 0080           RX8_RX_PARITY_ERROR:       equ   80h
 0040           RX8_RX_OVERRUN_ERROR:      equ   40h
 0020           RX8_RX_FRAMING_ERROR:      equ   20h
 00E0           RX8_RX_NO_ERROR:           equ   E0h
 0000           
 0000           ;---------------------------------
 0000           ;  Registers used by RX8
 0000           ;---------------------------------
 003B           RX8_1_CONTROL_REG:  equ 3bh                      ;Control register
 0038           RX8_1_RX_SHIFT_REG: equ 38h                      ;RX Shift Register register
 003A           RX8_1_RX_BUFFER_REG:    equ 3ah                  ;RX Buffer Register
 0038           RX8_1_FUNC_REG: equ 38h                          ;Function register
 0039           RX8_1_INPUT_REG:    equ 39h                      ;Input register
 003A           RX8_1_OUTPUT_REG:   equ 3ah                      ;Output register
 0000           
 0000           ; end of file
 0000           
 0000           
                area bss (RAM)
                
                export month
                export day
                export hour
                export minute
                export tel_status
                export indexreg
                export odd_even
                export temp
                export te_second
                export te_minute
                export ram_lsb
                export address_lsb
                export address_msb
                export temp2
                export counter1
                export counter2
                export dateandtime
                export msb_dateandtime
                export temp3
                export delay
                
                
                
                
 0000           buffer:         BLK 50h
 0050           temp:           BLK 1
 0051           month:          BLK 1
 0052           day:            BLK 1
 0053           hour:           BLK 1
 0054           minute:         BLK 1
 0055           tel_status: BLK 1
 0056           tel_status2: BLK 1
 0057           indexreg:       BLK     1
 0058           odd_even:       BLK 1
 0059           te_minute:      BLK 1
 005A           te_second:      BLK 1
 005B           ram_lsb:        BLK 1
 005C           address_lsb:    BLK 1
 005D           address_msb:    BLK 1
 005E           temp_msb:       BLK 1
 005F           temp_lsb:       BLK 1
 0060           temp2:                  BLK 1
 0061           counter1:               BLK 1
 0062           counter2:               BLK 1
 0063           //bRxData:  blk 1               ; Rx data storage area
 0001           TRUE:     equ 1
 0000           FALSE:    equ 0
 0063           temp3:                          BLK 1
 0064           msb_dateandtime:        BLK 1
 0065           dateandtime:    BLK 8
 006D           tempbyte:                       BLK 8
 0075           
 0075           
                area text (ROM, REL)
                export _main
                
 0000           _main:
 0000           
 0000 555500    mov [tel_status],00h //Telephone is not in-use=00,(Telephone in use=FF)
 0003 555700    mov [indexreg],00h       //This will hold the index register value
 0006 555800    mov [odd_even],00h   //This is about writing to dialed number in one memory location
 0009 555B00    mov [ram_lsb],00h        //Temporary call details are in range of 00h-64h memory location
 000C 555D0F    mov [address_msb],0Fh //First 64 byte block will be written to 0FC0+40h = 1000h address
 000F 555CC0    mov [address_lsb],C0h
 0012 620800    mov reg[PRT2DR],00h //port2_4 will be 0V (Showing that there is enouh space in ROM)
 0015           
 0015           
 0015           
 0015 555101    mov [month],1           //Reset DATE
 0018 555201    mov [day],1             
 001B 555300    mov [hour],0
 001E 555400    mov [minute],0
 0021           
 0021           
 0021           startmodules:
 0021           //Check if any key on the phone is pressed?
 0021           //If a button is pressed , then Port1_0 will detect this thru the DTMF
 0021           //receiver chip(from StD Pin of MT8870D)
 0021           
 0021 7101          or    F, FlagGlobalIE
 0023 43E020    or reg[INT_MSK0], 20h           ;This will be enable the GPIO 
 0026           
 0026 9000      call PWM8_1_EnableInt
 0028 9000      call  PWM8_1_Start
 002A 9000      call  PWM16_1_Start
 002C 9000      call  PWM16_2_Start
 002E 9000      call  TX8_1_Start
 0030 9000      call  RX8_1_Start
 0032           
 0032 9179      call clearRAM
 0034           
 0034           
 0034           
 0034           receivedata:

⌨️ 快捷键说明

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