Line 3:
Line 3:
{{ Wikify }}
{{ Wikify }}
−
[[Image:Wii-Remote-Top-surface.jpg|200px|thumb|right|Wii remote circuit board, top surface]][[Image:Wii Remote uncovered.jpg|200px|thumb|right|Wii remote circuit board, bottom surface]]{{selfref|This article is a technical guide to the Wii Remote. For a high-level overview of the Wii Remote, see the [http://en.wikipedia.org/wiki/Wii_Remote Wikipedia entry].}}
+
[[File:Wii-Remote-Top-surface.jpg|200px|thumb|right|Wii remote circuit board, top surface]][[File:Wii Remote uncovered.jpg|200px|thumb|right|Wii remote circuit board, bottom surface]]{{selfref|This article is a technical guide to the Wii Remote. For a high-level overview of the Wii Remote, see the [http://en.wikipedia.org/wiki/Wii_Remote Wikipedia entry].}}
*[[Wiimote/Firmware|Disassembled Firmware]]
*[[Wiimote/Firmware|Disassembled Firmware]]
Line 12:
Line 12:
*[[Wiimote/Mii Data|Mii Data]]
*[[Wiimote/Mii Data|Mii Data]]
−
[[Image:Wii Remote Broadcom.jpg|200px|thumb|right|Broadcom BCM2042 in a Wii remote]]The '''Wii Remote''' (informally known as the '''Wiimote''') is the Wii's main input device. It is a wireless device, using standard Bluetooth technology to communicate with the Wii. It is built around a [http://www.broadcom.com/products/Bluetooth/Bluetooth-RF-Silicon-and-Software-Solutions/BCM2042 Broadcom BCM2042] bluetooth System-on-a-chip, and contains multiple peripherals that provide data to it, as well as an expansion port for external add-ons. The Wii Remote uses (and, at times, abuses) the standard Bluetooth HID protocol to communicate with the host, which is directly based upon the [http://en.wikipedia.org/wiki/USB_human_interface_device_class USB HID] standard. As such, it will appear as a standard input device to any Bluetooth host. However, the Wii Remote does not make use of the standard data types and HID descriptor, and only describes its report format length, leaving the actual contents undefined, which makes it useless with standard HID drivers (but some [[Wiimote Driver]]s exist). The Wii Remote actually uses a fairly complex set of operations, transmitted through HID Output reports, and returns a number of different data packets through its Input reports, which contain the data from its peripherals.
+
[[File:Wii Remote Broadcom.jpg|200px|thumb|right|Broadcom BCM2042 in a Wii remote]]The '''Wii Remote''' (informally known as the '''Wiimote''') is the Wii's main input device. It is a wireless device, using standard Bluetooth technology to communicate with the Wii. It is built around a [http://www.broadcom.com/products/Bluetooth/Bluetooth-RF-Silicon-and-Software-Solutions/BCM2042 Broadcom BCM2042] bluetooth System-on-a-chip, and contains multiple peripherals that provide data to it, as well as an expansion port for external add-ons. The Wii Remote uses (and, at times, abuses) the standard Bluetooth HID protocol to communicate with the host, which is directly based upon the [http://en.wikipedia.org/wiki/USB_human_interface_device_class USB HID] standard. As such, it will appear as a standard input device to any Bluetooth host. However, the Wii Remote does not make use of the standard data types and HID descriptor, and only describes its report format length, leaving the actual contents undefined, which makes it useless with standard HID drivers (but some [[Wiimote Driver]]s exist). The Wii Remote actually uses a fairly complex set of operations, transmitted through HID Output reports, and returns a number of different data packets through its Input reports, which contain the data from its peripherals.
= Summary =
= Summary =
Line 21:
Line 21:
|-
|-
| style="border: 1px solid #ccc; padding: 0.2em; width: 14em;" | '''[[#Bluetooth Communication | Bluetooth Communication]]'''
| style="border: 1px solid #ccc; padding: 0.2em; width: 14em;" | '''[[#Bluetooth Communication | Bluetooth Communication]]'''
−
| style="border: 1px solid #ccc;" | [[Image:ButtonGreen.png|16px]]
+
| style="border: 1px solid #ccc;" | [[File:ButtonGreen.png|16px]]
| style="border: 1px solid #ccc; padding: 0.2em;" | Connection to the Wii Remote using the 1+2 sync sequence works sometimes, and single-press reconnection is understood.
| style="border: 1px solid #ccc; padding: 0.2em;" | Connection to the Wii Remote using the 1+2 sync sequence works sometimes, and single-press reconnection is understood.
|-
|-
| style="border: 1px solid #ccc; padding: 0.2em;" | '''[[#Core Buttons | Core Buttons]]'''
| style="border: 1px solid #ccc; padding: 0.2em;" | '''[[#Core Buttons | Core Buttons]]'''
−
| style="border: 1px solid #ccc;" | [[Image:ButtonGreen.png|16px]]
+
| style="border: 1px solid #ccc;" | [[File:ButtonGreen.png|16px]]
| style="border: 1px solid #ccc; padding: 0.2em;" | All working.
| style="border: 1px solid #ccc; padding: 0.2em;" | All working.
|-
|-
| style="border: 1px solid #ccc; padding: 0.2em;" | '''[[#Accelerometer | Accelerometer]]'''
| style="border: 1px solid #ccc; padding: 0.2em;" | '''[[#Accelerometer | Accelerometer]]'''
−
| style="border: 1px solid #ccc;" | [[Image:ButtonGreen.png|16px]]
+
| style="border: 1px solid #ccc;" | [[File:ButtonGreen.png|16px]]
| style="border: 1px solid #ccc; padding: 0.2em;" | All working.
| style="border: 1px solid #ccc; padding: 0.2em;" | All working.
|-
|-
| style="border: 1px solid #ccc; padding: 0.2em;" | '''[[#IR Camera | IR Camera]]'''
| style="border: 1px solid #ccc; padding: 0.2em;" | '''[[#IR Camera | IR Camera]]'''
−
| style="border: 1px solid #ccc;" | [[Image:ButtonGreen.png|16px]]
+
| style="border: 1px solid #ccc;" | [[File:ButtonGreen.png|16px]]
| style="border: 1px solid #ccc; padding: 0.2em;" | All working.
| style="border: 1px solid #ccc; padding: 0.2em;" | All working.
|-
|-
| style="border: 1px solid #ccc; padding: 0.2em;" | '''[[#Power Button | Power Button]]'''
| style="border: 1px solid #ccc; padding: 0.2em;" | '''[[#Power Button | Power Button]]'''
−
| style="border: 1px solid #ccc;" | [[Image:ButtonYellow.png|16px]]
+
| style="border: 1px solid #ccc;" | [[File:ButtonYellow.png|16px]]
| style="border: 1px solid #ccc; padding: 0.2em;" | Pressing Power disconnects and turns off the Wii Remote. Power-on currently unknown.
| style="border: 1px solid #ccc; padding: 0.2em;" | Pressing Power disconnects and turns off the Wii Remote. Power-on currently unknown.
|-
|-
| style="border: 1px solid #ccc; padding: 0.2em;" | '''[[#Speaker | Speaker]]'''
| style="border: 1px solid #ccc; padding: 0.2em;" | '''[[#Speaker | Speaker]]'''
−
| style="border: 1px solid #ccc;" | [[Image:ButtonGreen.png|16px]]
+
| style="border: 1px solid #ccc;" | [[File:ButtonGreen.png|16px]]
| style="border: 1px solid #ccc; padding: 0.2em;" | All working.
| style="border: 1px solid #ccc; padding: 0.2em;" | All working.
|-
|-
| style="border: 1px solid #ccc; padding: 0.2em;" | '''[[#Player LEDs | Player LEDs]]'''
| style="border: 1px solid #ccc; padding: 0.2em;" | '''[[#Player LEDs | Player LEDs]]'''
−
| style="border: 1px solid #ccc;" | [[Image:ButtonGreen.png|16px]]
+
| style="border: 1px solid #ccc;" | [[File:ButtonGreen.png|16px]]
| style="border: 1px solid #ccc; padding: 0.2em;" | Can be controlled by software arbitrarily. Even brightness modulation works.
| style="border: 1px solid #ccc; padding: 0.2em;" | Can be controlled by software arbitrarily. Even brightness modulation works.
|-
|-
| style="border: 1px solid #ccc; padding: 0.2em;" | '''[[#Status Information | Status Information]]'''
| style="border: 1px solid #ccc; padding: 0.2em;" | '''[[#Status Information | Status Information]]'''
−
| style="border: 1px solid #ccc;" | [[Image:ButtonGreen.png|16px]]
+
| style="border: 1px solid #ccc;" | [[File:ButtonGreen.png|16px]]
| style="border: 1px solid #ccc; padding: 0.2em;" | Battery and extension info in Status Report
| style="border: 1px solid #ccc; padding: 0.2em;" | Battery and extension info in Status Report
|-
|-
| style="border: 1px solid #ccc; padding: 0.2em;" | '''[[#Extension Controllers | Extension Controllers]]'''
| style="border: 1px solid #ccc; padding: 0.2em;" | '''[[#Extension Controllers | Extension Controllers]]'''
−
| style="border: 1px solid #ccc;" | [[Image:ButtonYellow.png|16px]]
+
| style="border: 1px solid #ccc;" | [[File:ButtonYellow.png|16px]]
| style="border: 1px solid #ccc; padding: 0.2em;" | Wireless Nunchuks don't work at all. Motion Plus support is limited.
| style="border: 1px solid #ccc; padding: 0.2em;" | Wireless Nunchuks don't work at all. Motion Plus support is limited.
|-
|-
Line 59:
Line 59:
{|align="center" style="margin-top: 2px; font-size: 8pt; background-color:#e4e4f4;border:1px solid #ccc; border-collapse: collapse;"
{|align="center" style="margin-top: 2px; font-size: 8pt; background-color:#e4e4f4;border:1px solid #ccc; border-collapse: collapse;"
| style="padding: 0.2em; border: 1px solid #ccc;" | '''Legend'''
| style="padding: 0.2em; border: 1px solid #ccc;" | '''Legend'''
−
| style="padding: 0.2em;"| [[Image:ButtonGreen.png|16px]] Perfect or near-perfect
+
| style="padding: 0.2em;"| [[File:ButtonGreen.png|16px]] Perfect or near-perfect
−
| style="padding: 0.2em;"| [[Image:ButtonYellow.png|16px]] Usable but not complete
+
| style="padding: 0.2em;"| [[File:ButtonYellow.png|16px]] Usable but not complete
−
| style="padding: 0.2em;"| [[Image:ButtonRed.png|16px]] Unusable
+
| style="padding: 0.2em;"| [[File:ButtonRed.png|16px]] Unusable
|}
|}
|}
|}
Line 416:
Line 416:
== EEPROM Memory ==
== EEPROM Memory ==
−
[[Image:Wii Remote Flash.jpg|thumb|right|Wii remote Flash memory chip|]]There is a 128kbit (= 16kB) EEPROM chip ([http://www.st.com/stonline/products/literature/ds/4578/m24128-bw.pdf Data Sheet] / [http://www.sparkfun.com/tutorial/WiiRemote/NintendoWii-I2C-Data.zip Full EEPROM dump from a sample Wii Remote]) in the Wii Remote. Part of its contents include code for the built-in microcontroller, and a generic section which can be freely read and written by the host. This section is 0x1700 bytes long, and part of this memory is used to store the [[Wiimote/Mii Data | Mii Data]]. It can be accessed by reading from/writing to addresses 0x0000-0x16FF in the Wii Remote's virtual memory space; in the actual EEPROM chip, the data is located at 0x0070-0x176F.
+
[[File:Wii Remote Flash.jpg|thumb|right|Wii remote Flash memory chip|]]There is a 128kbit (= 16kB) EEPROM chip ([http://www.st.com/stonline/products/literature/ds/4578/m24128-bw.pdf Data Sheet] / [http://www.sparkfun.com/tutorial/WiiRemote/NintendoWii-I2C-Data.zip Full EEPROM dump from a sample Wii Remote]) in the Wii Remote. Part of its contents include code for the built-in microcontroller, and a generic section which can be freely read and written by the host. This section is 0x1700 bytes long, and part of this memory is used to store the [[Wiimote/Mii Data|Mii Data]]. It can be accessed by reading from/writing to addresses 0x0000-0x16FF in the Wii Remote's virtual memory space; in the actual EEPROM chip, the data is located at 0x0070-0x176F.
The [[Wiimote/Firmware|firmware stored in the Wiimote has been disassembled]].
The [[Wiimote/Firmware|firmware stored in the Wiimote has been disassembled]].
Line 660:
Line 660:
== Accelerometer ==
== Accelerometer ==
−
[[Image:Wii-Remote-Accel.jpg|right|thumb|200px|ADXL330 in a Wii remote]][[Image:Wiimote_axis2.png|right|thumb|200px|Coordinate system used by Wii Remote]]
+
[[File:Wii-Remote-Accel.jpg|right|thumb|200px|ADXL330 in a Wii remote]][[File:Wiimote_axis2.png|right|thumb|200px|Coordinate system used by Wii Remote]]
The Wii Remote includes a three-axis linear accelerometer located on the top suface of the circuit board, slightly left of the large A button. The integrated circuit is the [http://www.analog.com/en/prod/0%2C2877%2CADXL330%2C00.html ADXL330] ([http://www.analog.com/UploadedFiles/Data_Sheets/ADXL330.pdf data sheet]), manufactured by Analog Devices. This device is physically rated to measure accelerations over a range of at least +/- 3g with 10% sensitivity.
The Wii Remote includes a three-axis linear accelerometer located on the top suface of the circuit board, slightly left of the large A button. The integrated circuit is the [http://www.analog.com/en/prod/0%2C2877%2CADXL330%2C00.html ADXL330] ([http://www.analog.com/UploadedFiles/Data_Sheets/ADXL330.pdf data sheet]), manufactured by Analog Devices. This device is physically rated to measure accelerations over a range of at least +/- 3g with 10% sensitivity.
Line 751:
Line 751:
== IR Camera ==
== IR Camera ==
−
[[Image:Wii-Remote-Camera.jpg|200px|thumb|right|Wii remote camera]] The Wii Remote includes a 128x96 monochrome camera with built-in image processing. The camera looks through an infrared pass filter in the remote's plastic casing. The camera's built-in image processing is capable of tracking up to 4 moving objects, and these data are the only data available to the host. Raw pixel data is not available to the host, so the camera cannot be used to take a conventional picture. The built-in processor uses 8x subpixel analysis to provide 1024x768 resolution for the tracked points. The Sensor Bar that comes with the Wii includes two IR LED clusters at each end, which are tracked by the Wii Remote to provide pointing information. The distance between the centers of the LED clusters is 20 cm (as measured on one unit).
+
[[File:Wii-Remote-Camera.jpg|200px|thumb|right|Wii remote camera]] The Wii Remote includes a 128x96 monochrome camera with built-in image processing. The camera looks through an infrared pass filter in the remote's plastic casing. The camera's built-in image processing is capable of tracking up to 4 moving objects, and these data are the only data available to the host. Raw pixel data is not available to the host, so the camera cannot be used to take a conventional picture. The built-in processor uses 8x subpixel analysis to provide 1024x768 resolution for the tracked points. The Sensor Bar that comes with the Wii includes two IR LED clusters at each end, which are tracked by the Wii Remote to provide pointing information. The distance between the centers of the LED clusters is 20 cm (as measured on one unit).
The IR Camera is enabled by setting bit 2 on output reports 0x13 and 0x1a:
The IR Camera is enabled by setting bit 2 on output reports 0x13 and 0x1a:
Line 981:
Line 981:
== Player LEDs ==
== Player LEDs ==
−
[[Image:Wii-Remote-LEDs.jpg|200px|thumb|right|Wii remote player LEDs]]There are four blue LEDs on the front face of the Wii Remote. During discovery and before initialization, these LEDs blink at a fixed rate. The number of blinking LEDs is proportional to the battery voltage, indicating battery charge (all four are lit for newly charged batteries, and only the first is lit if the batteries are low and should be replaced).
+
[[File:Wii-Remote-LEDs.jpg|200px|thumb|right|Wii remote player LEDs]]There are four blue LEDs on the front face of the Wii Remote. During discovery and before initialization, these LEDs blink at a fixed rate. The number of blinking LEDs is proportional to the battery voltage, indicating battery charge (all four are lit for newly charged batteries, and only the first is lit if the batteries are low and should be replaced).
During gameplay with the Wii, one LED is lit to indicate the player number assigned to the Wii Remote. However, the LEDs are independently controllable by the host, and can be set to display any pattern. They can also be modulated at a moderately high speed, enabling some brightness control at the cost of a lot of Bluetooth bandwidth. Sigma-delta modulation works reasonably well for this.
During gameplay with the Wii, one LED is lit to indicate the player number assigned to the Wii Remote. However, the LEDs are independently controllable by the host, and can be set to display any pattern. They can also be modulated at a moderately high speed, enabling some brightness control at the cost of a lot of Bluetooth bandwidth. Sigma-delta modulation works reasonably well for this.
Line 1,047:
Line 1,047:
== Rumble ==
== Rumble ==
−
[[Image:Wii_Remote_Rumble.jpg|200px|thumb|right|Wii remote rumble motor]]The Wii Remote includes a rumble feature, which is implemented as a small motor attached to an off-center weight. It will cause the controller to vibrate when activated.
+
[[File:Wii_Remote_Rumble.jpg|200px|thumb|right|Wii remote rumble motor]]The Wii Remote includes a rumble feature, which is implemented as a small motor attached to an off-center weight. It will cause the controller to vibrate when activated.
The rumble motor can be turned on or off through any of the Output Reports. Setting the LSB (bit 0) of the first byte of any output report will activate the rumble motor, and unsetting it will deactivate it. For example, the following report will turn the rumble motor on:
The rumble motor can be turned on or off through any of the Output Reports. Setting the LSB (bit 0) of the first byte of any output report will activate the rumble motor, and unsetting it will deactivate it. For example, the following report will turn the rumble motor on:
Line 1,142:
Line 1,142:
Once initialized, the last '''six''' bytes of the register block identify the connected Extension Controller. A six-byte read of register 0xa400fa will return these bytes. The Extension Controller must have been initialized prior to this. There are two ways of initializing the extension.
Once initialized, the last '''six''' bytes of the register block identify the connected Extension Controller. A six-byte read of register 0xa400fa will return these bytes. The Extension Controller must have been initialized prior to this. There are two ways of initializing the extension.
−
===The Old Way===
+
=== The Old Way ===
The old way to initialize the extension was by writing the single encryption byte 0x00 to 0x(4)A40040, but that only works on Nintendo's own brand extensions and the GH3 Guitar, and will fail on 3rd party wireless nunchuks and GHWT extensions. If it fails, the 6 bytes will be FFFF FFFF FFFF. With this method you must decrypt the extension bytes to read them.
The old way to initialize the extension was by writing the single encryption byte 0x00 to 0x(4)A40040, but that only works on Nintendo's own brand extensions and the GH3 Guitar, and will fail on 3rd party wireless nunchuks and GHWT extensions. If it fails, the 6 bytes will be FFFF FFFF FFFF. With this method you must decrypt the extension bytes to read them.
−
===The New Way===
+
=== The New Way ===
The new way to initialize the extension is by writing 0x55 to 0x(4)A400F0, then writing 0x00 to 0x(4)A400FB. It works on all extensions, and makes the extension type bytes '''unencrypted'''. This means that you no longer have to decrypt the extension bytes using the [[#Registers / Initialization | transform]] listed above.
The new way to initialize the extension is by writing 0x55 to 0x(4)A400F0, then writing 0x00 to 0x(4)A400FB. It works on all extensions, and makes the extension type bytes '''unencrypted'''. This means that you no longer have to decrypt the extension bytes using the [[#Registers / Initialization | transform]] listed above.
Line 1,214:
Line 1,214:
A [[Wii Balance Board]] extension is only found in a Wii Balance Board. Although it exposes functionality as an Extension Controller, they are not separable and this controller is documented separately.
A [[Wii Balance Board]] extension is only found in a Wii Balance Board. Although it exposes functionality as an Extension Controller, they are not separable and this controller is documented separately.
−
===Encryption setup===
+
=== Encryption setup ===
After the identification is read, the encryption can be set up if required. This is done by enabling encryption by writing 0xAA to extension register 0xF0, and then writing the 16-byte key to register 0x40. The key is written in 3 blocks of 6, 6, and 4 bytes. (Writing a single encryption byte to register 0x40 will work on genuine Nintendo controllers, but not on others). After this the extension can be operated in full encryption mode.
After the identification is read, the encryption can be set up if required. This is done by enabling encryption by writing 0xAA to extension register 0xF0, and then writing the 16-byte key to register 0x40. The key is written in 3 blocks of 6, 6, and 4 bytes. (Writing a single encryption byte to register 0x40 will work on genuine Nintendo controllers, but not on others). After this the extension can be operated in full encryption mode.
== Extension Controller Documentation ==
== Extension Controller Documentation ==
−
''Individual Extension Controllers are described on the [[Wiimote/Extension Controllers | Extension Controllers]] page.''
+
''Individual Extension Controllers are described on the [[Wiimote/Extension Controllers|Extension Controllers]] page.''
= Acknowledgements =
= Acknowledgements =