TIMER Registers: Difference between revisions

Neimod (talk | contribs)
Created page with "== Registers == {| class="wikitable" border="1" ! NAME ! PHYSICAL ADDRESS ! WIDTH |- | REG_TM0VAL | 0x10003000 | 2 |- | REG_TM0CNT | 0x10003002 | 2 |- | REG_TM1VAL | 0x1000300..."
 
Kernel9 treats F/64 as (ARM 9 clockrate)/128
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Registers ==
There are 4 timers. These timers run at a frequency of 67,027,964.0 ± 2<sup>-32</sup> Hz (i.e. exactly half the ARM9 clock frequency).
 
= Registers =
{| class="wikitable" border="1"
{| class="wikitable" border="1"
NAME
Old3DS
PHYSICAL ADDRESS
Name
WIDTH
Address
|-
!  Width
| REG_TM0VAL
!  Used by
| 0x10003000
| 2
|-
| REG_TM0CNT
| 0x10003002
| 2
|-
| REG_TM1VAL
| 0x10003004
| 2
|-
| REG_TM1CNT
| 0x10003006
| 2
|-
| REG_TM2VAL
| 0x10003008
| 2
|-
|-
| REG_TM2CNT
| style="background: green" | Yes
| 0x1000300A
| [[#TIMER_VAL|TIMER_VAL]](n)
| 0x10003000 + 4*n
| 2
| 2
| Boot9, Kernel9
|-
|-
| REG_TM3VAL
| style="background: green" | Yes
| 0x1000300C
| [[#TIMER_CNT|TIMER_CNT]](n)
| 2
| 0x10003002 + 4*n
[[Link title]]|-
| REG_TM3CNT
| 0x1000300E
| 2
| 2
| Boot9, Kernel9
|}
|}


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


= Timer control =
== TIMER_CNT ==
{| class="wikitable" border="1"
{| class="wikitable" border="1"
BIT
Bit
DESCRIPTION
Description
|-
|-
| 0-1
| 1-0
| Prescaler select (0=F/1, 1=F/64, 2=F/256, 3=F/1024)
| Prescaler select (0=F/1, 1=F/64, 2=F/256, 3=F/1024)
|-
|-
Line 52: Line 36:
| Count-up (0=Disabled, 1=Enabled)
| Count-up (0=Disabled, 1=Enabled)
|-
|-
| 3-5
| 5-3
| Not used
| Not used
|-
|-
Line 62: Line 46:
|}
|}


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