Program 11

Nasza ocena:

3
Wyświetleń: 861
Komentarze: 0
Notatek.pl

Pobierz ten dokument za darmo

Podgląd dokumentu
Program 11 - strona 1 Program 11 - strona 2

Fragment notatki:


;==============================================================================
;Listing 7.11 Procedura nadawania ramki danyvh przez intrefejs RS232
;==============================================================================
tx_out ;procedura nadawania ramki RS
movwf tx_teg ;wpisz dane do tx_reg
movlw .9 movwf licznik ;licznik bitow (8+1)
bcf status, c ;przygotuj bit startu
loop btfss status, c ;sprawdz c
bcf out ;wyslij 0
btfsc status, c ;sprawdz c
bsf out ;wyslij 1
rrf tx_reg, f ;przesun bit do c
call del_tb ;opoznienie 1 tb
decfsz licznik, f ;czy wszystkie bity
goto loop ;nie; nadaj kolejny bit
;pierwszy bit stopu
bsf out ;wyslij bit stopu
call del_6 ;opoznienie wyrownawcze (6 cm)
call del_tb ;opoznienie 1 tb
;drugi bit stopu
bsf out ;wyslij bit stopu
call del_6 ;opoznienie wyrownawcze (6 cm)
call del_tb ;opoznienie 1 tb
return
del_tb ;opoznienie 1 tb
movlw ntb ;ntb - w
movwf del_reg ;ntb - del_reg
decfsz del_reg, f ;dekrementuj del_reg do 0
goto $-1 ; return
del_6 ;opoznienie 6 cykli maszynowych
goto $+1 ;opoznienie 2 cykle
return
... zobacz całą notatkę



Komentarze użytkowników (0)

Zaloguj się, aby dodać komentarz