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

📄 sub_lcd_menu_disp.s

📁 该文件包含30F的电机控制程序
💻 S
字号:
;START_HEADER
;
; dsPIC30F6014 Demo Source File
; (c) Copyright 2005 Microchip Technology, All rights reserved
;
; --------------------------------------------------------------------------
; File Revision History:
; --------------------------------------------------------------------------
;
; $Log: sub_lcd_menu_disp.s,v $
; Revision 1.3  2005/04/04 23:38:46  VasukiH
; Updated comments in header
;
; Revision 1.2  2005/04/04 23:14:24  VasukiH
; Updates for MPLAB C30 v1.30 compatiblity
;
; Revision 1.1.1.1  2003/08/23 00:38:33  VasukiH
; First import of demo source into CVS Repository
;
;
;
; --------------------------------------------------------------------------
;
; Software and Development Tools Info:
; --------------------------------------------------------------------------
; Tool                          Version
; --------------------------------------------------------------------------
; MPLAB IDE                     7.0
; MPLAB C30 Toolsuite           1.30
; dsPICDEM(TM) Processor Board  1.10
; --------------------------------------------------------------------------
;
; File Notes:
; 1. This file initiates SPI transmissions to the LCD controller
; 2. It decides which menu screen to send to the LCD controller.
;
;END_HEADER


.include "p30fxxxx.inc"

.global _sub_lcd_menu_disp

.section .text
_sub_lcd_menu_disp:

        push.d  w0

        mov     #0, w0                          ;Compare current screen selection
        cp      ScreenSelection                 ;to power-on-screen (Screen 0)
        bra     nz, LoadMMstring                ;If it does not equal Screen 0 check Screen 1
        mov     #POR_disp, w1                   ;Else, load the POR screen string address to
        mov     w1, LCDDataPtr                  ;LCDDataPtr
        bra     start_tx2lcd                    ;Start transmitting to LCd
LoadMMstring:
        inc     w0, w0
        cp      ScreenSelection                 ;Compare current screen selection to main-menu(1)
        bra     nz, LoadDAcqstring              ;If it does not equal Screen 1 check Screen 2
        mov     #Main_disp, w1                  ;else load the Main menu screen string address to
        mov     w1, LCDDataPtr                  ;LCDDataPtr
        bra     start_tx2lcd                    ;Start transmitting to LCD

LoadDAcqstring:                                 ;Compare current screen selection to Data Acq. menu(2)
        inc     w0, w0                          ;If it does not equal Screen 2 check Screen 3
        cp      ScreenSelection                 ;else load the Data Acq menu screen string address to
        bra     nz, LoadDSPstring               ;LCDDataPtr
        mov     #Data_disp, w1                  ;Start transmitting to LCD
        mov     w1, LCDDataPtr
        bra     start_tx2lcd

LoadDSPstring:                                  ;Compare current screen selection to DSP menu(3)
        inc     w0, w0                          ;If it does not equal Screen 3 check Screen 4
        cp      ScreenSelection                 ;else load the Data Acq menu screen string address to
        bra     nz, LoadDTMFstring              ;LCDDataPtr
        mov     #DSP_disp, w1                   ;Start transmitting to LCD
        mov     w1, LCDDataPtr
        bra     start_tx2lcd

LoadDTMFstring:
        inc     w0, w0
        cp      ScreenSelection
        bra     nz, exit_rtn

        mov     #DTMF_disp, w1                  ;Send DTMF display string
        mov     w1, LCDDataPtr
        bra     start_tx2lcd

start_tx2lcd:

        bclr    SPI2STAT, #SPIROV               ;Clear overflow flag
        bset    LATG, #LATG9                    ;Deselect Slave LCD controller
        bclr    LATG, #LATG9                    ;Select Slave LCD controller

        clr     BypassCtrl                      ;Set up the ISR for transmitting
        setm    CtrlOrData                      ;a control byte before a data
                                                ;byte
        mov     #80, w0                         ;A full menu-screen on the LCD
        mov     WREG, LcdCharCnt                ;is 20x4=80 characters


        mov.b   SPI2BUF, WREG                   ;Dummy read of SPI2BUF
        mov.b   #0x82, w0                       ;Command for HomeClear is loaded
        mov.b   WREG, SPI2BUF                   ;on to SPI2BUF to kick off the SPI2
exit_rtn:                                       ;the module
        pop.d   w0

        return

.end                                            ;EOF

⌨️ 快捷键说明

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