⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ipod remote control protocol.mht

📁 ipodourdev_176702.rar IPOD接口资料IPODSOCKET 需要
💻 MHT
📖 第 1 页 / 共 5 页
字号:
  <TR>
    <TD style=3D"VERTICAL-ALIGN: top"><BR></TD>
    <TD style=3D"VERTICAL-ALIGN: top"><BR></TD>
    <TD style=3D"VERTICAL-ALIGN: top">Sleeve<BR></TD>
    <TD style=3D"VERTICAL-ALIGN: top">no connect /=20
unknown</TD></TR></TBODY></TABLE></P>
<P><I><FONT size=3D+3><BR>Generation 3</FONT></I><BR>The third =
generation iPod=20
seems to use the same remote (internally and externally) as the second=20
generation, but with a different connector. The circuit board and part =
number(!)=20
is the same, but the microcontroller implements a different protocol and =

contains different firmware. Here's a picture of morganw's =
remote:<BR></P>
<TABLE cellSpacing=3D0 cellPadding=3D0 border=3D0>
  <TBODY>
  <TR>
    <TD style=3D"VERTICAL-ALIGN: middle"><IMG=20
      style=3D"WIDTH: 150px; HEIGHT: 164px" alt=3D"gen 3 pcb"=20
      =
src=3D"http://www.maushammer.com/systems/ipod-remote/gen3pcb-small.jpg"><=
BR></TD></TR>
  <TR>
    <TD style=3D"VERTICAL-ALIGN: top; TEXT-ALIGN: center"><A=20
      =
href=3D"http://www.maushammer.com/systems/ipod-remote/gen3pcb-large.jpg">=
large=20
      size (400 kB)</A><BR></TD></TR></TBODY></TABLE><I><FONT=20
size=3D+3></FONT></I><I><FONT size=3D+3><BR>Remote Control IC</FONT></I> =
<BR>
<P>The remote uses a general-purpose Microchip 12C508A microcontroller =
<A=20
href=3D"http://www.microchip.com/download/lit/pline/picmicro/families/12c=
5xx/40139e.pdf">(datasheet)</A>:<BR></P>
<P>
<TABLE>
  <TBODY></TBODY>
  <TBODY>
  <TR>
    <TD><IMG height=3D145=20
      =
src=3D"http://www.maushammer.com/systems/ipod-remote/chip-enlargement-sma=
ll.jpg"=20
      width=3D199 border=3D0></TD>
    <TD><A=20
      =
href=3D"http://www.maushammer.com/systems/ipod-remote/chip-enlargement-me=
d.jpg">medium=20
      size</A> <BR><A=20
      =
href=3D"http://www.maushammer.com/systems/ipod-remote/chip-enlargement-la=
rge.jpg">large=20
      size (100kB)</A></TD></TR></TBODY></TABLE></P>The chip has 8 pins: =
2 for power,=20
6 are general purpose I/O. Reset and a 4 MHz oscillator are internal to =
the=20
chip. It runs on 3.0 - 5.5 volts and has 512 words of program memory, 25 =
bytes=20
of RAM, and a 1 microsecond instruction time. The only peripheral (other =
than=20
I/O) is a timer. This may be used, but it appears that the external =
clock on pin=20
5 (T0CKI) is used as a general purpose I/O.=20
<P>Two other unpopulated 5-pin IC's (IC2 and IC3) are on the button side =
of the=20
PCB; not sure what the purpose of these would be.</P>
<P><FONT size=3D+3><I>Schematic</I></FONT> <BR>I didn't trace the whole=20
button-side of the schematic, but the rest of it is pretty simple. =
Because we=20
have the datasheet of the microcontroller, the data output (TP7) and =
power (TP1)=20
connections are well defined electrically. </P>
<P>Testpoints: <BR>TP1 =3D IC1 pin 1, VDD (3.3v), connected to blue =
wire. <BR>TP2=20
=3D (pulled up to VDD by R3) <BR>TP3 =3D (pulled up to VDD by R2) =
<BR>TP4 =3D SW2=20
(pulled up to VDD by R1) <BR>TP5 =3D IC1 pin 5 (pulled up to VDD by R5) =
<BR>TP6 =3D=20
IC1 pin 6 (pulled up to VDD by R4) <BR>TP7 =3D IC1 pin 7. Connected via =
1K ohm=20
resistor R7 to the green wire, the data out to the iPod. <BR>TP8 =3D IC1 =
pin 8,=20
VSS (ground), connected to yellow wire. <BR>TP9 =3D [probably hold =
switch, SW1]=20
(pulled up to VDD by R6) </P>
<P>IC2 (unpopulated) - connects to SW2 &amp; SW4 <BR>IC3 (unpopulated) - =

connects to TP5, SW5</P>
<P><I><FONT size=3D+3>G2 Communications Protocol</FONT></I> <BR><FONT=20
size=3D+1>Electrical:</FONT>&nbsp; <BR>digital CMOS output (low =3D 0v, =
high =3D 3.3v)=20
through a 1K ohm resistor, normally low. </P>
<P><FONT size=3D+1>Logical:</FONT> <BR>I've only measured the second =
generation=20
protocol. I assume the 3rd generation is the same, but the code in the =
processor=20
could be totally different.<BR></P>
<P>I measured about 108.75 uSec/bit, but my equipment wasn't the most =
capable;=20
9600 baud is 104 uSec/bit and it's a safe bet that this is actually =
what's used,=20
and jives with other peoples' measurements. Also, since the =
microcontroller=20
relies on an RC oscillator, it won't be totally spot-on. My measurement =
could=20
also have been messed up by a non-integral bit time between words (which =
I=20
couldn't detect too well). </P>
<P>Upon pressing the button, the output goes high for about 45msec and =
then=20
sends the first version of the code. This high signal is probably used =
to wake=20
the iPod when sleeping.&nbsp; After that, the remote repeats a pattern =
of=20
waiting about 26msec with a low output, and then sending the second =
version of=20
the pattern (4msec), until the button is released. I wasn't able to see =
if=20
something different happened when the button was released. </P>
<P>The first version of the code (transmitted when button is first =
pressed) is:=20
</P>
<CENTER>
<P>(....1111) 0<B>11111111</B>11 0<B>10111111</B>11 0<B>xxx01111</B>111=20
(0000....)</P></CENTER>
<P>where the xxx depends on which button is pressed.&nbsp; The second =
version of=20
the code follows this format: </P>
<CENTER>(....0000) 1111 0<B>11111111</B>11 0<B>10111111</B>11 =
0<B>xxx01111</B>11=20
1 (0000....)=20
<P>where xxx depends on the button:<BR>
<TABLE cellSpacing=3D2 cellPadding=3D2 width=3D500 border=3D1>
  <CAPTION><BR></CAPTION>
  <TBODY></TBODY>
  <TBODY>
  <TR>
    <TD vAlign=3Dtop width=3D300>VOL+</TD>
    <TD vAlign=3Dtop align=3Dmiddle>SW6</TD>
    <TD style=3D"FONT-FAMILY: monospace" vAlign=3Dtop =
align=3Dmiddle>010</TD></TR>
  <TR>
    <TD vAlign=3Dtop width=3D300>VOL-</TD>
    <TD vAlign=3Dtop align=3Dmiddle>SW2</TD>
    <TD style=3D"FONT-FAMILY: monospace" vAlign=3Dtop =
align=3Dmiddle>110</TD></TR>
  <TR>
    <TD vAlign=3Dtop width=3D300>SKIP&gt;&gt;</TD>
    <TD vAlign=3Dtop align=3Dmiddle>SW3</TD>
    <TD style=3D"FONT-FAMILY: monospace" vAlign=3Dtop =
align=3Dmiddle>001</TD></TR>
  <TR>
    <TD vAlign=3Dtop width=3D300>&lt;&lt;SKIP</TD>
    <TD vAlign=3Dtop align=3Dmiddle>SW4</TD>
    <TD style=3D"FONT-FAMILY: monospace" vAlign=3Dtop =
align=3Dmiddle>101</TD></TR>
  <TR>
    <TD vAlign=3Dtop width=3D300>PLAY/PAUSE</TD>
    <TD vAlign=3Dtop align=3Dmiddle>SW5</TD>
    <TD style=3D"FONT-FAMILY: monospace" vAlign=3Dtop =
align=3Dmiddle>100</TD></TR>
  <TR>
    <TD vAlign=3Dtop width=3D300>(button release)</TD>
    <TD vAlign=3Dtop align=3Dmiddle><BR></TD>
    <TD style=3D"FONT-FAMILY: monospace" vAlign=3Dtop=20
  align=3Dmiddle>000</TD></TR></TBODY></TABLE></P></CENTER>
<P>Although my limited test equipment wasn't able to capture it, other =
people=20
report (thanks!) that a button release code is sent upon (guess what) =
button=20
release. </P>
<P>This looks like the standard asynchronous protocol implementing a =
8-bit, no=20
parity, 2 stop bit (8N2) protocol (or it could be also defined as 8-bit, =
mark=20
parity, 1 stop bit depending on how you look at it). This is similar to =
the=20
often-used 8N1 protocol, except there is an extra '1' between =
characters; it's=20
not known if the iPod actually needs this bit. Each group of 11 bits =
above is=20
classified composed of one start bit (a 0), followed by 8 data bits =
(least=20
significant bit first), then two hard-to-classify ones. These ones could =
be=20
either two stop bits, a stop bit and a mark parity bit, or a stop bit =
and one=20
just-for-fun mark bit.</P>
<P>There is an interesting quirk brought on by the fact that usual =
serial=20
protocols require the data line to be signaling high during the time =
inbetween=20
characters, but the iPod lowers the signal inbetween the 3-byte packets=20
(although it does keep it high inbetween bytes). At least 4 high high =
bits=20
precede valid data, which seems to be enough to satisfy the iPod's UART. =
But,=20
after the three bytes are sent, the data line quickly goes low. This =
isn't=20
usual, and the iPod UART seems to interpret this string of zeros as any =
other=20
UART would: a start bit, 8 bits of low data (0x00), and then a missing =
stop bit=20
(a missing 1). The iPod firmware apparently depends on receiving this =
0x00, but=20
it's not known if it actually checks to see that the stop bit is =
missing. If=20
emulating the remote with a serial port, you should send the 0x00.</P>
<P><I><FONT size=3D+3>G3 Communications Protocol</FONT></I> <BR>The G3 =
uses a=20
slightly different protocol than the G2. The wakeup pulse has been =
eliminated=20
and the serial line now remains high at idle (it's pulled up by a weak =
resistor=20
in the iPod). The baud rate has been upped to 19200 baud, while the =
message=20
format now uses just one stop bit (8N1). The code repetition rate has =
been=20
double to 66 times per second. But, the most interesting changes are in =
the new=20
seven byte code. It has two major features:<BR></P>
<UL>
  <LI>Instead of a numeric code indicating which button has been pushed, =
the=20
  buttons are bit-mapped. This means that the remote can now indicate =
that more=20
  than one button is pressed by by setting more than one bit. The =
presence of a=20
  0x00 before the sixth byte suggests that a total of 16 buttons may be=20
  accommodated by this protocol.=20
  <LI>The messages are protected from errors by a checksum. The last =
byte varies=20
  so that the sum of bytes 3-7 will form an even multiple of =
0x100.<BR></LI></UL>
<P><I><FONT size=3D+3>Communications Protocols, =
summary</FONT></I>&nbsp;<BR></P>
<P>
<TABLE style=3D"MARGIN-LEFT: auto; MARGIN-RIGHT: auto; TEXT-ALIGN: left" =

cellSpacing=3D2 cellPadding=3D2 border=3D1>
  <TBODY></TBODY>
  <TBODY>
  <TR>
    <TD=20
      style=3D"FONT-WEIGHT: bold; VERTICAL-ALIGN: top; TEXT-ALIGN: =
center">Button<BR></TD>
    <TD style=3D"FONT-WEIGHT: bold; VERTICAL-ALIGN: top; TEXT-ALIGN: =
center">G2=20
      Three Byte Code<BR></TD>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -