{"id":259,"date":"2017-03-09T15:41:04","date_gmt":"2017-03-09T20:41:04","guid":{"rendered":"https:\/\/jimandnoreen.com\/?p=259"},"modified":"2017-03-09T15:41:04","modified_gmt":"2017-03-09T20:41:04","slug":"a-usb-adapter-for-the-apple-newton-keyboard","status":"publish","type":"post","link":"https:\/\/jimandnoreen.com\/?p=259","title":{"rendered":"A USB adapter for the Apple Newton keyboard"},"content":{"rendered":"<p>Back in the pre-smartphone days, the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Apple_Newton\">Apple Newton<\/a> was the first device in the PDA category.\u00a0 Newtons were only sold for five years between 1993 and 1998, when Steve Jobs pulled the plug on the program.\u00a0 Although Apple frequently took a ribbing for problems with the Newton&#8217;s handwriting recognition feature, its main problem with achieving market dominance was Newton&#8217;s high cost.\u00a0 Although it beat the wildly successful Palm Pilot to market, Newton could not compete on price.<\/p>\n<p>One of Newton&#8217;s accessories was a very compact keyboard (just a hair over 10 inches wide).\u00a0 I had one rattling around in my spare parts bin and it was the perfect size to use with the SunFounder Display and Raspberry Pi one-piece computer that I <a href=\"https:\/\/jimandnoreen.com\/?p=253\" target=\"_blank\">recently assembled<\/a>.<\/p>\n<p>Only one problem, no way to plug it in.\u00a0 The Newton keyboard outputs a serial data stream and the RasPi (like most other modern computers) requires a USB keyboard.\u00a0 Further complicating matters, the Newton keyboard does not produce ASCII characters.\u00a0 Like the legacy IBM XT and AT keyboards, the Newt keyboard outputs a unique scan code for each key.\u00a0 One code is sent when the key is pressed and another gets sent when the key is released.<\/p>\n<p>I was surprised to find that nobody currently sells a pre-built adapter to do the serial to USB conversion.\u00a0 (Such adapters exist for IBM keyboards, but are not pin or code compatible with the Newt keyboard).\u00a0 The only homebrew solution I could locate was from a guy in Japan who posted <a href=\"https:\/\/www.youtube.com\/watch?v=OXCJfMTlV_g\">this video<\/a> but little else in the way of details.<\/p>\n<p>I was able to piece together the following information from various sources:<\/p>\n<ul>\n<li>The Newton keyboard runs at 5V (technically 4.5 volts) and produces a 5V TTL compatible signal<\/li>\n<li>Baud rate is 9600-N-8-1<\/li>\n<li>We can connect it to a microcontroller using three pins:\u00a0 pin 2 &#8211; +5V, pin 8 &#8211; signal, shield &#8211; ground<\/li>\n<li>The key scan codes are similar but not identical to those use by IBM AT keyboards<\/li>\n<\/ul>\n<p>To make the Newt keyboard impersonate a USB keyboard, I would need to remap the serial data to USB.\u00a0 This job calls for a small, cheap, 5V tolerant microcontroller having both serial and USB interfaces.<\/p>\n<p>The <a href=\"https:\/\/www.amazon.com\/gp\/product\/B00NC43256\/ref=as_li_ss_tl?ie=UTF8&amp;psc=1&amp;linkCode=ll1&amp;tag=therat00-20&amp;linkId=747ca8f682927620f58215bbeb8c7dba\">Teensy 2.0 board<\/a> is perfect for this purpose.\u00a0 It can impersonate all kinds of HID devices like mice, keyboards, joysticks, etc. and it is compatible with the <a href=\"http:\/\/arduino.cc\">Arduino <\/a>IDE, which comes with a great keyboard library that can do all the heavy lifting.<\/p>\n<p>If you want to build your own adapter and are familiar with building Arduino projects, feel free to grab the sketch <a href=\"https:\/\/jimandnoreen.com\/?page_id=185\">here<\/a>.\u00a0 Pinouts are in the readme file and you can install the Teensy (or MC board of your choice) within the Newton keyboard or in an external enclosure.<\/p>\n<p>If you&#8217;d like step-by-step directions for my build, please continue reading.<\/p>\n<h3>Bill of Materials<\/h3>\n<ul>\n<li><a href=\"http:\/\/amzn.to\/2mkorJa\">Teensy 2.0 microcontroller<\/a> development board (there are several Teensy versions;\u00a0 make sure you use one that operates at 5 volts).<\/li>\n<li>An 8-pin mini-DIN M\/F or F\/F cable like <a href=\"http:\/\/amzn.to\/2mHu4nu\">this one from Cables to Go<\/a>.\u00a0 We will be cutting off the female end to connect to the Newton keyboard.\u00a0 Any similar legacy Apple serial cable would work<\/li>\n<li>A suitable <a href=\"http:\/\/amzn.to\/2n0rd9Z\">enclosure <\/a>for the Teensy.\u00a0 Note that there is plenty of room inside the Newton keyboard case.\u00a0 If you don&#8217;t mind opening it up, you can mount the Teensy board inside.<\/li>\n<li>A short <a href=\"http:\/\/amzn.to\/2mkFsDi\">USB A to mini B cable<\/a> to connect your computer to the Teensy board<\/li>\n<\/ul>\n<h3>Hardware Assembly<\/h3>\n<ol>\n<li>Cut off the female end of your serial cable leaving at least a couple inches of wire.<\/li>\n<li>If you are using the Cables to Go cable, solder the brown \u00a0wire to VCC (+5 Volts), the purple wire to D2, and the uninsulated shield to GND (ground) as shown above. \u00a0Use a piece of shrink wrap tube or tape to cover the shield wire so it doesn&#8217;t short anything on the Teensy.\n<p>If you are using a different mini-DIN connector, use a multimeter to find the wires attached to pins 2, 8 and the connector outer case. \u00a0Pin 2 gets soldered\u00a0to VCC and pin 8 gets soldered to D2. \u00a0Looking at the\u00a0<strong>female<\/strong> connector that you will plug the keyboard into, pin 8 is on the upper left.\u00a0 Here is my sketch of the connector that will surely end up hanging in the Louvre:<\/p>\n<p><a href=\"https:\/\/i2.wp.com\/jimandnoreen.com\/wp-content\/uploads\/2017\/03\/8pin_mini-DIN_female.gif?ssl=1\"><img data-attachment-id=\"266\" data-permalink=\"https:\/\/jimandnoreen.com\/?attachment_id=266\" data-orig-file=\"https:\/\/i2.wp.com\/jimandnoreen.com\/wp-content\/uploads\/2017\/03\/8pin_mini-DIN_female.gif?fit=224%2C177&amp;ssl=1\" data-orig-size=\"224,177\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"8pin_mini-DIN_female\" data-image-description=\"\" data-medium-file=\"https:\/\/i2.wp.com\/jimandnoreen.com\/wp-content\/uploads\/2017\/03\/8pin_mini-DIN_female.gif?fit=224%2C177&amp;ssl=1\" data-large-file=\"https:\/\/i2.wp.com\/jimandnoreen.com\/wp-content\/uploads\/2017\/03\/8pin_mini-DIN_female.gif?fit=224%2C177&amp;ssl=1\" loading=\"lazy\" class=\"alignnone size-full wp-image-266\" src=\"https:\/\/i2.wp.com\/jimandnoreen.com\/wp-content\/uploads\/2017\/03\/8pin_mini-DIN_female.gif?resize=224%2C177&#038;ssl=1\" alt=\"\" width=\"224\" height=\"177\" data-recalc-dims=\"1\" \/><\/a><\/li>\n<li>Connect the keyboard to the connector you just soldered on and connect a USB cable to the Teensy.\u00a0 Mount it either inside the keyboard case or in a suitable enclosure.<\/li>\n<\/ol>\n<h3>Programming the Teensy<\/h3>\n<ol>\n<li>Install the latest Arduino IDE, if necessary.\u00a0 It can be downloaded <a href=\"https:\/\/www.arduino.cc\/en\/Main\/Software\">here<\/a>.<\/li>\n<li>Download and install <a href=\"https:\/\/www.pjrc.com\/teensy\/td_download.html\">Teensyduino<\/a>, which is an add-on for the Arduino software that adds Teensy support to it.<\/li>\n<li>Download the <a href=\"https:\/\/jimandnoreen.com\/?page_id=185\">Apple Newton Keyboard to USB Converter library<\/a>\u00a0 (Mac users: \u00a0please Ctrl-click and choose Save As to prevent the ZIP file from automatically unpacking)<\/li>\n<li>Launch Arduino and install from the ZIP file by selecting<br \/>\nSketch&#8211;&gt;Include Library&#8211;&gt;Add .ZIP Library<\/li>\n<li>Open the Sketch named NewtonKeyboardToUSB, which is located in the folder Arduino\/libraries\/newtonKeyboard\/examples<\/li>\n<li>Upload the sketch to the Teensy.\u00a0 If this is the first time you are uploading a sketch from the Arduino IDE, you will need to<\/li>\n<li>Your computer should immediately recognize that a new keyboard has been plugged in<\/li>\n<\/ol>\n<h3>Further improvements<\/h3>\n<p>There are lots of digital inputs and outputs available on the Teensy.\u00a0 It might be nice to use one of the outputs to drive an LED that indicates Caps Lock state.\u00a0 Or perhaps it would be useful to assign some inputs to keyboard macros.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Back in the pre-smartphone days, the Apple Newton was the first device in the PDA category.\u00a0 Newtons were only sold for five years between 1993 and 1998, when Steve Jobs pulled the plug on the program.\u00a0 Although Apple frequently took a ribbing for problems with the Newton&#8217;s handwriting recognition feature, its main problem with achieving [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":251,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[7,54,12,50],"tags":[55,52,56],"jetpack_featured_media_url":"https:\/\/i1.wp.com\/jimandnoreen.com\/wp-content\/uploads\/2017\/03\/IMG_3278.jpg?fit=640%2C480&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8sNNV-4b","jetpack-related-posts":[{"id":253,"url":"https:\/\/jimandnoreen.com\/?p=253","url_meta":{"origin":259,"position":0},"title":"A nice display for Raspberry Pi","date":"March 8, 2017","format":false,"excerpt":"I needed a compact computer setup for my cramped electronics workbench.\u00a0 The SunFounder 10.1 inch display is both space- and cost-efficient.\u00a0 Instead of using molded parts for the case, SunFounder uses laser cut acrylic sheets, presumably to keep the cost of production down.\u00a0 A Raspberry Pi computer can be mounted\u2026","rel":"","context":"In &quot;Apple&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jimandnoreen.com\/wp-content\/uploads\/2017\/03\/IMG_3279.jpg?fit=640%2C480&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":385,"url":"https:\/\/jimandnoreen.com\/?p=385","url_meta":{"origin":259,"position":1},"title":"A $2 Development Board Test\/Programming Jig","date":"October 5, 2020","format":false,"excerpt":"I've been using LoRa (Long Distance Radio) boards for a few recent projects. At $20 a pop, these aren't exactly cheap. I didn't want to dedicate one to breadboard prototyping by soldering headers to it and sought a commercial solution that would allow me to easily make a reliable temporary\u2026","rel":"","context":"In &quot;Arduino&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jimandnoreen.com\/wp-content\/uploads\/2020\/10\/2.jpg?fit=1200%2C900&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":178,"url":"https:\/\/jimandnoreen.com\/?p=178","url_meta":{"origin":259,"position":2},"title":"Microsoft Surface Pro 3 first impressions","date":"January 16, 2015","format":false,"excerpt":"My office is replacing its aging fleet of HP 620 notebooks with Surface Pro 3\u00a0 (256 GB, Intel Core i5) tablets. \u00a0Each tablet will be deployed with an optional keyboard cover and docking station. \u00a0This is the middle-of-the-road model, which is powerful enough to run most business applications but not\u2026","rel":"","context":"In &quot;Reviews&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":484,"url":"https:\/\/jimandnoreen.com\/?p=484","url_meta":{"origin":259,"position":3},"title":"MC-2100 Motor Controller Console for Arduino Uno","date":"March 2, 2026","format":false,"excerpt":"My fancy NordicTrack iFit treadmill recently greeted me with a blank screen when I switched it on. (No, it wasn't a victim of the iFit bricking debacle. The console just up and croaked). I was saddened (but not entirely shocked) that neither a replacement console nor parts for it were\u2026","rel":"","context":"In &quot;Arduino&quot;","img":{"alt_text":"MC-2100 Motor Controller Board","src":"https:\/\/i2.wp.com\/jimandnoreen.com\/wp-content\/uploads\/2026\/03\/IMG_8496-scaled.jpeg?fit=1200%2C900&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":356,"url":"https:\/\/jimandnoreen.com\/?p=356","url_meta":{"origin":259,"position":4},"title":"Long Distance Mailbox Alert using LoRa","date":"October 28, 2020","format":false,"excerpt":"You've got mail! An IoT project using solar power and long range radio In these pandemic times of limited mobility, I become more like a dog every day: looking forward with great enthusiasm to meals, walks and car rides. One of the daily events that's taken on new importance is\u2026","rel":"","context":"In &quot;Arduino&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jimandnoreen.com\/wp-content\/uploads\/2020\/10\/img_5468-scaled.jpg?fit=1200%2C821&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":195,"url":"https:\/\/jimandnoreen.com\/?p=195","url_meta":{"origin":259,"position":5},"title":"Thoughts on the Apple Watch","date":"June 19, 2015","format":false,"excerpt":"I've been living with an Apple Watch for a month now (stainless steel case\/Milanese loop band). \u00a0Overall, I think it's great. \u00a0The most common criticism that I hear about Apple Watch is that there is no \"killer app\" that creates a compelling new product category. \u00a0This is absolutely true. \u00a0However,\u2026","rel":"","context":"In &quot;Apple&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jimandnoreen.com\/index.php?rest_route=\/wp\/v2\/posts\/259"}],"collection":[{"href":"https:\/\/jimandnoreen.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jimandnoreen.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jimandnoreen.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jimandnoreen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=259"}],"version-history":[{"count":9,"href":"https:\/\/jimandnoreen.com\/index.php?rest_route=\/wp\/v2\/posts\/259\/revisions"}],"predecessor-version":[{"id":269,"href":"https:\/\/jimandnoreen.com\/index.php?rest_route=\/wp\/v2\/posts\/259\/revisions\/269"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jimandnoreen.com\/index.php?rest_route=\/wp\/v2\/media\/251"}],"wp:attachment":[{"href":"https:\/\/jimandnoreen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jimandnoreen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jimandnoreen.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}