
S3C8248/C8245/P8245/C8247/C8249/P8249
8-BIT TIMER A/B
11-9
+
+
PROGRAMMING TIP — To generate 38 kHz, 1/3duty signal through P3.0
This example sets Timer B to the repeat mode, sets the oscillation frequency as the Timer B clock source, and
TBDATAH and TBDATAL to make a 38 kHz,1/3 Duty carrier frequency. The program parameters are:
17.59
µ
s
37.9 kHz 1/3 Duty
8.795
µ
s
— Timer B is used in repeat mode
— Oscillation frequency is 4 MHz (0.25
µ
s)
— TBDATAH = 8.795
µ
s/0.25
µ
s = 35.18, TBDATAL = 17.59
µ
s/0.25
µ
s = 70.36
— Set P3.0 to TBPWM mode.
ORG
0100H
; Reset address
START
DI
•
•
•
LD
TBDATAL,#(70-2)
; Set 17.5
µ
s
LD
TBDATAH,#(35-2)
; Set 8.75
µ
s
LD
TBCON,#00000110B
; Clock Source
←
fxx
; Disable Timer B interrupt.
; Select repeat mode for Timer B.
; Start Timer B operation.
; Set Timer B Output flip-flop (TBOF) high.
;
LD
P3CONL,#02H
; Set P3.0 to TBPWM mode.
; This command generates 38 kHz, 1/3 duty pulse signal
through P3.0.
•
•
•
Summary of Contents for C8245
Page 31: ...ADDRESS SPACES S3C8248 C8245 P8245 C8247 C8249 P8249 2 20 NOTES ...
Page 107: ...INTERRUPT STRUCTURE S3C8248 C8245 P8245 C8247 C8249 P8249 5 18 NOTES ...
Page 195: ...INSTRUCTION SET S3C8248 C8245 P8245 C8247 C8249 P8249 6 88 NOTES ...
Page 221: ...I O PORTS S3C8248 C8245 P8245 C8247 C8249 P8249 9 16 NOTES ...
Page 245: ...16 BIT TIMER 0 1 S3C8248 C8245 P8245 C8247 C8249 P8249 12 10 NOTES ...
Page 249: ...WATCH TIMER S3C8248 C8245 P8245 C8247 C8249 P8249 13 4 NOTES ...
Page 267: ...A D CONVERTER S3C8248 C8245 P8245 C8247 C8249 P8249 15 6 NOTES ...
Page 299: ...S3P8245 P8249 OTP S3C8248 C8245 P8245 C8247 C8249 P8249 21 8 NOTES ...
Page 307: ......
Page 309: ......
Page 311: ......
Page 313: ......