CS2261_23_timers

CS2261_23_timers - CS 2261 Timers Common Practice Game...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 2261 Timers
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Common Practice Game timing is normally synchronized with the vertical blank. For certain applications such as precise DMA transfers involving sound, timers are used. Timers are also sometimes used in profiling studies, that is, determining how much time is spent in executing different portions of code.
Background image of page 2
GBA Timers Trigger an event after a duration, or hold the elapsed time since started 4 timers available 4 different speeds/frequencies Can be chained together to create longer timers
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Timer Layout FREQ OV IR ON 0 0 0 0 0 0 0 0 0000000000000000 REG_TMxCNT REG_TMxD 0 0 0 0 0 0 0 0 0000000000000000 0 0 0 0 0 0 0 0 0000000000000000 0 0 0 0 0 0 0 0 0000000000000000
Background image of page 4
Timer Registers Timer register holds number of elapsed timer ticks 16 bits 0 through 65535 ticks, then overflow or reset Timer control register sets frequency, overflow, and enables timers
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
REG_TMxCNT Bits 0-1: Frequency See next slides 2: Toggle overflow from previous timer #define TM_CASCADE (1<<2) 6: Generate interrupt when timer register is full #define TM_IRQ (1<<6) 7: Enable timer #define TM_ON (1<<7)
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 18

CS2261_23_timers - CS 2261 Timers Common Practice Game...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online