Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- TMS320C2x DSP - the tms320c2x provides a memory-mapped 16-bit timer (tim) register http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
      The TMS320C2x provides a memory-mapped 16-bit timer (TIM) register
      and a 16-bit period (PRD) register. The on-chip timer is a down
      counter that is continuously clocked by CLKOUT1 on the TMS320C25.
      The timer on the TMS32020 is clocked by a signal whose frequency is
      CLKOUT1 / 4 or whose period is 4 * CLKOUT1 cycles.

      The TIM register is set to the maximum value (>FFFF) on both the
      TMS32020 and the TMS320C25. The PRD register on the TMS320C25 is
      also initialized by reset to >FFFF. The TMS32020 requires a software
      initialization of the PRD register. The TIM register begins
      decrementing only after the reset signal is de-asserted. Following
      this, the TIM and PRD registers may be reloaded under program
      control.

      The TIM register, data memory location 2, holds the current count
      of the timer. At every N * CLKOUT1 cycle where N = 4 on the TMS32020
      and N = 1 on the TMS320C25, the TIM register is decremented by one.
      The PRD register, data memory location 3, holds the starting count
      of the timer. A timer interrupt (TINT) is generated every time the
      timer decrements to zero. The timer is reloaded with the value
      contained in the period (PRD) register within the next cycle after
      it reaches zero so that interrupts can be programmed to occur at
      regular intervals of (PRD + 1) cycles of CLKOUT1 on the TMS320C25
      and (4 * PRD) cycles of CLKOUT1 on the TMS32020. This feature is
      useful for control operations and for synchronously sampling or
      writing to peripherals. By programming the PRD register from 1 to
      65535 (>FFFF), a TINT can be generated every 2 to 65536 cycles on
      the TMS320C25. Note that on the TMS32020, a TINT can be generated
      every 4 to 262,140 cycles. A PRD register value of zero is not
      allowed.

      The timer and period registers can be read from or written to on any
      cycle. The count can be monitored by reading the TIM register. A new
      counter period can be written to the period register without
      disturbing the current timer count. The timer will then start the
      new period after the current count is complete. If both the PRD and
      TIM registers are loaded with a new period, the timer begins
      decrementing the new period without generating an interrupt. Thus,
      the programmer has complete control of the current and next periods
      of the timer.

      If the timer is not used, TINT should be masked or all maskable
      interrupts disabled by a DINT instruction. The PRD register can then
      be used as general-purpose data memory location. If TINT is used,
      the PRD and TIM registers should be programmed before unmasking the
      TINT.

See Also: reset system initialization

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson