Texas-instruments TMS320C3x Manual do Utilizador Página 393

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 757
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 392
Timers
12-14
2) Configure the timer through the timer global-control register (with GO =
HLD = 0 ), the timer-counter register, and timer-period register, if necessary.
3) Start the timer by setting the GO/HLD bits of the timer global-control register.
Example 12–2 shows how to set up the ‘C3x timer to generate the maximum
clock frequency through the TCLKx pin.
Example 12–2. Maximum Frequency Timer Clock Setup
* Maximum Frequency Timer Clock Setup
*
.data
Timer0 .word 808020h ; Timer global control address
TCTRL_RST .word 301h
TCTRL_GD .word 3C1h
TCNT .word 0 ; Timer counter value
TPRD .word 0 ; Timer-period value
.text
.
.
.
LDP Timer0
LD1 @Timer0,AR0 ; Load data page pointer
LD1 0,R0
ST1 R0,*AR0 ; Halt timer
LD1 @TCTRL_RST,R0 ; Configure timer
ST1 R0,*AR0
LD1 @TCNT,R0
ST1 R0,*+AR0(4) ; Load timer counter
LD1 @TPRD,R0
ST1 R0,**+AR0(8) ; Load timer period
LD1 @TCTRL_G0,R0
ST1 R0,*AR0 ; Start timer
Vista de página 392
1 2 ... 388 389 390 391 392 393 394 395 396 397 398 ... 756 757

Comentários a estes Manuais

Sem comentários