<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:og="http://ogp.me/ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:schema="http://schema.org/" xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:sioct="http://rdfs.org/sioc/types#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" version="2.0" xml:base="https://www.linuxjournal.com/tag/pic">
  <channel>
    <title>pic</title>
    <link>https://www.linuxjournal.com/tag/pic</link>
    <description/>
    <language>en</language>
    
    <item>
  <title>Summer Hacking</title>
  <link>https://www.linuxjournal.com/content/summer-hacking</link>
  <description>  &lt;div data-history-node-id="1023118" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/pl-pk2.jpg" width="358" height="149" alt="PICkitII" title="CC-BY http://www.flickr.com/photos/travisgoodspeed/2906693762/" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/johan-thelin" lang="" about="https://www.linuxjournal.com/users/johan-thelin" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Johan Thelin&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;It is summer on the northern hemisphere, and I've decided to target a smaller system than I've been used to in the last couple of years. In particular, I've decided to finally open my dear old PICkit II. The goal is to be able to work with this board from within a Linux environment.&lt;/p&gt;
&lt;p&gt;The PICkit II sports a PIC16F690 device. The debug dongle supplied supports many more devices and is a very handy tool to have around if you work with PIC processors. The PIC16F690 comes with 7kB of program FLASH, 256B of RAM and 256B of EEPROM; hardly enough to run Linux, but just right to do small monitoring or automation tasks.&lt;/p&gt;
&lt;p&gt;To my joy, the PICkit II is now supported on Linux by Microchip (the makers of the PIC processors). The tools are supplied "as-is," and do not expect to be popular in the support department for not following the main road, but still, it is better than nothing. Also, they are free, but only as in free beer. To download the tool, look for PK2CMD for Linux (simply search for Linux) on the &lt;a href="http://www.microchip.com/pickit2"&gt;PICkit II page&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The recommended file to download is the source code package, as the binary was built back in 2009 on CentOS 4.7. To build the binary, untar the source code package, enter the resulting directory and run make linux, followed by sudo make install. On my Debian system, I needed to have build-essential and libusb-dev installed to get the compilation to succeed. The resulting installation ends up in /usr/local/bin/ and /usr/share/pk2/. You will also have to setup a couple of udev rules for the USB device to be properly detected, as shown in &lt;a href="http://sync-signal.com/2010/01/getting-started-with-pickit2-on-ubuntu-9-10/"&gt;this blog&lt;/a&gt;. The only issue not discussed there that I ran into was updating the software of the PICkit II programmer itself, i.e. the &lt;em&gt;OS Firmware Version&lt;/em&gt; returned from pk2cmd -?V. I had to surrender and used the Windows version to get that updated properly (and it took three attempts there as well). Rest assured - I did not brick the device by trying - more than once.&lt;/p&gt;
&lt;p&gt;The pk2cmd tool lets me interface the PICkit II programmer, i.e. to download software to the PIC device. Now, all that is missing are the tools to actually create software. Here, a fully open source toolchain is available. To my joy, it was already packaged for Debian, so a simple apt-get install gputils gpsim takes care of that.&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://gputils.sourceforge.net/"&gt;gputils&lt;/a&gt; package contains gpasm and gplink - an assembler and linker compatible with the PIC16F690 device. The &lt;a href="http://gpsim.sourceforge.net"&gt;gpsim&lt;/a&gt; package contains a simulator for PIC circuits. However, it does not support our specific PIC device. Still, it is great for experimentation and detailed debugging in a controlled environment (no reality present to bite you).&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/summer-hacking" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Wed, 03 Aug 2011 13:00:00 +0000</pubDate>
    <dc:creator>Johan Thelin</dc:creator>
    <guid isPermaLink="false">1023118 at https://www.linuxjournal.com</guid>
    </item>

  </channel>
</rss>
