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

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

?? soft_uart.asm

?? SOFT_UART,本程序來自21ic網友
?? ASM
?? 第 1 頁 / 共 2 頁
字號:

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

;        Duplex UART Routines for the 8xC751 and 8xC752 Microcontrollers

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


; This is a demo program showing a way to perform simultaneous RS-232 
; transmit and receive using only one hardware timer. 

; The transmit and receive routines divide each bit time into 4 slices to 
; allow synchronizing to incoming data that may be out of synch with outgoing 
; data.

; The main program loop in this demo processes received data and sends it 
; back to the transmitter in hexadecimal format. This insures that we can 
; always fill up the receiver buffer (since the returned data is longer than 
; the received data) for testing purposes. Example: if the letter "A" is 
; received, we will echo "A41 ".

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


$Title(Duplex UART Routines for the 751/752)
$Date(8/20/92)
$MOD751


;*******************************************************************************
;                                   Definitions
;*******************************************************************************


; Miscellaneous

TxBitLen    EQU   -4 + 1                ; Timer slices per serial bit transmit.
RxBitLen    EQU   -4 + 1                ; Timer slices per serial bit receive.
RxHalfBit   EQU   (RxBitLen / 4) + 1    ; Timer slices for a partial bit time.
                                        ;   Used to adjust the input sampling 
                                        ;   time point.

; Note:  TxBitLen and RxBitLen are kept separate in order to facilitate the
;   possibility of having different transmit and receive baud rates. The timer
;   would be set up to give four slices for the fastest baud rate, and the
;   BitLen for the slower channel would be set longer for the slower baud rate.
;   BitLen = -4 + 1 gives four timer interrupts per bit. BitLen = -8 + 1 would
;   give 8 slices, BitLen = -16 + 1 would give 16 slices, etc.

TxPin       BIT   P1.0                  ; RS-232 transmit pin (output).
RxPin       BIT   P1.5                  ; RS-232 receive pin (input).
RTS         BIT   P1.3                  ; RS-232 request to send pin (output).
CTS         BIT   P1.6                  ; RS-232 clear to send pin (input).
; Note: P1.1 and P1.2 are used to input the baud rate selection.


; RAM Locations

Flags       DATA  20h                   ; Miscellaneous bit flags (see below).
TxOn        BIT   Flags.0               ; Indicates transmitter is on (busy).
RxOn        BIT   Flags.1               ; Indicates receiver is on (busy).
TxFull      BIT   Flags.2               ; Transmit buffer (1 byte only) is full.
RxFull      BIT   Flags.3               ; Receiver buffer is full.
RxAvail     BIT   Flags.4               ; RX buffer is not empty.
OverrunErr  BIT   Flags.6               ; Overrun error flag.
FramingErr  BIT   Flags.7               ; Framing error flag.

BaudHigh    DATA  21h                   ; High byte timer value for baud rate.
BaudLow     DATA  22h                   ; Low byte timer value for baud rate.

TxCnt       DATA  23h                   ; RS-232 byte transmit bit counter.
TxTime      DATA  24h                   ; RS-232 transmit time slice count.
TxShift     DATA  25h                   ; Transmitter shift register.
TxDat       DATA  26h                   ; Transmitter holding register.

RxCnt       DATA  27h                   ; RS-232 byte receive bit counter.
RxTime      DATA  28h                   ; RS-232 receive time slice count.
RxShift     DATA  29h                   ; Receiver shift register.
RxDatCnt    DATA  2Ah                   ; Received byte count.
RxBuf       DATA  2Bh                   ; Receive buffer (3 bytes long).

Temp        DATA  2Fh                   ; Temporary holding register.


;*******************************************************************************
;                                Interrupt Vectors
;*******************************************************************************

            ORG   00h                   ; Reset vector.
            AJMP  RESET


            ORG   03h                   ; External interrupt 0
            AJMP  Intr0                 ; (received RS-232 start bit).


            ORG   0Bh                   ; Timer 0 overflow interrupt.
            AJMP  Timer0                ; (4X the RS-232 bit rate).
        
            ORG   13h                   ; External interrupt 1.
            RETI                        ; (not used).

            ORG   1Bh                   ; Timer I interrupt.
            RETI                        ; (not used).

            ORG   23h                   ; I2C interrupt.
            RETI                        ; (not used).


;*******************************************************************************
;                               Interrupt Handlers
;*******************************************************************************


; External Interrupt Int0.
;   RS-232 start bit transition.

Intr0:      PUSH  ACC                   ; Save accumulator,
            PUSH  PSW                   ;   and status.
            CLR   IE.0                  ; Disable more RX interrupts.

            SETB  RxOn                  ; Set receive active flag.
            MOV   RxCnt,#11h            ; Set bit counter to expect a start.
            MOV   RxTime,#RxHalfBit     ; First sample is at a partial bit time.
            JB    TxOn,I0TimerOn        ; If TX active then timer is on.

            MOV   RTH,BaudHigh          ; Set up timer for selected baud rate.
            MOV   RTL,BaudLow
            MOV   TH,BaudHigh
            MOV   TL,BaudLow
            SETB  TR                    ; Start timer 0.

I0TimerOn:  MOV   A,RxDatCnt            ; Check for buffer about to be full:
            CJNE  A,#2,Int0Ex           ;   one space left and a byte starting.
            SETB  RTS                   ; If so, tell whoever is on the 
                                        ;   other end to wait.

Int0Ex:     POP   PSW                   ; Restore status,
            POP   ACC                   ;   and accumulator.
            RETI


; Timer 0 Interrupt
;   This is used to generate time slices for both serial transmit and receive
;   functions. 

Timer0:     PUSH  ACC                   ; Save accumulator,
            PUSH  PSW                   ;   and status.
            JNB   TxTime.7,RS232TX      ; Is this an active time slice
                                        ;   for an RS-232 transmit?
            JNB   TxOn,CheckRx          ; If transmit is active,
            INC   TxTime                ;   increment the time slice count.
CheckRx:    JNB   RxTime.7,RS232RX      ; Is this an active time slice 
                                        ;   for an RS-232 receive?
            JNB   RxOn,T0Ex             ; If receive is active, increment 
            INC   RxTime                ;   the time slice count.

T0Ex:       POP   PSW                   ; Restore status,
            POP   ACC                   ;   and accumulator.

            MOV   P3,Flags              ; For demo purposes, output status 
                                        ;   on an extra port.
            RETI



;*******************************************************************************
;                             RS-232 Transmit Routine
;*******************************************************************************


RS232TX:    JNB   TxCnt.4,TxData        ; Go if data bit.
            JNB   TxCnt.0,TxStop        ; Go if stop bit.


; Send start bit and do buffer housekeeping.

TxStart:    JB    CTS,TxEx1             ; Is CTS asserted (low) so can we send?  
                                        ;   If not, try again after 1 bit time.
            CLR   TxPin                 ; Set start bit.
            MOV   TxShift,TxDat         ; Get byte to transmit  from buffer.
            CLR   TxFull
            MOV   TxCnt,#08h            ; Init bit count for 8 bits of data.
                                        ;   (note: counts UP).

TxEx1:      MOV   TxTime,#TxBitLen      ; Reset time slice count.
            SJMP  CheckRx               ; Restore state and exit.


; Send Next Data Bit.

TxData:     MOV   A,TxShift             ; Get un-transmitted bits.
            RRC   A                     ; Shift next TX bit to carry.
            MOV   TxPin,C               ; Move carry out to the TXD pin.
            MOV   TxShift,A             ; Save bits still to be TX'd.

            INC   TxCnt                 ; Increment TX bit counter
            MOV   TxTime,#TxBitLen      ; Reset time slice count.
            SJMP  CheckRx               ; Restore state and exit.


; Send Stop Bit and Check for More to Send.

TxStop:     SETB  TxPin                 ; Send stop bit.
            JB    TxFull,TxEx2          ; More data to transmit?
            CLR   TxOn                  ; If not, turn off TX active flag, and
            CLR   RTS                   ;   make sure that whoever is on the
                                        ;   other end knows it's OK to send.

            JB    RxOn,TxEx2            ; If receive active, timer stays on,
            CLR   TR                    ;   otherwise turn off timer.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人一级片在线观看| 日韩区在线观看| 国产一区二区视频在线| 自拍偷拍国产精品| 亚洲精品一区二区三区99| 在线视频你懂得一区二区三区| 麻豆视频一区二区| 丝袜美腿亚洲色图| 亚洲一区在线视频观看| 国产精品嫩草影院av蜜臀| 欧美电影免费观看高清完整版在线| 精品一区精品二区高清| 亚洲欧美国产高清| 亚洲人成在线播放网站岛国| 久久伊人蜜桃av一区二区| 欧美日本在线播放| 欧美日韩不卡视频| 欧美三电影在线| 欧美中文字幕亚洲一区二区va在线| 国产999精品久久| 国产精品亚洲一区二区三区在线| 激情五月婷婷综合网| 免费成人深夜小野草| 日韩精品国产欧美| 日韩精品亚洲一区二区三区免费| 亚洲一区视频在线观看视频| 亚洲蜜桃精久久久久久久| 国产精品久久久久永久免费观看| 欧美激情一区二区| 国产精品久久久久久久久动漫| 国产欧美一区二区精品秋霞影院| 国产三级欧美三级日产三级99| 欧美日韩dvd在线观看| 欧美性受xxxx| 日韩午夜在线观看| 久久亚洲综合av| 欧美国产精品v| 亚洲天堂av一区| 亚洲一区二区在线免费看| 亚洲电影一区二区| 精久久久久久久久久久| 成人综合婷婷国产精品久久蜜臀| av午夜一区麻豆| 欧美视频中文字幕| 精品免费国产一区二区三区四区| 精品国产91久久久久久久妲己 | 另类小说色综合网站| 国产激情91久久精品导航| 麻豆精品久久精品色综合| 日本人妖一区二区| 蜜桃视频一区二区三区在线观看| 国产乱子轮精品视频| www.亚洲色图.com| 欧美精品 日韩| 中文字幕久久午夜不卡| 亚洲国产cao| 国产成人99久久亚洲综合精品| 黄页网站大全一区二区| 91毛片在线观看| 精品久久久久久亚洲综合网| 国产精品高潮久久久久无| 视频一区二区中文字幕| 国产91精品露脸国语对白| 欧美性三三影院| 国产亲近乱来精品视频| 亚洲激情欧美激情| 国产成人在线网站| 在线不卡免费欧美| 亚洲色图20p| 国产成人av自拍| 在线成人av网站| 亚洲人成网站色在线观看| 激情综合五月天| 欧美精品丝袜中出| 亚洲免费视频成人| 国产精品综合在线视频| 欧美一级黄色大片| 国产亚洲欧美一级| 蜜臀精品一区二区三区在线观看| 99精品视频中文字幕| 日韩一级片在线观看| 亚洲一区二区黄色| 99riav久久精品riav| 国产色产综合产在线视频| 欧美aaa在线| 欧美福利一区二区| 亚洲一区二区av在线| 91麻豆免费视频| 国产精品伦理在线| 国产乱理伦片在线观看夜一区| 91精品国产手机| 国产精品国产自产拍高清av王其 | 亚洲一区二区精品久久av| 国产在线视视频有精品| 日韩一本二本av| 久草在线在线精品观看| 欧美一级在线视频| 久久国产精品无码网站| 日韩精品一区二区三区三区免费| 日产国产高清一区二区三区| 欧美人伦禁忌dvd放荡欲情| 亚洲国产成人av好男人在线观看| 欧洲亚洲国产日韩| 五月婷婷激情综合| 欧美日本在线一区| 免费观看久久久4p| 久久综合久久99| 成人激情小说网站| 亚洲精品亚洲人成人网| 色丁香久综合在线久综合在线观看| |精品福利一区二区三区| 91小视频在线| 亚洲高清三级视频| 欧美一级片在线观看| 久久se精品一区精品二区| 欧美精品一区二区三区久久久| 国产精品一区二区黑丝| 中文一区在线播放| 91女神在线视频| 五月婷婷综合网| 精品国精品国产| 91视频在线观看免费| 亚洲mv在线观看| 欧美白人最猛性xxxxx69交| 国产精品综合网| 一区二区三区免费看视频| 欧美精品成人一区二区三区四区| 久久精品72免费观看| 欧美国产在线观看| 欧美午夜一区二区| 国产乱子伦一区二区三区国色天香| 国产精品美女久久久久av爽李琼 | 精品国产伦一区二区三区观看方式 | 国产不卡视频一区二区三区| 亚洲丝袜精品丝袜在线| 欧美日韩一二三区| 天堂精品中文字幕在线| 欧美激情综合在线| 色噜噜夜夜夜综合网| 亚洲国产精品久久久久秋霞影院| 久久免费看少妇高潮| 欧美在线一区二区三区| 国产伦精品一区二区三区免费迷| 亚洲综合一二区| 国产日韩亚洲欧美综合| 欧美日韩黄色一区二区| 成人性生交大片免费看中文| 日本网站在线观看一区二区三区 | 久久综合九色综合欧美就去吻| 96av麻豆蜜桃一区二区| 精品亚洲免费视频| 亚洲国产精品综合小说图片区| 久久久久久久网| 欧美一区二区三区视频在线观看| 99国产精品久久久久久久久久 | 精品少妇一区二区三区免费观看| 播五月开心婷婷综合| 亚洲电影第三页| 亚洲国产激情av| 久久综合九色综合97婷婷| 欧美日本在线看| 欧美无乱码久久久免费午夜一区| 成人福利在线看| 国产精品系列在线观看| 日韩电影一区二区三区四区| 亚洲欧美视频一区| 综合欧美一区二区三区| 欧美激情综合在线| 国产人久久人人人人爽| 国产欧美1区2区3区| 精品福利av导航| www激情久久| 免费成人在线网站| 国产精品久久影院| 亚洲自拍偷拍麻豆| 六月丁香综合在线视频| 国内偷窥港台综合视频在线播放| 成+人+亚洲+综合天堂| 色婷婷国产精品综合在线观看| 欧美精品久久一区二区三区| 精品久久久久久久久久久院品网| 欧美国产综合色视频| 亚洲成av人**亚洲成av**| 久久成人麻豆午夜电影| 91在线观看下载| 日韩一区二区三区三四区视频在线观看 | 国产成人综合精品三级| 在线欧美日韩精品| 久久久另类综合| 天堂av在线一区| a在线播放不卡| 欧美一区二区免费观在线| 国产精品美日韩| 美女mm1313爽爽久久久蜜臀| 成+人+亚洲+综合天堂| 精品国产网站在线观看| 亚洲一二三区在线观看| 风间由美一区二区三区在线观看| 欧美挠脚心视频网站| 日韩久久一区二区|