tag:blogger.com,1999:blog-42530907254041163762024-03-19T00:10:11.635-04:00Retro-NewtonHacking the Apple Newton. Use this information at your own risk.Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comBlogger21125tag:blogger.com,1999:blog-4253090725404116376.post-16688606524909184392017-01-15T07:26:00.001-05:002017-01-15T07:29:16.789-05:00Overview of an Operational WiFiBoardThis video was made to to help @indigi_newton with troubleshooting his wifi card build. Even though the video is from the perspective of helping a single person troubleshoot a card, it is still a nice overview with a demonstration of it working in a Newton.<span style="background-color: white; color: #333333; font-family: "roboto" , "arial" , sans-serif; font-size: 13px;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/ne8iScaxD1M/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/ne8iScaxD1M?feature=player_embedded" width="320"></iframe></div>
<span style="background-color: white; color: #333333; font-family: "roboto" , "arial" , sans-serif; font-size: 13px;"><br /></span>Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-83236301539621110762015-12-22T16:20:00.001-05:002015-12-22T18:42:05.674-05:00Files published to GitHub<br />
You can find the files for this project in GitHub: <a href="https://github.com/jake-b/Newton-Internal-WiFi">https://github.com/jake-b/Newton-Internal-WiFi</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHlxFyAhTYigvPGjB0LRoY7_OE2VzMH4cOvFiiMdymjlQWXW4avhQoZFPaHslJHkhvu-SaRT6_DchmXjD5zAI1YmHVjJAmyuYUyPFdJiLrXZ2G5a36RwDecZucU47g1jAiYNf9_SxyYN-X/s1600/wifi.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHlxFyAhTYigvPGjB0LRoY7_OE2VzMH4cOvFiiMdymjlQWXW4avhQoZFPaHslJHkhvu-SaRT6_DchmXjD5zAI1YmHVjJAmyuYUyPFdJiLrXZ2G5a36RwDecZucU47g1jAiYNf9_SxyYN-X/s320/wifi.jpg" width="240" /></a></div>
<br />Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-60755234052798062202015-12-22T16:10:00.002-05:002015-12-22T18:40:22.775-05:003D Printed Port CoverSince the MP2x00 did not come with an internal modem (and one was never sold), each MessagePad came installed with a little plastic cover that fills the space where the RJ-11 jack would be.<br />
<div>
<br /></div>
<div>
This is the same cover where apple would place a "2100" sticker indicating that a MP2000 was upgraded to a 2100.</div>
<div>
<br /></div>
<div>
Due to an oversight, the WiFi card extended into the area where this plastic cover would sit. (I'm not sure this could have been avoided, even if I had planned ahead)<br />
<br />
Instead, I've designed a replacement cover that does not interfere. For good measure, I added an embossed WiFi logo to indicate that the internal WiFi card is present.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtTrCnjePvobpuik2nBnQIm9lBS4CXvm04avhudeGiR-V-tKnJJRxMnz7tydJPJPkTGFMhdTTbErg-lBqAN28dJQJC9Hk8-zv6gcG3CjWTRQXovy59ylebQ7yRRTyCuNrIkFJwyl65akQy/s1600/portcover.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="159" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtTrCnjePvobpuik2nBnQIm9lBS4CXvm04avhudeGiR-V-tKnJJRxMnz7tydJPJPkTGFMhdTTbErg-lBqAN28dJQJC9Hk8-zv6gcG3CjWTRQXovy59ylebQ7yRRTyCuNrIkFJwyl65akQy/s320/portcover.jpg" width="320" /></a></div>
<div>
I think it makes for a nice finished product.<br />
<br />
The STL files for the port cover can be found here: <a href="https://github.com/jake-b/Newton-Internal-WiFi/tree/master/Port%20Cover">https://github.com/jake-b/Newton-Internal-WiFi/tree/master/Port%20Cover</a></div>
Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-61643315961211837852015-05-07T20:09:00.000-04:002015-05-07T20:12:38.520-04:00WiFi Board v1.1I got the revised boards and finally found some time to assemble a board. This board adds a logic inverter to fix the flow control, and removes some extra traces for an alternate reset circuit.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNL2WctDY0pYzvb5NPW2ll6OqMvTK-YKApdqD9pYzAOJQSGgrK8dsAoednyZunbal4mF8SIrVbEWFq6KdVHL9W0F2fl52Bu_qkc3tEp3PBxLM1rA-QVby1Fq5oyQYmla2SbrQ1tzty5f9S/s1600/IMG_2190.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="313" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNL2WctDY0pYzvb5NPW2ll6OqMvTK-YKApdqD9pYzAOJQSGgrK8dsAoednyZunbal4mF8SIrVbEWFq6KdVHL9W0F2fl52Bu_qkc3tEp3PBxLM1rA-QVby1Fq5oyQYmla2SbrQ1tzty5f9S/s320/IMG_2190.jpg" width="320" /></a></div>
To assemble the board, I <a href="https://www.oshstencils.com/">had a stencil made</a> and used it to apply solder paste. Then I placed the components using a very simple "pick and place" rig:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvmvetueiqeCLmptlkbReE3lGSjCa8FDZG19sYcBAOrqaq0dseKgRP84rPLAtEe3-9icHe6QOp01tFXzaYRLo3vAvZ8ZwYljCAgravJgISwYOm617_wg5Ouv9mewaGHQHUg41nufgF2FcE/s1600/place.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvmvetueiqeCLmptlkbReE3lGSjCa8FDZG19sYcBAOrqaq0dseKgRP84rPLAtEe3-9icHe6QOp01tFXzaYRLo3vAvZ8ZwYljCAgravJgISwYOm617_wg5Ouv9mewaGHQHUg41nufgF2FcE/s320/place.jpg" width="320" /></a></div>
This jig was made from a piece of brass tube, a leur lock fitting, some tubing, and a 22ga blunt dispensing needle. It was mounted in a cheap USB microscope holder (available on eBay or Amazon) and hooked to a vacuum pump that I already had. There are many more complicated versions of this rig on the internet, but this simple setup worked fine for me.<br />
<br />
Finally, I baked it in a toaster oven that I got for free at a garage sale, and a <a href="http://www.rocketscream.com/blog/portfolio-item/reflow-controller-shield/">rocket scream reflow shield</a>. <br />
<br />
Everything works great. I consider this project a success. All thats left to do now is to 3D print a replacement for the plastic "plug" that covers the hole in the case.<br />
<br />
Finally, a little application that uses the method mentioned in an earlier post to enable the board when the 'modem' port is opened:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSIbqR3K5qnwzikueT5hSgODwXqBSCX19PeE58mQXGrNsEw5TgTzgyQtbEuV0Cw3NmFGNeNNcVREisnRjuPqcr4bpCx8e6uk3hh5CdA5mODFbdpr1Eh3PgclDPb2BgChDoZkihgbql8y2t/s1600/MyAppTemp.i3sMP0.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSIbqR3K5qnwzikueT5hSgODwXqBSCX19PeE58mQXGrNsEw5TgTzgyQtbEuV0Cw3NmFGNeNNcVREisnRjuPqcr4bpCx8e6uk3hh5CdA5mODFbdpr1Eh3PgclDPb2BgChDoZkihgbql8y2t/s320/MyAppTemp.i3sMP0.png" width="213" /></a></div>
<br />Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-21195447751878237262015-04-29T06:43:00.001-04:002015-04-29T06:43:41.931-04:00Thermal Performance and Loose Ends<h4>
Thermal</h4>
Early designs used a linear regulator to supply 3.3v from the Newton's battery voltage. It became pretty obvious that a linear regulator would get too hot, and so I changed it for a <a href="http://www.ti.com/product/LMZ21700">switching regulator</a>.<br />
<br />
I wanted to do a real world test. The WiReach specs say that it can draw around 350mA peak during transmit. I modified the Thumb sample code into a program that would output a continuous stream of ~25kB packets. I taped a thermocouple to the regulator and ran the test for an hour or so.<br />
<br />
The results were promising. From room temperature, the regulator went from 77.4F to a high of 85.1F. This satisfies me that in my normal use the board will not overheat. <br />
<br />
A <a href="http://www.pda-soft.de/">wise man</a> once told me:<br />
<blockquote class="tr_bq">
"People might be using such a Newton on a camp site close to Death Valley in August. Before you release such a circuit into the wild, you should put the assembly into the baking oven at 60 degrees centigrade and see what happens..."</blockquote>
Good advise, but I don't think I'll be performing that test. I just can't imagine putting a Newton in a oven for any amount of time.<br />
<br />
This test is anecdotal at best, I guess. Was the WiReach module anywhere near its peak transmit power or current draw? I don't know. At 115200bps, I'm not sure that the Newton can saturate the WiFi module such that it would need to draw its maximum.<br />
<h4>
Physical</h4>
I found one other minor issue with the physical design. I intentionally pushed the module as close to the edge of the Newton as possible-- into the space where a telephone jack would have been for an internal modem. The module is large and getting it in just the right place and keeping the board within a 5cm square took some trial and error. Also, I wanted the antenna area as close to the edge of the case as possible.<br />
<br />
Well this made for one unintended consequence-- the "plug" that covers the hole likely won't fit, and it will interfere with the WiReach antenna connector and board. It isn't the end of the world really -- I intend to 3D print a new plug with a little more clearance, and maybe an embossed WiFi logo so you can tell from the outside that there's a WiFi card installed.Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-77247930973451786742015-04-08T21:03:00.000-04:002015-04-08T21:03:18.426-04:00An ugly fixIt is ugly, but it works:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSe2Ks9QY1SzsrFCGkV583h63ZYpmvOFHnAsZiNZP_EejpRL09l0_4uX-hcjAB6C3SQkVURPRMPK0l9ievR3wciE0NcZOdRuToeXUz6kJ6AKeOZOXMYxUTNFIR5ZqKF5tuOs17lM3jZoaL/s1600/ugly1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSe2Ks9QY1SzsrFCGkV583h63ZYpmvOFHnAsZiNZP_EejpRL09l0_4uX-hcjAB6C3SQkVURPRMPK0l9ievR3wciE0NcZOdRuToeXUz6kJ6AKeOZOXMYxUTNFIR5ZqKF5tuOs17lM3jZoaL/s1600/ugly1.jpg" height="200" width="200" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYc6nBPbjkFtrSvmYfK9Yj2isrhXZnZU7aOzLsxSdakLfY1ZGZUTXNrkPXAc8fuoODsEyzBwx6Cw6eghYZzd5lJwkejeKnSZ4pKyFdeFDka9sW-XBdNTAp8oIE0Eh9dRWVfvt8N47Par5U/s1600/ugly2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYc6nBPbjkFtrSvmYfK9Yj2isrhXZnZU7aOzLsxSdakLfY1ZGZUTXNrkPXAc8fuoODsEyzBwx6Cw6eghYZzd5lJwkejeKnSZ4pKyFdeFDka9sW-XBdNTAp8oIE0Eh9dRWVfvt8N47Par5U/s1600/ugly2.jpg" height="199" width="200" /></a></div>
<br />
I soldered leads to a 1-gate logic inverter. This wasn't easy because the part is so small. Then connect it to 3.3v, GND, and the RTS line coming out of the WiReach. Then I cut the RTS trace on the bottom of the board. I connected the output of the inverter to the input of the line driver IC.<br />
<br />
Some Kapton tape holds it all in place. It is a really terrible hack, but it works. Hardware flow control works as expected, now.<br />
<br />
I'm going to design a version 1.1 of the board that includes the inverter. Also I can remove the extra GPIO/Reset stuff since the "power good/reset" circuit works.Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-80527227534826762972015-04-03T16:40:00.000-04:002015-04-03T16:40:56.116-04:00WiFi Board For Newton: A Success?I'm going to call this one a success.<br />
<br />
There is an error in the hardware flow control circuit, but that's due to an error in the N2 Platform documentation. I'll take responsibility because I should have more thoroughly prototyped (which I thought I had, but oh well) I'm still planning on hacking an inverter onto the board to fix the issue.<br />
<br />
Even so. I'm chalking this one up as a success.<br />
<br />
A few last details:<br />
<h3>
The Antenna</h3>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhw_EBc0zoy_X4NZT6xtfza3eVB7-NkW7dj_61WTjoIdXdyJ6EBo6XKv4wPp0dyqpnXVAEkHzgPnGlSlg7IfbXPuxN2_4o0cRdl29UQJ39J_52WQAK0PHIyWKMaoP3ukhKPDqaQWcdwZs9d/s1600/antenna.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhw_EBc0zoy_X4NZT6xtfza3eVB7-NkW7dj_61WTjoIdXdyJ6EBo6XKv4wPp0dyqpnXVAEkHzgPnGlSlg7IfbXPuxN2_4o0cRdl29UQJ39J_52WQAK0PHIyWKMaoP3ukhKPDqaQWcdwZs9d/s1600/antenna.jpg" height="197" width="200" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgV1Pb-yrSmbaGzANUlSMqR7vMiraP2Skk-H0TCOPj9XqDGChAPqLqGJo9xWjz_XGxCEcySCLZZX8KCr-I4GouIQ3KO6OVL3Y5A7xZgOtlc2EloMBVN7T2iMW0jx2aRGBSzxhpgvFmsF-yg/s1600/antenna+placement.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgV1Pb-yrSmbaGzANUlSMqR7vMiraP2Skk-H0TCOPj9XqDGChAPqLqGJo9xWjz_XGxCEcySCLZZX8KCr-I4GouIQ3KO6OVL3Y5A7xZgOtlc2EloMBVN7T2iMW0jx2aRGBSzxhpgvFmsF-yg/s1600/antenna+placement.jpg" height="150" width="200" /></a></div>
<br />
I found a really small antenna. I think its really for bluetooth devices, but it seems to work fine. It is so small, I was able to tuck it in a small gap between the power connector and the interconnect port.<br />
<br />
<h3>
WiReach Configuration</h3>
<div>
You need to send a few specific commands to configure the WiReach module. The most important is AT+iWANS=1 which tells the WiReach that the WiFi network is the WAN subnet. Also you need to configure a username and password (which matches the PPP configuration on the Newton.) AT+iRAU and AT+RAP are the commands you use to set the username and password. And of course you'll need to connect to your network using:</div>
<blockquote class="tr_bq">
AT+iWLSI=My_WiFi<br />AT+iWST0=4<br />AT+iWPP0=<WPA2 passphrase></blockquote>
I use PT-100 to configure the module. Then a Serial Internet configuration with a script. The script is simple. First, it pauses for a few seconds to give the module time to power on. Second, it sends the at+iSPPP:0 command to start the PPP server. Finally, it waits for the OK.<br />
<h3>
How Does it Work?</h3>
My goals when I started this were:<br />
<br />
<ul>
<li>The case had to close and everything had to be fully internal. </li>
<li>Find an antenna and antenna placement that would work without modifying the case or the shielding.</li>
<li>Enough range to reach my router from my couch...</li>
<li>Connecting my Newton to a WPA2 network.</li>
</ul>
<br />
In all, despite the flow control thing, I'm pretty happy with the end result. The project meets my requirements.<br />
<br />
I'm trying to decide if I want to do a v1.1 board with corrected flow control signals.Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-12796213883175119452015-04-02T17:12:00.002-04:002015-04-02T17:14:17.385-04:00Subsystem Power Configuration for Fun and ProfitUp till now, I have been following <a href="https://github.com/ekoeppen/Newton-Blunt-Support">Ekhart's template for enabling the serial signals</a>: directly calling the ROM functions to toggle SerPortSel. The only issue with this approach is that the OS also toggles these signals when a port is opened. This means you have to configure the signals after the serial port is opened.<br />
<br />
Wouldn't it be great if you could tell NewtonOS that you wanted SerPortSel to be "set to internal" when you open Serial0 or Serial3?<br />
<br />
The trick is the functions TVotagerPlatform::SetSubsystemPower() and its twin TVotagerPlatform::GetSubsystemPower(). These functions involve a bitmask that tells the Newton which power rails a subsystem requires. It is a 8-bit mask but is set/returned as a ULong. By looking at the disassembly of TVoyagerPlatform::PowerOnSubsystem(), I have found the following flags:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>#define kNeedsPowerOnSrc5v <span class="Apple-tab-span" style="white-space: pre;"> </span>0x01</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>#define kNeedsPowerOnSrc12v <span class="Apple-tab-span" style="white-space: pre;"> </span>0x02</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>#define kNeedsPowerOnIC5v <span class="Apple-tab-span" style="white-space: pre;"> </span>0x08</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>#define kNeedsPowerOnDMA <span class="Apple-tab-span" style="white-space: pre;"> </span>0x10</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>#define kSetPortSelectExternal<span class="Apple-tab-span" style="white-space: pre;"> </span>0x20</span><br />
<br />
The constant names are my own invention. The key one is kSetPortSelectExternal. When this bit is set, the NewtonOS conigures the SerPortSel LOW, indicating an external device connected to the interconnect port. When this bit is clear, it configures the SerPortSel HIGH, indicating that the internal serial slot will use the port.<br />
<br />
These functions need an index or ID of the subsystem involved. Again, looking at the disassembly, you find the relevant index. There may be more, but the ones involving the serial port are:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>#define kSerial0SubsystemIndex 1</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>#define kSerial3SubsystemIndex 3</span><br />
<br />
Again, the constant names are invented. So some simple pseudocode to tell NewtonOS "when you open 'mdem' set SerPortSel3 to HIGH" might be:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>theVotagerPlatform->GetSubsystemPower(3, &flag);</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>flag &= ~0x20; // clear the bit, setting internal</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>theVotagerPlatform->SetSubsystemPower(3, flag);</span><br />
<br />
When the serial port is opened in software, the NewtonOS reads the bitmask and enables the proper voltage supplies and sets the SerPortSel apporopriately. When the port is closed, the GPIO line is returned to its default state. Note for Serial0, the default state is "internal" (HIGH) until you open the port, as this disables the LTC1323 (used on the external port), probably to save power.<br />
<br />
These settings are reset on reboot, which I think is probably for the best. You could always have a Pacakge that sets the flags on boot.<br />
<br />
Currently, this is what I consider the "right way" or at least the "best known way" to use the serial port select signal for the internal slot. It is much better than manually toggling the signal with the SerialPortXLineDriverConfig functions.Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-61030324661225275832015-04-02T07:33:00.001-04:002015-04-02T07:34:38.680-04:00I dislike hardware flow controlI can't ever seem to get the flow control lines right. The current prototype only works with flow control disabled.<br />
<br />
<a href="http://www.unna.org/unna/apple/documentation/n2platform/n2-issdg.pdf">The N2 Platform docs</a> says that the Serial3 signals are"ModemNotCTS" and "ModemNotRTS". The WiReach docs also use inverted signals "nCTS" and "nRTS". So I connected them up to each other thinking that they're all using the same signaling logic.<br />
<br />
But I was wrong, and I think the n2 docs are too. It seems that the Newton's CTS line is not inverted. This can be verified with a loopback. When RX-TX are connected and RTS-CTS are connected, you will not get an echo when hardware flow control is enabled.<br />
<br />
Similarly, if you connect CTS to GND, you won't get an echo. If you connect CTS to 3v, you get the echo.<br />
<br />
So this tells me that CTS is not inverted. <a href="http://simmonmt.blogspot.com/2011/05/rtscts-handshaking-and-waveforms.html">Per this site</a>:<br />
<br />
<blockquote class="tr_bq">
<span style="background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; line-height: 20.799999237060547px;">RTS and CTS are normally held high (TTL 1). When high, no request (RTS) has been made, and no permission (CTS) has been granted. When the PC is ready to send data, it brings TTL RTS low. The MCU sees this. When the MCU is ready to receive data, it brings TTL CTS low. The PC sends data as long as TTL CTS is low, and stops when the MCU takes TTL CTS high.</span></blockquote>
The opposite seems to be happening no the Serial3 signal.<br />
<br />
So what next? Well the board works fine without hardware flow control... but I'm going to try and "<a href="http://en.wikipedia.org/wiki/Point-to-point_construction">dead bug</a>" a 1 gate inverter onto the board on the RTS line coming from the WiReach. It won't be pretty, but it should work.<br />
<br />Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-83823753006701901552015-04-01T07:15:00.001-04:002015-04-01T07:15:10.356-04:00Serial Channel 2The Newton's internal serial slot exposes 3 serial channels. Serial 1 and Serial 3 are the most interesting, as they have a full set of signals and are selectable by the selection signals.<div>
<br /></div>
<div>
I was searching for a way to control SerPortSel3 within software. When you open the serial port on the Newton, it sets SerPortSel3 LOW. I had hoped there was a parameter you could pass to the endpoint that would keep SerPortSel3 high. (See earlier posts)</div>
<div>
<br /></div>
<div>
I was searching the DDK headers and I found this (HALOptions.h)</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>#define kHWLocExternalSerial<span class="Apple-tab-span" style="white-space: pre;"> </span>'extr'</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>#define kHWLocBuiltInIR<span class="Apple-tab-span" style="white-space: pre;"> </span>'infr'</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>#define kHWLocBuiltInModem<span class="Apple-tab-span" style="white-space: pre;"> </span>'mdem'</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>#define kHWLocPCMCIASlot1<span class="Apple-tab-span" style="white-space: pre;"> </span>'slt1'</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>#define kHWLocPCMCIASlot2<span class="Apple-tab-span" style="white-space: pre;"> </span>'slt2'</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>#define kHWLocPCMCIAAnySlot<span class="Apple-tab-span" style="white-space: pre;"> </span>'slot'</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>#define kHWLocBuiltInExtra<span class="Apple-tab-span" style="white-space: pre;"> </span>'tblt'</span></div>
</div>
<div>
<br /></div>
<div>
<div>
kHWLocBuiltInExtra seemed promising. I haven't seen it mentioned in any of the other docs. So I whipped up a little package to enable it as a valid modem location:</div>
</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">InstallScript := func(partFrame,removeFrame)</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> begin</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>AddArraySlot(GetGlobals().ModemLocations, {title: "Modem", id:"mdem"});</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>AddArraySlot(GetGlobals().ModemLocations, {title: "Extra", id:"tblt"});</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> end;</span></div>
</div>
<div>
<br /></div>
<div>
I had hoped that 'tblt' would open Serial3 and set SerPortSel high. This is not the case. It turns out that kHWLocBuiltInExtra is actually Serial Channel 2.</div>
<div>
<br /></div>
<div>
The <a href="http://www.unna.org/unna/apple/documentation/n2platform/n2-overview.pdf">n2 platform documents say</a> that SerialChannel2 is a "low speed channel for printer support". I've also seen <a href="http://www.pda-soft.de/en/hardware/2x00/usb001/usb001.html">references that Serial2 is for keyboard</a>. Since Serial2 is not exposed on the external port, I don't think that it is used for the keyboard.</div>
<div>
<br /></div>
<div>
In all, kHWLocBuiltInExtra is one more piece of the internal serial slot puzzle.</div>
Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-40792892969172029322015-03-29T13:07:00.001-04:002015-03-29T17:21:05.955-04:00It Works! (Sorta...)It works! (Sorta)
I finally got all the parts together to assemble the project. I started by populating the 3.3v regualtor section of the board, just to make sure it works. It did, a nice stable 3.29v.<br />
<br />
I then proceeded to blow up the regulator somehow. I was trying to load it with a few ohms of load to simulate a 300mA draw... but that shouldn't destroy the thing. Maybe I connected something incorrectly or zapped it with static.
Luckly, I had enough parts to try again. Again I populated the 3.3v regulator first, and checked the output. Again, a nice output voltage. This time I threw caution to the wind and just populated the rest of the board.
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzzF2oEAXhiQN4uxCMc3Z_UlZOlK4P0IlL_J9HZ5_KuLkhz7QiYjKW-G5fR9ZNkdOeuAkd65fCuPnO1Zrht-jCw_5mRTkSddRjWbCO6-16uUn6TPH-0PwJZ8-pDOnV4fsZpiifCAtEoHtW/s1600/board.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzzF2oEAXhiQN4uxCMc3Z_UlZOlK4P0IlL_J9HZ5_KuLkhz7QiYjKW-G5fR9ZNkdOeuAkd65fCuPnO1Zrht-jCw_5mRTkSddRjWbCO6-16uUn6TPH-0PwJZ8-pDOnV4fsZpiifCAtEoHtW/s320/board.jpg" /></a></div>
At first I thought the thing was not working. But then I tried disabling flow control, and moudle responded.<br />
<br />
This means a few things:<br />
<br />
<ul>
<li> Power regulation seems to work as expected</li>
<li>The auto reset (which holds the module in reset until power-good) seems to work. </li>
<li>The buffer IC is forwarding the RX and TX lines between the Newton and the module properly. </li>
<li>My track record for screwing up hardware flow control may be unbroken. (Sadly)</li>
</ul>
Now there are a few things going on here, so maybe the hardware control isn't broken.
<br />
<br />
First, when PT-100 connects, it turns off the SerPortSel3 signal. This powers down the module. PT-100 then reports a Buffer Under-run... I can then manually toggle SerPortSel3 and communicate with the module.
I am wondering if the fact that the module is powered off during the process of opening the serial port does something to hardware flow control. Maybe it gets things in an inconsistent state. I am not sure.<br />
<br />
I haven't tried using NIE yet, but I was able to connect to my WiFi network (WPA2) and ping my router using the AT+i command set.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiF3nZ9YnbhdLS1sUbfnkvnd94DXLPrs82fwo2CQi9XM0MXp9q4QOtDFx0wZhOv3tl2BV8Rw_nt8wN6nQqn7uMJ8T0bhLeH14aXjR-rW3ZAnkqnTGApa3hOSzpNCKExfRgqpauAr-UiztOL/s1600/response.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiF3nZ9YnbhdLS1sUbfnkvnd94DXLPrs82fwo2CQi9XM0MXp9q4QOtDFx0wZhOv3tl2BV8Rw_nt8wN6nQqn7uMJ8T0bhLeH14aXjR-rW3ZAnkqnTGApa3hOSzpNCKExfRgqpauAr-UiztOL/s1600/response.jpg" height="240" width="320" /></a></div>
<br />
Now if only I can figure out why hardware flow control doesn't work! If someone wants to check my work, the relevant part of the circuit can be found below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiC04HqgIQm2z2ISY14NdpSwV6CL3v5Jh3JM8dIzcbL4suVZXJwQ5Yz029H63Gu5c25cl1PZAsQQmhw4urDC_DeHrqWr9-BITBb-W2-ZcGXu6Yw_FJxg2X2ZKa1_qpGocMxuKGJi6G5XhIt/s1600/circuit.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiC04HqgIQm2z2ISY14NdpSwV6CL3v5Jh3JM8dIzcbL4suVZXJwQ5Yz029H63Gu5c25cl1PZAsQQmhw4urDC_DeHrqWr9-BITBb-W2-ZcGXu6Yw_FJxg2X2ZKa1_qpGocMxuKGJi6G5XhIt/s1600/circuit.png" height="320" width="316" /></a></div>
<br />Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-7996041246288256422015-02-27T19:28:00.000-05:002015-03-01T09:17:22.211-05:00WiFi UpdateSome updates on the project:<br />
<ol>
<li>I was unhappy with the linear regulator's heat performance, so I changed to a switching module. This increased the number of passive components a bit. I found a <a href="http://www.ti.com/lit/ds/symlink/lmz21700.pdf">nice module from TI that has an integrated inductor</a>, so the whole thing still fits nicely. The PCB layout is tricky for switching regulators, but I did my best to follow the guidelines in the data sheet, so I'm hopeful it will work as expected. <br /><br />Rather than making a separate breakout board to prototype the regulator, I just went ahead and ordered the PCBs for the whole project. I'll reflow the regulator components first and test the circuit out before reflowing again to add the WiReach and additional components.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ4aDP7jJrlD6y4K1rqKKDQLCx4y_olrQa8hnFh9vkUwJaZLy5ZK8ADmgi9freF__ZoybBl78jo0QzECHO7snHbYpc-q4_y1y5GFtSOoSqYToHk7Wzlgv6mAhygwXFPD0KSUiBg0EcR-Gv/s1600/feb+design.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ4aDP7jJrlD6y4K1rqKKDQLCx4y_olrQa8hnFh9vkUwJaZLy5ZK8ADmgi9freF__ZoybBl78jo0QzECHO7snHbYpc-q4_y1y5GFtSOoSqYToHk7Wzlgv6mAhygwXFPD0KSUiBg0EcR-Gv/s1600/feb+design.jpg" height="200" width="182" /></a></li>
<li>Mathias suggested a buffer to translate between 3.3v and 5v signals, but this is all 3.3v logic. I did add a buffer for another reason-- the fact that the module is powered separately from the Newton means that the Newton can be pushing 3.3v logic signals when the module is powered off. I checked with ConnectOne and the module is tolerant to this, but it wastes power and possibly causes problems with an inconsistent state on power-up. By using a buffer, the logic signals are kept at the same voltage level as the module itself. I chose<a href="http://www.onsemi.com/PowerSolutions/product.do?id=MC74VHCT50A"> a buffer that has "power off protection on inputs and outputs"</a> which means the buffer can be at Vcc=0 and still tolerate signals coming from the Newton.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></li>
<li>I have an idea for the reset circuit. The power regulator has a "Power Good" output that holds to ground until the power regulation hits the target voltage. The idea is to tie this to the WiReach module's reset pin. This should hold the module in reset until the power regulator is fully online. This only costs one extra pull-up resistor.<br /><br />In case this strategy doesn't work, I've got an alternate setup where the Newton's extra GPIO can trigger the reset. The GPIO is looped through the buffer, again to keep the logic at the same voltage as the WiReach supply. A solder jumper selects which reset circuit you wish to use. The WiReach reset pin is an open-drain, and can be pulled low by the module. I added a 200 ohm resistor inline to limit the current should the Newton be outputting a 3.3v signal while the module is pulling down its own reset signal.</li>
<li>Switched the test pads to just pads rather than thru-holes. Moved them near the edge of the board so I can clip on with alligator clips to test. Exposed the reset and MSEL signals as test pads on the back of the board as well. These can be used to reset the module into rescue mode if necessary.</li>
<li>Some of the routing is a little odd but I tried to keep the jumpers on the bottom layer as short as possible. This resulted in few extra vias. I wanted to keep the ground plane as intact as possible.</li>
<li>I'm still paranoid about the hole locations and the physical design fitting properly, so I 3D printed another mockup to test the fit. Seems to work well. Hole placement is still iffy. I'd love to know the real measurements. Each time I tweak it a little, but never seem to be happy, so I'm finally just going with it.<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_JSBxtp9FJ30UIRpFG8M7_MTrq4lraGV_yyliLGrPCy-1oMWrMg1RudtleS9YgF1jfXkYeTHI1VAg68ptCjEch6TOiDZSoXVN6XEMUbl39j5yoA2T4ka48tFFWrlWdyuCrdDsLJ2tTrpi/s1600/feb+mockup.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_JSBxtp9FJ30UIRpFG8M7_MTrq4lraGV_yyliLGrPCy-1oMWrMg1RudtleS9YgF1jfXkYeTHI1VAg68ptCjEch6TOiDZSoXVN6XEMUbl39j5yoA2T4ka48tFFWrlWdyuCrdDsLJ2tTrpi/s1600/feb+mockup.jpg" height="320" width="239" /></a></li>
</ol>
<br />
So the board is off at <a href="http://imall.iteadstudio.com/">ITEAD Studio</a> being built, assuming it passes their error checks. <i>update: it passed error checks and is being manufactured</i> I also ordered two solder stencils from OSHStencils. I also built a reflow toaster out of an old toaster oven I got for free from a garage sale. All that's left is to get some solder paste. I also want to build a little pick and place jig to help place the small components.<br />
<br />
Hopefully this will all work in the end... and then there's still the antenna to figure out.<br />
________
<br />
<div class="footnotes">
<ol>
<li class="footnote" id="fn:1">The data sheet for the On Semi MC74VHCT50A is vague on exactly what "Power Down Protection Provided on Inputs and Outputs" actually means. I did a little testing on the bench, and found that when Vcc=0 the inputs and outputs seem to work like they are Hi-Z. (I'm not sure how to verify that they are definitively Hi-Z, but I can't measure any current flowing in or out when Vcc=0) It expect it to work for this application. <a href="#fnref:1">↩</a></li>
</ol>
</div>Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-78181482056696346712015-02-04T17:32:00.003-05:002015-02-06T16:52:12.443-05:00SSL: An Exercise for the ReaderAs a diversion, I tried to compiling an SSL library for the Newton. I settled on <a href="http://wolfssl.com/yaSSL/Home.html">CyaSSL</a>, because it is designed for constrained devices. For example, you can define macros that conditionally compile for devices that have NO_FILESYSTEM or NO_DEV_RANDOM. That sounds a lot like the Newton.<br />
<h2>
Building</h2>
I got surprisingly far in compiling the library. First you need to edit settings.h and add a section defining the compilation for the Newton, then pass this definition using "-D NEWTON" to the compiler:<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;"> #ifdef NEWTON<br /> #define USER_MATH_LIB<br /> #define BIG_ENDIAN_ORDER<br /> #define SINGLE_THREADED<br /> #define NO_DEV_RANDOM<br /> #define NO_FILESYSTEM<br /> #define NO_STDIO_FILESYSTEM<br /> #define CYASSL_USER_IO<br /> #define NO_WRITEV<br /> #define SIZEOF_LONG 4<br /> #define SIZEOF_LONG_LONG 4<br /> #endif</span></blockquote>
One issue is that the Newton doesn't seem to support an 8-byte integer data type. There is one configuration in settings.h where they <span style="font-family: Courier New, Courier, monospace;">#undef SIZE_OF_LONG_LONG</span>. (I assume this is if you don't have a long long datatype) When I try this, it throws an #error, so I set both <span style="font-family: Courier New, Courier, monospace;">SIZEOF_LONG</span> and <span style="font-family: Courier New, Courier, monospace;">SIZEOF_LONG_LONG</span> to 4 and everything seems to compile. (Note: There is a Int64 datatype in the C++ headers, but its just a struct with two longs.)<br />
<br />
Next you need to define a GenerateSeed() function in random.c. I just passed rand() from the CLibrary back. The Newton doesn't have a /dev/random or a good source of entropy that I know of. I just wanted to get things to compile. Randomness is important for encryption. In practice, a better source of entropy might be needed.<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">int GenerateSeed(OS_Seed* os, byte* output, word32 sz)<br />{<br /> return rand();<br />}</span></blockquote>
Next you'll find a odd casting error in internal.c in <span style="font-family: Courier New, Courier, monospace;">GetHandShakeHeader:</span><br />
<br />
<span style="font-family: Courier New, Courier, monospace;">File ":src:internal.c"; Line 3136 # Error: <function argument>: implicit cast of pointer loses 'const' qualifier</span><br />
<br />
The c24to32 is an inline function, and the const qualifier was getting lost for a reason I don't understand. I manually inlined the function in the one spot where there was a problem.<br />
<br />
In internal.h there is a buffer structure that throws the following error:<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">File ":cyassl:internal.h"; Line 930 # Error: 'buffer::buffer' must be a function<br />File ":cyassl:internal.h"; Line 931 # Fatal error: Failure of internal consistency check<br />odd ctor type in struct 'buffer'</span></blockquote>
The issue appears to be that the compiler does not like the struct being named the same as one of the members. I add an underscore to the struct name. This doesn't really affect anything else because its in a typedef and future code uses the type:<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">typedef struct buffer<span style="color: blue;">_</span> {<br /> word32 length;<br /> byte* buffer;<br />} buffer;</span></blockquote>
Next, you need to modify dh.c to use <span style="font-family: Courier New, Courier, monospace;"><fp.h></span> for the <span style="font-family: Courier New, Courier, monospace;">pow()</span> and <span style="font-family: Courier New, Courier, monospace;">log()</span> functions rather than math.h (which doesn't exist in the Newton C++ Toolkit) There is a place in dh.c for you to place this code, and a macro (USER_MATH_LIB) in the settings.h file that conditionally compiles it in.<br />
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;">#ifndef USER_MATH_LIB</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> #include <math.h></span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> #define XPOW(x,y) pow((x),(y))</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> #define XLOG(x) log((x))</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">#else</span><br />
<span style="color: blue; font-family: 'Courier New', Courier, monospace;"> #include <fp.h></span><br />
<span style="color: blue; font-family: 'Courier New', Courier, monospace;"> #define XPOW(x,y) pow((x),(y))</span><br />
<span style="color: blue; font-family: 'Courier New', Courier, monospace;"> #define XLOG(x) log((x))</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">#endif</span></blockquote>
Finally, you need to compile the c files. I snagged a list of the c files out of the make file (<span style="font-family: Courier New, Courier, monospace;">am__src_libcyassl_la_SOURCES_DIST</span>) and made my own little makefile to call ARMCpp using the mpw tool. (mosrun would work too, but I already had an mpw makefile from another project.) I took Demos.cp and Demos.exp from the NCT example code and modified them to call a few of the CyaSSL initialization functions. (Otherwise the linker won't link in any of the CyaSSL stuff, since its not used anywhere) I tried to link with ARMLink...<br />
<br />
...And... it links! I was surprised, because I expected there to be some random assembly file or something with symbols that I missed. The .sym file is around 386kB. Seems like a reasonable size.<br />
<h2>
Things go wrong: Static globals</h2>
The next step in using C/C++ code in a Newton app is to make the .ntkc package using the AIFtoNTK tool... and this is where things go wrong:<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">### AIFtoNTK - error - the file 'CyaSSL.sym' has a R/W global variables which is NOT supported in Newton packages.<br /># You can use 'const' global variables & '*const' pointers.</span></blockquote>
Per the "NCT Programmer's Reference":<br />
<blockquote class="tr_bq">
<span style="font-family: Times, Times New Roman, serif;"> Any global data that you reference in your C++ functions must be read-only data. You must reference this data with a constant pointer to constant data [...]<br /> <br /> You sometimes need to allocate memory for use in your C++ code that is like global data. Since you cannot use non-constant global data in your C++ code, you need to utilize a coordinated effort between your NewtonScript and C++ code to achieve this.</span></blockquote>
CyaSSL is pretty light on the static globals variables, but there are some sprinkled throughout. Here are some that I found using a simple grep:<br />
<ul>
<li> sniffer.c has a bunch, but I think this can be excluded</li>
<li> ssl.c has a mutex and a global random number generator object, and some related counters</li>
<li> io.c has errno as a global variable</li>
<li> des3.c has a few buffers and bytes, and a mutex</li>
<li> ecc.c has a cache of some sort.</li>
<li> memory.c uses globals to hold the malloc, free, and realloc functions. These can be changed to static globals and #ifndef out the inside of CyaSSL_SetAllocators, since it won't be necessary.</li>
<li> there may be others that I didn't find.</li>
</ul>
Not all of these get linked in, they all might not not need to be fixed. This is more retrofitting then I care to tackle. I'm guessing that we'd need to MakeBinary() on the NewtonScript side and access these binaries using the NCT functions for accessing NewtonScript objects.<br />
<h2>
Newton Globals</h2>
<div>
I put together a little stub function that simulates a global variable by storing a pointer in a NewtonScript frame and passing that information back and forth between the C++ code. The prototype looks something like this:</div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">void* NewtonGlobal(RefArg sym, long size);</span></blockquote>
<div>
You give the global a unique name and pass it as a symbol. If the symbol does not exist, a memory block of the given size is created, the pointer is stored in the NewtonScript frame and returned. If it does exist already, then the pointer is retrieved and returned.</div>
<div>
<br /></div>
<div>
With this a very ugly preprocessor macro can be used to remove the static global:</div>
<div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">static SessionRow SessionCache[SESSION_ROWS];</span></blockquote>
<div>
becomes</div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">#define SessionCache ((SessionRow*)NewtonGlobal(SYM(SessionCache),sizeof(SessionRow)*SESSION_ROWS))</span></blockquote>
Ugly, but it should work. I am able to compile, link, and package the CyaSSL library as a .ntkc file. My "test" file tries and calls a few of the CyaSSL function so that the linker will find them in the dependency tree... but in practice there may be more static globals to tackle.</div>
<h2>
Other considerations</h2>
Besides the globals issue, there needs to be some glue code that allows NewtonScript to call CyaSSL and pass data back and forth. NIE doesn't support the traditional concept of a "socket". On the plus side, CyaSSL has an abstracted I/O architecture. You can define functions for input and output instead of the default socket implementation.<br />
<br />
Also, its quite likely that there are many more compiling & linking issues hidden. When the library is used in practice, there will be more parts of the library in the dependency tree, and we may find new errors or static globals.<br />
<h2>
An Exercise for the Reader</h2>
I think that CyaSSL is a good choice for the Newton. If you're interested in learning more about CyaSSL, here are some good starting points:<br />
<br />
<div style="text-align: center;">
<a href="http://www.yassl.com/yaSSL/Docs-cyassl-porting-guide.html">http://www.yassl.com/yaSSL/Docs-cyassl-porting-guide.html</a></div>
<div style="text-align: center;">
<a href="http://yassl.com/yaSSL/Docs-cyassl-manual-5-portability.html">http://yassl.com/yaSSL/Docs-cyassl-manual-5-portability.html</a></div>
<br />
I don't know how many places these global variables might pop up in the CyaSSL code. Also I'm not an expert on NewtonScript/NIE Endpoints and what well designed "glue" might look like. Could it be done? Probably. It is more work than I want to tackle with this little digression. <br />
<br />
While I may dabble with this a little more, I don't think I'll see it through to completion. I invite someone else to pick up the ball run with it. You can find me on <a href="http://newtontalk.net/">NewtonTalk</a> if you have any questions about what I have tried up till this point. I'm happy to help out, but given the weird encryption export laws in the USA, I don't want to post any code directly.Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-12420584145695387192015-02-02T17:01:00.001-05:002015-02-02T17:03:50.201-05:00Initial Design of Internal WiReach WiFi Board<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh7APekBA4ZGMdQSSUryVoqa6ZSV06-Aj4y71QE2CzMR1Sw86w8Cw_Iajo_5l1yKchJfwEQaupgdYzVH4_fnUpex5oam81GfpKy3Ra7AqwUPfYyGIw7IVsRsgsSc0R9H5JOZUmZNDgk3Uu/s1600/slice1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh7APekBA4ZGMdQSSUryVoqa6ZSV06-Aj4y71QE2CzMR1Sw86w8Cw_Iajo_5l1yKchJfwEQaupgdYzVH4_fnUpex5oam81GfpKy3Ra7AqwUPfYyGIw7IVsRsgsSc0R9H5JOZUmZNDgk3Uu/s1600/slice1.png" height="305" width="320" /></a></div>
<br />
I have been triangulating on a final PCB design for an internal WiReach card. I am not an EE, so the design is hobbiest-grade at best. Here is the thinking behind some of what you see in the picture above:<br />
<br />
1. Board size is less than 5cm x 5cm in order to print it at <a href="http://imall.iteadstudio.com/">iTead Studio</a> at a reasonable cost. 10 of them on 0.8mm board should be around $15.<br />
<br />
2. Hole locations were determined based on trial and error. I have a 3D printer, so I printed 6 or so iterations of the board and then checked the fit and hole locations. If someone has better dimensions for the location of the mounting points, please let me know. <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkMAVtvZljEYeVxeW0yLHs5Fg_Zgp0_RJk8OcUSmVwCm-b46yUJuStuKFVbaTjt00wLT5wxoQ9UYqtKERbeJzwC_eM4ERhgZPPoznfB_StH9s5iZiRMvgLqfRVIOMPVDIrFVbFb51wzyKA/s1600/testboard.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkMAVtvZljEYeVxeW0yLHs5Fg_Zgp0_RJk8OcUSmVwCm-b46yUJuStuKFVbaTjt00wLT5wxoQ9UYqtKERbeJzwC_eM4ERhgZPPoznfB_StH9s5iZiRMvgLqfRVIOMPVDIrFVbFb51wzyKA/s1600/testboard.jpg" height="200" width="200" /></a></div>
<br />
Screw size seems to be #1-72. Length is 3/8". Flat head. Phillips. Shannon from NewtonTalk was selling an original SER-001 on eBay. I have a SER-001 too, but I've lost the screws. Shannon was nice enough to measure the screws for me, and confirm that the head diameter is ~0.136. This seems consistant with McMaster part number <a href="http://www.mcmaster.com/#91771a168/=vqluox">91771A168</a>, but I would love to find an flat undercut version of this screw. Unfortunately, it doesn't seem to be available in this length. At least now I can get some screws for both my SER-001 and this project!<br />
<br />
Eagle PCB tends to want to route things across the mounting holes as plated vias. Since these holes will need to be countersunk, I didn't want to rely on these holes. Drilling the countersink will break the plated thru hole. Hence a couple of extra vias are nearby to make sure there isn't an issue.<br />
<br />
3. I trimed down one side of the board to give a little more clearance for the microphone and power switch wires. This isn't strictly necessary, since the wires have their own recess in the stylus assembly. Since I don't know how/where I'm going to route the antenna yet, but I figured a little extra room wouldn't hurt.<br />
<br />
4. I added a 500mA PTC Fuse, since the battery leads are unfused. While there's not going to be any external connector to short out, I figured this was a safe play.<br />
<br />
5. I chose the Texas Instruments REG103 regulator, mainly because I was able to get a handful cheaply on eBay and it has a shutdown input. Also its pretty low profile and won't interfere with mainboard components. The shutdown signal will will be driven by SerPortSel3. SerPortSel3 is normally low, keeping the regulator off. When toggled high in software the regulator will come online and power the WiReach. This way, the module will only be powered when in use. This regulator can handle 500mA. At peak, the WiReach should only use 60% of this amount.<br />
<br />
6. The large copper planes on the top side are for battery power, ground and 3.3v. The intent to help cool the regulator. I'm not sure what the thermal characteristics will be in practice. Power and ground traces are 30 mils wide, which is more than double what the online trace width calulators say you need for 500mA.<br />
<br />
7. Headers for debugging give access to the power lines on one side and the communication lines on the other. In practice, I intend to tape over the pads so that there's no possibility of a short. (I may go a little crazy with Kapton tape just to make sure the board doens't flex into something and cause a short to the mainboard.)<br />
<br />
8. The ground plane on the backside is only broken by a few signal jumpers where routing couldn't be done on the top side.<br />
<br />
My next steps are to verify the connections one more time to make sure everything is correct, and then send the board off to be made. In the interem, I'm going to build a reflow toaster oven.Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-36850014361841801152015-01-19T19:52:00.002-05:002015-01-19T19:52:18.955-05:00WiReach Module Connection TestAll of this work on the internal serial slot is in support of my WiFi module project. The goal is to build an internal interface to a <a href="http://www.connectone.com/?page_id=3527">ConnectOne WiReach</a> module. I like this module for a few reasons:<br />
<br />
<ol>
<li>It supports modern wireless networking, such as WPA2. There isn't any native way for the Newton to connect to a modern WiFi network, and likely there never will be.</li>
<li>It supports a PPP server. This means that the module can appear to Newton Internet Enabler (NIE) as a PPP dialup server. In effect, you can "dial up" to a wifi network.</li>
<li>It supports an AT command set for configuration-- so you can send a few commands from PT-100 or using the script utility in NIE to configure the module. </li>
</ol>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSAbsxQSqxXPD_YIKbFhTbEzkXPISYsJQwkgHsd9fIJTloKlU0rbH4YvrXmXah8H3jn-YbLCQpfuZ9WTYeSlJvktSuY9A12zSwPcaw9wlHodCUdtjkfkVCv_RVQq1fcqV1xTNgzHlVsPPo/s1600/IMG_0657.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSAbsxQSqxXPD_YIKbFhTbEzkXPISYsJQwkgHsd9fIJTloKlU0rbH4YvrXmXah8H3jn-YbLCQpfuZ9WTYeSlJvktSuY9A12zSwPcaw9wlHodCUdtjkfkVCv_RVQq1fcqV1xTNgzHlVsPPo/s1600/IMG_0657.jpg" height="400" width="278" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I've done some testing today and found that it works really well. A few caveats:</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li>The Newton's internal 3.3v regulator is not sufficient to run the module. This was expected, but it does mean that any design will have to have a 3.3v regulator that runs off of the battery supply lines. Luckily the internal serial slot does provide access directly to the battery.</li>
<li>Hardware flow control seems to work. I have a history of messing up the pinout, so I'l probably have a solder jumper that you can cut if you want to disable hardware flow control.</li>
<li>There's a giant capacitor right where I would want the module to sit. I think that that there is enough clearance in the area, but I'm starting to be concerned about how this will all fit.</li>
</ul>
<div>
My current thinking is to use the SerPortSel3 line to control the 3.3v regulator shutdown. Serial3 is just as fast as Serial0 (even though the specs say that Ser3 is slower, this doesn't appear to be the case, it works fine at 119200) I wouldn't want the module running all the time, drawing power. SerPortSel3 would work to turn on and off power to the module. Since no one ever connects anything to Serial3 externally, I am thinking that I might skip a tri-state bus buffer. </div>
<div>
<br /></div>
Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-48464199347246720282015-01-18T18:06:00.002-05:002015-01-18T19:42:33.362-05:00Posted to GitHub: Internal Serial Enabler<br />
I have posted the source to "Internal Serial Enabler" - a small newton app that allows you to view and control a few of the signals of the internal serial slot on the MessagePad 2x00:<br />
<div>
<ul>
<li><b>gpSerPortSel</b> - the serial port 0 selection signal. When high, the internal serial driver is disabled, leaving Serial0 available for the internal slot.</li>
<li><b>PortSelect</b> - the serial port 3. When high, Serial3 is available for the internal slot. When low, Serial3 is dedicated for the external interconnect port.</li>
<li><b>General Purpose I/O</b> - Pin 26 can either be an input or output signal. Using the app, you can select whether you want the app to be an input or an output. If you select 'output', you can control the signal.</li>
</ul>
<div>
The application polls all three I/O signals and updates the user interface state every 1/2 second. This will allow you to see when other applications or NewtonOS makes changes. The gpSerPortSel pin does toggle on and off, enabling/disabling the driver. This is likely for power saving.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhypIdwmLGA5rJNspsfHIDyp_NvovJs-R0iFM543lgk3b5g1XguQd6F7Y-OsQCAZADPHlZXSDLzWJx3vxCyMqBl5KEFRM5UYvRN2WFxNWRbMauQd3us6nxsgqXIvIMS1F9KYluegbqCyH2q/s1600/screenshot.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhypIdwmLGA5rJNspsfHIDyp_NvovJs-R0iFM543lgk3b5g1XguQd6F7Y-OsQCAZADPHlZXSDLzWJx3vxCyMqBl5KEFRM5UYvRN2WFxNWRbMauQd3us6nxsgqXIvIMS1F9KYluegbqCyH2q/s1600/screenshot.jpg" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Once again, I can't credit Eckhart Köppen enough for posting the source to <a href="https://github.com/ekoeppen/Newton-Blunt-Support">Newton-Blunt-Support</a>. It is how I learned to call arbitrary ROM functions.</div>
<div>
<br /></div>
<div>
This application is <b>intended for developers </b>working on hardware for the internal serial slot. If you are not such a person<b>, do not install this application. </b> It should be harmless for a Newton with an empty internal serial slot. Even still, you are toggling hardware signals with undocumented ROM functions... there is the potential to do hardware damage.</div>
</div>
<div>
<br /></div>
<div>
You can find the source and a pre-built package on GitHub here: <a href="https://github.com/jake-b/Newton-Internal-Serial-Enabler">https://github.com/jake-b/Newton-Internal-Serial-Enabler</a> I have released it under GPL v2.0 and as always,<b> use it at your own risk!</b></div>
Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-44169430599848163792015-01-16T17:37:00.003-05:002015-01-17T10:56:32.707-05:00General Purpose I/O LinePin 26 on the internal serial slot is listed as a "General Purpose I/O". The <a href="http://www.unna.org/unna/apple/documentation/n2platform/n2-issdg.pdf">Internal Serial Slot Developers Guide</a> says that this pin can be configured as either an input or output.<br />
<br />
The question is, how is this pin connected? What GPIO or DIO pin is it connected to?<br />
<br />
Well the answer seems to be GPIO #9. Again a little tweaking of Eckhart's code lets you call the relevant functions and toggle the pin.<br />
<br />
Also, you can configure the pin as an input, and things work as expected. From a hardware design perspective, however, this pin will likely be an output (pulled to ground) until your software configures it as an input... so your hardware should be tolerant of the pin as both an input and an output.<br />
<br />
One interesting note, is the <a href="http://www.unna.org/unna/apple/documentation/n2platform/n2-overview.pdf">N2 platform overview</a> (p 1-29) document lists this GPIO as "Serial NOT CP Enable". This doesn't seem accurate. Also DIO #2 is listed as "Available for Configuration to the Slot". DIO #2 is the output we use to configure SerPortSel3. Perhaps there is a documentation error here and these signals are reversed. Maybe these were reversed in the final hardware design and the documents were never updated. Its a mystery.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDstRFCK9ZuTxPOQdEQ0LKxSf1dsvSYMxTFl1p-BPsCylVj8QmrWIeczbU_5Kqm3VY79okhgpmNvGcpcRwZYhtkEadDUTpBMy6CLvkhJFsZRNZ7vUZJHS2Lo-paiShICmTlpj9DjgYjWo_/s1600/SDE.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDstRFCK9ZuTxPOQdEQ0LKxSf1dsvSYMxTFl1p-BPsCylVj8QmrWIeczbU_5Kqm3VY79okhgpmNvGcpcRwZYhtkEadDUTpBMy6CLvkhJFsZRNZ7vUZJHS2Lo-paiShICmTlpj9DjgYjWo_/s1600/SDE.jpg" /></a></div>
I also updated my little app to support the GPIO pin for both input and output. I'll post the code to Github soon. Really this is intended for developer use, so it is not recommended that the average user install this application on their Newton.Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-79349169038008692002015-01-14T20:22:00.001-05:002015-01-14T20:54:01.614-05:00Manually controlling the SerPortSel PinsEckhart Köppen, author of the Blunt, the Newton bluetooth stack, has posted <a href="https://github.com/ekoeppen/Newton-Blunt-Support">code on GitHub</a> for manually controlling the SerPortSel3 signal. His code manually controls the proper DIO pins using functions in the Newton ROM.<br />
<div>
<br /></div>
<div>
While this method works great for Serial3, I wanted to also control Serial0. So I started looking at the ROM. I found two functions in the ROM explicitly for controlling these signals:</div>
<div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">0x0026d050 SerialPort0LineDriverConfig__16TVoyagerPlatformFUcT1</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">0x0026d094 SerialPort3LineDriverConfig__16TVoyagerPlatformFUcT1</span></blockquote>
I took a look at the assembly for these functions and found them to be pretty simple. The first parameter seems to be a boolean and the second a bitfield. I'm not exactly sure what the second parameter does, but it changes the behavior of the function when it finds the 0x20 bit set.<br />
<br />
From what I can tell, for the Port3 function, you can leave the second parameter as 0x0 and the first parameter is a bool that controls the signal. For the Port0 function, the first parameter the logical inverse of the signal you want, and the second parameter should be 0x20.<br />
<ul>
<li><span style="font-family: Courier New, Courier, monospace; font-size: x-small;">SerialPort0LineDriverConfig(0,0) // results in Port0Sel High </span></li>
<li><span style="font-family: Courier New, Courier, monospace; font-size: x-small;">SerialPort0LineDriverConfig(1,0) // results in Port0Sel High </span></li>
<li><span style="font-family: Courier New, Courier, monospace; font-size: x-small;">SerialPort0LineDriverConfig(0,0x20) // results Port0Sel High </span></li>
<li><span style="font-family: Courier New, Courier, monospace; font-size: x-small;">SerialPort0LineDriverConfig(1,0x20) // results Port0Sel Low </span></li>
</ul>
<ul>
<li><span style="font-family: Courier New, Courier, monospace; font-size: x-small;">SerialPort3LineDriverConfig(0,0) // results in Port3Sel Low </span></li>
<li><span style="font-family: Courier New, Courier, monospace; font-size: x-small;">SerialPort3LineDriverConfig(1,0) // results in Port3Sel High </span></li>
<li><span style="font-family: Courier New, Courier, monospace; font-size: x-small;">SerialPort3LineDriverConfig(0,0x20) // results in Port3Sel Low </span></li>
<li><span style="font-family: Courier New, Courier, monospace; font-size: x-small;">SerialPort3LineDriverConfig(1,0x20) // results in Port3Sel Low</span></li>
</ul>
Eckhart's code is an awesome blueprint for calling arbitrary memory locations, so it was easy to modify it to call these two functions. Putting it all together, I whipped up this little Newton application:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHMrrHMc-Uv1DB_gWQzhcuV20X0p7J0WiMO9PivICokBvXw096Jz9tmN_yxcthJiZ81aiXb0PddSVaD7rciWmuxPwnx4uhSzHck9OM5zcPtmR8tKfaT9_cbUKpTGflAnn6NuOWDDQW63C6/s1600/serial_enabler_screenshot.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHMrrHMc-Uv1DB_gWQzhcuV20X0p7J0WiMO9PivICokBvXw096Jz9tmN_yxcthJiZ81aiXb0PddSVaD7rciWmuxPwnx4uhSzHck9OM5zcPtmR8tKfaT9_cbUKpTGflAnn6NuOWDDQW63C6/s1600/serial_enabler_screenshot.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
Still a little more work to do, but good enough for development and testing.<br />
<br />
Incidentally, when called with the correct parameters, the assembly behind SerialPort3LineDriverConfig is virtually identical to Eckhart's code. The SerialPort0LineDriverConfig is very similar but uses as GPIO instead of DIO.</div>
Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-91883684640167595002015-01-14T19:56:00.001-05:002015-01-14T19:56:09.238-05:00The SerPortSel Pins<br />
The internal serial port of the Newton MessagePad 2x00 exposes the same ports as the external interconnect. In order to prevent two devices (one internal, one external) from diving the port at the same time, there are "Serial Port Select Pins" for Serial Channel 0 and Serial Channel 3.<div>
<br /></div>
<div>
The "Internal Serial Slot Designer's Guide states:</div>
<div>
<br /></div>
<blockquote class="tr_bq">
<b>Pin 1 PortSelect</b>:<br />This is the control signal to select between a peripheral in the internal Serial SLot and the Newton Interconnect Port. When the signal is low, the Newton Interconnect POrt may drive the Serail Port 3 Signals. When the signal is high, the Internal Serial Slot Peripheral may drive the Serial Port 3 Signals.</blockquote>
<blockquote class="tr_bq">
<b>Pin 8 gpSerPortSel</b><br />This signal controls the LTC 1323 line driver for Serial Port 0 that drives the 26 pin Newton Interconnect Port. When Low, the Newton Interconnect Port can drive Serial Port 0. When high, the internal Serial Device can drive serial port 0 on the 32 pin connector.</blockquote>
<div>
The signals are most critical for Serial0, which has the LTC1323 driver on the main board which will attempt to drive the signal lines unless Pin 8 is high. For Serial3, there are few (if any) devices that ever connected to the external interconnect port and used Serial3, so the potential for conflict is less. Even still a "good citizen" will still honor these signals. A bus driver buffer that can tristate these signals when not selected by these logic signals should probably be used.</div>
<div>
<br /></div>
<div>
One interesting wrinkle is an <a href="http://lists.newtontalk.net/pipermail/newtontalk/2015-January/012295.html">observation by Matthias Melcher:</a></div>
<div>
<br /></div>
<div>
<blockquote class="tr_bq">
Serial Port 0 uses gpSerPortSel on pin 8. When gpSerPortSel switches high, the card must respond with a low on DCD (5).</blockquote>
</div>
<div>
Basically, Matthias has found a sort of handshake where the Newton checks to see if a modem is present, and if the modem answers properly, it will leave the modem port selected. I have not yet reproduced this, but I have seen a 5ms pulse when connecting to Serial0 on the Newton. This pulse may be an interrogation. I have yet try and respond on DCD to see if the port stays high (internal port selected).</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWA4aYlAVC8lCX1hABc43tDHj7_WX65J1OLnAgsKJDntPZw4H6yuij_S_Abq_z8UyCnHa90e7Eud6qv58eurQ4ejDfoYCSrhsftJuRvfsZPlFj1iDKhe-DNBuKsQBkOJDwcC5yEc5PKJIj/s1600/152248_hardcopy.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWA4aYlAVC8lCX1hABc43tDHj7_WX65J1OLnAgsKJDntPZw4H6yuij_S_Abq_z8UyCnHa90e7Eud6qv58eurQ4ejDfoYCSrhsftJuRvfsZPlFj1iDKhe-DNBuKsQBkOJDwcC5yEc5PKJIj/s1600/152248_hardcopy.png" height="240" width="320" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-57359111718572028622015-01-14T19:33:00.000-05:002015-01-14T19:39:13.902-05:00The Internal Interconnect PortI seem to have an odd, recurring interest in the internal serial port on the MP2x00. A few years back I tried to make an internal bluetooth module. It worked, but I never got the RF design correct so it didn't work well.<br />
<br />
Now, I'd like to try for an internal WiFi module. I'm more hopeful that I can get the antenna correct by using more off the shelf components and, worst case, an external antenna.<br />
<br />
The internal port was originally designed for an internal modem that was never produced. Luckily, some of the design documents were leaked and are now available. The documents give you part of the picture, but there are omissions and errors that make the process a bit more of an exercise in reverse engineering.<br />
<br />
I wanted a breakout board that would help prototype and test the behavior of some of the GPIO pins and such. I came up with this:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyMmhOhj7NbSaVkxc8HxcNCPk74thjd3sWBfnABrQZv2UxaweP4f12Szcmrqj8t3zMRSKkHkgrzE1lv7u9CV6_AwYGx__XNvzhZ1iW9NipOI13FCqpyddWkU8JHx2PE8z5JkTAmqt9FBdh/s1600/n2_breakout.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyMmhOhj7NbSaVkxc8HxcNCPk74thjd3sWBfnABrQZv2UxaweP4f12Szcmrqj8t3zMRSKkHkgrzE1lv7u9CV6_AwYGx__XNvzhZ1iW9NipOI13FCqpyddWkU8JHx2PE8z5JkTAmqt9FBdh/s1600/n2_breakout.jpg" height="175" width="320" /></a></div>
<br />
<br />
The connector is a FTE-116-01-G-DV-ES. It is easier to find without the -ES option, FTE-116-01-G-DV-P for example is available from Newark electronics. The ES is just an end shroud, which while a nice thing, is not strictly necessary. I think the pins are a little longer than the original JAE connector, so it sits a little high. The case seems to close so I'm hopeful that it'll work for an internal card as well.<br />
<br />
I had 20 of these boards made for $15. You'll have to solder the connector on there yourself, but if you're playing around with this sort of thing, you probably know how to handle surface mount pins of this size.Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.comtag:blogger.com,1999:blog-4253090725404116376.post-50186291581164829952015-01-14T18:28:00.000-05:002015-01-14T18:28:53.969-05:00WelcomeThe Apple Newton is still one of my favorite gadgets. Even now, almost 20 years later, my Newton MessagePad can do things that a modern iPad cannot. Every six years or so I pull my Newton out of a drawer and it captures my interest.<br />
<br />
I don't blog, but I needed a place to post some content and images. Blogger seemed as good a place as any-- its free, and likely will be around as long as Google is. <br />
<br />
I'm currently in one of my six year periods of fascination. When I loose interest again and the Newton takes its place back in the drawer, this information posted here hopefully will still be available for archival purposes.<br />
<br />
<br />Jakehttp://www.blogger.com/profile/03841942369084354380noreply@blogger.com