{"id":20337,"date":"2017-01-20T01:00:07","date_gmt":"2017-01-20T11:00:07","guid":{"rendered":"http:\/\/darkerview.com\/wordpress\/?p=20337"},"modified":"2017-06-14T20:47:33","modified_gmt":"2017-06-15T06:47:33","slug":"genpic-a-microcontroller-utility-pcb","status":"publish","type":"post","link":"https:\/\/darkerview.com\/wordpress\/?p=20337","title":{"rendered":"GenPIC, A Microcontroller Utility PCB"},"content":{"rendered":"<p>Over the years I have hand wired so many microcontroller PCB&#8217;s.  Along with my own projects for myself there are more than a dozen of my little microcontroller devices at work about the observatory.  The <a href=\"https:\/\/darkerview.com\/wordpress\/?p=7754\">OSIRIS IR calibration source<\/a>, the <a href=\"https:\/\/darkerview.com\/wordpress\/?p=15738\">Keck 2 dome inclinometers<\/a>, a <a href=\"https:\/\/darkerview.com\/wordpress\/?p=14445\">precipitation sensor interface<\/a>, the Keck 1 AO electronic vault temperature sensors, the weather mast fan and shelter controller, the list goes on.  Anyplace a bit of electronic intelligence is needed for the task.<\/p>\n<p><figure id=\"attachment_20325\" aria-describedby=\"caption-attachment-20325\" style=\"width: 200px\" class=\"wp-caption alignright\"><a href=\"https:\/\/darkerview.com\/wordpress\/?attachment_id=20325\" rel=\"attachment wp-att-20325\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/darkerview.com\/wordpress\/wp-content\/uploads\/2016\/11\/GenPIC-200x200.png\" alt=\"GenPIC\" width=\"200\" height=\"200\" class=\"size-thumbnail wp-image-20325\" \/><\/a><figcaption id=\"caption-attachment-20325\" class=\"wp-caption-text\">A PCB assembly in layout<\/figcaption><\/figure>Of course the challenge is that each of these controllers has been hand wired and built for a specific task.  This takes a few hours of running little wires on a perfboard.  And while I enjoy such wiring, it does make the task take notably longer.<\/p>\n<p>While a couple of my microcontroller designs have been laid out on proper circuit cards, like the SciMeasure camera exposure controllers, I have never laid out a general purpose microcontroller PCB.  This is not for lack of thinking about it, so many times I have considered this could be so much easier if I could only invest a little time in a layout.<\/p>\n<p><!--more-->There are plenty of ready made <a href=\"http:\/\/www.digikey.com\/product-search\/en\/development-boards-kits-programmers\/evaluation-and-demonstration-boards-and-kits\/2622039?k=&#038;pkeyword=&#038;v=150&#038;FV=fff40028%2Cfff80257%2C1f140000&#038;mnonly=0&#038;newproducts=0&#038;ColumnSort=0&#038;page=1&#038;quantity=0&#038;ptm=0&#038;fid=0&#038;pageSize=25\" target=\"_blank\">PIC microcontroller<\/a> <a href=\"https:\/\/www.sparkfun.com\/categories\/9\" target=\"_blank\">development<\/a> PCB&#8217;s <a href=\"https:\/\/www.adafruit.com\/categories\/71\" target=\"_blank\">available<\/a> on the market, you can buy a handful from any of dozens of vendors.  I have never found one that met my requirements.  There are also plenty of other microcontroller options, the AVR&#8217;s and the <a href=\"https:\/\/www.arduino.cc\/\" target=\"_blank\">Arduino systems<\/a>, the STM32&#8217;s, and a powerful range of <a href=\"http:\/\/www.ti.com\/lsds\/ti\/microcontrollers_16-bit_32-bit\/overview.page\" target=\"_blank\">MSP offerings by TI<\/a>.<\/p>\n<p><figure id=\"attachment_20915\" aria-describedby=\"caption-attachment-20915\" style=\"width: 200px\" class=\"wp-caption alignleft\"><a href=\"https:\/\/darkerview.com\/wordpress\/?attachment_id=20915\" rel=\"attachment wp-att-20915\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/darkerview.com\/wordpress\/wp-content\/uploads\/2017\/01\/CI43-54-17012-DC-200x200.jpg\" alt=\"GenPIC PCB\" width=\"200\" height=\"200\" class=\"size-thumbnail wp-image-20915\" \/><\/a><figcaption id=\"caption-attachment-20915\" class=\"wp-caption-text\">A stuffed GenPIC PCB ready for testing<\/figcaption><\/figure>I do have a specific set of needs&#8230;  A small form factor, many development boards are quite large once you pile a few features on.  Find a board that has all the features I want and it is just too big!  When reduced to the size I want the feature sets on the any of the available development boards never seem to match up with what I need.<\/p>\n<p>Features?  An LCD display and buttons, maybe a rotary encoder for adjusting some parameter.  Two or more serial ports, an unusual feature.  Support for WiFi and direct ethernet communications would be good, also an unusual feature on a small microcontroller development board.  No need for USB!  A common feature in many dev boards is USB support, while convenient in development, use of USB weds a device to a nearby computer.  If I have a nearby computer why do I need a microcontroller for the task?<\/p>\n<p><figure id=\"attachment_21098\" aria-describedby=\"caption-attachment-21098\" style=\"width: 200px\" class=\"wp-caption alignright\"><a href=\"https:\/\/darkerview.com\/wordpress\/wp-content\/uploads\/2017\/02\/CI49-99-17035-DC.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/darkerview.com\/wordpress\/wp-content\/uploads\/2017\/02\/CI49-99-17035-DC-200x200.jpg\" alt=\"GenPIC Development Setup\" width=\"200\" height=\"200\" class=\"size-thumbnail wp-image-21098\" \/><\/a><figcaption id=\"caption-attachment-21098\" class=\"wp-caption-text\">The development setup in use generating the first software release for the GenPIC utility PCB<\/figcaption><\/figure>I need a practical form factor that you can build a real device around, most dev boards are arranged for use on a workbench, not in a real device.  There are two form factors I typically need&#8230;  Something that can fit in a small project box with connectors at either end or a PCB that can sit behind a panel and form a simple user interface with a display and buttons.  It should really be possible to do both with a clever layout.<\/p>\n<p>I really have no choice&#8230;  Lay out my own development board.  Actually I am going to call this a utility board as it is something to build real equipment around, not to play with.<\/p>\n<p>The design is presented here in its entirety, available for anyone to use as open hardware.<\/p>\n<h5>Design Realization<\/h5>\n<p>The GenPIC board is fairly small, a little under 3&#215;5&#8243;, actually 2.9&#8243; x 4.75&#8243;.  This fits into a standard extruded aluminum case, the commonly available <a href=\"http:\/\/www.hammondmfg.com\/pdf\/1455J1201.pdf\" target=\"_blank\">Hammond 1455J1201<\/a> which measures 5&#8243; x 3&#8243; x 1&#8243;. Component positions and traces allow use of the mounting rails. The power and serial connectors are laid out to allow access through the end panels of this case.<\/p>\n<p><figure id=\"attachment_20331\" aria-describedby=\"caption-attachment-20331\" style=\"width: 200px\" class=\"wp-caption alignright\"><a href=\"https:\/\/darkerview.com\/wordpress\/?attachment_id=20331\" rel=\"attachment wp-att-20331\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/darkerview.com\/wordpress\/wp-content\/uploads\/2016\/11\/GenPICPCB-200x200.png\" alt=\"GenPIC PCB\" width=\"200\" height=\"200\" class=\"size-thumbnail wp-image-20331\" \/><\/a><figcaption id=\"caption-attachment-20331\" class=\"wp-caption-text\">A microcontroller utility PCB layout ready for manufacture<\/figcaption><\/figure>Alternately the GenPIC can be panel mounted with an LCD display and several switches forming a simple user interface.  There are two tactile pushbutton switches available, or a single rotary encoder with a built-in pushbutton switch.<\/p>\n<p>I choose a capable 8-bit microcontroller to build GenPIC around, the <a href=\"http:\/\/www.microchip.com\/wwwproducts\/en\/en550195\" target=\"_blank\">PIC18F66K80<\/a>.  With 64Kb of program space, 3.6Kb of RAM, two serial ports, 12-bit A\/D on-board, and operating at up to 16MIPS, the processor is quite capable.  While the capability of this microcontroller is sheer overkill for many of the tasks it will be used for, this processor <a href=\"http:\/\/www.digikey.com\/product-detail\/en\/microchip-technology\/PIC18F66K80-I-PT\/PIC18F66K80-I-PT-ND\/2601540\" target=\"_blank\">is only $4<\/a> in small quantities from the usual vendors.  This is not really any more expensive than lesser microcontrollers&#8230;  Use it.<\/p>\n<h5>Open Source Hardware<\/h5>\n<p><figure id=\"attachment_20492\" aria-describedby=\"caption-attachment-20492\" style=\"width: 191px\" class=\"wp-caption alignright\"><a href=\"https:\/\/darkerview.com\/wordpress\/?attachment_id=20492\" rel=\"attachment wp-att-20492\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/darkerview.com\/wordpress\/wp-content\/uploads\/2016\/11\/oshw-logo-e1480374177551-191x200.png\" alt=\"Open Source Hardware Logo\" width=\"191\" height=\"200\" class=\"size-thumbnail wp-image-20492\" \/><\/a><figcaption id=\"caption-attachment-20492\" class=\"wp-caption-text\">The Open Source Hardware Association logo<\/figcaption><\/figure>The design is released under the principles of the <a href=\"http:\/\/www.oshwa.org\/\" target=\"_blank\">Open Source Hardware Association<\/a>.  The design may be openly copied and modified under the terms of the <a href=\"http:\/\/www.oshwa.org\/definition\/\" target=\"_blank\">OSHWA&#8217;s Definition 1.0<\/a>.<\/p>\n<p>Below you will find all source files needed to create this design.  Provided are the original source files in common formats that should be easily loaded and modified by anyone familiar with the technology.<\/p>\n<h5>Documentation<\/h5>\n<p>Here you go, all of the design files needed for GenPIC.  Some of these are in PDF for easy viewing, but the source files are also provided.  The PCB is in Eagle format, I have the full version available, but this is a small PCB, it should load up in the free version.<\/p>\n<table width=\"400\" style=\"border: 1px solid grey\">\n<tr style=\"border: 1px solid grey\">\n<td>Second code release<br \/>14Jun2017<\/td>\n<td><a href=\"https:\/\/darkerview.com\/wordpress\/wp-content\/uploads\/2017\/06\/GenPICCode0.2.zip\">GenPIC Code r0.2<\/a><\/td>\n<\/tr>\n<tr style=\"border: 1px solid grey\">\n<td>First code release<br \/>11Feb2017<\/td>\n<td><a href=\"https:\/\/darkerview.com\/wordpress\/wp-content\/uploads\/2017\/01\/GenPICCode0.1.zip\">GenPIC Code r0.1<\/a><\/td>\n<\/tr>\n<tr style=\"border: 1px solid grey\">\n<td>Updated Manual<br \/>8Feb2017<\/td>\n<td><a href=\"https:\/\/darkerview.com\/wordpress\/wp-content\/uploads\/2017\/01\/GenPICManual-revA.pdf\">GenPIC Manual rev A<\/a><\/td>\n<\/tr>\n<tr style=\"border: 1px solid grey\">\n<td>First hardware<br \/>release<br \/>20Dec2016<\/td>\n<td>\n<a href=\"https:\/\/darkerview.com\/wordpress\/wp-content\/uploads\/2016\/12\/GenPIC-Manual.pdf\">GenPIC Manual<\/a><br \/>\n<a href=\"https:\/\/darkerview.com\/wordpress\/wp-content\/uploads\/2016\/12\/GenPIC-Eagle.zip\">GenPIC Eagle PCB Design Files<\/a><br \/>\n<a href=\"https:\/\/darkerview.com\/wordpress\/wp-content\/uploads\/2016\/11\/GenPIC-PCB-CAM.zip\">PCB Gerber CAM Files<\/a><\/td>\n<\/tr>\n<\/table>\n<p>The first code revision is a test and demonstration release.  It contains support for one serial port, an LCD character display, user input including the encoder and pushbuttons, the indicator LED&#8217;s, timer generation, analog input including onboard temperature readout.<\/p>\n<p>Also included is a serial command interpreter implementing a serial interface usable with any serial terminal.  There is also a user interface system with a state setup that provides multiple input screens.  This should handle a wide array of basic control capabilities, either using the serial port or through using the LCD screen and the encoder. The code allows you to exercise many of the basic functions of the hardware and provide a framework on which a real application can be built.<\/p>\n<p>Not all of the possible peripherals are supported in the current code release, these will come with time and need.  Notably the ESP-01 and XPort are not yet supported.  Look for further code releases as I have time.<\/p>\n<h5>Design Notes<\/h5>\n<p>There are quite a few options to consider when using the PCB.  I have included many features that I think I might need, but some of those features must be traded off against others.  The manual linked above contains a fair number of notes into configuring the PCB to the application, please download and refer to these notes before loading the PCB.<\/p>\n<h5>Errata<\/h5>\n<p>So far there are only a couple errors found in the first revision hardware&#8230;<\/p>\n<ul>\n<li>The footprint for the pushbuttons (S2 and S3) is problematic, the holes are the wrong size for the leads being a bit too small.  The footprint for the rotary encoder is fine, will use that for the first builds.<\/li>\n<li>It was intended that a small heatsink could be used for the 7805 voltage regulator (U5), but one trace is in the way and the heatsink needs to be cut down a bit to avoid a possible short circuit from ground to +5V.<\/li>\n<li>The OE pin of the 3.3V level shift IC (U3 pin 8) is tied to ground.  Unlike every other OE in the world it needs to be tied to VccA (3.3V on GenPIC).  You can cut the short trace between OE and the nearby ground (a pin on S3) , then solder a pullup resistor between pins 8 and 1.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Over the years I have hand wired so many microcontroller PCB&#8217;s. Along with my own projects for myself there are more than a dozen of my little microcontroller devices at work about the observatory. The OSIRIS IR calibration source, the Keck 2 dome inclinometers, a precipitation sensor interface, the Keck 1 AO electronic vault temperature &hellip; <a href=\"https:\/\/darkerview.com\/wordpress\/?p=20337\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;GenPIC, A Microcontroller Utility PCB&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[253,8],"tags":[922,2344,1994,2227,2343],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/darkerview.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/20337"}],"collection":[{"href":"https:\/\/darkerview.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/darkerview.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/darkerview.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/darkerview.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=20337"}],"version-history":[{"count":5,"href":"https:\/\/darkerview.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/20337\/revisions"}],"predecessor-version":[{"id":21922,"href":"https:\/\/darkerview.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/20337\/revisions\/21922"}],"wp:attachment":[{"href":"https:\/\/darkerview.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/darkerview.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/darkerview.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}