TIMER Registers: Difference between revisions

From 3dbrew
Jump to navigation Jump to search
Line 1: Line 1:
== Registers ==
There are 3 timers.
 
= Registers =
{| class="wikitable" border="1"
{| class="wikitable" border="1"
NAME
Old3DS
PHYSICAL ADDRESS
Name
WIDTH
Address
!  Width
!  Used by
|-
|-
| REG_TM0VAL
| style="background: green" | Yes
| 0x10003000
| TIMER_VAL(n)
| 0x10003000 + 4*n
| 2
| 2
|
|-
|-
| REG_TM0CNT
| style="background: green" | Yes
| 0x10003002
| TIMER_CNT(n)
| 2
| 0x10003002 + 4*n
|-
| REG_TM1VAL
| 0x10003004
| 2
|-
| REG_TM1CNT
| 0x10003006
| 2
|-
| REG_TM2VAL
| 0x10003008
| 2
|-
| REG_TM2CNT
| 0x1000300A
| 2
|-
| REG_TM3VAL
| 0x1000300C
| 2
|-
| REG_TM3CNT
| 0x1000300E
| 2
| 2
|
|}
|}



Revision as of 23:42, 19 March 2015

There are 3 timers.

Registers

Old3DS Name Address Width Used by
Yes TIMER_VAL(n) 0x10003000 + 4*n 2
Yes TIMER_CNT(n) 0x10003002 + 4*n 2

Timer value

Writing to REG_TMxVAL loads a starting value for one of the 4 timers, while reading it will show the current timer value.

Timer control

REG_TMxCNT
BIT DESCRIPTION
0-1 Prescaler select (0=F/1, 1=F/64, 2=F/256, 3=F/1024)
2 Count-up (0=Disabled, 1=Enabled)
3-5 Not used
6 IRQ enable (0=Disabled, 1=IRQ on timer value overflow)
7 Start/Stop (0=Stop, 1=Start)

Count-up

When count-up is enabled, the timer value will increase every time the previous timer overflows.