Cirrus-logic AN118 Uživatelský manuál Strana 30

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 32
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 29
AN118
30 AN118REV2
;****************************************************************
;* Routine - TXSER
;* Input - Byte to be transmitted is placed in R7
;* Output - None
;* Description - This subroutine transfers 1 byte from converter
;* via UART. It uses the RS-232 serial protocol to transmit
;* one byte from a 80C51 to the PC/UART system. To
;* function properly, the programmer must first initialize the
;* TI bit in the SCON register to 0X01.
;****************************************************************
;The function prototype is: void TXSER(char);
$DEBUG
USING 0 ; Use register bank 0
TCOD SEGMENT CODE ; Define TCOD as a segment of code
PUBLIC _TXSER ; Make subroutine global
RSEG TCOD ; Make code relocatable
_TXSER: JNB SCON.1,$ ; Poll TI
CLR SCON.1 ; Reset TI
MOV SBUF, R7 ; Move byte to output register
RET ; Exit subroutine
END
Zobrazit stránku 29
1 2 ... 25 26 27 28 29 30 31 32

Komentáře k této Příručce

Žádné komentáře