{"id":1491,"date":"2019-10-29T20:35:44","date_gmt":"2019-10-29T20:35:44","guid":{"rendered":"http:\/\/tomblog.firstsolo.net\/?p=1491"},"modified":"2019-12-16T17:56:50","modified_gmt":"2019-12-16T17:56:50","slug":"gaggia-baby-twin-front-panel-protocol","status":"publish","type":"post","link":"http:\/\/tomblog.firstsolo.net\/index.php\/gaggia-baby-twin-front-panel-protocol\/","title":{"rendered":"Gaggia Baby Twin front panel protocol"},"content":{"rendered":"<p>I recently got (and fixed) a broken Baby Twin off ebay. I want to experiment with the extra boiler. Anyway, it turns out the Twin talks to its front panel using a TWI based protocol. Here are my notes (which I made in an ASCII editor &#8211; enjoy the ASCII graphics and sorry about the scroll bar at the bottom):<!--more--><\/p>\n<pre>A 14 wire ribbon cable connects the front panel to the controller\r\nboard. If we number the wires from 1 to 14, starting at the red end,\r\nthen the connector on the board alternates sides:\r\n\r\n14  12  10   8   6   4   2\r\n |   |   |   |   |   |   |\r\n-----------------------------\r\n|                           ]\r\n|                          |\r\n|                           ]\r\n-----------------------------\r\n   |   |   |   |   |   |   |\r\n  13  11   9   7   5   3   1\r\n\r\nI am pretty sure the connector is from te (Tycho Electronics) and the\r\nribbon cable part number is 1-215083-4 or 8-215083-4 (same part but one\r\ncomes in boxes and the other on reels).\r\n\r\nMy best guess is that the controller board has two interfaces on this\r\ncable, one for the Twin and one for the Dose. For the Twin, it is a\r\nTWI interface and for the Dose it is a simple set of lines to LEDs and\r\nswitches. The only pins that seem to make any difference for the Twin\r\nare:\r\n\r\n1  VCC\r\n9  SDA\r\n7  Button touch notification\r\n11 SCL\r\n14 GND\r\n\r\nThe front panel pulls pins 9 (SDA), 11 (SCL) and 7 high. When a button\r\nis touched or released, pin 7 pulses low for 50us. This could be used\r\nto respond or you can you poll regularly.\r\n\r\nIn addition, the controller board pulls the following high: 2, 4, 6,\r\n8, 10. And 3 and 5 are high impedence. And 12 is low or high impedence\r\n(can't remember). None of these are relevant to the Twin front panel.\r\n\r\nThe controller polls the front panel periodically with the following\r\nprotocol:\r\n\r\nPoll rate: normally every 48ms. When a button is being touched,\r\n  continuously.\r\nSCL clock speed: 62500Hz.\r\n\r\nAt each poll, the controller writes the LED state and then reads the\r\nbuttons.\r\n\r\nTo write: write two bytes, the first is address and the second is\r\nvalue.\r\n\r\nTo read: write one byte (address) and read one byte (value).\r\n\r\nThe front panel only responds to the general call TWI address 0.\r\nThe address of the LEDs is 0x00 and the address of the buttons is\r\n0x01.\r\n\r\nSo on the TWI bus, you see:\r\nSTART, address packet to 0 and W = 0x00, 2 data packets: 0x00, CODE1, STOP,\r\nSTART, address packet to 0 and W = 0x00, 1 data packets: 0x01, STOP,\r\nSTART, address packet to 0 and R = 0x01, 1 data packets: CODE2, STOP.\r\n\r\nCODE1 is a six bit bitmask plus two parity bits:\r\n\r\n| 7        | 6        | 5           | 4         | 3         | 2          | 1         | 0         |\r\n| Parity 1 | Parity 0 | Element LED | Steam LED | Water LED | Manual LED | 2 cup LED | 1 cup LED |\r\n\r\nParity 1 is bit3 XOR bit4 XOR bit5.\r\nParity 0 is bit0 XOR bit1 XOR bit2.\r\n\r\nCODE2 is a pair of 4 bit nibbles where high nibble = 1s complement of\r\nlow nibble. Low nibble is a 4 bit bitmask indicating which button is\r\ntouched:\r\n\r\n| 3     | 2      | 1     | 0     |\r\n| Water | Manual | 2 cup | 1 cup |\r\n\r\nNote: if more than one button is touched, this is invalid and\r\ncode2 = 0xf0.<\/pre>\n<p>&nbsp;<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-facebook\"><a rel=\"nofollow\" class=\"share-facebook sd-button share-icon\" href=\"http:\/\/tomblog.firstsolo.net\/index.php\/gaggia-baby-twin-front-panel-protocol\/?share=facebook\" target=\"_blank\" title=\"Share on Facebook\" id=\"sharing-facebook-1491\"><span>Facebook<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow\" class=\"share-twitter sd-button share-icon\" href=\"http:\/\/tomblog.firstsolo.net\/index.php\/gaggia-baby-twin-front-panel-protocol\/?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" id=\"sharing-twitter-1491\"><span>Twitter<\/span><\/a><\/li><li class=\"share-google-plus-1\"><a rel=\"nofollow\" class=\"share-google-plus-1 sd-button share-icon\" href=\"http:\/\/tomblog.firstsolo.net\/index.php\/gaggia-baby-twin-front-panel-protocol\/?share=google-plus-1\" target=\"_blank\" title=\"Click to share on Google+\" id=\"sharing-google-1491\"><span>Google<\/span><\/a><\/li><li class=\"share-reddit\"><a rel=\"nofollow\" class=\"share-reddit sd-button share-icon\" href=\"http:\/\/tomblog.firstsolo.net\/index.php\/gaggia-baby-twin-front-panel-protocol\/?share=reddit\" target=\"_blank\" title=\"Click to share on Reddit\"><span>Reddit<\/span><\/a><\/li><li class=\"share-pocket\"><a rel=\"nofollow\" class=\"share-pocket sd-button share-icon\" href=\"http:\/\/tomblog.firstsolo.net\/index.php\/gaggia-baby-twin-front-panel-protocol\/?share=pocket\" target=\"_blank\" title=\"Click to share on Pocket\"><span>Pocket<\/span><\/a><\/li><li><a href=\"#\" class=\"sharing-anchor sd-button share-more\"><span>More<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><div class=\"sharing-hidden\"><div class=\"inner\" style=\"display: none;\"><ul><li class=\"share-tumblr\"><a rel=\"nofollow\" class=\"share-tumblr sd-button share-icon\" href=\"http:\/\/tomblog.firstsolo.net\/index.php\/gaggia-baby-twin-front-panel-protocol\/?share=tumblr\" target=\"_blank\" title=\"Click to share on Tumblr\"><span>Tumblr<\/span><\/a><\/li><li class=\"share-stumbleupon\"><a rel=\"nofollow\" class=\"share-stumbleupon sd-button share-icon\" href=\"http:\/\/tomblog.firstsolo.net\/index.php\/gaggia-baby-twin-front-panel-protocol\/?share=stumbleupon\" target=\"_blank\" title=\"Click to share on StumbleUpon\"><span>StumbleUpon<\/span><\/a><\/li><li class=\"share-end\"><\/li><li class=\"share-pinterest\"><a rel=\"nofollow\" class=\"share-pinterest sd-button share-icon\" href=\"http:\/\/tomblog.firstsolo.net\/index.php\/gaggia-baby-twin-front-panel-protocol\/?share=pinterest\" target=\"_blank\" title=\"Click to share on Pinterest\"><span>Pinterest<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>I recently got (and fixed) a broken Baby Twin off ebay. I want to experiment with the extra boiler. Anyway, it turns out the Twin talks to its front panel using a TWI based protocol. Here are my notes (which &hellip; <a href=\"http:\/\/tomblog.firstsolo.net\/index.php\/gaggia-baby-twin-front-panel-protocol\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-facebook\"><a rel=\"nofollow\" class=\"share-facebook sd-button share-icon\" href=\"http:\/\/tomblog.firstsolo.net\/index.php\/gaggia-baby-twin-front-panel-protocol\/?share=facebook\" target=\"_blank\" title=\"Share on Facebook\" id=\"sharing-facebook-1491\"><span>Facebook<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow\" class=\"share-twitter sd-button share-icon\" href=\"http:\/\/tomblog.firstsolo.net\/index.php\/gaggia-baby-twin-front-panel-protocol\/?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" id=\"sharing-twitter-1491\"><span>Twitter<\/span><\/a><\/li><li class=\"share-google-plus-1\"><a rel=\"nofollow\" class=\"share-google-plus-1 sd-button share-icon\" href=\"http:\/\/tomblog.firstsolo.net\/index.php\/gaggia-baby-twin-front-panel-protocol\/?share=google-plus-1\" target=\"_blank\" title=\"Click to share on Google+\" id=\"sharing-google-1491\"><span>Google<\/span><\/a><\/li><li class=\"share-reddit\"><a rel=\"nofollow\" class=\"share-reddit sd-button share-icon\" href=\"http:\/\/tomblog.firstsolo.net\/index.php\/gaggia-baby-twin-front-panel-protocol\/?share=reddit\" target=\"_blank\" title=\"Click to share on Reddit\"><span>Reddit<\/span><\/a><\/li><li class=\"share-pocket\"><a rel=\"nofollow\" class=\"share-pocket sd-button share-icon\" href=\"http:\/\/tomblog.firstsolo.net\/index.php\/gaggia-baby-twin-front-panel-protocol\/?share=pocket\" target=\"_blank\" title=\"Click to share on Pocket\"><span>Pocket<\/span><\/a><\/li><li><a href=\"#\" class=\"sharing-anchor sd-button share-more\"><span>More<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><div class=\"sharing-hidden\"><div class=\"inner\" style=\"display: none;\"><ul><li class=\"share-tumblr\"><a rel=\"nofollow\" class=\"share-tumblr sd-button share-icon\" href=\"http:\/\/tomblog.firstsolo.net\/index.php\/gaggia-baby-twin-front-panel-protocol\/?share=tumblr\" target=\"_blank\" title=\"Click to share on Tumblr\"><span>Tumblr<\/span><\/a><\/li><li class=\"share-stumbleupon\"><a rel=\"nofollow\" class=\"share-stumbleupon sd-button share-icon\" href=\"http:\/\/tomblog.firstsolo.net\/index.php\/gaggia-baby-twin-front-panel-protocol\/?share=stumbleupon\" target=\"_blank\" title=\"Click to share on StumbleUpon\"><span>StumbleUpon<\/span><\/a><\/li><li class=\"share-end\"><\/li><li class=\"share-pinterest\"><a rel=\"nofollow\" class=\"share-pinterest sd-button share-icon\" href=\"http:\/\/tomblog.firstsolo.net\/index.php\/gaggia-baby-twin-front-panel-protocol\/?share=pinterest\" target=\"_blank\" title=\"Click to share on Pinterest\"><span>Pinterest<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div><\/div><\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"http:\/\/tomblog.firstsolo.net\/index.php\/wp-json\/wp\/v2\/posts\/1491"}],"collection":[{"href":"http:\/\/tomblog.firstsolo.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/tomblog.firstsolo.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/tomblog.firstsolo.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/tomblog.firstsolo.net\/index.php\/wp-json\/wp\/v2\/comments?post=1491"}],"version-history":[{"count":6,"href":"http:\/\/tomblog.firstsolo.net\/index.php\/wp-json\/wp\/v2\/posts\/1491\/revisions"}],"predecessor-version":[{"id":1855,"href":"http:\/\/tomblog.firstsolo.net\/index.php\/wp-json\/wp\/v2\/posts\/1491\/revisions\/1855"}],"wp:attachment":[{"href":"http:\/\/tomblog.firstsolo.net\/index.php\/wp-json\/wp\/v2\/media?parent=1491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/tomblog.firstsolo.net\/index.php\/wp-json\/wp\/v2\/categories?post=1491"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/tomblog.firstsolo.net\/index.php\/wp-json\/wp\/v2\/tags?post=1491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}