Apple iPod Remote Control Protocol | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
세상에는 벼래별 희안한 사람들이 다 있다. iPOD를 해킹해서 소스코드까지 만들어내는 훌륭한 사람들... 쿠쿵!! I reverse-engineered a second-generation iPod remote (theversion that has the touch-sensitive scroll wheel). The remote probablyworks exactly as-is with the first generation iPod (with the mechanicalscroll wheel). The newest third-generation ipods (thinner, rounder, andwith 4 buttons in-line)have a similar remote with an identical circuit board, but with adifferent square 4-pin remote connector-- the new pinout hasn't been completely figured out, and it's notknown if the same protocol is used. Remote is labeled "MITSUMI" and "66-6616A". The cable has 6 pins: 3analog signals are fed directly to the headphone jack, 3 go to a smallmicrocontroller and handle the remote-control functions. To reducenoise,they do not share a common ground in the remote (but I can still heartheremote affecting the sound). Disassembly Pinout morganw has kindly provided the information (and pictures) of thegeneration 3 connector. All of the remote functionality has been movedto a unique 4-pin square connector, and two additional contacts mayhave new signals on them.
Connections
Remote Control IC The remote uses a general-purpose Microchip 12C508A microcontroller (datasheet):
Two other unpopulated 5-pin IC's (IC2 and IC3) are on the buttonsideof the PCB; not sure what the purpose of these would be. Testpoints: IC2 (unpopulated) - connects to SW2 & SW4 Communications Protocol Logical: I measured about 108.75 uSec/bit, but my equipment wasn't the mostcapable; 9600 baud is 104 uSec/bit and it's a safe bet that this isactuallywhat's used, and jives with other peoples' measurements. Also, sincethemicrocontroller relies on an RC oscillator, it won't be totallyspot-on.My measurement could also have been messed up by a non-integral bittimebetween words (which I couldn't detect too well). Upon pressing the button, the output goes high for about 45msec andthen sends the first version of the code. This high signal is probablyused to wake the iPod when sleeping. After that, the remoterepeatsa pattern of waiting about 26msec with a low output, and then sendingthesecond version of the pattern (4msec), until the button is released. Iwasn't able to see if something different happened when the button wasreleased. The first version of the code (transmitted when button is firstpressed)is: (....1111) 01111111111 01011111111 0xxx01111111(0000....) where the xxx depends on which button is pressed. The secondversionof the code follows this format: where xxx depends on the button:
Although my limited test equipment wasn't able to capture it, otherpeople report (thanks!) that a button release code is sent upon (guesswhat) button release. This looks like the standard asynchronous protocol implementing a8-bit,no parity, 2 stop bit (8N2) protocol (or it could be also defined as8-bit,mark parity, 1 stop bit depending on how you look at it). This issimilarto the often-used 8N1 protocol, except there is an extra '1' betweencharacters;it's not known if the iPod actually needs this bit. Each group of 11bitsabove is classified composed of one start bit (a 0), followed by 8 databits (least significant bit first), then two hard-to-classify ones.Theseones could be either two stop bits, a stop bit and a mark parity bit,ora stop bit and one just-for-fun mark bit. So, restated, the 3-byte message sent is:
There is an interesting quirk brought on by the fact that usualserialprotocols require the data line to be signaling high during the timeinbetweencharacters, but the iPod lowers the signal inbetween the 3-byte packets(although it does keep it high inbetween bytes). At least 4 high highbitsprecede valid data, which seems to be enough to satisfy the iPod'sUART.But, after the three bytes are sent, the data line quickly goes low.Thisisn't usual, and the iPod UART seems to interpret this string of zerosas any other UART would: a start bit, 8 bits of low data (0x00), andthena missing stop bit (a missing 1). The iPod firmware apparently dependson receiving this 0x00, but it's not known if it actually checks to seethat the stop bit is missing. If emulating the remote with a serialport,you should send the 0x00. Example Microcontroller Code The chip I picked is the Atmel ATtiny12-8PI. This is a small 8-pindevicewith 6 usable I/O pins, built-in 1.2 MHz RC oscillator (factorycalibratedto ±1% accuracy), 1K of flash memory, 32 bytes of RAM, and 64bytesof EEPROM. You probably noticed the lack of UART - instead I'm justbit-bangingthe output. It's ok for this single use, but when I eventually try tosimultaneouslyreceive data from my car's bus, I'll have to rewrite this code. Thisversionalso runs off of 5 volts and won't run at 3.3v, so it requires someinterfacecircuitry - you may want to use the 3.3v version, especially if youwantto use the iPod's power, or it's power output as a "connected" signal. The schematic is pretty simple; I'll just describe how the 8 pins ofthe microcontroller connect:
Others' Work static int ipod_remote_buttons[] = {KEY_1, KEY_2,KEY_3,KEY_4, KEY_5};He uses the defines KEY_1 ... KEY_5, arbitrarily from the HP-HILprotocolrather than defining his own incompatible values. 출처: http://www.maushammer.com/systems/ipod-remote/ipod-remote%20copy.html Tags: ipod 윈도우즈 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
로그인을 하시면 댓글을 등록 할 수 있습니다. |
SIMILAR POSTS 훅 인스턴스의 생성과 해제 |
OTHER POSTS IN THE SAME CATEGORY PC가 점점 느려지고 있다면 바탕화면에 있는 단축 아이콘이 점유하는 메모리 용량을 되찾아라 |