![Samsung S3P80C5 User Manual Download Page 244](http://html1.mh-extra.com/html/samsung/s3p80c5/s3p80c5_user-manual_3993739244.webp)
S3P80C5/C80C5/C80C8
COUNTER A
12-7
F
F
PROGRAMMING TIP — To Generate a One Pulse Signal Through P2.1
This example sets Counter A to the one shot mode, sets the oscillation frequency as the Counter A clock source,
and CADATAH and CADATAL to make a 40
µ
s width pulse. The program parameters are:
40
µ
s
— Counter A is used in one shot mode
— Oscillation frequency is 4 MHz (1 clock = 0.25
µ
s)
— CADATAH = 40
µ
s / 0.25
µ
s = 160, CADATAL = 1
— Set P2.1 C-MOS push-pull output and CAOF mode.
ORG
0100H
; Reset address
START
DI
•
•
LD
CADATAH,# (160-2)
; Set 40
µ
s
LD
CADATAL,# 1
; Set any value except 00H
;
LD
P2CON,#10101010B
; Set P2 to C-MOS push-pull output.
; Set P2.1 to REM output
;
LD
CACON,#00000001B
; Clock Source
←
f
OSC
; Disable Counter A interrupt.
; Select one shot mode for Counter A.
; Stop Counter A operation.
; Set Counter A Output flip-flop (CAOF) high
LD
P2,#20H
; Set P2.5(Carrier On/Off) to high.
•
•
•
Pulse_out:
LD
CACON,#00000101B
; Start Counter A operation
; to make the pulse at this point.
•
; After the instruction is executed, 0.75
µ
s is required
•
; before the falling edge of the pulse starts.
•
Summary of Contents for S3P80C5
Page 2: ...S3P80C5 C80C5 C80C8 8 BIT CMOS MICROCONTROLLERS USER S MANUAL Revision 1 ...
Page 5: ......
Page 13: ......
Page 15: ......
Page 17: ......
Page 19: ......
Page 49: ...ADDRESS SPACES S3P80C5 C80C5 C80C8 2 20 NOTES ...
Page 197: ...INSTRUCTION SET S3P80C5 C80C5 C80C8 6 88 NOTES ...
Page 201: ...CLOCK CIRCUITS S3P80C5 C80C5 C80C8 7 4 NOTES ...
Page 237: ...TIMER 1 S3P80C5 C80C5 C80C8 11 6 NOTES ...
Page 245: ...COUNTER A S3P80C5 C80C5 C80C8 12 8 NOTES ...
Page 255: ......
Page 257: ......
Page 259: ......
Page 261: ......