English
Language : 

TMP86CM74AFG Datasheet, PDF (139/182 Pages) Toshiba Semiconductor – 8 Bit Microcontroller
TMP86CM74AFG
Example :Example of setting the transmit/receive mode
(transmit/receive mode, external clock, and 32-byte transfer)
START:
; Sets the transmit/receive mode, selects the direction of transfer,
LD
(SIOCR1), 00100111B
and sets a serial clock.
LD
(SIOCR2), 00011111B
; Sets the number of bytes (32 bytes) to transfer.
Transmit data set-
;
ting:
LD
(SIOCR1), 10100111B
; Starts transferring.
INTSIO (INTSIO
service routine):
LD
(SIOCR1), 00100111B
; Directs the SIO to stop transferring.
TEST
(SIOSR). 3
; Checks TXERR.
JRS
T, TXNOERR
LD
(SIOCR1), 01100111B
; Forces the SIO to halt (clears TXERR).
:
Error handling
:
JR
END
TXNOER:
:
Receive-data reading
Checks a checksum or the
like to see if the received
data are correct.
:
LD
(SIOCR1), 01100111B
; Forces the SIO to halt.
END:
; End of transfer
Page 129