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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? serialb.asm

?? USB大全電子版全部資料3~包含源碼、協(xié)議等
?? ASM
?? 第 1 頁 / 共 2 頁
字號:
;======================================================================

;		copyright 1997 Cypress Corporation

;======================================================================

; Designer:		J. Brown

; Date:		9/27/97

;======================================================================

; Part Number:	CY7C63000

; File:		Serial3.asm

; Rev:		1.0

;======================================================================

; Comments:

;

;	This code will send generic commands to

;	the RS-232 port of a serial device and reads back

;	the response character string.

;

;	This version of code provides a UART function

;	with the following characteristics:

;

;	1. 2400 baud

;	2. 1 start bit

;	3. 8 data bits

;	4. No parity bit

;	5. 1 stop bit

;

;	5. No framing error support.

;	6. No NACK support.

;	7. No retry support.

;

;======================================================================

; History:

;

; 12/30/97 :

; Clean-up of code for incoportaion to reference designs.

;

;	9/27/97 :

;	Initial code for generic Serial Interface.

;

;======================================================================

; Background:

;

;	The micro-controller transmits 4 character command codes.

;	Upon receipt of a command code, the target device responds with

;	a character string containing the requested information.

;	This character string is terminated with a carriage return/

;	line feed pair. The micro-controller then stores the character

;	string in a local RAM buffer while stripping the line feed

;	character. The carriage return character is retained as the

;	buffer's delimiter.

;

;	If the device receives an unrecognized command it will respond

;	with a NACK character (15h), indicating that the command is

;	unsupported on this model of the product.

;

;	If the miro-controller receives an invalid start bit, it will

;	return to the main routine and await a new start bit.

;

;	If the miro-controller does not detect that the current

;	character is a line feed character, it will retun to the main

;	routine and await the next character.

;

;	No time out retry features are implemented in this version of

;	code.

;

;	Note that all delay loops and time between receive and transmit

;	are dependent on the response timing of the RS-232 peripheral.

;	These relanionships must be adjusted in each design to provide

;	stable communications. This behaviour is due to the lack of

;	hardware handshaking with the peripheral.

;

;	Limited software handshaking is provided by detection of the

;	carriage_return/line_feed pair string terminator.

;

;**********************************************************************

;************************ assembler directives ************************ 

;

;label:          XPAGEON

;

; I/O ports

Port0_Data:		    equ 00h ; GPIO data port 0

Port1_Data:		    equ 01h ; GPIO data port 1

Port0_Interrupt:	equ 04h ; Interrupt enable for port 0

Port1_Interrupt:	equ 05h ; Interrupt enable for port 1

Port0_Pullup:	    equ 08h ; Pullup resistor control for port 0

Port1_Pullup:	    equ 09h ; Pullup resistor control for port 1

;

; GPIO current sink register

Port0_Isink0:	    equ 30h ; 

;

; Variable memory allocations

innerDelayOneCount: equ 3Ah ; Delay One: Inner delay count 

outerDelayOneCount: equ 3Bh ; Delay One: Outer delay count 

innerDelayCount:	  equ 3Ch ; Delay: Inner delay count 

outerDelayCount:	  equ 3Dh ; Delay: Outer delay count 

rxEnable:		        equ 40h ; Receiver Enabled Flag

rxBitCount:		      equ 42h ; Recieve Bits Count

rxFrameCount:	      equ 44h ; Recieve Frame Count

rxData:		          equ 46h ; Receive Data Holding Register

rxBufPtr:		        equ 48h ; Receive Buffer Pointer

rxFrameFlag:	      equ 4Ah ; Framing Error Flag (0=No,1=Yes)

rxPassCount:	      equ 4Bh ; Transmit Buffer Pointer

rxBuf:		          equ 50h ; Recieve Buffer Start

rxBufEnd:		        equ 5Fh ; Recieve Buffer End

txEnable:		        equ 41h ; Transmiter Enabled Flag

txBitCount:		      equ 43h ; Transmit Bits Count

txFrameCount:	      equ 45h ; Transmit Frame Count

txData:		          equ 47h ; Transmit Data Holding Register

txBufPtr:		        equ 49h ; Transmit Buffer Pointer

txBuf:		          equ 4Ch ; Transmit Buffer Start (4 Bytes)

;

; Constant declarations

; Transmit counter values

txStart:	  equ 00h ; Start bit begin

txBit0:	    equ 03h ; Start bit end

txBit1:	    equ 07h ; Data bit 0 end

txBit2:	    equ 0Ah ; Data bit 1 end

txBit3:	    equ 0Dh ; Data bit 2 end

txBit4:	    equ 10h ; Data bit 3 end

txBit5:	    equ 14h ; Data bit 4 end

txBit6:	    equ 17h ; Data bit 5 end

txBit7:	    equ 1Ah ; Data bit 6 end

txStop:	    equ 1Dh ; Data bit 7 end

txComp:	    equ 20h ; Stop bit end

;

txDataMask: equ FEh ; Mask to preserve inputs.

;

; Receive counter values

rxStart:    equ 01h ; Start bit center

rxBit0:	    equ 05h ; Data bit 0 center

rxBit1:	    equ 09h ; Data bit 1 center

rxBit2:	    equ 0Ch ; Data bit 2 center

rxBit3:	    equ 0Fh ; Data bit 3 center

rxBit4:	    equ 12h ; Data bit 4 center

rxBit5:	    equ 16h ; Data bit 5 center

rxBit6:	    equ 19h ; Data bit 6 center

rxBit7:	    equ 1Ch ; Data bit 7 center

rxStop:	    equ 1Fh ; Data bit 7 center

rxComp:	    equ 22h ; Stop bit center

lastrxBit:  equ 07h ; Last receive data bit count

;

; Interrupt masks

GPIO_intMask:	  equ 40h ; Mask for Port 0 GPIO interrupts.

128us_intMask:	equ 02h ; Mask to enable 128us only.

;

; ASCII Characters for commands

;Car_Ret:	  equ 0Dh ; Carriage Return Terminator

;Ln_Fd:	    equ 0Ah ; Line Feed Terminator

;Asc_Space:	equ 20h ; ASCII Space Character

;

;************************************************************************

; If we are recieving a byte of data from the serial channel we need to

; go to the receive subroutine.

Serial_ISR:

	push	A                     ;

	push X                      ;

	mov	A, [rxEnable]           ; Load the receive enable flag.

	cmp	A, 0 			              ; Check for receive in progress.

	jnz	Increment_rxFrameCount  ; Yes, go receive.

;************************************************************************

; If we are sending a byte of data to the serial channel we need to

; go to the transmit subroutine.

;

	mov	A, [txEnable]           ; Check for transmit in progress.

	cmp	A, 0                    ;

	jnz	Increment_txFrameCount  ; Yes, go transmit.

	jmp	done_Serial             ; Default

;

; We are transmitting.

Increment_txFrameCount:

	inc	[txFrameCount]          ; Adjust frame count.

	mov	A, [txFrameCount]       ; Put it in the accumulator

	mov	[txBitCount], A         ; Save it as the new bit count

	jmp	done_Serial             ; Finished

;

; We are receiving.

Increment_rxFrameCount:

	inc	[rxFrameCount]          ; Adjust frame count.

	call	rxRoutine             ; Go get a character

	pop X                       ;

	mov	A, 00h                  ; Disable interrupts and return.

	ipret	Global_Interrupt      ;

;

; Finish the interrupt handling

done_Serial:

	pop X

	mov	A, 128us_intMask        ; Load 128us ISR Enable value

	ipret	Global_Interrupt      ; Return and enable 128us ISR

;

;************************************************************************

; The GPIO interrupt will occur at the start of a receive data byte.

; The low going start bit will trigger the GPIO_ISR.

;

GPIO_ISR:

	push	A	; save the accumulator to stack

	push	X	; save X on stack



; Three steps for detecting the start bit:

; 1.) Check that the receiver generated the interrupt.

;	iord	[Port0_Data]	;

;	and	A, 80h          ;

;	jz	GPIO_ISR_Done   ;

;	jnz	GPIO_ISR_Done	  ;

;

; 2.) Set the receive enable bit.

	mov	A, 01h		          ; Load the accumulator.

	mov	[rxEnable], A	      ; write to the receive enable flag.

;

; 3.) Clear the receive data register.

	mov	A, 00h		          ; Clear the accumulator.

	mov	[rxData], A		      ; Clear the receive data register.

;

GPIO_ISR_Done:

	pop	x			              ; Restore the index register.

	mov	A, 128us_intMask	  ; Load the 128us interrupt mask.

	ipret	Global_Interrupt	; Return to caller.

					                ; 128us interrupt enabled.

;

;************************************************************************

; During serial transfers data bit 0 is transmitted first.

; We will use Port 0 Bit 7 for receive and Bit 0 for transmit.

; Data will always be right shifted for either transmit or receive.

; Port 0 Bit 7 will be a falling edge sensitive GPIO_ISR input.

; Port 0 bits 6-0 and Port 1 bits 3-0 will be outputs.

;

SerialInitialize:

	push	A			        ; Save the accumulator.

	push	X			        ; Save the index.

	mov	A, FFh		      ; load accumulator with ones

	iowr	Port0_Data		; output ones to port 0

	iowr	Port1_Data		; output ones to port 1

;

	mov	A, 00h		; load accumulator with zeros

	iowr	Port0_Pullup	; enable port 0 pullups

	iowr	Port1_Pullup	; enable port 1 pullups

;

	iowr	Port0_Interrupt	; disable port 0 interrupts

	iowr	Port1_Interrupt	; disable port 1 interrupts

;

	mov	A, 08h		      ; load accumulator with med sink

	iowr	Port0_Isink0	; minimum sink current Port0 bit 0

;

;	iowr	Watchdog		  ; clear watchdog timer

;

; Clear the serial channel counters.

	mov	A, 00h

	mov	[rxEnable], A	    ; Clear rxEnable Flag

	mov	[rxBitCount], A	  ; Clear rx bit count.

	mov	[rxFrameCount], A	; Clear rx frame counter.

	mov	[rxBufPtr], A	    ; Clear rx buffer Pointer.

	mov	[txEnable], A	    ; Clear txEnable Flag.

	mov	[txBitCount], A	  ; Clear tx bit count.

	mov	[txFrameCount], A	; Clear tx frame counter.

	mov	[txBufPtr], A	    ; Clear tx buffer Pointer.

;

	mov	A, 81h		        ; Enable port0 bit7 as input.

	iowr	Port0_Data		  ; All other bits are outputs.

	mov	A, 7Eh		        ; Select falling edge interrupt

	iowr	Port0_Pullup	  ; on port0 bit7.

	mov	A, 00h		        ;

	iowr	Port0_Interrupt	; Disable port 0 bit 7 interrupt.

;

	mov	[txBufPtr], A	      ; Reset tx buffer pointer.

	mov	[interrupt_mask], A ; Default all interrupts to disabled.

	pop	X			              ; Restore the index.

	pop	A			              ; Restore the accumulator.

	ret				              ; Return to caller.

;************************************************************************

; TX_Data processing:

; This routine will write a byte of data.

; 1.) Send the active low Start bit.

; 2.) Send eight variable data bits.

; 3.) Send the active high Start bit.

; 4.) Stay in transmit until complete.

;************************************************************************

;

txRoutine:

;  Prepare for the transmit.

	push	A			          ; save accumulator.

	mov	A, 01h		        ; Load txEnable Flag.

	mov	[txEnable], A	    ; Store txEnable Flag.

	mov	A, [txFrameCount]	; Get frame count.

	mov	[txBitCount], A	  ; Save bit count.

;

sendStart:

;  Write out the start bit. (active low)

	mov	A, FEh		          ; Load tx Start bit.

	iowr	Port0_Data		    ; Send tx Start bit.

	mov	A, 02h		          ; Load 128us ISR Enable value.

	iowr	Global_Interrupt	; Enable 128us ISR.

;

;  Check the bit count and send a bit if required.

check_tx_bit:

	mov	A, [txBitCount]	; Get frame count

	cmp	A, txBit0		; tx bit 0 at frame count=03h

	jz	sendtxBit		; Go send data bit

	cmp	A, txBit1		; tx bit 1 at frame count=07h

	jz	sendtxBit		; Go send data bit

	cmp	A, txBit2		; tx bit 2 at frame count=0Ah

	jz	sendtxBit		; Go send data bit

	cmp	A, txBit3		; tx bit 3 at frame count=0Dh

	jz	sendtxBit		; Go send data bit

	cmp	A, txBit4		; tx bit 4 at frame count=10h

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91在线免费播放| 欧美军同video69gay| 亚洲在线免费播放| 欧美精品一区二区三区在线| 在线观看不卡视频| 国产不卡免费视频| 蜜桃视频第一区免费观看| 亚洲三级在线观看| 久久亚洲捆绑美女| 欧美二区三区的天堂| 91一区二区三区在线播放| 国产美女在线观看一区| 秋霞午夜鲁丝一区二区老狼| 亚洲另类在线制服丝袜| 久久久久久夜精品精品免费| 欧美一区二区视频在线观看 | 国产欧美日韩综合精品一区二区| 欧美午夜精品免费| www.亚洲国产| 国产·精品毛片| 国产一区视频网站| 奇米综合一区二区三区精品视频| 亚洲福利电影网| 一区二区三区中文字幕电影| 国产精品麻豆网站| 国产欧美精品区一区二区三区| 欧美一区二区三区小说| 91.xcao| 欧美日韩中文字幕一区| 日本精品免费观看高清观看| av影院午夜一区| 99精品视频中文字幕| 成人国产精品免费观看| 成人97人人超碰人人99| 99热99精品| 99精品热视频| 色综合久久99| 欧美性感一区二区三区| 91欧美一区二区| 91九色最新地址| 欧美在线制服丝袜| 欧美日韩www| 日韩一级免费一区| 精品久久久影院| 久久久不卡网国产精品一区| 国产日韩视频一区二区三区| 国产午夜亚洲精品理论片色戒 | 久久综合av免费| 久久久国产综合精品女国产盗摄| 久久久久久久免费视频了| 欧美国产一区二区| 中文字幕亚洲成人| 亚洲综合在线第一页| 日韩精品视频网站| 久草中文综合在线| 大白屁股一区二区视频| 91亚洲大成网污www| 欧美系列日韩一区| 日韩一区二区视频| 国产亚洲女人久久久久毛片| 国产精品国产三级国产专播品爱网| 国产精品毛片久久久久久| 伊人色综合久久天天人手人婷| 亚洲一区二区在线免费观看视频| 日韩国产在线观看一区| 激情综合色播五月| 99久久国产综合精品女不卡| 欧美日韩三级一区| 欧美精品一区二区三区在线| 久久精品夜色噜噜亚洲a∨| 亚洲久本草在线中文字幕| 日韩av在线发布| 国产成人精品在线看| 一本色道亚洲精品aⅴ| 欧美丰满美乳xxx高潮www| 国产欧美一区二区精品婷婷 | 欧美一区二区二区| 国产亚洲精品精华液| 亚洲欧美日本在线| 日韩中文字幕1| 成人激情小说乱人伦| 欧美美女喷水视频| 国产精品天美传媒沈樵| 视频一区中文字幕| 成人自拍视频在线| 欧美电影在线免费观看| 亚洲国产精品v| 青青草97国产精品免费观看无弹窗版| 国产成人亚洲综合色影视| 欧美性大战久久久久久久蜜臀| 2021国产精品久久精品| 亚洲小说春色综合另类电影| 国产一区二区三区免费播放| 欧美性xxxxx极品少妇| 国产精品网站在线播放| 麻豆国产91在线播放| 色欧美88888久久久久久影院| 精品国产髙清在线看国产毛片| 一区二区三区在线观看国产| 国产成人av资源| 91精品国产入口| 亚洲男人天堂一区| 国产精品99久久久久久久女警| 欧美精品成人一区二区三区四区| 亚洲国产精华液网站w| 久久精品国产99| 欧美日韩国产色站一区二区三区| 国产精品福利影院| 国产一区二区三区在线看麻豆| 欧美伦理影视网| 一区二区三区精品久久久| 成人免费视频app| 精品日产卡一卡二卡麻豆| 丝袜亚洲另类丝袜在线| 色综合久久88色综合天天6 | 欧美国产激情二区三区| 精品一区在线看| 欧美美女网站色| 亚洲成人tv网| 欧洲视频一区二区| 亚洲区小说区图片区qvod| 成人黄色在线看| 久久精品免视看| 国产一区二区三区日韩| 精品福利二区三区| 精品一区二区三区香蕉蜜桃| 6080午夜不卡| 日韩激情一区二区| 91精品国产综合久久久蜜臀图片| 亚洲一区二区综合| 欧美色老头old∨ideo| 一区二区免费在线播放| 91福利国产成人精品照片| 尤物视频一区二区| 欧美日韩一区二区在线观看视频| 一区二区三区在线观看动漫 | 欧美伊人精品成人久久综合97| 亚洲免费毛片网站| 色一情一伦一子一伦一区| 亚洲精品国久久99热| 91久久精品网| 亚洲18色成人| 欧美一级淫片007| 狠狠色综合播放一区二区| 久久免费精品国产久精品久久久久| 麻豆91在线观看| 久久久久久久免费视频了| 成人av电影在线观看| 亚洲精品少妇30p| 欧美肥妇free| 国产一区二区主播在线| 亚洲国产精品二十页| 色悠久久久久综合欧美99| 亚洲gay无套男同| 精品久久国产字幕高潮| 国产乱码一区二区三区| 亚洲天堂精品视频| 欧美日韩亚洲不卡| 激情综合色播激情啊| 国产精品久久久久久亚洲伦 | 日本一区二区成人| 91蜜桃视频在线| 日本欧美一区二区三区| 久久综合九色综合欧美就去吻| 福利一区二区在线| 亚洲一区二区在线免费观看视频| 91精品国产福利| 成人免费观看男女羞羞视频| 亚洲资源在线观看| 欧美精品一区二区精品网| 成人av在线播放网站| 天使萌一区二区三区免费观看| 精品日产卡一卡二卡麻豆| 97精品国产97久久久久久久久久久久| 香蕉乱码成人久久天堂爱免费| 久久精品免视看| 欧美日韩国产123区| 国产精品亚洲视频| 亚洲图片欧美一区| 欧美国产国产综合| 欧美一卡二卡三卡四卡| av中文一区二区三区| 毛片基地黄久久久久久天堂| 1024亚洲合集| 亚洲精品一区二区精华| 91国产丝袜在线播放| 国产成人免费xxxxxxxx| 无吗不卡中文字幕| 国产精品久久久久婷婷二区次| 日韩一区二区免费电影| 色婷婷精品大视频在线蜜桃视频| 久久丁香综合五月国产三级网站| 亚洲激情自拍视频| 久久精品人人做| 日韩欧美国产电影| 在线精品视频小说1| 成人av免费网站| 国产美女在线精品| 久久超碰97中文字幕| 亚洲成人激情自拍|