{"id":140,"date":"2017-06-23T22:38:38","date_gmt":"2017-06-23T21:38:38","guid":{"rendered":"http:\/\/www.burningimage.net\/cattrack\/?p=140"},"modified":"2023-07-22T07:56:58","modified_gmt":"2023-07-22T06:56:58","slug":"gps-cat-tracker-microcontroller","status":"publish","type":"post","link":"https:\/\/www.burningimage.net\/cattrack\/gps-cat-tracker-microcontroller\/","title":{"rendered":"Choosing a Microcontroller"},"content":{"rendered":"<p><strong>We&#8217;re having a bit of a heat-wave at the minute in the UK! \u00a0It has been over 30\u00b0C (86\u00b0F) for 2 days in a row. \u00a0We can&#8217;t cope. \u00a0It&#8217;s too hot. \u00a0Buttons particularly is not impressed. \u00a0The coolest place he&#8217;s found is on top of the water butt &#8211; as you can see in the picture.<\/strong><\/p>\n<p>Anyway, as everyone knows, the best thing to do when it&#8217;s nice and sunny outside is sit inside on a computer and look at Microcontrollers.<\/p>\n<p><!--more--><\/p>\n<p>I have a lot of experience with <a href=\"http:\/\/www.microchip.com\/design-centers\/8-bit\/pic-mcus\">PICs<\/a>, so I&#8217;ll stick with them. \u00a0There&#8217;s no need for anything more powerful than a small 8-bit device, especially given my ultra-low-power requirement.<\/p>\n<p>Choosing a PIC these days is a minefield. \u00a0There are so many devices that it&#8217;s hard to know where to start. \u00a0Microchip have realised this and managed to cash in as a result. \u00a0The incredibly popular\u00a0PIC16F84 is now being sold by Microchip for \u00a33.76, whereas the newer and better PIC16F54 is only 53p. \u00a0You could go wild and fork out \u00a31.37 to get the PIC16F1826 which is\u00a0<em>so<\/em> much better than the PIC16F84, has more peripherals than you could ever think of using and an internal 32 MHz oscillator!<\/p>\n<p>So whenever you think of using the 16F84, don&#8217;t. \u00a0Get the 16F1826 instead!<\/p>\n<p>I need to choose a PIC that has SPI\/UART support and lots of spare GPIO pins. \u00a0The GPS module will likely require some GPIO pins for remotely turning it on and off. \u00a0I think I&#8217;ll also put an EEPROM on the board so that I can save a log of where Buttons has been, so I&#8217;ll need an extra SPI chip-select line for that.<\/p>\n<p>Another feature I&#8217;d like to incorporate is a battery-life indicator. \u00a0To accomplish this I&#8217;ll need to use a PIC with an ADC and an fixed voltage reference. \u00a0The fixed voltage reference will allow me to determine the exact voltage of the battery. \u00a0I can then transmit the battery voltage back to the base station, allowing me to work out when I may need to change the batteries.<\/p>\n<p>Luckily to help people navigate the PIC minefield there&#8217;s a <a href=\"http:\/\/ww1.microchip.com\/downloads\/en\/DeviceDoc\/30010068E.pdf\">quick reference guide<\/a> for their latest devices.<\/p>\n<p>Taking all of the above into account, I&#8217;ve settled on the PIC16LF18345, a brand new 20-pin device that has all the peripherals I need. \u00a0They are still a bit too new to be widely available from places like Farnell, but Microchip have sent me some to sample so I&#8217;ll see how I get on with them!<\/p>\n<p>Up next&#8230;. the GPS module.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;re having a bit of a heat-wave at the minute in the UK! \u00a0It has been over 30\u00b0C (86\u00b0F) for 2 days in a row. \u00a0We can&#8217;t cope. \u00a0It&#8217;s too hot. \u00a0Buttons particularly is not impressed. \u00a0The coolest place he&#8217;s found is on top of the water butt &#8211; as you can see in the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":146,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[30,29,28,36,34,35,33,32,38,24,25,37,31,11],"class_list":["post-140","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-posts","tag-16f1826","tag-16f54","tag-16f84","tag-16lf18345","tag-adc","tag-fvr","tag-gpio","tag-i2c","tag-microchip","tag-microcontroller","tag-pic","tag-pic16lf18345","tag-spi","tag-uart"],"_links":{"self":[{"href":"https:\/\/www.burningimage.net\/cattrack\/wp-json\/wp\/v2\/posts\/140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.burningimage.net\/cattrack\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.burningimage.net\/cattrack\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.burningimage.net\/cattrack\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.burningimage.net\/cattrack\/wp-json\/wp\/v2\/comments?post=140"}],"version-history":[{"count":7,"href":"https:\/\/www.burningimage.net\/cattrack\/wp-json\/wp\/v2\/posts\/140\/revisions"}],"predecessor-version":[{"id":165,"href":"https:\/\/www.burningimage.net\/cattrack\/wp-json\/wp\/v2\/posts\/140\/revisions\/165"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.burningimage.net\/cattrack\/wp-json\/wp\/v2\/media\/146"}],"wp:attachment":[{"href":"https:\/\/www.burningimage.net\/cattrack\/wp-json\/wp\/v2\/media?parent=140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.burningimage.net\/cattrack\/wp-json\/wp\/v2\/categories?post=140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.burningimage.net\/cattrack\/wp-json\/wp\/v2\/tags?post=140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}