To Generate 38 Khz, 1/3Duty Signal Through P3.1 - Samsung S3F80JB User Manual

8-bit cmos microcontrollers
Table of Contents

Advertisement

COUNTER A
PROGRAMMING TIP — To generate 38 kHz, 1/3duty signal through P3.1
This example sets Counter A to the repeat mode, sets the oscillation frequency as the Counter A clock source,
and CADATAH and CADATAL to make a 38 kHz, 1/3 Duty carrier frequency. The program parameters are:
— Counter A is used in repeat mode
— Oscillation frequency is 4 MHz (0.25 µs)
— CADATAH = 8.795 µs / 0.25 µs = 35.18, CADATAL = 17.59 µs / 0.25 µs = 70.36
— Set P3.1 C-MOS push-pull output and CAOF mode.
— 44 pin package
ORG
START:
DI
LD
LD
LD
LD
LD
12-6
8.795 us
17.59 us
37.9 kHz 1/3 duty
0100H
CADATAL,#(70-2)
CADATAH,#(35-2)
P3CON,#11110010B
CACON,#00000110B
P3,#80H
; Reset address
; Set 17.5 ms
; Set 8.75 ms
;
; Set P3 to C-MOS push-pull output.
; Set P3.1 to REM output
;
; Clock Source → Fosc
; Disable Counter A interrupt.
; Select repeat mode for Counter A.
; Start Counter A operation.
; Set Counter A Output Flip-flop(CAOF) high.
;
; Set P3.7(Carrier On/Off) to high.
; This command generates 38 kHz, 1/3duty pulse signal
; through P3.1
;
S3F80JB

Advertisement

Table of Contents
loading

Table of Contents