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

📄 lcd.lst

📁 ST7 Software LCD driver
💻 LST
📖 第 1 页 / 共 3 页
字号:
METAi Assembler  6.02  (C)1987-91 Crash Barrier  Tue Jan 20 19:34:04 2004
Page 1  "VARIABLE.INC"           
                                               D:\usr\jatin\AN\Code\LCD_SW\LCD_SW\LCD_4COM\lcd.asm

   1                             st7/      
   2                             
   3                             ;*************************************************************
                                 ;*********** 
   4                             ; TITLE:                LCD.ASM
   5                             ; AUTHOR:               Microcontroller Application Team
   6                             ; DESCRIPTION:          Software driver for a 4 backplane LCD 
                                 ;display.
   7                             ;                       Use only one timer to generate the 
                                 ;appropriate lcd timing
   8                             ; Version:		Ver 1.0                   
   9                             ;*************************************************************
                                 ;***********
  10                             
  11                             
  12  0000                                 TITLE    "LCD.ASM"           
  13                                       
  14  0000                                 MOTOROLA 
<END_OF_INCLUSION>
<END_OF_INCLUSION>
  19  0000                                 
  20                             ;*************************************************************
                                 ;***********
  21                                       
  22                                       
  23                             ;*************************************************************
                                 ;**********
  24                             ;       Variables, constants defined and referenced locally
  25                             ;       You can define your own values for a local reference 
                                 ;here
  26                             ;*************************************************************
                                 ;**********
  27                             
  28                             ;*************************************************************
                                 ;***********
  29                             ;       Public routines   (defined here)
  30                             ;*************************************************************
                                 ;***********
  31                             ; routines
  32                                       
  33                             ; We could have used a dot in front of the label's name to 
                                 ;declare the routine 
  34                             ; as visible by others modules in the project.
  35                             
  36                                       
  37                             ;*************************************************************
                                 ;***********
  38                             ;       Extern routines   (defined elsewhere)
  39                             ;
  40                             ;       The EXTERN directive will be seen by the linker as a 
                                 ;call
  41                             ;       instruction to another routine written in another 
                                 ;file
  42                             ;*************************************************************
                                 ;***********
  43                             ; routines
  44                             
  45                             ;**********************************************************
  46                             ;       Program code
METAi Assembler  6.02  (C)1987-91 Crash Barrier  Tue Jan 20 19:34:04 2004
Page 2  "VARIABLE.INC"           
                                               D:\usr\jatin\AN\Code\LCD_SW\LCD_SW\LCD_4COM\lcd.asm

  47                             ;**********************************************************
  48                             
  49  0000                                 WORDS                  ; define subsequent addresses as
                                                                  ; words
  50                                                              ; meaning that all instructions 
                                                                  ;are located 
  51                                                              ; in the address field after 
                                                                  ;0FFh in the ST72251
  52                                                              ; memory mapping
  53                             
  54                                       segment  'rom'
  55  E0AD   01                  .COM1     BYTE     $01
  56  E0AE   02                  .COM2     BYTE     $02
  57  E0AF   04                  .COM3     BYTE     $04
  58  E0B0   08                  .COM4     BYTE     $08
  59                             
  60  E0B1   FE                  .CPL0COM1  BYTE     $FE
  61  E0B2   FD                  .CPL0COM2  BYTE     $FD
  62  E0B3   FB                  .CPL0COM3  BYTE     $FB
  63  E0B4   F7                  .CPL0COM4  BYTE     $F7
  64                             
  65                             ;*************************************************************
                                 ;****
  66                             ; TimerA driver - TimerA used for LCD timing generation: 
  67                             ; - PC[0..3] dedicated to COM[1..4] respectively. They provide
                                 ; 3 levels thanks to 2 external pull up 
  68                             ;   and pull down resistors for each pin, and the open drain 
                                 ;output feature: 0, Vdd/2, and Vdd
  69                             ; - For segment signals which are normal numerical signal (0 
                                 ;or 1) PA[0..5], PB[0..7], PD[0..7],PF[0..7],PE[6..7]are used
  70                             ;	 as output push-pull mode 
  71                             ; - The lcd timing is divided in 4 parts & each part has 
                                 ;oc1_1, oc2, oc1_2, oc2 events
  72                             ; - 4 interrupts are generated per control period(4msec)& 16 
                                 ;per frame period(16msec)
  73                             ;*************************************************************
                                 ;****
  74                             
  75                             .tima_rt                         ; timer status register is read 
                                                                  ;before entering into ISR
  76  E0B5   0C3356                        BTJT     TASR,#6,oc1    ; Check if Output Compare1 
                                                                  ;interrupt
  77  E0B8   063302                        BTJT     TASR,#3,oc2    ; Check if Output Compare2 
                                                                  ;interrupt
  78  E0BB   2050                          JRT      out            
  79  E0BD   B63F                oc2       LD       A,TAOC2LR      ; access OC2LR to clear the OCF2
                                                                  ; flag
  80  E0BF   3F39                          CLR      TACLR         ; reset timer counter by any 
                                                                  ;write to the LSB
  81  E0C1   A600                          LD       A,#$00        ; Deactivate all COM & SEG lines
                                                                  ; 
  82  E0C3   B703                          LD       PBDR,A
  83  E0C5   B709                          LD       PDDR,A
  84  E0C7   B70F                          LD       PFDR,A
  85  E0C9   B60C                          LD       A,PEDR      
  86  E0CB   A43F                          AND      A,#$3f        ; Deactivate PE6-PE7
  87  E0CD   B70C                          LD       PEDR,A 
METAi Assembler  6.02  (C)1987-91 Crash Barrier  Tue Jan 20 19:34:04 2004
Page 3  "VARIABLE.INC"           
                                               D:\usr\jatin\AN\Code\LCD_SW\LCD_SW\LCD_4COM\lcd.asm

  88  E0CF   B600                          LD       A,PADR        ; Deactivate PA0-PA5
  89  E0D1   A4C0                          AND      A,#$c0
  90  E0D3   B700                          LD       PADR,A
  91                                       
  92  E0D5   B608                          LD       A,PCOR
  93  E0D7   AA0F                          OR       A,#$0f 
  94  E0D9   B708                          LD       PCOR,A
  95                                       
  96  E0DB   B606                          LD       A,PCDR
  97  E0DD   A4F0                          AND      A,#$F0      
  98  E0DF   B706                          LD       PCDR,A
  99  E0E1   202A                          JRT      out
 100                                       
 101                             oc1_1     
 102  E0E3   3C98                          inc      var
 103  E0E5   BE83                          LD       X,lcdcr       ; lcdcr saves the index no(0-3) 
                                                                  ;for each control period 
 104  E0E7   B600                          LD       A,PADR
 105  E0E9   A4C0                          AND      A,#$c0
 106  E0EB   EA84                          OR       A,(segA1,X)   ; segments which are to be 
                                                                  ;turned ON, are loaded with 
                                                                  ;value 1, otherwise 0  
 107  E0ED   B700                          LD       PADR,A       
 108  E0EF   E688                          LD       A,(segB1,X)   ; segments which are to be 
                                                                  ;turned ON, are loaded with 
                                                                  ;value 1, otherwise 0  
 109  E0F1   B703                          LD       PBDR,A        
 110  E0F3   E68C                          LD       A,(segD1,X)   ; segments which are to be 
                                                                  ;turned ON, are loaded with 
                                                                  ;value 1, otherwise 0  

⌨️ 快捷键说明

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