Samsung S3C84E5 user manual Org, 0100H Reset address, Start DI, P4CONLH,#03H, 11-9

Models: S3C84E5

1 316
Download 316 pages 61.65 Kb
Page 253
Image 253

S3C84E5/C84E9/P84E9

8-BIT TIMER A/B

 

 

FPROGRAMMING TIP — To Generate 38 kHz, 1/3duty signal through P4.3

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:

8.795 μs

17.59 μs

37.9 kHz 1/3 Duty

Timer B is used in repeat mode

Oscillation frequency is 16 MHz (0.0625 μs), fx=fxx/4=4MHz (0.25 μs)

TBDATAH = 8.795 μs/0.25 μs = 35.18, TBDATAL = 17.59 μs/0.25 μs = 70.36

Set P4.3 to TBPWM mode.

ORG

0100H

; Reset address

START DI

 

 

 

 

 

 

 

 

 

LD

TBDATAL,#(35-1)

;

Set 17.5 μs

LD

TBDATAH,#(70-1)

;

Set 8.75 μs

LD

TBCON,#00100111B

;

Clock Source fxx/4

;Disable Timer B interrupt.

;Select repeat mode for Timer B.

;Start Timer B operation.

;Set Timer B Output flip-flop (T-FF) high.

LD

P4CONLH,#03H

; Set P4.3 to TBPWM mode.

;This command generates 38 kHz, 1/3 duty pulse signal through P4.3.

11-9

Page 253
Image 253
Samsung S3C84E5 user manual Org, 0100H Reset address, Start DI, P4CONLH,#03H, 11-9