{"id":21,"date":"2015-11-21T18:50:35","date_gmt":"2015-11-21T18:50:35","guid":{"rendered":"http:\/\/martinelectronics.co.uk\/wp\/?p=21"},"modified":"2015-11-21T18:53:38","modified_gmt":"2015-11-21T18:53:38","slug":"introducing-the-picmicro-from-microchip-technology","status":"publish","type":"post","link":"http:\/\/martinelectronics.co.uk\/wp\/?p=21","title":{"rendered":"Introducing the PICmicro from Microchip technology"},"content":{"rendered":"<p>PIC is a family of RISC microcontrollers made by Microchip Technology, derived from the PIC1650 originally developed by General Instrument&#8217;s Microelectronics Division.<\/p>\n<p>Microchip Technology does not use PIC as an acronym; in fact the brand name is PICmicro. It is generally regarded that PIC stands for Peripheral Interface Controller, although General Instruments&#8217; original acronym for the PIC1650 was &#8220;Programmable Intelligent Computer&#8221;. The original PIC was built to be used with GI&#8217;s new 16-bit CPU, the CP1600. While generally a good CPU, the CP1600 had poor I\/O performance, and the 8-bit PIC was developed in 1975 to improve performance of the overall system by offloading I\/O tasks from the CPU. The PIC used simple microcode stored in ROM to perform its tasks, and although the term wasn&#8217;t used at the time, it is a RISC design that runs one instruction per cycle (4 oscillator cycles).<\/p>\n<figure id=\"attachment_23\" aria-describedby=\"caption-attachment-23\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/martinelectronics.co.uk\/wp\/wp-content\/uploads\/2015\/11\/Microchip-PIC1655A_GI-01.jpg\"><img loading=\"lazy\" class=\"size-medium wp-image-23\" src=\"http:\/\/martinelectronics.co.uk\/wp\/wp-content\/uploads\/2015\/11\/Microchip-PIC1655A_GI-01-300x122.jpg\" alt=\"General Instrument's PIC1655\" width=\"300\" height=\"122\" srcset=\"http:\/\/martinelectronics.co.uk\/wp\/wp-content\/uploads\/2015\/11\/Microchip-PIC1655A_GI-01-300x122.jpg 300w, http:\/\/martinelectronics.co.uk\/wp\/wp-content\/uploads\/2015\/11\/Microchip-PIC1655A_GI-01.jpg 800w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-23\" class=\"wp-caption-text\">General Instrument&#8217;s PIC1655<\/figcaption><\/figure>\n<p>In 1985 General Instruments spun off their microelectronics division, and the new ownership cancelled almost everything \u2014 which by this time was mostly out-of-date. The PIC, however, was upgraded with EPROM to produce a programmable channel controller, and today a huge variety of PICs are available with various on-board peripherals (serial communication modules, UARTs, motor control kernels, LCD drivers, etc.) and program memory from 512 words to 32k words and more (a &#8220;word&#8221; is one assembly language instruction, varying from 12, 14 or 16 bits depending on the specific PICmicro family).<\/p>\n<figure id=\"attachment_22\" aria-describedby=\"caption-attachment-22\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/martinelectronics.co.uk\/wp\/wp-content\/uploads\/2015\/11\/Microchip-PIC16Cxx-01.jpg\"><img loading=\"lazy\" class=\"size-medium wp-image-22\" src=\"http:\/\/martinelectronics.co.uk\/wp\/wp-content\/uploads\/2015\/11\/Microchip-PIC16Cxx-01-300x225.jpg\" alt=\"Various PIC microcontrollers\" width=\"300\" height=\"225\" srcset=\"http:\/\/martinelectronics.co.uk\/wp\/wp-content\/uploads\/2015\/11\/Microchip-PIC16Cxx-01-300x225.jpg 300w, http:\/\/martinelectronics.co.uk\/wp\/wp-content\/uploads\/2015\/11\/Microchip-PIC16Cxx-01.jpg 800w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-22\" class=\"wp-caption-text\">Various PIC microcontrollers<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>Writing Code for PICs<\/p>\n<p>PICs use a RISC instruction set, which varies in length from about 35 instructions for the low-end PICs to about 70 instructions for the high-end PICs. The instruction set includes instructions to perform a variety of operations on the accumulator and a constant or the accumulator and a memory location, as well as for conditionally executing code and jumping\/calling other parts of the program and returning from them, and specific hardware features like interrupts and one low-power mode called sleep. Microchip provides a freeware IDE package called MPLAB, that also includes a software simulator as well as an assembler.<\/p>\n<p>Third parties make C and BASIC language compilers for PICs. Microchip also sells compilers for the high-end PICs (&#8220;C18&#8221; for the 18F series and &#8220;C30&#8221; for the dsPICs). They also make available for download a &#8220;student edition\/demo&#8221; version of C18 or C30 which disables some optimiser features after a timeout period. Open-source compilers for the C, Pascal, JAL, and for the Forth programming language, PicForth, have also been released.<\/p>\n<p>GPUTILS is an Open Source collection of tools, distributed under the GNU General Public License. GPUTILS includes an assembler and linker and works on Linux, Mac OS X, OS\/2 and Microsoft Windows. GPSIM is an Open Source simulator for the PIC microcontrollers featuring hardware modules that simulate specific devices that might be connected to them, like LCDs.<\/p>\n<p>Devices called &#8220;programmers&#8221; are traditionally used to get program code into the target PIC. Most PICs that Microchip sells nowadays have ICSP (In Circuit Serial Programming) and\/or LVP (Low Voltage Programming) capabilities, allowing the PIC to be programmed while it is sitting in the target circuit. ICSP programming is performed using the RB6 and RB7 pins for clock and data, while a high voltage (12V) is present on the Vpp\/MCLR pin. Low voltage programming allows for the elimination of the extra voltage rail in the programmer but comes at the cost of an IO pin and can therefore be disabled (once disabled it can only be re-enabled using high voltage programming). There are many programmers for PIC microcontrollers, ranging from the extremely simple designs that rely on the communications software for taking care of all the communication details to complex designs that can verify the device at several supply voltages and can do much of the work in the hardware. Many of these complex programmers use a pre-programmed PIC themselves to send the programming commands to the PIC that is to be programmed.<\/p>\n<p>Many of the higher end flash based PICs can also write to their own program memory. Demo boards are available with a small bootloader factory programmed that can be used to load user programs over an interface such as RS-232 or USB.<\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">There are many programmers\/debuggers available directly from Microchip:<\/span><\/p>\n<ul>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">PICStart Plus (RS232 serial interface)<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">Promate II (RS232 serial interface)<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">MPLAB PM3 (RS232 serial and USB interface)<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">ICD2 (RS232 serial and USB interface)<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">PICKit 1 (USB interface)<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">PICKit 2 (USB interface)<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">Debugging<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">MPLAB (which is a free download) includes a software emulator for PICs. However software emulation of a microcontroller will always suffer from limited simulation of the devices interactions with its target circuit.<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">The MPLAB ICD2 (RS-232 serial and USB interface). Offers fairly cheap (about \u00a3100) in circuit debugging. A programming\/debug connector (the ICD2 has a RJ12 socket and comes with a cross wired RJ12 lead but there is nothing preventing the use of custom cables to other connector types) is designed into the target circuit. This cheap and simple debugging system comes at a price however, namely limited breakpoint count (1 on older pics 3 on newer PICs), loss of some IO (with the exception of some surface mount 44 pin PICs which have dedicated lines for debugging) and loss of some features of the chip. For small PICs where the loss of IO caused by this method would be unacceptable special headers are made which are fitted with PICs that have extra pins specifically for debugging. Some third party debugging solutions also exist using the on chip facilities provided for the ICD2.<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">Finally microchip offers two full in circuit emulators. The MPLAB ICE2000 (parallel interface, a USB converter is available) and the newer MPLAB ICE4000 (USB interface). There are also third party emulators from such companies as RF Solutions, who produce the ICEPIC3 system, these are often lower cost solutions.<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">Word size<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">The word size of PICs is a source of much confusion. All PICs (except dsPICs and PIC24s) handle data in 8-bit chunks, so they should be called 8-bit microcontrollers. But unlike most CPUs, PICs use Harvard architecture, so the size of an instruction can be different from the size of the data. In fact, different PIC families use different instruction sizes, which makes it a challenge to compare the code size of PICs to other microcontrollers. For example, say a microcontroller has 6144 bytes of program memory. For a 12-bit PIC, this works out to 4096 words (or assembly instructions); for a 16-bit PIC, this is 3072 words.<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">Modern PICs<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">The old PROM and EPROM PICs are now gradually replaced by chips with Flash memory. Likewise the original 12-bit instruction set of the PIC1650 and its direct descendants has been superseded by 14-bit and 16-bit instruction sets. Microchip still sells OTP (one-time-programmable, or PROM) and UV-eraseable (EPROM) versions of most of its PICs for legacy support, or volume orders. It should be noted that the Microchip website lists PICs that are not electrically erasable as OTP despite the fact that UV erasable windowed versions of these chips can be ordered.<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">Features<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">Current PICs offer a wide range of built-in hardware, such as:<\/span><\/p>\n<ul>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">8\/16 bit Modified Harvard Architecture CPU cores<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">Flash and ROM Memory options in 256 byte to 256 kilobyte array sizes<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">I\/O Ports (0 to 5.5 volts Typical)<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">8\/16 Bit Timers<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">Nanowatt Technology for Power Moding<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">Synchronous\/Asynchronous Serial Peripherals USART, AUSART, EUSARTs<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">Analog-to-digital converters, 10\/12 bit<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">Voltage Comparators<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">Capture\/Compare\/PWM modules<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">LCD Drivers<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">MSSP Peripheral for I\u00b2C and SPI Communications<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">Internal EEPROM Memory &#8211; up to 1M erase\/write cycles durability<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">Motor Control Peripherals<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">USB interfacing support<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">Ethernet controller support<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">CAN controller support<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">LIN controller support<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">IrDA controller support<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">Integrated analog RF front ends (PIC16F639, and rfPIC)<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">KEELOQ Rolling code encryption peripheral (encode\/decode)<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">DSP digital signal processing capabilities (dsPIC)<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">PICs on the Internet<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">PICs are well-documented on the Internet, mainly for two reasons. First, PICs were commonly used to defeat the security system of popular consumer products (pay-TV, PlayStation), which attracted the attention of crackers. Second, the now obsolete PIC16C84 was the first widely available microcontroller that could easily be re-programmed by hobbyists. There are many forums and lists concerning PIC microcontrollers where the user can post questions and receive free answers.<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">PIC clones<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">Every now and then there are companies that offer cheap and\/or enhanced PIC versions. Most seem to disappear quite soon. Ubicom (formerly Scenix) seems to avoid this fate and produces the SX, a PIC clone that runs much faster than the original (as of November 2005 Parallax is the exclusive supplier of the SX). OpenCores has a pic16f84 core written in Verilog.<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">Wireless PICs<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">The rfPIC microcontroller devices integrate the power of Microchip\u00b4s PICmicro devices with UHF wireless communication capabilities for low power RF applications. The devices offer small package outline and low external component count to fit the most space-constrained applications.<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">dsPICs (Digital Signal PICs)<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">dsPICs are Microchip&#8217;s newest family, which entered mass production in late 2004. They are designed as a PIC with digital signal processing capabilities. These are Microchip&#8217;s first inherent 16-bit (data) microcontrollers. They build on the PICs existing strengths by offering hardware MAC (multiply-accumulate), barrel shifting, bit reversal, (16&#215;16)-bit multiplication and other digital signal processing operations.<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">8\/16-bit PIC microcontroller product families<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">These links take you to product selection matrices at the manufacturer&#8217;s site.<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">8-bit Microcontrollers<\/span><\/p>\n<ul>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">PIC10<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">PIC12<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">PIC14<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">PIC16<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">PIC17<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">PIC18<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">16-bit Microcontrollers<\/span><\/p>\n<ul>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">PIC24<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">16-bit Digital Signal Controllers<\/span><\/p>\n<ul>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">dsPIC30<\/span><\/li>\n<li><span style=\"font-family: Arial, Helvetica, sans-serif;\">dsPIC33F<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">The F in a name generally indicates the PICmicro uses flash memory and can be erased electronically. A C generally means it can only be erased by exposing the die to ultraviolet light (which is only possible if a windowed package style is used).<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">External links<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">For more information visit <a href=\"http:\/\/www.microchip.com\/\" target=\"new\">www.Microchip.com<\/a><\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\"><a href=\"http:\/\/www.piclist.com\/\" target=\"new\">www.piclist.com<\/a><\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\">Linux PIC Programmer Software<\/span><\/p>\n<p><span style=\"font-family: Arial, Helvetica, sans-serif;\"><a href=\"http:\/\/cole.homedns.org\/picprg.php\" target=\"new\">PICPrg <\/a>A fast Linux command line (or ncurses) program, to program any Microchip PIC using the PC parallel port interface. Program\/verify PIC data, erase non-protected\/protected PIC data or calculate the PIC checksum.<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PIC is a family of RISC microcontrollers made by Microchip Technology, derived from the PIC1650 originally developed by General Instrument&#8217;s Microelectronics Division. Microchip Technology does not use PIC as an acronym; in fact the brand name is PICmicro. It is generally regarded that PIC stands for Peripheral Interface Controller, although General Instruments&#8217; original acronym for &hellip; <a href=\"http:\/\/martinelectronics.co.uk\/wp\/?p=21\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Introducing the PICmicro from Microchip technology<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,15,17,14,1],"tags":[20,19,21,18],"_links":{"self":[{"href":"http:\/\/martinelectronics.co.uk\/wp\/index.php?rest_route=\/wp\/v2\/posts\/21"}],"collection":[{"href":"http:\/\/martinelectronics.co.uk\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/martinelectronics.co.uk\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/martinelectronics.co.uk\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/martinelectronics.co.uk\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=21"}],"version-history":[{"count":4,"href":"http:\/\/martinelectronics.co.uk\/wp\/index.php?rest_route=\/wp\/v2\/posts\/21\/revisions"}],"predecessor-version":[{"id":27,"href":"http:\/\/martinelectronics.co.uk\/wp\/index.php?rest_route=\/wp\/v2\/posts\/21\/revisions\/27"}],"wp:attachment":[{"href":"http:\/\/martinelectronics.co.uk\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=21"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/martinelectronics.co.uk\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=21"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/martinelectronics.co.uk\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}