亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tut6014.s

?? dspic的匯編例程
?? S
字號:
;------------------------------------------------------------------------------
; Write LCD with text using PSV feature and flash LED1 with a Timer1 loop
;------------------------------------------------------------------------------

	.equ __30F6014, 1
	.include "E:\Microchip\MPLAB ASM30 Suite\Support\inc\p30f6014.inc"

;------------------------------------------------------------------------------
;Global Declarations:

    .global __reset			    ;The label for the first line of code. 
 	.global	__OscillatorFail	;Declare Oscillator Fail trap routine label
 	.global	__AddressError		;Declare Address Error trap routine label
	.global	__StackError		;Declare Stack Error trap routine label
	.global	__MathError		    ;Declare Math Error trap routine label

;------------------------------------------------------------------------------
;Data Declarations in near data space
	   .section .nbss
flags: .space 1	


;------------------------------------------------------------------------------
;Program Specific Constants (literals used in code)

	.equ	Fcy, #7372800

;------------------------------------------------------------------------------
;Start of code

	.text				;Start of Code section
__reset:    mov	 #__SP_init,w15 ;Initalize the Stack Pointer
	        mov	 #__SPLIM_init,w0
	        mov	 w0,SPLIM	    ;Initialize the Stack Pointer Limit Register
	        nop			        ;Add NOP to follow SPLIM initialization
	        
;------------------------------------------------------------------------------
;Initialize LED outputs on PORTD bits 0-4

	        mov	 #0xFFFF,w0  ;Initialize LED pin data to off state
	        mov	 w0,LATD
	        mov	 #0xFFF0,w0  ;Set LED pins as outputs
            mov	 w0,TRISD
            bclr LATD,#RD0	 ;Turn LED1 on
            

;------------------------------------------------------------------------------
;Initialize Timer1 for 1/2 second period
		    clr	 T1CON		 ;Turn off Timer1 by clearing control register
		    clr	 TMR1		 ;Start Timer1 at zero
	  	    mov	 #Fcy/512,w0 ;Get period register value for 1/2 second 
	    	mov	 w0,PR1		 ;Load Timer1 period register
	    	mov	 #0x8030,w0	 ;Get Timer1 settings (1:256 prescaler)
		    mov	 w0,T1CON	 ;Load Timer1 settings into control register

;------------------------------------------------------------------------------
;Initialize SPI for comms to LCD display and clear display
;Ensure LCD Controller is up and running
       
            bset   LATD, #LATD7	 ;Set chip select high for MCP41010
		    bclr   TRISD, #TRISD7;Set chip select pin to output
            rcall  SPI_Init      ;Call routine to set up SPI2 for LCD display

;Ensure LCD Controller is up and running (~100mS at 7.37MIPs)
            mov     #256, w0     
            mov     #2800, w1   
            do      w1, end_delay1 ;outer loop
            repeat  w0             ;inner loop
            nop
            nop
end_delay1: nop

		    mov.b  #0x82,w0     ;Load command to clear the display 
		    rcall  WrtLCD	    ;Call routine to send the command to the display
            mov.b  #0x82,w0     ;Load command to clear the display 
		    rcall  WrtLCD	    ;Call routine to send the command to the display

;------------------------------------------------------------------------------
;Set up PSV to make "Demo_Board_Message1" program memory data accessible as data space  
	 	    bset  CORCON, #PSV		      ;Enable PSV operation in CORCON
		    mov   #psvpage(Demo_Board_Message1),w0 ;Get upper address (page) of text in program memory 
		    mov   w0, PSVPAG		      ;Load address into PSVPAG
	  	    mov   #psvoffset(Demo_Board_Message1),w4 ;Get lower address (offset) of text in program 
	  	                                  ;memory and place into w4

	        bset  flags, #0               ;set flag to indicate string write to LCD
		    rcall WrtNextChr              ;display data on LCD            
                    
wait:		btsc  PORTA, #12
			bra   wait                    ;wait here until SW1 is pressed
			mov.b  #0x82,w0               ;Load command to clear the display 
		    rcall  WrtLCD	              ;Call routine to send the command to the display 
		   	mov.b  #0x82,w0               ;Load command to clear the display 
		    rcall  WrtLCD	              ;Call routine to send the command to the display 
		    
;------------------------------------------------------------------------------
;Set up PSV to make "Hi_Msg1" program memory data accessible as data space  
	 	    bset  CORCON, #PSV		     ;Enable PSV operation in CORCON
		    mov   #psvpage(Hi_Msg1),w0   ;Get upper address (page) of text in program memory 
		    mov   w0, PSVPAG		     ;Load address into PSVPAG
	  	    mov   #psvoffset(Hi_Msg1),w4 ;Get lower address (offset) of text in program 
	  	                                 ;memory and place into w4

			bclr  flags, #0              ;clear flag to indicate non string LCD update
		    rcall WrtNextChr             ;display data on LCD
		
wait1:		btsc  PORTA, #13
			bra   wait1                  ;wait here until SW4 is pressed
	        mov.b  #0x82,w0              ;Load command to clear the display 
		    rcall  WrtLCD	             ;Call routine to send the command to the display 
		    
;------------------------------------------------------------------------------		    
;Set up PSV to make "Line Draw" program memory data accessible as data space  
	 	    bset  CORCON, #PSV		      ;Enable PSV operation in CORCON
		    mov   #psvpage(Line_Draw),w0  ;Get upper address (page) of text in program memory 
		    mov   w0, PSVPAG		      ;Load address into PSVPAG
	  	    mov   #psvoffset(Line_Draw),w4;Get lower address (offset) of text in program 
			                              ;memory and place into w4
			bclr  flags, #0               ;clear flag to indicate non string LCD update
		    rcall WrtNextChr              ;display data on LCD   


wait2:		btsc  PORTA, #14
			bra   wait2  
		    mov.b  #0x82,w0              ;Load command to clear the display 
		    rcall  WrtLCD	             ;Call routine to send the command to the display 
		    
;------------------------------------------------------------------------------
;Set up PSV to make "Demo_Board_Message2" program memory data accessible as data space  
	 	    bset  CORCON, #PSV		      ;Enable PSV operation in CORCON
		    mov   #psvpage(Demo_Board_Message2),w0 ;Get upper address (page) of text in program memory 
		    mov   w0, PSVPAG		      ;Load address into PSVPAG
	  	    mov   #psvoffset(Demo_Board_Message2),w4 ;Get lower address (offset) of text in program 
	  	                                  ;memory and place into w4

	        bset  flags, #0               ;set flag to indicate string write to LCD
		    rcall WrtNextChr              ;display data on LCD      
		        			         
            
;------------------------------------------------------------------------------
;Loop while waiting for a Timer1 match and toggle LED1 when it happens

MainLoop:	btss  IFS0,#T1IF	;Check if Timer1 interrupt flag is set
		    bra   MainLoop	    ;Loop back until set
		    bclr  IFS0,#T1IF	;Clear Timer1 interrupt flag
		    btg   LATD,#0		;Toggle LED1
		    bra   MainLoop	    ;Loop back

	
;------------------------------------------------------------------------------
;Initialize SPI port to communicate with the LCD display controller (PIC18F242)
SPI_Init:   bset  LATG,#LATG9	;Set SPI slave select pin high
		    bclr  TRISG,#TRISG9	;and set as output
		    mov   #0x003A,w0	;Load SPI control register
		    mov   w0,SPI2CON	;Master mode, Clk = Fosc/8, Input data sampled at middle 
		                        ;of output time, Data clocked out on rising edge, Clk idle is low
            bclr  IEC1, #SPI2IE ;Ensure SPI interrupt is disabled
		    mov   #0x8000,w0	;Enable SPI port
	  	    mov   w0,SPI2STAT
  	    	return


;------------------------------------------------------------------------------
;Send w0 byte to LCD
WrtLCD:     bclr  LATG,#LATG9	   ;Set slave select low for new transmission
	        bclr  SPI2STAT,#SPIROV; 
            mov   SPI2BUF, w2	   ;Dummy read to avoid overflow
	        mov.b wreg, SPI2BUF	   ;Write the data to the output buffer
	        
spibusy:	btss  SPI2STAT,#SPIRBF ;
		    bra   spibusy		   ;Loop back until complete
		    bset  LATG,#LATG9	   ;Set SPI slave select pin high	        
		    return


;------------------------------------------------------------------------------
;Write next char to LCD Controller until loop complete (null character)
WrtNextChr: btss  flags, #0       ;test if this is string write to LCD
			bra   bypass_cmd      ;not a string update so bypass "WrtChrNext" command
			mov   #0xA8, w0       ;Load command to send an ascii character
		    rcall  WrtLCD         ;Call routine to send the command to the display
bypass_cmd: mov.b [w4++],w0	      ;Get data byte pointed to by w4, 
		                          ;place in w0 and increment pointer
		    mov   #0x00FF, w1                    
		    cp.b  w1, w0		  ;Test if byte (in w0) is 0xFF 
	  	    bra   NZ, not_end     ;If not zero then branch to send more data
            return                ;end of transmission so return

not_end:    rcall WrtLCD	      ;Call routine to send the character to the display
		    bra   WrtNextChr   	  ;Loop back for next character in table
		    return
 		    
		    
;==============================================================================
;Tables of constants in program memory

;------------------------------------------------------------------------------
;Text in program memory
	.section .const,"r"

;------------------------------------------------------------------------------
; Character commands example #1
; Defining ascii string for LCD
Demo_Board_Message1:
	.ascii	"   dsPICDEM(tm)1.1  "	;Text string
	.ascii	"  Development Board "	;Text string
	.ascii	"                    "	;Text string
	.ascii	"      Tutorial      "	;Text string with trailing zero
	.byte 0xFF                      ;string terminator
	
	
;------------------------------------------------------------------------------	
; Character commands example #2
; How to define LCD column and row position and write characters
Hi_Msg1:          
	.byte 0xE7
	.ascii "H"
	.byte 9, 0
	.byte 0xA8
	.ascii "i"
	.byte 0xFF          ;string terminator


;------------------------------------------------------------------------------
; Pixel Commands example	
; How to define pixel commands to write lines to the display
Line_Draw:
	.byte 0xD7, 1, 1, 0xDA, 119, 31
	.byte 0xD7, 1, 31, 0xDA, 119, 1
	.byte 0xD7, 1, 1,  0xDA, 1, 31
	.byte 0xD7, 119, 1, 0xDA, 119, 31
	.byte 0xD7, 1, 31, 0xDA, 119, 31
	.byte 0xD7, 1, 1,  0xDA, 119, 1	
	.byte 0xFF          ;string terminator


;------------------------------------------------------------------------------
; Character commands example #3
; Defining ascii string for LCD	
Demo_Board_Message2:
    .ascii "  dsPIC30F 16-bit   "
    .ascii "   Digital Signal   "
    .ascii "     Controller     "
	.byte 0xFF          ;string terminator
	
			
;==============================================================================
; Error traps
; Example trap routines. In application use retfie instruction to exit trap
;------------------------------------------------------------------------------
;Oscillator Fail Error trap routine

	.text				;Start of Code section
__OscillatorFail:
		bclr  LATD,#LATD3       ;Turn LED4 on
        bclr  INTCON1, #OSCFAIL ;Reset oscillator fail trap flag
		bra	__OscillatorFail    ;Loop forever when oscillator failure occurs
		
;------------------------------------------------------------------------------
;Address Error trap routine

__AddressError:	
		bclr  LATD,#LATD3	    ;Turn LED4 on
        bclr  INTCON1, #ADDRERR ;Reset address error trap flag
		bra	__AddressError	    ;Loop forever when address error occurs

;------------------------------------------------------------------------------
;Math (Arithmetic) Error trap routine

__StackError:	
		bclr  LATD,#LATD3	    ;Turn LED4 on
	    bclr  INTCON1, #STKERR  ;Reset stack error trap flag  
		bra	__StackError	    ;Loop forever when stack error occurs
		
;------------------------------------------------------------------------------
;Math (Arithmetic) Error trap routine

__MathError:	
		bclr  LATD,#LATD3	    ;Turn LED4 on
	    bclr  INTCON1, #MATHERR ;Reset math error trap flag
		bra	__MathError	        ;Loop forever when math error occurs
		
;------------------------------------------------------------------------------
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                                           ;
;                       Software License Agreement                          ;
;                                                                           ;
;   The software supplied herewith by Microchip Technology Incorporated     ;
;   (the "Company") for its dsPIC controller is intended and supplied to    ;
;   you, the Company's customer, for use solely and exclusively on          ;
;   Microchip dsPIC products. The software is owned by the Company and/or   ;
;   its supplier, and is protected under applicable copyright laws. All     ;
;   rights are reserved. Any use in violation of the foregoing              ;
;   restrictions may subject the user to criminal sanctions under           ;
;   applicable laws, as well as to civil liability for the breach of the    ;
;   terms and conditions of this license.                                   ;
;                                                                           ;
;   THIS SOFTWARE IS PROVIDED IN AN "AS IS" CONDITION.  NO WARRANTIES,      ;
;   WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO,   ;
;   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR      ;
;   PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, IN ANY           ;
;   CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR CONSEQUENTIAL       ;
;   DAMAGES, FOR ANY REASON WHATSOEVER.                                     ;
;                                                                           ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	.end				;End of code in this file

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人福利片| 中文字幕二三区不卡| 亚洲成a人v欧美综合天堂 | 国产精品美女久久久久久久久久久 | 成人动漫一区二区在线| |精品福利一区二区三区| 色偷偷88欧美精品久久久| 亚洲成人免费av| 日韩午夜激情电影| 国产精品一区二区免费不卡| 国产精品国产自产拍高清av王其| 国产69精品一区二区亚洲孕妇| 国产精品欧美久久久久无广告| www.久久久久久久久| 亚洲国产成人av| 精品少妇一区二区三区在线视频| 国内精品免费在线观看| 欧美日韩在线播放三区| 首页国产欧美日韩丝袜| 日韩精品一区二区三区中文不卡| 人人狠狠综合久久亚洲| 亚洲精品在线一区二区| 丝袜美腿亚洲色图| 精品国产第一区二区三区观看体验| 久草热8精品视频在线观看| 精品国产乱码久久久久久闺蜜| 韩国三级电影一区二区| 中文字幕一区av| 在线观看www91| 日本在线不卡一区| 久久久久久亚洲综合| av中文字幕不卡| 亚洲线精品一区二区三区| 日韩一区二区在线观看视频| 国产在线播放一区二区三区| 最新国产精品久久精品| 日本久久一区二区三区| 亚洲成av人**亚洲成av**| 日韩一区二区三区免费看| 国产风韵犹存在线视精品| 亚洲精品自拍动漫在线| 91精品综合久久久久久| 国产成人超碰人人澡人人澡| 一区二区三区高清| 精品国产伦一区二区三区观看体验 | 日本麻豆一区二区三区视频| 亚洲国产精品精华液ab| 欧美视频在线观看一区二区| 精品影视av免费| 一区二区在线观看免费视频播放 | 亚洲欧美视频在线观看视频| 9191久久久久久久久久久| 成人永久看片免费视频天堂| 亚洲最新在线观看| 久久久三级国产网站| 欧美日韩一区精品| 粉嫩在线一区二区三区视频| 亚洲精品视频免费观看| 精品久久免费看| 在线观看免费亚洲| 久久99精品一区二区三区三区| 专区另类欧美日韩| 欧美刺激午夜性久久久久久久| 成人小视频免费观看| 蜜桃视频一区二区三区在线观看| 亚洲欧美一区二区久久 | 成人aa视频在线观看| 日日摸夜夜添夜夜添亚洲女人| 综合在线观看色| 久久久久久99精品| 欧美精品1区2区3区| 色哟哟国产精品| 国产a久久麻豆| 激情小说亚洲一区| 亚洲国产乱码最新视频| 亚洲人成网站精品片在线观看| 国产精品色婷婷久久58| 欧美精品色综合| 欧美日韩一级大片网址| 色综合久久综合| 成熟亚洲日本毛茸茸凸凹| 香蕉影视欧美成人| 亚洲欧美另类小说视频| 国产精品福利影院| 国产精品久久久久久久久搜平片 | 裸体一区二区三区| 亚洲成人午夜影院| 亚洲第一会所有码转帖| 亚洲一区二区三区影院| 亚洲美女视频在线| 亚洲日本在线天堂| 亚洲精品视频自拍| 一区二区三区高清| 亚洲午夜在线电影| 亚洲国产美女搞黄色| 亚洲日本成人在线观看| 亚洲精品日产精品乱码不卡| 国产精品久久福利| 亚洲素人一区二区| 一区二区三区四区视频精品免费| 一区二区三区丝袜| 亚洲电影欧美电影有声小说| 亚洲国产精品欧美一二99| 午夜精品一区二区三区电影天堂| 亚洲va欧美va人人爽| 欧美a级理论片| 紧缚奴在线一区二区三区| 国产经典欧美精品| 91在线小视频| 欧美中文一区二区三区| 欧美日韩精品福利| 日韩视频一区二区三区在线播放| 欧美欧美欧美欧美| 日韩欧美久久久| 国产精品美日韩| 亚洲五码中文字幕| 麻豆精品在线播放| 成人综合在线观看| 日本伦理一区二区| 日韩欧美一区二区三区在线| 久久五月婷婷丁香社区| 中文字幕av一区二区三区高| 亚洲精品乱码久久久久久日本蜜臀| 亚洲一级在线观看| 激情六月婷婷久久| 色综合一区二区| 9191成人精品久久| 国产欧美日韩麻豆91| 中文字幕一区二区三区不卡| 午夜不卡在线视频| 国产福利一区二区三区视频在线| 色婷婷亚洲精品| 欧美成人精品高清在线播放 | 国产欧美日本一区视频| 亚洲一区在线免费观看| 狠狠色丁香久久婷婷综| 色狠狠桃花综合| 精品国产免费视频| 亚洲三级在线免费观看| 老司机午夜精品99久久| 一本在线高清不卡dvd| 日韩欧美在线网站| 亚洲天天做日日做天天谢日日欢 | av一区二区三区四区| 91精品国产综合久久久蜜臀图片| 中文av一区特黄| 蜜臀va亚洲va欧美va天堂| 色综合亚洲欧洲| 久久精品人人做| 日本成人在线视频网站| 91麻豆国产福利精品| 久久久亚洲高清| 日韩和的一区二区| 91国产免费看| 国产精品免费aⅴ片在线观看| 蜜桃精品视频在线| 欧美日韩一区在线观看| 亚洲色图视频网站| 蜜桃精品在线观看| 国产suv精品一区二区三区| 欧美日韩电影在线播放| 中文字幕在线视频一区| 国产一区二区调教| 在线观看日韩精品| 亚洲妇熟xx妇色黄| 一本大道久久a久久综合婷婷| 国产女人18水真多18精品一级做| 免费观看30秒视频久久| 欧美日韩aaaaa| 亚洲国产精品人人做人人爽| 一本色道久久加勒比精品 | 亚洲另类中文字| 福利电影一区二区三区| 久久蜜桃一区二区| 国产一区福利在线| 精品国产伦一区二区三区观看体验| 日本午夜一本久久久综合| 欧美三级中文字| 亚洲乱码中文字幕| 色丁香久综合在线久综合在线观看| 精品精品国产高清一毛片一天堂| 午夜精品福利在线| 欧美无人高清视频在线观看| 亚洲欧美国产77777| 91在线小视频| 尤物视频一区二区| 在线观看网站黄不卡| 亚洲一区在线电影| av不卡在线播放| 亚洲乱码中文字幕| 欧美图区在线视频| 亚洲国产乱码最新视频| 7878成人国产在线观看| 亚洲成a人片综合在线| 精品日韩99亚洲| 国产成人自拍网| 中文字幕在线不卡视频| 色哟哟亚洲精品| 天天av天天翘天天综合网 | 亚洲综合小说图片|