NEC PD754144 User Manual page 171

4-bit single-chip microcontrollers
Table of Contents

Advertisement

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

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pd754244

Table of Contents