Maxim-integrated MAXQ Family Users Guide: MAXQ2010 Supplement Bedienungsanleitung Seite 123

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 147
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 122
MAXQ Family Users Guide:
MAXQ2010 Supplement
21-12
21.2.8 EXENB Control During PWM/Output Control Mode
The TBB 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 fall-
ing edge on the TBB 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 TB0CN, #0000010000000000b ; Timer mode, reload mode, clock/256
move TB0R, #8000h ; Reload every 8000h timer cycles
move TB0CN.2, #1 ; Start timer
;; Reload time is 1/sysclk * 256 * 8000h == 838ms
timerLoop:
move C, TB0CN.7 ; Check reload flag
jump NC, timerLoop
move TB0CN.7, #0 ; Clear reload flag
move Acc, PO5
xor #0100b ; Toggle bit 2
move PO5, Acc
jump timerLoop
Seitenansicht 122
1 2 ... 118 119 120 121 122 123 124 125 126 127 128 ... 146 147

Kommentare zu diesen Handbüchern

Keine Kommentare