{"id":86,"date":"2010-12-21T17:42:43","date_gmt":"2010-12-21T17:42:43","guid":{"rendered":"http:\/\/www.emtronics.co.uk\/wp_blog\/?p=86"},"modified":"2017-04-16T15:36:15","modified_gmt":"2017-04-16T15:36:15","slug":"testing-the-hm55b-compass-module-with-an-at90s2313-avr","status":"publish","type":"post","link":"http:\/\/www.emtronics.co.uk\/wp_blog\/?p=86","title":{"rendered":"Testing the HM55b Compass module with an AT90S2313 AVR"},"content":{"rendered":"<h3>Introduction<\/h3>\n<p>I received a Parallax HM55B compass module and wanted to quicky test it out, so I interfaced it with an old AVR and wrote a program to read the X and Y values and send them to a PC over the serial port.<\/p>\n<h3>Design<\/h3>\n<figure id=\"attachment_90\" aria-describedby=\"caption-attachment-90\" style=\"width: 594px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2010\/12\/hm55b_avr.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-90\" title=\"HM55B test\" src=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2010\/12\/hm55b_avr.png\" alt=\"HM55B test\" width=\"594\" height=\"162\" srcset=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2010\/12\/hm55b_avr.png 594w, http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2010\/12\/hm55b_avr-300x81.png 300w\" sizes=\"auto, (max-width: 594px) 100vw, 594px\" \/><\/a><figcaption id=\"caption-attachment-90\" class=\"wp-caption-text\">HM55B test<\/figcaption><\/figure>\n<table border=\"0\">\n<tbody>\n<tr>\n<td>\n<p><figure id=\"attachment_92\" aria-describedby=\"caption-attachment-92\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2010\/12\/hm55b_bb.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-92\" title=\"HM55B test board\" src=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2010\/12\/hm55b_bb-300x193.jpg\" alt=\"HM55B test board\" width=\"300\" height=\"193\" srcset=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2010\/12\/hm55b_bb-300x193.jpg 300w, http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2010\/12\/hm55b_bb.jpg 1000w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-92\" class=\"wp-caption-text\">HM55B test board<\/figcaption><\/figure><\/td>\n<td>\n<p><figure id=\"attachment_91\" aria-describedby=\"caption-attachment-91\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2010\/12\/app.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-91\" title=\"HM55B test app\" src=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2010\/12\/app-300x120.png\" alt=\"HM55B test app\" width=\"300\" height=\"120\" srcset=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2010\/12\/app-300x120.png 300w, http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2010\/12\/app.png 603w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-91\" class=\"wp-caption-text\">HM55B test app<\/figcaption><\/figure><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><a href=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2010\/12\/MVI_3063.mpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-97\" title=\"hm55b_video\" src=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2010\/12\/hm55b_video.jpg\" alt=\"\" width=\"300\" height=\"225\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2010\/12\/MVI_3063.mpg\">HM55B test video<\/a><\/p>\n<p>The compass module is wired to PORTB of the AVR, and a USB&lt;-&gt;Serial connects to the UART.<\/p>\n<p>The software on the AVR is written in assembly. It is programed to wait for a any byte to be recived on the UART, then reads the X and Y values from the HM55B, and transmits them over the UART as 4 bytes &#8211; 2 x 16bit signed integers (Y-LSB, Y-MSB, X-LSB, X-MSB).<\/p>\n<p>A simple app is written in C# (2008 Express Edition), which requests X&amp;Y, then converts these values into an angle in degrees.<\/p>\n<h3>Files<\/h3>\n<p><a href=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2010\/12\/hm55b_test.rar\">AVR Studio HM55B test<\/a><\/p>\n<p><a href=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2010\/12\/hm55b_compass_test.rar\">Visual Studio 2008 HM55B test<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction I received a Parallax HM55B compass module and wanted to quicky test it out, so I interfaced<\/p>\n","protected":false},"author":1,"featured_media":92,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-86","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-projects"],"_links":{"self":[{"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=\/wp\/v2\/posts\/86","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=86"}],"version-history":[{"count":7,"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=\/wp\/v2\/posts\/86\/revisions"}],"predecessor-version":[{"id":306,"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=\/wp\/v2\/posts\/86\/revisions\/306"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=\/wp\/v2\/media\/92"}],"wp:attachment":[{"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}