{"id":1034,"date":"2010-12-03T08:50:33","date_gmt":"2010-12-03T13:50:33","guid":{"rendered":"http:\/\/embedded-lab.com\/blog\/?p=1034"},"modified":"2012-07-30T09:29:29","modified_gmt":"2012-07-30T13:29:29","slug":"breadboard-module-for-pic16f628a","status":"publish","type":"post","link":"https:\/\/embedded-lab.com\/blog\/breadboard-module-for-pic16f628a\/","title":{"rendered":"Breadboard module for PIC16F628A"},"content":{"rendered":"<p>Here&#8217;s another breadboard module that carries a PIC16F628A microcontroller. The power supply pins and the I\/O ports of the PIC16F628A microcontroller are accessed through male headers. It can be easily plugged into a breadboard and is very useful for quick prototyping. It frees up a lot of space on the breadboard since the oscillator, reset, and ICSP circuits are already built on the module. It is different from the previous <a href=\"http:\/\/embedded-lab.com\/blog\/?p=574\" target=\"_blank\"><em><strong>PIC16F688 breadboard module<\/strong><\/em><\/a> in the way that the microcontroller now runs with an external 4.0 MHz crystal. So, this module will be more appropriate for experiments that require accurate timing calculations. Besides, the PIC16F628a microcontroller allows you to read\/write 8-bit data directly through PORTB, which is 8-bit wide (none of the ports in PIC16F688 were 8-bit wide).<\/p>\n<p style=\"text-align: left;\">The layout and the circuit diagram of the module is shown below. The module has ICSP header pins for in-circuit programming, a reset switch, and an LED as power-on indicator. It provides easy access to all the pins of PORTB, and RA0 through RA4 pins of PORTA. Pins RA6 and RA7 are used for external crystal connections, whereas RA5 is input only pin and is used for reset circuit.<\/p>\n<div id=\"attachment_4702\" style=\"width: 496px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2010\/12\/HeaderPins.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4702\" class=\"size-full wp-image-4702\" title=\"HeaderPins\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2010\/12\/HeaderPins.png\" alt=\"\" width=\"486\" height=\"356\" \/><\/a><p id=\"caption-attachment-4702\" class=\"wp-caption-text\">Component layout<\/p><\/div>\n<p><!--more--><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2010\/12\/PIC16F628A_Mod.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-1873 aligncenter\" title=\"PIC16F628A_Mod\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2010\/12\/PIC16F628A_Mod-550x343.png\" alt=\"\" width=\"550\" height=\"343\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2010\/12\/PIC16F628A_Mod-550x343.png 550w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2010\/12\/PIC16F628A_Mod.png 825w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/a><\/p>\n<p>This circuit can be soldered on a general-purpose prototyping circuit board. Here are some pictures that I took of my finished board.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/embedded-lab.com\/blog\/?attachment_id=1184\" rel=\"attachment wp-att-1184\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1184 aligncenter\" title=\"Img_BreadBoardModulePIC16F628A\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2010\/12\/Img_BreadBoardModulePIC16F628A.jpg\" alt=\"\" width=\"580\" height=\"459\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2010\/12\/Img_BreadBoardModulePIC16F628A.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2010\/12\/Img_BreadBoardModulePIC16F628A-550x435.jpg 550w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/embedded-lab.com\/blog\/?attachment_id=1185\" rel=\"attachment wp-att-1185\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1185 aligncenter\" title=\"Img_BreadBoardModulePIC16F628A_Back\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2010\/12\/Img_BreadBoardModulePIC16F628A_Back.jpg\" alt=\"\" width=\"580\" height=\"439\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2010\/12\/Img_BreadBoardModulePIC16F628A_Back.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2010\/12\/Img_BreadBoardModulePIC16F628A_Back-550x416.jpg 550w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>Now, the breadboard module is ready and its a time to test it. I have written a small application program to chase 8 LEDs that are connected to the PORTB pins of the PIC16F628A microcontroller. The circuit diagram is not shown here as it is very simple. The anodes of the 8 LEDs are connected to the \u00a0PORTB pins, whereas the cathodes are grounded through 330 ? resistors in series. The program is written in C and is given below. I compiled it with MikroC Pro for PIC, and loaded the HEX file into the PIC16F628A microcontroller with my handy iCP01 USB programmer from <a href=\"http:\/\/www.piccircuit.com\/\" target=\"_blank\">iCircuit technology<\/a>. In the configuration bit settings, MCLR should be enabled and the clock source could be XT or HS, both will work for 4.0 MHz.<\/p>\n<p><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2010\/12\/PI16F628A_ConfigSettings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-1301\" title=\"PI16F628A_ConfigSettings\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2010\/12\/PI16F628A_ConfigSettings-550x267.png\" alt=\"\" width=\"550\" height=\"267\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2010\/12\/PI16F628A_ConfigSettings-550x267.png 550w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2010\/12\/PI16F628A_ConfigSettings-1024x498.png 1024w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2010\/12\/PI16F628A_ConfigSettings.png 1040w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/a><\/p>\n<p>Here is the test program in MikroC.<\/p>\n<pre><span style=\"color: #003366;\">\/*<\/span><\/pre>\n<pre><span style=\"color: #003366;\">Project: LED chaser program for testing the PIC16F628A module<\/span><\/pre>\n<pre><span style=\"color: #003366;\">Eight LEDs are connected to PORTB pins<\/span><\/pre>\n<pre><span style=\"color: #003366;\">Copyright @ Rajendra Bhatt<\/span><\/pre>\n<pre><span style=\"color: #003366;\">Dec 2, 2010<\/span><\/pre>\n<pre><span style=\"color: #003366;\">MCU: PIC16F628A<\/span><\/pre>\n<pre><span style=\"color: #003366;\">Oscillator: XT, 4.0000 MHz<\/span><\/pre>\n<pre><span style=\"color: #003366;\">MCLR Enabled<\/span><\/pre>\n<pre><span style=\"color: #003366;\">*\/<\/span><\/pre>\n<pre><span style=\"color: #003366;\">unsigned short i, j;<\/span><\/pre>\n<pre><span style=\"color: #003366;\">void main() {<\/span><\/pre>\n<pre><span style=\"color: #003366;\"> CMCON = 0x07; \/\/ Disable comparators<\/span><\/pre>\n<pre><span style=\"color: #003366;\"> PORTB = 0x00; \/\/ Start with all zero O\/Ps<\/span><\/pre>\n<pre><span style=\"color: #003366;\"> TRISB = 0x00; \/\/ PORTB pins all O\/Ps<\/span><\/pre>\n<pre><span style=\"color: #003366;\"> do {<\/span><\/pre>\n<pre><span style=\"color: #003366;\"> i = 1;<\/span><\/pre>\n<pre><span style=\"color: #003366;\"> for(j=0; j&lt;8; j++) {<\/span><\/pre>\n<pre><span style=\"color: #003366;\"> PORTB = i;<\/span><\/pre>\n<pre><span style=\"color: #003366;\"> Delay_ms(100);<\/span><\/pre>\n<pre><span style=\"color: #003366;\"> i = i&lt;&lt; 1; \/\/ Left shift one bit<\/span><\/pre>\n<pre><span style=\"color: #003366;\"> }<\/span><\/pre>\n<pre><span style=\"color: #003366;\"> }while(1);<\/span><\/pre>\n<pre><span style=\"color: #003366;\">}<\/span><\/pre>\n<p style=\"text-align: right;\"><a href=\"http:\/\/embedded-lab.com\/uploads\/HexFiles\/PIC16F628A\/ScrollLEDs.zip\">Download the HEX file<\/a><\/p>\n<p>After the program is loaded, turn the power ON and watch the chasing LEDs.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/embedded-lab.com\/blog\/?attachment_id=1183\" rel=\"attachment wp-att-1183\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1183 aligncenter\" title=\"Img_PIC16F628A_LEDChaser\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2010\/12\/Img_PIC16F628A_LEDChaser.jpg\" alt=\"\" width=\"521\" height=\"409\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s another breadboard module that carries a PIC16F628A microcontroller. The power supply pins and the I\/O ports of the PIC16F628A microcontroller are accessed through male headers. It can be easily plugged into a breadboard and is very useful for quick prototyping. It frees up a lot of space on the breadboard since the oscillator, reset, and ICSP circuits are already built on the module. It is different from the previous PIC16F688 breadboard module in the way that the microcontroller now runs with an external 4.0 MHz crystal. So, this module will be more appropriate for experiments that require accurate timing<\/p>\n","protected":false},"author":2,"featured_media":1036,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,4,38],"tags":[133,132,96],"class_list":["post-1034","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-embedded-labs","category-pic-projects","category-pic-tutorials","tag-breadboard-module","tag-pic-board","tag-pic16f628a"],"_links":{"self":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/1034","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/comments?post=1034"}],"version-history":[{"count":34,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/1034\/revisions"}],"predecessor-version":[{"id":5815,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/1034\/revisions\/5815"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media\/1036"}],"wp:attachment":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media?parent=1034"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/categories?post=1034"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/tags?post=1034"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}