Download Print this page

Samsung S3C8248 User Manual page 235

8-bit cmos

Advertisement

8-BIT TIMER A/B
+ +
PROGRAMMING TIP — To generate a one pulse signal through P3.0
This example sets Timer B to the one shot mode, sets the oscillation frequency as the Timer B clock source, and
TBDATAH and TBDATAL to make a 40 µs width pulse. The program parameters are:
— Timer B is used in one shot mode
— Oscillation frequency is 4 MHz (1 clock = 0.25 µs)
— TBDATAH = 40 µs / 0.25 µs = 160, TBDATAL = 1
— Set P3.0 to TBPWM mode
ORG
START
DI
LD
LD
LD
LD
LD
Pulse_out:
11-10
0100H
TBDATAH,# (160-2)
TBDATAL,# 1
TBCON,#00000001B
P3CONL, #02H
TBCON,#00000101B
S3C8248/C8245/P8245/C8247/C8249/P8249
40 µ s
; Reset address
; Set 40 µs
; Set any value except 00H
; Clock Source ← f
OSC
; Disable Timer B interrupt.
; Select one shot mode for Timer B.
; Stop Timer B operation.
; Set Timer B output flip-flop (TBOF) high
; Set P3.0 to TBPWM mode.
; Start Timer B 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.

Advertisement

loading

This manual is also suitable for:

C8245P8245C8249C8247P8249