beautypg.com

8 exenb control during pwm/output control mode, 3 timer b examples, 1 timer b example: reloading timer mode – Maxim Integrated MAXQ Family Users Guide: MAXQ8913 Supplement User Manual

Page 86: 8 exenb control during pwm/output control mode -11, 3 timer b examples -11, 1 timer b example: reloading timer mode -11, Maxq family user’s guide: maxq8913 supplement

background image

MAXQ Family User’s Guide:

MAXQ8913 Supplement

21-11

21.2.8 EXENB Control During PWM/Output Control Mode

The TB0B input function (EXENB = 1) and the PWM/output control function (TBCS:TBCR<>00b) can be enabled at
the same time. However, the input function changes slightly when this is done. In this configuration, the detection of a
falling edge on the TB0B pin results in setting of the EXFB interrupt flag, but does not force an autoreload.

21.3 Timer B Examples

21.3.1 Timer B Example: Reloading Timer Mode

move PD5.2, #1

; Set P5.2 to output mode

move PO5.2, #1

; Drive high (LED off)

move TBCN, #0000010000000000b ; Timer mode, reload mode, clock/256

move TBR, #8000h

; Reload every 8000h timer cycles

move TBCN.2, #1

; Start timer

;; Reload time is 1/sysclk * 256 * 8000h == 838ms

timerLoop:

move C, TBCN.7

; Check reload flag

jump NC, timerLoop

move TBCN.7, #0

; Clear reload flag

move Acc, PO5

xor #0100b

; Toggle bit 2

move PO5, Acc

jump timerLoop

Maxim Integrated