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

📄 rtxconf.a51

📁 RTX51 CAN Program for the Infineon C505C, This program demonstrates how to transmit and receive CAN
💻 A51
📖 第 1 页 / 共 5 页
字号:
      INT_EN_MASK_NUMBER   EQU 2
      ?RTX_IE              DATA  0A8H
      ?RTX_IEN1            DATA  0A7H
      ?RTX_IEN2            DATA  0A8H  ; not used

      ;------------------------------------------------------------------
      ; Generate the interrupt entry points supported by the peripherals
      ; of the selected CPU type.
      IF (?RTX_SYSTEM_TIMER = 0)
         ; Do NOT include the Timer 0 Vector  (INT-1)
         INT_ENTRY      0
         INT_ENTRY      2
         INT_ENTRY      3
         INT_ENTRY      4
         INT_ENTRY      5
         INT_ENTRY      6
         INT_ENTRY      7
         INT_ENTRY      8
         INT_ENTRY      9
         INT_ENTRY     10
         INT_ENTRY     11
         INT_ENTRY     12
         INT_ENTRY     13
         INT_ENTRY     14
      ELSEIF (?RTX_SYSTEM_TIMER = 1)
         ; Do NOT include the Timer 1 Vector (INT-3)
         INT_ENTRY      0
         INT_ENTRY      1
         INT_ENTRY      2
         INT_ENTRY      4
         INT_ENTRY      5
         INT_ENTRY      6
         INT_ENTRY      7
         INT_ENTRY      8
         INT_ENTRY      9
         INT_ENTRY     10
         INT_ENTRY     11
         INT_ENTRY     12
         INT_ENTRY     13
         INT_ENTRY     14
      ELSEIF (?RTX_SYSTEM_TIMER = 2)
         ; Do NOT include the Timer 2 Vector (INT-5)
         INT_ENTRY      0
         INT_ENTRY      1
         INT_ENTRY      2
         INT_ENTRY      3
         INT_ENTRY      4
         INT_ENTRY      6
         INT_ENTRY      7
         INT_ENTRY      8
         INT_ENTRY      9
         INT_ENTRY     10
         INT_ENTRY     11
         INT_ENTRY     12
         INT_ENTRY     13
         INT_ENTRY     14
      ENDIF

      ;------------------------------------------------------------------
      ; The following table attaches the interrupt numbers (0..31) to the
      ; corresponding bits in the interrupt enable masks of the specific
      ; processor.
      ; All three interrupt enable register contents must be defined
      ; for every interrupt number (even when the specific processor contains
      ; only one interrupt mask).
      ; Syntax: DB IE-content, IE1-content, IE2-content
      ;
      ?RTX?RTX_INT_TO_BIT_TABLE?RTXCONF  SEGMENT  CODE
                        RSEG  ?RTX?RTX_INT_TO_BIT_TABLE?RTXCONF

         ?RTX_INT_TO_BIT_TABLE_BASE:
                        DB 01H, 00H, 00H    ; INT_0   (INT0)
                        DB 02H, 00H, 00H    ; INT_1   (Timer 0)
                        DB 04H, 00H, 00H    ; INT_2   (INT1)
                        DB 08H, 00H, 00H    ; INT_3   (Timer 1)
                        DB 10H, 00H, 00H    ; INT_4   (Ser. channel)
                        DB 20H, 00H, 00H    ; INT_5   (Timer 2)
                        DB 40H, 00H, 00H    ; INT_6   (PCA)
                        DB 00H, 80H, 00H    ; INT_7   (A/D-Converter)
                        DB 00H, 02H, 00H    ; INT_8   (PCA1)
                        DB 00H, 01H, 00H    ; INT_9   (Serial expansion)
                        DB 00H, 04H, 00H    ; INT_10  (INT2)
                        DB 00H, 08H, 00H    ; INT_11  (INT3)
                        DB 00H, 10H, 00H    ; INT_12  (INT4)
                        DB 00H, 20H, 00H    ; INT_13  (INT5)
                        DB 00H, 40H, 00H    ; INT_14  (INT6)

      ;------------------------------------------------------------------
      ; Define the greatest supported interrupt number
      ?RTX_MAX_INT_NBR      EQU   14

PCON    DATA    87H

ENTER_IDLE       MACRO
;;
;;      Enter Idle Mode
;;      ---------------
;;      Not supported by all 8051 type processors (see manufacturer's
;;      data sheet !)
;;      To be used whenever entering idle state.
;;
            ORL     PCON, #01H          ; Set idle mode (leave by interrupt)
                                        ; (peripherals stay active)
         ENDM

ELSEIF (?RTX_CPU_TYPE = 14)
   ;***********
   ;* Type 14 *
   ;***********
      ;------------------------------------------------------------------
      ; Define the number and addresses of the interrupt enable registers
      ; 80F51FC -> 2 interrupt enable registers
      ; (Set the not used registers to the same address as ?RTX_IE)

      INT_EN_MASK_NUMBER   EQU 2
      ?RTX_IE              DATA  0A8H
      ?RTX_IEN1            DATA  0A7H
      ?RTX_IEN2            DATA  0A8H  ; not used

      ;------------------------------------------------------------------
      ; Generate the interrupt entry points supported by the peripherals
      ; of the selected CPU type.
      IF (?RTX_SYSTEM_TIMER = 0)
         ; Do NOT include the Timer 0 Vector  (INT-1)
         INT_ENTRY      0
         INT_ENTRY      2
         INT_ENTRY      3
         INT_ENTRY      4
         INT_ENTRY      5
         INT_ENTRY      6
         INT_ENTRY     14
      ELSEIF (?RTX_SYSTEM_TIMER = 1)
         ; Do NOT include the Timer 1 Vector  (INT-3)
         INT_ENTRY      0
         INT_ENTRY      1
         INT_ENTRY      2
         INT_ENTRY      4
         INT_ENTRY      5
         INT_ENTRY      6
         INT_ENTRY     14
      ELSEIF (?RTX_SYSTEM_TIMER = 2)
         ; Do NOT include the Timer 2 Vector (INT-5)
         INT_ENTRY      0
         INT_ENTRY      1
         INT_ENTRY      2
         INT_ENTRY      3
         INT_ENTRY      4
         INT_ENTRY      6
         INT_ENTRY     14
      ENDIF

      ;------------------------------------------------------------------
      ; The following table attaches the interrupt numbers (0..31) to the
      ; corresponding bits in the interrupt enable masks of the specific
      ; processor.
      ; All three interrupt enable register contents must be defined
      ; for every interrupt number (even when the specific processor contains
      ; only one interrupt mask).
      ; Syntax: DB IE-content, IE1-content, IE2-content
      ;
      ?RTX?RTX_INT_TO_BIT_TABLE?RTXCONF  SEGMENT  CODE
                        RSEG  ?RTX?RTX_INT_TO_BIT_TABLE?RTXCONF

         ?RTX_INT_TO_BIT_TABLE_BASE:
                        DB 01H, 00H, 00H    ; INT_0  (INT0)
                        DB 02H, 00H, 00H    ; INT_1  (Timer 0)
                        DB 04H, 00H, 00H    ; INT_2  (INT1)
                        DB 08H, 00H, 00H    ; INT_3  (Timer 1)
                        DB 10H, 00H, 00H    ; INT_4  (Ser. channel)
                        DB 20H, 00H, 00H    ; INT_5  (Timer 2)
                        DB 40H, 00H, 00H    ; INT_6  (PCA)
                        DB 00H, 00H, 00H    ; INT_7  not used
                        DB 00H, 00H, 00H    ; INT_8  not used
                        DB 00H, 00H, 00H    ; INT_9  not used
                        DB 00H, 00H, 00H    ; INT_10 not used
                        DB 00H, 00H, 00H    ; INT_11 not used
                        DB 00H, 00H, 00H    ; INT_12 not used
                        DB 00H, 00H, 00H    ; INT_13 not used
                        DB 00H, 40H, 00H    ; INT_14 (Flash Memory)

      ;------------------------------------------------------------------
      ; Define the greatest supported interrupt number
      ?RTX_MAX_INT_NBR      EQU   14

PCON    DATA    87H

ENTER_IDLE       MACRO
;;
;;      Enter Idle Mode
;;      ---------------
;;      Not supported by all 8051 type processors (see manufacturer's
;;      data sheet !)
;;      To be used whenever entering idle state.
;;
            ORL     PCON, #01H          ; Set idle mode (leave by interrupt)
                                        ; (peripherals stay active)
         ENDM

ELSEIF (?RTX_CPU_TYPE = 15)
   ;***********
   ;* Type 15 *
   ;***********
      ;------------------------------------------------------------------
      ; Define the number and addresses of the interrupt enable registers
      ; 80512 -> 1 interrupt enable register
      ; (Set the not used registers to the same address as ?RTX_IE)

      INT_EN_MASK_NUMBER   EQU 1
      ?RTX_IE              DATA  0A8H
      ?RTX_IEN1            DATA  0A8H  ; not used
      ?RTX_IEN2            DATA  0A8H  ; not used

      ;------------------------------------------------------------------
      ; Generate the interrupt entry points supported by the peripherals
      ; of the selected CPU type.
      IF (?RTX_SYSTEM_TIMER = 0)
         ; Do NOT include the Timer 0 Vector  (INT-1)
         INT_ENTRY      0
         INT_ENTRY      2
         INT_ENTRY      3
         INT_ENTRY      4
         INT_ENTRY      5
      ELSEIF (?RTX_SYSTEM_TIMER = 1)
         ; Do NOT include the Timer 1 Vector  (INT-3)
         INT_ENTRY      0
         INT_ENTRY      1
         INT_ENTRY      2
         INT_ENTRY      4
         INT_ENTRY      5
      ENDIF

      ;------------------------------------------------------------------
      ; The following table attaches the interrupt numbers (0..31) to the
      ; corresponding bits in the interrupt enable masks of the specific
      ; processor.
      ; All three interrupt enable register contents must be defined
      ; for every interrupt number (even when the specific processor contains
      ; only one interrupt mask).
      ; Syntax: DB IE-content, IE1-content, IE2-content
      ;
      ?RTX?RTX_INT_TO_BIT_TABLE?RTXCONF  SEGMENT  CODE
                        RSEG  ?RTX?RTX_INT_TO_BIT_TABLE?RTXCONF

         ?RTX_INT_TO_BIT_TABLE_BASE:
                        DB 01H, 00H, 00H    ; INT_0  (P3.2/INT0)
                        DB 02H, 00H, 00H    ; INT_1  (Timer 0)
                        DB 04H, 00H, 00H    ; INT_2  (P3.3/INT1)
                        DB 08H, 00H, 00H    ; INT_3  (Timer 1)
                        DB 10H, 00H, 00H    ; INT_4  (Ser. channel)
                        DB 40H, 00H, 00H    ; INT_5  (A/D-Converter)

      ;------------------------------------------------------------------
      ; Define the greatest supported interrupt number
      ?RTX_MAX_INT_NBR      EQU   5

ENTER_IDLE       MACRO
;;
;;      Enter Idle Mode
;;      ---------------
;;      Not supported by all 8051 type processors (see manufacturer's
;;      data sheet !)
;;      To be used whenever entering idle state.
;;
            NOP                 ; Not supported
         ENDM

ELSEIF (?RTX_CPU_TYPE = 16)
   ;***********
   ;* Type 16 *
   ;***********
      ;------------------------------------------------------------------
      ; Define the number and addresses of the interrupt enable registers
      ; 80C320/520 -> 2 interrupt enable register
      ; (Set the not used registers to the same address as ?RTX_IE)

      INT_EN_MASK_NUMBER   EQU 2
      ?RTX_IE              DATA  0A8H
      ?RTX_IEN1            DATA  0E8H
      ?RTX_IEN2            DATA  0A8H  ; not used

      ;------------------------------------------------------------------
      ; Generate the interrupt entry points supported by the peripherals
      ; of the selected CPU type.
      IF (?RTX_SYSTEM_TIMER = 0)
         ; Do NOT include the Timer 0 Vector  (INT-1)
         INT_ENTRY      0
         INT_ENTRY      2
         INT_ENTRY      3
         INT_ENTRY      4
         INT_ENTRY      5
         INT_ENTRY      7
         INT_ENTRY      8
         INT_ENTRY      9
         INT_ENTRY     10
         INT_ENTRY     11
         INT_ENTRY     12
      ELSEIF (?RTX_SYSTEM_TIMER = 1)
         ; Do NOT include the Timer 1 Vector  (INT-3)
         INT_ENTRY      0
         INT_ENTRY      1
         INT_ENTRY      2
         INT_ENTRY      4
         INT_ENTRY      5
         INT_ENTRY      7
         INT_ENTRY      8
         INT_ENTRY      9
         INT_ENTRY     10
         INT_ENTRY     11
         INT_ENTRY     12
      ELSEIF (?RTX_SYSTEM_TIMER = 2)
         ; Do NOT include the Timer 2 Vector (INT-5)
         INT_ENTRY      0
         INT_ENTRY      1
         INT_ENTRY      2
         INT_ENTRY      3
         INT_ENTRY      4
         INT_ENTRY      7
         INT_ENTRY      8
         INT_ENTRY      9
         INT_ENTRY     10
         INT_ENTRY     11
         INT_ENTRY     12
      ENDIF

      ;------------------------------------------------------------------
      ; The following table attaches the interrupt numbers (0..31) t

⌨️ 快捷键说明

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