CHAPTER 6 PERIPHERAL HARDWARE FUNCTION
171
Users Manual U10676EJ3V0UM
<Program example>
In the following example, it is assumed that the output latch of the PTO2 pin is cleared to 0 and that
the output mode has been set. It is also assumed that the carrier clock is generated with the status of
the program in the preceding example (2).
; SEND_CARIER_DATA_PRO
SEL MB15 ; or CLR1 MBE
MOV HL, #00H ; Sets pointer of BSB (bit sequential buffer) to L.
Uses H as bit data temporary saving area of BSB
; CG_Init & Send_1st_Data
MOV XA, #48H
MOV TMOD1, XA ; Sets modulo register (carrier clock output period)
MOV XA, #00000000B ; Enables output of carrier clock, and initializes NRZB and
NRZ to 0
MOV TC2, XA
SET1 NRZ ; Sets no return zero flag to 1
MOV XA, #01101100B ; Selects count pulse and 8-bit timer counter mode
MOV TM1, XA ; Enables timer counter operation and issues timer start
command
; Send_1st_Data
CALL !GET_DATA ; Gets data from BSB
CALL !SEND_D_0 ; Outputs carrier with data 0 and 1 and first low level output
period setting processing
SKE H, #1H ; If bit 0 is 1, proceeds to second additional processing of low
level output period
BR SEND_1_F ; If bit 0 is 0, outputs low level and transfers control to search
of next data
CALL !SEND_D_1 ; Second additional processing of low level output period.
Transfers control to data transmission processing of BSB
bit 0-F with PTO2 pin outputting low
; SEND_1_F: ; Data transmission processing of bit 0-F of BSB
SET1 NRZB ; Sets NRZB to 1 so that carrier of data to be transmitted next
is output by IRQT1 generated next during low level output
period of preceding data
INCS L ; Counts data being transmitted and ends data transmission
when L changes from 0FH to 0H
BR LOOP_C_0
BR SEND_END
LOOP_C_0: SKTCLR IRQT1 ; Waits for low level output of preceding data (confirmation
of end of preceding data)
BR LOOP_C_0
; Starts carrier output
CLR1 NRZB ; Clears NRZB to 0 in advance so that first low level output
is performed by IRQT1 generated next
CALL !GET_DATA
CALL !SEND_D_0
SKE H, # 1H ; If data obtained is 1, proceeds to second additional processing
of low level output period (SEND_D_1)