{"id":1045,"date":"2020-02-23T16:40:47","date_gmt":"2020-02-23T16:40:47","guid":{"rendered":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/?p=1045"},"modified":"2020-03-08T22:56:05","modified_gmt":"2020-03-08T22:56:05","slug":"economatics-smart-box","status":"publish","type":"post","link":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/?p=1045","title":{"rendered":"Economatics Smart Box"},"content":{"rendered":"\n<h2>Economatics Smart Box<\/h2>\n\n\n\n<p>A little while ago, I bought myself a Economatics Smart Box (SB-04). My  intention is to reverse engineer the serial protocol so that I can use  it from a modern (Linux, but the information will be useful to others)  computer. These boxes were common in schools in the UK through the 90s (and possibly before). Older variants worked with the BBC Micro. This is what they look like if anyone has forgotten or hasn&#8217;t  seen one before :<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"http:\/\/elephantandchicken.co.uk\/SmartBox\/IMG_20200223_153013.jpg\" alt=\"Image\"\/><\/figure>\n\n\n\n<p> A couple of minor issues so far &#8211; Number 1 &#8211; This specific model (the  SB-04) doesn&#8217;t have mains in like some of the older versions, it has 12v  AC in &#8211; don&#8217;t know about you, but I&#8217;ve hardly seen any AC-AC PSUs in  years.<br><br> I&#8217;m aware that often you can just use a DC PSU of the same voltage with  such equipment because the first thing that happens on the circuit board  is that the supply is rectified and smoothed&#8230; using a DC supply just  means that the supply is always going through two of the diodes and the  capacitor remains permanently charged. As long as you&#8217;re within the  diode ratings and the resultant voltage is close enough, there isn&#8217;t an  issue. My thought was to check the circuit and see if there was any  obvious reason why this wouldn&#8217;t work, which is where we get to issue  Number 2&#8230;<br><br> Anti-tamper screws. I managed to get these out using a tiny socket and pushing down hard.<br><br> Lovely looking PCB inside designed by &#8220;G A Assembly Ltd&#8221; and &#8220;Mindstorm&#8221; (I wonder if there is  any connection to the Lego Mindstorm?). Note one bodge wire, a socketed  chip with the firmware version (with an unusual pitch), a missing  MAX4622 chip (single pole double throw fast acting switch <a href=\"https:\/\/www.maximintegrated.com\/en\/products\/analog\/analog-switches-multiplexers\/MAX4622.html\">https:\/\/www.maximintegrated.com\/en\/prod &#8230; X4622.html<\/a>) and space for a USB B socket. The digital outputs are buffered with ULN2064b chips (these are darlington pair arrays).<br><br> Anyway, I&#8217;ve got distracted.<br><br> First point &#8211; there is no obvious rectifier, the PSU portion of the  circuit is complex and includes two large inductors by the look of it.  I&#8217;ll have to do a bit more digging and look up what some of the  components are.<br><br><strong>Second most important point &#8211; does anybody have a photo of the USB version of this board <\/strong>&#8211;  I&#8217;d be interested in adding USB if I can. Current theory &#8211; the bodge  wire is hardwiring my board to Serial and saving the need for the  MAX4622 chip for switching between USB and RS232. There are a bank of  jumpers that look interested and are next to the USB lines. I&#8217;m also  wondering is the firmware the same in the USB and Serial variants?<br><br> Photos of the top side of the PCB (actually the bottom as it sits on the desk) for interest.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"http:\/\/elephantandchicken.co.uk\/SmartBox\/IMG_20200223_150013.jpg\" alt=\"Image\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"http:\/\/elephantandchicken.co.uk\/SmartBox\/IMG_20200223_150053.jpg\" alt=\"Image\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"http:\/\/elephantandchicken.co.uk\/SmartBox\/IMG_20200223_150123.jpg\" alt=\"Image\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"http:\/\/elephantandchicken.co.uk\/SmartBox\/IMG_20200223_150027.jpg\" alt=\"Image\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"http:\/\/elephantandchicken.co.uk\/SmartBox\/IMG_20200223_150100.jpg\" alt=\"Image\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"http:\/\/elephantandchicken.co.uk\/SmartBox\/IMG_20200223_150127.jpg\" alt=\"Image\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"http:\/\/elephantandchicken.co.uk\/SmartBox\/IMG_20200223_150031.jpg\" alt=\"Image\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"http:\/\/elephantandchicken.co.uk\/SmartBox\/IMG_20200223_150112.jpg\" alt=\"Image\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"http:\/\/elephantandchicken.co.uk\/SmartBox\/IMG_20200223_150134.jpg\" alt=\"Image\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"http:\/\/elephantandchicken.co.uk\/SmartBox\/IMG_20200223_150046.jpg\" alt=\"Image\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"http:\/\/elephantandchicken.co.uk\/SmartBox\/IMG_20200223_150118.jpg\" alt=\"Image\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"http:\/\/elephantandchicken.co.uk\/SmartBox\/IMG_20200223_150139.jpg\" alt=\"Image\"\/><\/figure>\n\n\n\n<p><s>I think the main chip might be some kind of 6502 based MCU or similar &#8211; I can&#8217;t find a good  datasheet online that exactly matches. It has a reduced pin pitch, 42 pins and it looks like  the Crystal is connected to pins 19 and 20.<br><br> A 6502 based MCU would make sense given that the company made BBC Micro peripherals.<\/s><\/p>\n\n\n\n<p>Older versions of the board are basically an embedded 6502 computer with RAM, ROM, an ADC and a VIA. My newer version is based on a Mitsubishi microcontroller, the <a href=\"http:\/\/elephantandchicken.co.uk\/SmartBox\/M37536E8SP_MitsubishiElectricSemiconductor.pdf\">M37536E8SP<\/a>.<\/p>\n\n\n\n<p> I&#8217;ve taken the board completely out of the case now. No components on  the reverse, but useful for tracking traces. I&#8217;ve also noticed that  there is a cut trace next to the test point that the bodge wire is  attached to (separating it from a capacitor that looks like it is  attached to a power rail judging by the track width &#8211; they must have  accidentally tied it high).<br><br> Underside of the PCB :<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"http:\/\/elephantandchicken.co.uk\/SmartBox\/IMG_20200223_161555.jpg\" alt=\"Image\"\/><\/figure>\n\n\n\n<p>Thoughts welcome, photos of the USB variant would be gratefully received!<\/p>\n\n\n\n<p>___________________________________________________________________<\/p>\n\n\n\n<p>Update &#8211; Some progress. I have digital write working from Python. I was lucky enough to find <a href=\"http:\/\/old.ftcommunity.de\/ftComputingFinis\/smartboxe.html\">this page<\/a>, which includes a download of sample code for controlling the Smart Box from VB6. Helpfully, this includes a number of the serial commands for making the box do various things. I&#8217;ve been able to extract the commands for the core functionality.<\/p>\n\n\n\n<figure class=\"wp-block-video aligncenter\"><video controls src=\"http:\/\/elephantandchicken.co.uk\/SmartBox\/SB_Hello_World.mp4\"><\/video><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Economatics Smart Box A little while ago, I bought myself a Economatics Smart Box (SB-04). My intention is to reverse engineer the serial protocol so that I can use it from a modern (Linux, but the information will be useful to others) computer. These boxes were common in schools in the UK through the 90s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1046,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[6,13,12,260],"tags":[252,247,250,249,251,248,103],"jetpack_featured_media_url":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/wp-content\/uploads\/2020\/02\/IMG_20200223_150134.jpg","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7g9vY-gR","_links":{"self":[{"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=\/wp\/v2\/posts\/1045"}],"collection":[{"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1045"}],"version-history":[{"count":5,"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=\/wp\/v2\/posts\/1045\/revisions"}],"predecessor-version":[{"id":1106,"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=\/wp\/v2\/posts\/1045\/revisions\/1106"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=\/wp\/v2\/media\/1046"}],"wp:attachment":[{"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1045"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1045"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elephantandchicken.co.uk\/stuffandnonsense\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1045"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}