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

📄 lm032l.lst

📁 this program uses pic microcontroller for display temperature on a lcd monitor.
💻 LST
📖 第 1 页 / 共 4 页
字号:


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

0082 0008           00373             RETURN
                    00374 ;
                    00375         endif
                    00376     else
                    00377 ;
                    00378 ;**************************************************************
                    00379 ;* SEND_CND - Sends command contained in register W to LCD    *
                    00380 ;* This routine sends the entire character to the PORT        *
                    00381 ;* The data is transmitted on the PORT<7:0> pins              *
                    00382 ;**************************************************************
                    00383 
                    00384 SEND_CMD
                    00385             MOVWF   CHAR            ; Command to be sent is in W
                    00386             CALL    BUSY_CHECK      ; Wait for LCD to be ready
                    00387             MOVF    CHAR, w          
                    00388             MOVWF   LCD_DATA        ; Send data to LCD
                    00389             BCF     LCD_CNTL, RW   ; Set LCD in read mode
                    00390             BCF     LCD_CNTL, RS    ; Set LCD in command mode
                    00391             BSF     LCD_CNTL, E     ; toggle E for LCD
                    00392             BCF     LCD_CNTL, E
                    00393             RETURN
                    00394 ;
                    00395     endif
                    00396 ;
MPASM 01.40 Released           LM032L.ASM   1-22-1997  10:25:15         PAGE 11


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

                    00397     page
                    00398 ;
                    00399     if ( Four_bit )      ; 4-bit Data transfers?
                    00400 ;
                    00401         if ( Data_HI )   ; 4-bit transfers on the high nibble of the PORT
                    00402 ;
                    00403 ;*******************************************************************
                    00404 ;* This routine checks the busy flag, returns when not busy        *
                    00405 ;*  Affects:                                                       *
                    00406 ;*      TEMP - Returned with busy/address                          *
                    00407 ;*******************************************************************
                    00408 ;
                    00409 BUSY_CHECK
                    00410             BSF     STATUS, RP0     ; Select Register page 1
                    00411             MOVLW   0xFF            ; Set Port_D for input
                    00412             MOVWF   LCD_DATA_TRIS
                    00413             BCF     STATUS, RP0     ; Select Register page 0
                    00414             BCF     LCD_CNTL, RS    ; Set LCD for Command mode
                    00415             BSF     LCD_CNTL, RW   ; Setup to read busy flag
                    00416             BSF     LCD_CNTL, E     ; Set E high
                    00417             BCF     LCD_CNTL, E     ; Set E low
                    00418             MOVF    LCD_DATA, W     ; Read upper nibble busy flag, DDRam address
                    00419             ANDLW   0xF0            ; Mask out lower nibble
                    00420             MOVWF   TEMP
                    00421             BSF     LCD_CNTL, E     ; Toggle E to get lower nibble
                    00422             BCF     LCD_CNTL, E
                    00423             SWAPF   LCD_DATA, w     ; Read lower nibble busy flag, DDRam address
                    00424             ANDLW   0x0F            ; Mask out upper nibble
                    00425             IORWF   TEMP            ; Combine nibbles
                    00426             BTFSC   TEMP, 7         ; Check busy flag, high = busy
                    00427             GOTO    BUSY_CHECK      ; If busy, check again
                    00428             BCF     LCD_CNTL, RW        
                    00429             BSF     STATUS, RP0     ; Select Register page 1
                    00430             MOVLW   0x0F
                    00431             MOVWF   LCD_DATA_TRIS   ; Set Port_D for output
                    00432             BCF     STATUS, RP0     ; Select Register page 0
                    00433             RETURN
                    00434 ;
                    00435         else             ; 4-bit transfers on the low nibble of the PORT
                    00436 ;
                    00437 ;*******************************************************************
                    00438 ;* This routine checks the busy flag, returns when not busy        *
                    00439 ;*  Affects:                                                       *
                    00440 ;*      TEMP - Returned with busy/address                          *
                    00441 ;*******************************************************************
                    00442 ;
0083                00443 BUSY_CHECK
0083 1683           00444             BSF     STATUS, RP0     ; Bank 1
0084 30FF           00445             MOVLW   0xFF            ; Set PortB for input
0085 0086           00446             MOVWF   LCD_DATA_TRIS
0086 1283           00447             BCF     STATUS, RP0     ; Bank 0
0087 1105           00448             BCF     LCD_CNTL, RS    ; Set LCD for Command mode
0088 1485           00449             BSF     LCD_CNTL, RW   ; Setup to read busy flag
MPASM 01.40 Released           LM032L.ASM   1-22-1997  10:25:15         PAGE 12


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

0089 1405           00450             BSF     LCD_CNTL, E     ; Set E high
008A 1005           00451             BCF     LCD_CNTL, E     ; Set E low
008B 0E06           00452             SWAPF   LCD_DATA, W     ; Read upper nibble busy flag, DDRam address
008C 39F0           00453             ANDLW   0xF0            ; Mask out lower nibble
008D 00B5           00454             MOVWF   TEMP            ;
008E 1405           00455             BSF     LCD_CNTL, E     ; Toggle E to get lower nibble
008F 1005           00456             BCF     LCD_CNTL, E
0090 0806           00457             MOVF    LCD_DATA, W     ; Read lower nibble busy flag, DDRam address
0091 390F           00458             ANDLW   0x0F            ; Mask out upper nibble
0092 04B5           00459             IORWF   TEMP, F         ; Combine nibbles
0093 1BB5           00460             BTFSC   TEMP, 7         ; Check busy flag, high = busy
0094 2883           00461             GOTO    BUSY_CHECK      ; If busy, check again
0095 1085           00462             BCF     LCD_CNTL, RW
0096 1683           00463             BSF     STATUS, RP0     ; Bank 1
0097 30F0           00464             MOVLW   0xF0            ;
0098 0086           00465             MOVWF   LCD_DATA_TRIS   ; RB7 - 4 = inputs, RB3 - 0 = output
0099 1283           00466             BCF     STATUS, RP0     ; Bank 0
009A 0008           00467             RETURN
                    00468 ;
                    00469         endif
                    00470     else
                    00471 ;
                    00472 ;**************************************************************
                    00473 ;* This routine checks the busy flag, returns when not busy   *
                    00474 ;*  Affects:                                                  *
                    00475 ;*      TEMP - Returned with busy/address                     *
                    00476 ;**************************************************************
                    00477 ;
                    00478 BUSY_CHECK
                    00479             BSF     STATUS,RP0      ; Select Register page 1
                    00480             MOVLW   0xFF            ; Set port_D for input
                    00481             MOVWF   LCD_DATA_TRIS
                    00482             BCF     STATUS, RP0     ; Select Register page 0
                    00483             BCF     LCD_CNTL, RS    ; Set LCD for command mode
                    00484             BSF     LCD_CNTL, RW   ; Setup to read busy flag
                    00485             BSF     LCD_CNTL, E     ; Set E high
                    00486             BCF     LCD_CNTL, E     ; Set E low
                    00487             MOVF    LCD_DATA, w     ; Read busy flag, DDram address
                    00488             MOVWF   TEMP    
                    00489             BTFSC   TEMP, 7         ; Check busy flag, high=busy
                    00490             GOTO    BUSY_CHECK 
                    00491             BCF     LCD_CNTL, RW        
                    00492             BSF     STATUS, RP0     ; Select Register page 1
                    00493             MOVLW   0x00
                    00494             MOVWF   LCD_DATA_TRIS   ; Set port_D for output
                    00495             BCF     STATUS, RP0     ; Select Register page 0
                    00496             RETURN
                    00497 ;
                    00498     endif
MPASM 01.40 Released           LM032L.ASM   1-22-1997  10:25:15         PAGE 13


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

                    00499     page
                    00500 ;
009B                00501 Table
009B 0782           00502             addwf   PCL, F          ;Jump to char pointed to in W reg
009C 344D           00503             retlw   'M'
009D 3469           00504             retlw   'i'
009E 3463           00505             retlw   'c'
009F 3472           00506             retlw   'r'
00A0 346F           00507             retlw   'o'
00A1 3463           00508             retlw   'c'
00A2 3468           00509             retlw   'h'
00A3 3469           00510             retlw   'i'
00A4 3470           00511             retlw   'p'
00A5 3420           00512             retlw   ' '
00A6 3454           00513             retlw   'T'
00A7 3465           00514             retlw   'e'
00A8 3463           00515             retlw   'c'
00A9 3468           00516             retlw   'h'
00AA 346E           00517             retlw   'n'
00AB 346F           00518             retlw   'o'
00AC 346C           00519             retlw   'l'
00AD 346F           00520             retlw   'o'
00AE 3467           00521             retlw   'g'
00AF 3479           00522             retlw   'y'
00B0                00523 Table_End
00B0 3400           00524             retlw   0
                    00525 ;
                    00526         if ( (Table & 0x0FF) >= (Table_End & 0x0FF) )
                    00527        MESSG   "Warning - User Definded: Table Table crosses page boundry in computed jump"
                    00528     endif
                    00529 ;
                    00530 
                    00531 
                    00532 
                    00533     end
MPASM 01.40 Released           LM032L.ASM   1-22-1997  10:25:15         PAGE 14


SYMBOL TABLE
  LABEL                             VALUE 

ADCON1                            0000009F
AM                                00000007
BF                                00000000
BUSY_CHECK                        00000083
C                                 00000000
CCP1CON                           00000017
CCP1IE                            00000002
CCP1IF                            00000002
CCP1M0                            00000000
CCP1M1                            00000001
CCP1M2                            00000002
CCP1M3                            00000003
CCP1X                             00000005
CCP1Y                             00000004
CCPR1H                            00000016
CCPR1L                            00000015
CHAR                              00000036
CKP                               00000004
CLR_DISP                          00000001
CLR_MIN_SW                        00000005
CMD_SEQ                           0000002F
D                                 00000005
DATA_ADDRESS                      00000005
DB_HI_BYTE                        00000002
DC                                00000001
DD_RAM_ADDR                       00000080
DD_RAM_UL                         00000080
DISPLAY_INIT                      00000024

⌨️ 快捷键说明

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