Maxim-integrated MAXQ Family Users Guide: MAXQ2010 Supplement Uživatelský manuál Strana 123

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 147
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 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
Zobrazit stránku 122
1 2 ... 118 119 120 121 122 123 124 125 126 127 128 ... 146 147

Komentáře k této Příručce

Žádné komentáře