{"id":196,"date":"2017-05-06T15:55:48","date_gmt":"2017-05-06T20:55:48","guid":{"rendered":"http:\/\/www.millamilla.com\/?p=196"},"modified":"2017-05-27T17:00:31","modified_gmt":"2017-05-27T22:00:31","slug":"testing-mcp9808-with-bus-pirate","status":"publish","type":"post","link":"https:\/\/www.millamilla.com:443\/?p=196","title":{"rendered":"Testing MCP9808 with Bus Pirate"},"content":{"rendered":"<p>As part of the CE Header project from the\u00a0<a href=\"https:\/\/skills.contextualelectronics.com\">CE Skills<\/a>\u00a0course , I picked an additional temp sensor to test with, the <a href=\"http:\/\/www.microchip.com\/wwwproducts\/en\/en556182\">MCP9808<\/a>. \u00a0I used a <a href=\"http:\/\/dangerousprototypes.com\/docs\/Bus_Pirate\">Bus Pirate<\/a>\u00a0(Dangerous Prototypes) and probes, from <a href=\"https:\/\/www.seeedstudio.com\/Bus-Pirate-v3.6-universal-serial-interface-p-609.html\">Seeed Studio<\/a>, to iteratively poke at it until I understood how to talk to it via I2C.<\/p>\n<p>Once I soldered the MCP9808 to a small carrier board from <a href=\"https:\/\/www.adafruit.com\/product\/1212\">Adafruit<\/a>, I placed it on a breadboard and wired it up to the Bus Pirate. \u00a0Please note, the cable and connectors in the image below are from the Seeed probe cable. \u00a0Some of the other probe cables have the colors in a different order on the connectors.<\/p>\n<p>I used <a href=\"http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/latest.html\">putty<\/a> to connect to the Bus Pirate via a mini usb cable.<\/p>\n<table border=\"1\" cellspacing=\"2\" cellpadding=\"0\">\n<thead>\n<tr>\n<td style=\"width: 86px;\">Command<\/td>\n<td style=\"width: 163px;\">What it does<\/td>\n<\/tr>\n<\/thead>\n<caption>Initalize the Bus Pirate<\/caption>\n<tbody>\n<tr>\n<td style=\"width: 86px;\">m 4 1<\/td>\n<td style=\"width: 163px;\">Mode, I2C, Speed 5khz<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 86px;\">W<\/td>\n<td style=\"width: 163px;\">Turn power on<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 86px;\">P<\/td>\n<td style=\"width: 163px;\">Turn on pull ups<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table style=\"width: 510px;\" border=\"1\" cellspacing=\"2\" cellpadding=\"0\">\n<thead>\n<tr style=\"height: 25px;\">\n<td style=\"width: 86px; height: 25px;\">Command<\/td>\n<td style=\"width: 194px; height: 25px;\">What it does<\/td>\n<td style=\"width: 220px; height: 25px;\">Output<\/td>\n<\/tr>\n<\/thead>\n<caption>Find the\u00a0I2C address<\/caption>\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 86px; height: 24px;\">(1)<\/td>\n<td style=\"width: 194px; height: 24px;\">Find the slave address<\/td>\n<td style=\"width: 220px; height: 24px;\">0x30(0x18 W) 0x31(0x18 R)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table style=\"width: 617.352px;\" border=\"1\" cellspacing=\"2\" cellpadding=\"0\">\n<thead>\n<tr style=\"height: 25px;\">\n<td style=\"width: 320px; height: 25px;\">Command<\/td>\n<td style=\"width: 137px; height: 25px;\">What it does<\/td>\n<td style=\"width: 214.352px; height: 25px;\">Output<\/td>\n<\/tr>\n<\/thead>\n<caption>Working with the Config register<\/caption>\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 320px; height: 24px;\">[ 0x30 0x01 [ 0x31 r:2 ]<\/td>\n<td style=\"width: 137px; height: 24px;\">Read the register<\/td>\n<td style=\"width: 214.352px; height: 24px;\">0x00 (default)<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 320px; height: 24px;\">[ 0x30 0x01 0x00 0x08 ]<\/td>\n<td style=\"width: 137px; height: 24px;\">Enable Alert Stat<\/td>\n<td style=\"width: 214.352px; height: 24px;\"><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 320px; height: 24px;\">[ 0x30 0x01 0x00 0x08 [ 0x31 r:2 ]<\/td>\n<td style=\"width: 137px; height: 24px;\">Enable Alert Stat and read back current config<\/td>\n<td style=\"width: 214.352px; height: 24px;\">\u00a00x00\u00a00x08<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<table style=\"width: 617.352px;\" border=\"1\" cellspacing=\"2\" cellpadding=\"0\">\n<thead>\n<tr style=\"height: 25px;\">\n<td style=\"width: 320px; height: 25px;\">Command<\/td>\n<td style=\"width: 137px; height: 25px;\">What it does<\/td>\n<td style=\"width: 214.352px; height: 25px;\">Output<\/td>\n<\/tr>\n<\/thead>\n<caption>Working with the\u00a0Manufacturer register<\/caption>\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 320px; height: 24px;\">[ 0x30 0x06 [ 0x31 r:2 ]<\/td>\n<td style=\"width: 137px; height: 24px;\">Read the register<\/td>\n<td style=\"width: 214.352px; height: 24px;\">0x00 0x54 \u00a0(default)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table style=\"width: 617.352px;\" border=\"1\" cellspacing=\"2\" cellpadding=\"0\">\n<thead>\n<tr style=\"height: 25px;\">\n<td style=\"width: 320px; height: 25px;\">Command<\/td>\n<td style=\"width: 137px; height: 25px;\">What it does<\/td>\n<td style=\"width: 214.352px; height: 25px;\">Output<\/td>\n<\/tr>\n<\/thead>\n<caption>Working with the Device register<\/caption>\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 320px; height: 24px;\">[ 0x30 0x07 [ 0x31 r:2 ]<\/td>\n<td style=\"width: 137px; height: 24px;\">Read the register<\/td>\n<td style=\"width: 214.352px; height: 24px;\">0x04 0x00\u00a0 (default)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table style=\"width: 617.352px;\" border=\"1\" cellspacing=\"2\" cellpadding=\"0\">\n<thead>\n<tr style=\"height: 25px;\">\n<td style=\"width: 320px; height: 25px;\">Command<\/td>\n<td style=\"width: 137px; height: 25px;\">What it does<\/td>\n<td style=\"width: 214.352px; height: 25px;\">Output<\/td>\n<\/tr>\n<\/thead>\n<caption>Working with the Resolution register<\/caption>\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 320px; height: 24px;\">[ 0x30 0x08 [ 0x31 r:1]<\/td>\n<td style=\"width: 137px; height: 24px;\">Read the register<\/td>\n<td style=\"width: 214.352px; height: 24px;\">0x03\u00a0 (default)<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 320px; height: 24px;\">[ 0x30 0x08 0x00 [ 0x31 r:1]<\/td>\n<td style=\"width: 137px; height: 24px;\">Set register to 0x00 or 1 bit resolution and read back<\/td>\n<td style=\"width: 214.352px; height: 24px;\">0x03<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table style=\"width: 617.352px;\" border=\"1\" cellspacing=\"2\" cellpadding=\"0\">\n<thead>\n<tr style=\"height: 25px;\">\n<td style=\"width: 320px; height: 25px;\">Command<\/td>\n<td style=\"width: 137px; height: 25px;\">What it does<\/td>\n<td style=\"width: 214.352px; height: 25px;\">Output<\/td>\n<\/tr>\n<\/thead>\n<caption>Working with the Ambient temperature register<\/caption>\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 320px; height: 24px;\">[ 0x30 0x05 [ 0x31 r:2 ]<\/td>\n<td style=\"width: 137px; height: 24px;\">Read the register<\/td>\n<td style=\"width: 214.352px; height: 24px;\">ex:\u00a00xC1 0xBC<\/p>\n<p>Celsius = (C1BC &amp; FFF)\/16 = 24C or 75F, see P25 of MCP9808 Datasheet<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 320px; height: 24px;\">Special result values<\/p>\n<p>0x80 0x00,\u00a0TA&gt;TCRIT<br \/>\n0x40 0x00,\u00a0TA&gt;TUPPER<br \/>\n0x20 0x00,\u00a0TA&lt;TLOWER<br \/>\n0x10 0xBE ( after upper&amp;1F ), TA &lt; 0C, Celsius = d256 &#8211; ((( 10 &amp; 0F ) * d16) + (BE\/d16))= -245?<\/td>\n<td style=\"width: 137px; height: 24px;\"><\/td>\n<td style=\"width: 214.352px; height: 24px;\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<div id=\"attachment_217\" style=\"width: 610px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/connect_buspirate_mcp9808-1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-217\" class=\"wp-image-217\" src=\"http:\/\/ostrich.hedrickfam.com:8081\/wp-content\/uploads\/2017\/05\/connect_buspirate_mcp9808-1-300x238.jpg\" alt=\"\" width=\"600\" height=\"476\" srcset=\"https:\/\/www.millamilla.com:443\/wp-content\/uploads\/2017\/05\/connect_buspirate_mcp9808-1-300x238.jpg 300w, https:\/\/www.millamilla.com:443\/wp-content\/uploads\/2017\/05\/connect_buspirate_mcp9808-1-768x609.jpg 768w, https:\/\/www.millamilla.com:443\/wp-content\/uploads\/2017\/05\/connect_buspirate_mcp9808-1-1024x812.jpg 1024w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-217\" class=\"wp-caption-text\">Click image for full size<\/p><\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of the CE Header project from the\u00a0CE Skills\u00a0course , I picked an additional temp sensor to test with, the MCP9808. \u00a0I used a Bus Pirate\u00a0(Dangerous Prototypes) and probes, from Seeed Studio, to iteratively poke at it until I understood how to talk to it via I2C. Once I soldered the MCP9808 to a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-196","post","type-post","status-publish","format-standard","hentry","category-contextual-electronics"],"_links":{"self":[{"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=\/wp\/v2\/posts\/196","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=196"}],"version-history":[{"count":15,"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=\/wp\/v2\/posts\/196\/revisions"}],"predecessor-version":[{"id":257,"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=\/wp\/v2\/posts\/196\/revisions\/257"}],"wp:attachment":[{"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.millamilla.com:443\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}