Difference between revisions of "84PCE:Ports:7000"

From WikiTI
Jump to: navigation, search
(Created page with "7000 - Another Timer Another Timer == Synopsis == '''Port Number:''' 7000-? '''Function:''' Another timer...")
 
(Registers)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:84PCE:Ports:By_Address|7000 - Another Timer]] [[Category:84PCE:Ports:By_Name|Another Timer]]
+
[[Category:84PCE:Ports:By_Address|7000 - General-Purpose Timers]] [[Category:84PCE:Ports:By_Name|General-Purpose Timers]]
 
== Synopsis ==
 
== Synopsis ==
'''Port Number:''' 7000-?
+
'''Port Number:''' 7000-703F
  
'''Function:''' Another timer
+
'''Memory-mapped address:''' F20000
  
This range appears to provide another timer that runs when USB is connected. It probably has other functions.
+
'''Function:''' General-Purpose Timers
 +
 
 +
This range provides three general-purpose 32-bit timers (appears to be model FTTMR010). They can count up or down, and run at either 32768Hz or the CPU clock speed. The counters can generate interrupts either when looping or when matching one of two customizable values. The OS uses the third timer when USB is connected.
 +
 
 +
== Registers ==
 +
All registers are little-endian and cross multiple 8-bit ports.
 +
 
 +
{|-
 +
|<u>Timer 1</u>&nbsp;&nbsp;&nbsp;
 +
|<u>Timer 2</u>&nbsp;&nbsp;&nbsp;
 +
|<u>Timer 3</u>&nbsp;&nbsp;&nbsp;
 +
|<u>Bits, R/W?</u>&nbsp;&nbsp;&nbsp;
 +
|<u>Purpose</u>&nbsp;&nbsp;&nbsp;
 +
|<u>Description</u>&nbsp;&nbsp;&nbsp;
 +
|-
 +
|7000<br/>F20000
 +
|7010<br/>F20010
 +
|7020<br/>F20020
 +
|32-bit<br/>R/W
 +
|Counter register&nbsp;&nbsp;&nbsp;
 +
|Can be written directly, but it should be disabled first since the entire value cannot be written atomically.
 +
|-
 +
|7004<br/>F20004
 +
|7014<br/>F20014
 +
|7024<br/>F20024
 +
|32-bit<br/>R/W
 +
|Reset value&nbsp;&nbsp;&nbsp;
 +
|The counter is reloaded with this value once it reaches 0.
 +
|-
 +
|7008<br/>F20008
 +
|7018<br/>F20018
 +
|7028<br/>F20028
 +
|32-bit<br/>R/W
 +
|Match value 1&nbsp;&nbsp;&nbsp;
 +
|An interrupt will be generated when the counter matches this value.
 +
|-
 +
|700C<br/>F2000C
 +
|701C<br/>F2001C
 +
|702C<br/>F2002C
 +
|32-bit<br/>R/W
 +
|Match value 2&nbsp;&nbsp;&nbsp;
 +
|An interrupt will be generated when the counter matches this value.
 +
|-
 +
|7030<br/>F20030
 +
|<i>Same</i>
 +
|<i>Same</i>
 +
|12-bit<br/>R/W
 +
|Control register
 +
|-
 +
|&nbsp;&bull; Bit 0
 +
|&nbsp;&bull; Bit 3
 +
|&nbsp;&bull; Bit 6
 +
|
 +
|Timer enable
 +
|Set to enable the corresponding timer.
 +
|-
 +
|&nbsp;&bull; Bit 1
 +
|&nbsp;&bull; Bit 4
 +
|&nbsp;&bull; Bit 7
 +
|
 +
|Clock source
 +
|Set 1 for 32768&nbsp;Hz crystal, or 0 for CPU clock
 +
|-
 +
|&nbsp;&bull; Bit 2
 +
|&nbsp;&bull; Bit 5
 +
|&nbsp;&bull; Bit 8
 +
|
 +
|Interrupt enable&nbsp;&nbsp;&nbsp;
 +
|Set to generate an interrupt when the counter reaches 0.
 +
|-
 +
|&nbsp;&bull; Bit 9
 +
|&nbsp;&bull; Bit 10
 +
|&nbsp;&bull; Bit 11
 +
|
 +
|Count direction&nbsp;&nbsp;&nbsp;
 +
|Set to 1 to count up, or 0 to count down.
 +
|-
 +
|7034<br/>F20034
 +
|<i>Same</i>
 +
|<i>Same</i>
 +
|12-bit<br/>R/W
 +
|Interrupt status
 +
|Reads the cause of the interrupt. Write 1 bits to reset.
 +
|-
 +
|&nbsp;&bull; Bit 0
 +
|&nbsp;&bull; Bit 3
 +
|&nbsp;&bull; Bit 6
 +
|
 +
|Match 1&nbsp;&nbsp;&nbsp;
 +
|Set after the counter reaches match register 1.
 +
|-
 +
|&nbsp;&bull; Bit 1
 +
|&nbsp;&bull; Bit 4
 +
|&nbsp;&bull; Bit 7
 +
|
 +
|Match 2&nbsp;&nbsp;&nbsp;
 +
|Set after the counter reaches match register 2.
 +
|-
 +
|&nbsp;&bull; Bit 2
 +
|&nbsp;&bull; Bit 5
 +
|&nbsp;&bull; Bit 8
 +
|
 +
|Overflow&nbsp;&nbsp;&nbsp;
 +
|Set after the counter reaches 0 and gets reloaded, but only if enabled in the control register.
 +
|-
 +
|7038<br/>F20038
 +
|<i>Same</i>
 +
|<i>Same</i>
 +
|12-bit<br/>R/W
 +
|Interrupt mask?
 +
|Seems to have no effect on interrupt generation, despite being documented
 +
|-
 +
|7038<br/>F20038
 +
|
 +
|
 +
|32-bit<br/>R
 +
|Revision number
 +
|Reads a constant 0x00010801, which corresponds to revision 1.8.1.
 +
|}

Latest revision as of 17:20, 21 December 2015

Synopsis

Port Number: 7000-703F

Memory-mapped address: F20000

Function: General-Purpose Timers

This range provides three general-purpose 32-bit timers (appears to be model FTTMR010). They can count up or down, and run at either 32768Hz or the CPU clock speed. The counters can generate interrupts either when looping or when matching one of two customizable values. The OS uses the third timer when USB is connected.

Registers

All registers are little-endian and cross multiple 8-bit ports.

Timer 1    Timer 2    Timer 3    Bits, R/W?    Purpose    Description   
7000
F20000
7010
F20010
7020
F20020
32-bit
R/W
Counter register    Can be written directly, but it should be disabled first since the entire value cannot be written atomically.
7004
F20004
7014
F20014
7024
F20024
32-bit
R/W
Reset value    The counter is reloaded with this value once it reaches 0.
7008
F20008
7018
F20018
7028
F20028
32-bit
R/W
Match value 1    An interrupt will be generated when the counter matches this value.
700C
F2000C
701C
F2001C
702C
F2002C
32-bit
R/W
Match value 2    An interrupt will be generated when the counter matches this value.
7030
F20030
Same Same 12-bit
R/W
Control register
 • Bit 0  • Bit 3  • Bit 6 Timer enable Set to enable the corresponding timer.
 • Bit 1  • Bit 4  • Bit 7 Clock source Set 1 for 32768 Hz crystal, or 0 for CPU clock
 • Bit 2  • Bit 5  • Bit 8 Interrupt enable    Set to generate an interrupt when the counter reaches 0.
 • Bit 9  • Bit 10  • Bit 11 Count direction    Set to 1 to count up, or 0 to count down.
7034
F20034
Same Same 12-bit
R/W
Interrupt status Reads the cause of the interrupt. Write 1 bits to reset.
 • Bit 0  • Bit 3  • Bit 6 Match 1    Set after the counter reaches match register 1.
 • Bit 1  • Bit 4  • Bit 7 Match 2    Set after the counter reaches match register 2.
 • Bit 2  • Bit 5  • Bit 8 Overflow    Set after the counter reaches 0 and gets reloaded, but only if enabled in the control register.
7038
F20038
Same Same 12-bit
R/W
Interrupt mask? Seems to have no effect on interrupt generation, despite being documented
7038
F20038
32-bit
R
Revision number Reads a constant 0x00010801, which corresponds to revision 1.8.1.