Samsung S3C84E5 Microphone User Manual


 
8-BIT TIMER A/B S3C84E5/C84E9/P84E9
11-10
F PROGRAMMING TIP To generate a one pulse signal through P4.3
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:
40
µ
s
Timer B is used in one shot mode
Oscillation frequency is 4 MHz (fx=1/4 clock = 1 µs)
TBDATAH = 40 µs / 1 µs = 40, TBDATAL = 1
Set P4.3 to TBPWM mode
ORG 0100H ; Reset address
START DI
LD TBDATAH,# (40-1) ; Set 40 µs
LD TBDATAL,# 1 ; Set any value except 00H
LD TBCON,#00010001B ; Clock Source fxx/4
; Disable Timer B interrupt.
; Select one shot mode for Timer B.
; Stop Timer B operation.
; Set Timer B output flip-flop (T-FF) high
LD P4CONL, #03H ; Set P4.3 to TBPWM mode.
PULSE_OUT:LD TBCON,#00000101B ; 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.