It 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.

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.

WiFi Update

Some updates on the project:

  1. 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 nice module from TI that has an integrated inductor, 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. 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.
<a href="http://4.bp.blogspot.com/-ysFtbj1Tb24/VPEKyRo1JCI/AAAAAAAAAbg/hu4x6O63L2A/s1600/feb%2Bdesign.jpg" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img loading="lazy" decoding="async" border="0" src="http://4.bp.blogspot.com/-ysFtbj1Tb24/VPEKyRo1JCI/AAAAAAAAAbg/hu4x6O63L2A/s1600/feb%2Bdesign.jpg" height="200" width="182" /></a></li> 

  * Mathias suggested a buffer to translate between 3.3v and 5v signals, but this is all 3.3v logic. &nbsp;I did add a buffer for another reason&#8211; 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. &nbsp;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. &nbsp;By using a buffer, the logic signals are kept at the same voltage level as the module itself. &nbsp;I chose [a buffer that has &#8220;power off protection on inputs and outputs&#8221;][2] which means the buffer can be at Vcc=0 and still tolerate signals coming from the Newton.<sup><a href="/#fn:1" rel="footnote">1</a></sup>
  * I have an idea for the reset circuit. &nbsp;The power regulator has a &#8220;Power Good&#8221; output that holds to ground until the power regulation hits the target voltage. &nbsp; The idea is to tie this to the WiReach module&#8217;s reset pin. &nbsp;This should hold the module in reset until the power regulator is fully online. &nbsp;This only costs one extra pull-up resistor. 
    In case this strategy doesn&#8217;t work, I&#8217;ve got an alternate setup where the Newton&#8217;s extra GPIO can trigger the reset. &nbsp;The GPIO is looped through the buffer, again to keep the logic at the same voltage as the WiReach supply. &nbsp;A solder jumper selects which reset circuit you wish to use. &nbsp;The WiReach reset pin is an open-drain, and can be pulled low by the module. &nbsp;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> 
    
      * Switched the test pads to just pads rather than thru-holes. &nbsp;Moved them near the edge of the board so I can clip on with alligator clips to test. &nbsp;Exposed the reset and MSEL signals as test pads on the back of the board as well. &nbsp;These can be used to reset the module into rescue mode if necessary.
      * Some of the routing is a little odd but I tried to keep the jumpers on the bottom layer as short as possible. &nbsp;This resulted in few extra vias. &nbsp;I wanted to keep the ground plane as intact as possible.
      * I&#8217;m still paranoid about the hole locations and the physical design fitting properly, so I 3D printed another mockup to test the fit. &nbsp;Seems to work well. &nbsp;Hole placement is still iffy. &nbsp;I&#8217;d love to know the real measurements. &nbsp;Each time I tweak it a little, but never seem to be happy, so I&#8217;m finally just going with it. 
        <a href="http://1.bp.blogspot.com/-20_jT-boE0A/VPELRWwiKrI/AAAAAAAAAbo/-X0mRQD5-lo/s1600/feb%2Bmockup.jpg" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img loading="lazy" decoding="async" border="0" src="http://1.bp.blogspot.com/-20_jT-boE0A/VPELRWwiKrI/AAAAAAAAAbo/-X0mRQD5-lo/s1600/feb%2Bmockup.jpg" height="320" width="239" /></a></li> </ol> 
        
        So the board is off at [ITEAD Studio][3] being built, assuming it passes their error checks. _update: it passed error checks and is being manufactured_&nbsp;I also ordered two solder stencils from OSHStencils. &nbsp;I also built a reflow toaster out of an old toaster oven I got for free from a garage sale. &nbsp;All that&#8217;s left is to get some solder paste. &nbsp;I also want to build a little pick and place jig to help place the small components.
        
        Hopefully this will all work in the end&#8230; and then there&#8217;s still the antenna to figure out.  
        \___\_____ 
        
        <div>
          <ol>
            <li>
              The data sheet for the On Semi MC74VHCT50A is vague on exactly what &#8220;Power Down Protection Provided on Inputs and Outputs&#8221; actually means. &nbsp;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&#8217;m not sure how to verify that they are definitively Hi-Z, but I can&#8217;t measure any current flowing in or out when Vcc=0) It expect it to work for this application.&nbsp;<a href="/#fnref:1">?</a>
            </li>
          </ol>
        </div>

SSL: An Exercise for the Reader

As a diversion, I tried to compiling an SSL library for the Newton.  I settled on CyaSSL, 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.

Building#

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:

Initial Design of Internal WiReach WiFi Board

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:

  1.  Board size is less than 5cm x 5cm in order to print it at iTead Studio at a reasonable cost.  10 of them on 0.8mm board should be around $15.

WiReach Module Connection Test

All 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 ConnectOne WiReach module.  I like this module for a few reasons:

  1. 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.
  2. 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.
  3. 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.  
I’ve done some testing today and found that it works really well.  A few caveats:
  • 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.
  • 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.
  • 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.
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. 

Posted to GitHub: Internal Serial Enabler

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 2×00:

  • gpSerPortSel – the serial port 0 selection signal.  When high, the internal serial driver is disabled, leaving Serial0 available for the internal slot.
  • PortSelect – the serial port 3.  When high, Serial3 is available for the internal slot.  When low, Serial3 is dedicated for the external interconnect port.
  • General Purpose I/O – 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.
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.
Once again, I can’t credit Eckhart Köppen enough for posting the source to Newton-Blunt-Support.  It is how I learned to call arbitrary ROM functions.
This application is intended for developers working on hardware for the internal serial slot.  If you are not such a person, do not install this application.   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.
You can find the source and a pre-built package on GitHub here: https://github.com/jake-b/Newton-Internal-Serial-Enabler  I have released it under GPL v2.0 and as always, use it at your own risk!

General Purpose I/O Line

Pin 26 on the internal serial slot is listed as a “General Purpose I/O”.  The Internal Serial Slot Developers Guide says that this pin can be configured as either an input or output.

The question is, how is this pin connected?  What GPIO or DIO pin is it connected to?

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.

Manually controlling the SerPortSel Pins

Eckhart Köppen, author of the Blunt, the Newton bluetooth stack, has posted code on GitHub for manually controlling the SerPortSel3 signal.  His code manually controls the proper DIO pins using functions in the Newton ROM.

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:

0x0026d050 SerialPort0LineDriverConfig__16TVoyagerPlatformFUcT1
0x0026d094 SerialPort3LineDriverConfig__16TVoyagerPlatformFUcT1

The SerPortSel Pins

The internal serial port of the Newton MessagePad 2×00 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.

The “Internal Serial Slot Designer’s Guide states:

Pin 1 PortSelect:
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.

The Internal Interconnect Port

I 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.

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.