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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? dupuart.asm

?? 一個(gè)rs-232接口的程序
?? ASM
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):

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

;        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.

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成av人片一区二区三区 | 久久99国产精品免费| 美女www一区二区| 成人av网址在线| 欧美一级欧美三级| 国产精品国产精品国产专区不蜜 | 欧美激情一区不卡| 亚洲一区二区三区在线播放| 国产九九视频一区二区三区| 色婷婷久久99综合精品jk白丝| 欧美电影精品一区二区| 一区二区三区在线观看欧美| 日韩av电影免费观看高清完整版| 激情综合五月婷婷| 欧美私模裸体表演在线观看| 国产精品久久一级| 精品一区二区三区在线观看国产| 色综合久久久久综合体| 日本一区二区三区电影| 五月婷婷综合在线| 成人精品国产一区二区4080| 久久一夜天堂av一区二区三区| 亚洲国产成人91porn| 99精品视频在线免费观看| 精品国精品国产尤物美女| 亚洲v中文字幕| 在线观看欧美黄色| 国产精品系列在线| 东方aⅴ免费观看久久av| 亚洲精品在线免费观看视频| 免费看欧美女人艹b| 欧美高清视频不卡网| 亚洲人成7777| 91麻豆国产福利在线观看| 国产欧美视频在线观看| 国产一区二区三区久久久| 欧美成人猛片aaaaaaa| 日本成人超碰在线观看| 91精品视频网| 美女视频一区在线观看| 日韩精品一区二区三区中文精品| 日韩成人免费电影| 欧美一区二区三区系列电影| 青青国产91久久久久久 | 一级日本不卡的影视| 色老头久久综合| 亚洲愉拍自拍另类高清精品| 99九九99九九九视频精品| 伊人一区二区三区| 欧美色精品在线视频| 天堂av在线一区| 欧美xxxx老人做受| 国产在线国偷精品免费看| 国产欧美日韩精品在线| 99视频精品在线| 亚洲成人在线观看视频| 欧美一个色资源| 国产成人免费av在线| 国产精品视频一二| 在线观看成人免费视频| 视频在线在亚洲| 欧美日韩精品一区二区三区蜜桃| 国产精品久久久久影院亚瑟| 福利电影一区二区| 亚洲国产高清在线| 91一区一区三区| 综合久久国产九一剧情麻豆| 日本道免费精品一区二区三区| 国产精品婷婷午夜在线观看| 懂色av一区二区三区免费观看| 国产精品天天看| 视频一区二区中文字幕| 91精品国产综合久久久久| 精品av久久707| 久久日韩粉嫩一区二区三区| 国产精品一区二区三区乱码| 国产视频一区二区三区在线观看 | 在线观看日韩电影| 亚洲日韩欧美一区二区在线| 日本韩国精品在线| 亚洲成人动漫av| 国产精品一区在线| 中文字幕欧美三区| av资源站一区| 亚洲超碰97人人做人人爱| 91在线观看美女| 偷偷要91色婷婷| 久久久精品国产免费观看同学| 国产成人精品aa毛片| |精品福利一区二区三区| 91精品福利在线| 免费在线看一区| 日本一区二区三区在线不卡| 色吧成人激情小说| 午夜精品一区二区三区电影天堂| 日韩精品一区二区三区中文精品| 成人动漫一区二区| 亚洲一区二区精品久久av| 日韩欧美另类在线| 成人a级免费电影| 亚洲一区二区三区国产| 欧美一区二区播放| 福利一区在线观看| 亚洲国产乱码最新视频| 精品国产髙清在线看国产毛片| 国产一区91精品张津瑜| 一区二区三区日韩精品视频| 日韩欧美亚洲国产另类| 91色综合久久久久婷婷| 丝袜亚洲精品中文字幕一区| 欧美视频中文字幕| 国产精品亚洲午夜一区二区三区| 亚洲精品视频免费看| 欧美精品一区二区三区久久久| 成人精品视频一区二区三区| 青青草国产精品97视觉盛宴 | 中文字幕一区日韩精品欧美| 欧美一区二区三区在线视频| 午夜精品久久久久久久| 国产精品无遮挡| 日韩欧美三级在线| 在线观看不卡视频| 天堂影院一区二区| 亚洲蜜臀av乱码久久精品蜜桃| 国产无遮挡一区二区三区毛片日本| 精品视频在线视频| 国产在线精品一区二区夜色| 亚洲一区av在线| 尤物在线观看一区| 日本一区二区三区四区| 色老汉一区二区三区| www.爱久久.com| 国产不卡在线视频| 国产一区二区不卡老阿姨| 国产精品高潮呻吟久久| 国产婷婷色一区二区三区| 日韩精品中文字幕在线不卡尤物| 欧美日韩一区二区三区在线| 婷婷综合久久一区二区三区| 亚洲无人区一区| 一区二区三区av电影| 亚洲视频一区在线观看| 久久影院午夜片一区| 26uuu另类欧美亚洲曰本| 日韩欧美一二区| 日韩精品一区二区三区在线| 欧美精品色综合| 欧美高清www午色夜在线视频| 欧美三级一区二区| 在线免费观看日本一区| 亚洲福中文字幕伊人影院| 国产精品女主播在线观看| 日韩欧美综合一区| 久久久噜噜噜久噜久久综合| 色老汉一区二区三区| 丰满少妇在线播放bd日韩电影| 国产大陆a不卡| 色综合久久综合网欧美综合网| 99国产精品久| 99久久久免费精品国产一区二区| 99免费精品视频| av福利精品导航| 视频一区二区国产| 久久成人精品无人区| 久久99精品国产麻豆婷婷| 亚洲一二三区不卡| 水野朝阳av一区二区三区| 日本成人中文字幕| 国产一区二区在线看| 视频在线观看91| 久久av资源站| 99精品国产99久久久久久白柏| 一本到三区不卡视频| 国产高清亚洲一区| 91玉足脚交白嫩脚丫在线播放| 不卡视频在线看| 一本一本大道香蕉久在线精品 | 成人深夜福利app| 国产福利精品导航| 国产成人a级片| 国产在线播精品第三| 99国产欧美另类久久久精品| 8x8x8国产精品| 色老汉一区二区三区| 在线播放中文一区| 久久精品人人做人人爽人人| 亚洲图片激情小说| 亚洲国产日韩精品| 久久精品国产久精国产爱| 成人黄色av电影| 成人国产精品视频| 欧美视频一区二| 国产日韩视频一区二区三区| 亚洲一区二区三区视频在线| 亚洲v中文字幕| 99r国产精品| 国产亚洲精久久久久久| 亚洲一区二区四区蜜桃| 国产乱人伦偷精品视频免下载| 在线观看免费亚洲|