strict warning: Only variables should be passed by reference in /sites/linuxpc.info/httpdocs/modules/book/book.module on line 559.

Microchip PIC

This is work in progress (14-2-2010).

The PIC is a family of microcontrollers developed by Microchip. On this page we will focus on the PIC18F4550 which is a microcontroller with USB support. Back in 2007 I did a lot of work on this, but due to lack of time I was forced to put it aside for a while, until now. In the meantime the development software has changed a bit, as well as the Linux distributions, so we will be going back to square one, which is a good opportunity for newcomers to join in.

First you need the microcontroller itself of course, and you need a programmer in order to program the microcontroller. You can build a programmer for yourself, as I did back then. However nowadays it is not really worth the effort as you can buy the Pickit 2 programmer for under 50 euro's, and it is often more reliable than a low cost self made programmer.

Installing the software for the Pickit 2 programmer

We will install and use pk2cmd which allows you to control your Pickit 2 programmer:

  • install the package libusb-dev:
    aptitude install libusb-dev
  • download the source of pk2cmd from http://www.microchip.com/pickit2. The software is nearly at the bottom of the page, section "Linux & Mac OS X software (Unsupported)".
  • extract it, cd to it, and build it:
    tar zxvf pk2cmdv1.20LinuxMacSource.tar.gz
    cd pk2cmdv1.20LinuxMacSource
    make linux
  • copy 2 files to the bin directory:
    cp pk2cmd PK2DeviceFile.dat /usr/local/bin
    chmod 644 /usr/local/bin/PK2DeviceFile.dat
    According to the readme file, the dat file should be copied to /usr/share/pk2 instead, and that directory should be added to your PATH, but the solution above also works, and it is less dirty IMHO.

Now connect your Pickit 2 and verify it is working by using this command:

pk2cmd '-S#'

The required firmware version on the Pickit 2 is v2.32.00 or later, so if an earlier version is reported, it is time to upgrade the firmware:

  • download the firmware v2.32 from the website
  • unzip it:
    unzip PK2V023200.zip
  • flash the hex file:
    pk2cmd -DPK2V023200.hex
  • check if it worked:
    pk2cmd '-S#'
    
    If the firmware version reported is 2.32.00 or higher then you are okay.

Here is a list of commands commonly used:

pk2cmd '-S#' list all connected Pickit 2 devices and their firmware version
pk2cmd -Dfile replace the firmware by the contents of the specified file
pk2cmd -Ppart -R -T power on the target, part is for example PIC18F4550. The -R option is needed to release the Vpp line, which is also the MCLR (reset) on many PIC's.
pk2cmd -Ppart -W power off the target
pk2cmd -Ppart -Ffile -M program the target using specified file

Connecting the programmer to the microcontroller

The pinout of the Pickit 2 is:

1 Vpp (programming voltage)
2 Vdd (target power, often 5V)
3 Vss (Gnd)
4 PGD (program data)
5 PGC (program clock)
6 Aux (not used)

To connect the Pickit 2 to the PIC18F4550:

Pickit 2 PIC18F4550 Optional, if PIC is programmed in application circuit
1 1 pullup 10k to +5V
2 11+32 do not make this connection if using external power
3 12+31  
4 40 10k series resistor to application circuit
5 39 10k series resistor to application circuit
6 n.c.  

It is possible to use the Pickit 2 programmer as (limited) power supply for your application circuit.

Getting and building PUF

The latest release of PUF is at the time of writing from 2007, so you are probably better of using the nightly CVS snapshot which you can find here: http://gforge.enseeiht.fr/snapshots.php?group_id=10. To build, first install flex and bison, extract PUF, cd to it, then do the following:

cd device/puf
aclocal
automake
autoconf
./configure
make

The pinout of the USB connectors:

1 Vcc
2 D-
3 D+
4 Gnd

 

host, A: +-----------+
         | --------- |
         |  - - - -  |
         +-----------+
            1 2 3 4

slave, B:  ---------
         /  -     -  \
        |   2     1   |
        |   3     4   |
        |   -     -   |
        +-------------+ (chassis part)

(This document is not finished. To be continued...)

You're the best to share us

You're the best to share us about this redesign. Trust you won't get tired on making posts as useful as this. Richmond hill brakes

I welcomed your work

I welcomed your work extremely thanks Pest Control Cairns

Positive webpage, where did u

Positive webpage, where did u think of the data on this posting?I have perused a couple of the articles on your site now, and I truly like your style. You rock and please keep up the successful work. fedex soma

Glowpink.com is a women-only beauty, health & lifestyle communit

Glowpink is a Women only 360° Health Community, wherein women can discuss their beauty, health & wellness problems. Here women can post queries and answer other's related to topics, including but not limited to, beauty, health, parenting, lifestyle, and fashion. Here we also try to connect best of the experts in related areas to the users. how to reduce dark circles

Great artcile, yet it would

Great artcile, yet it would be better if in future you can share more about this subject. Continue posting. Ps4

Its an incredible joy

Its an incredible joy perusing your post.Its brimming with data I am searching for and I want to post a remark that "The substance of your post is marvelous" Great work. outsource software

I can’t imagine focusing long

I can’t imagine focusing long enough to research; much less write this kind of article. You’ve outdone yourself with this material. This is great content. mobile detailing orlando

Affection to peruse

Affection to peruse it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks. Pump Repairs

This substance is composed

This substance is composed exceptionally well. Your utilization of organizing when mentioning your focuses makes your objective facts clear and straightforward. Much obliged to you. home depot string trimmers

I discovered this is an

I discovered this is an instructive and fascinating post so i suspect as much it is extremely valuable and proficient. I might want to thank you for the endeavors you have made in composing this article. cheap print canvas

tariq

Easily, the article is actually the best topic on this registry related issue. I fit in with your conclusions and will eagerly look forward to your next updates. Just saying thanks will not just be sufficient, for the fantasti c lucidity in your writing. I will instantly grab your rss feed to stay informed of any updates. http://hilariouspastor23.diowebhost.com/2211402/deciding-on-a-fishing-kayak

internet

I feel a lot more people need to read this, very good info! . . . . . . internet

Affection to peruse

Affection to peruse it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks. web site

It is an awesome site.. The

It is an awesome site.. The Design looks great.. Continue working like that!. read more

Affection to peruse

Affection to peruse it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks. web design

Awesome post, and incredible

Awesome post, and incredible site. A debt of gratitude is in order for the data! The Author Incubator

I as of late ran over your

I as of late ran over your online journal and have been perusing along. I thought I would leave my first remark. I don't realize what to say with the exception of that I have delighted in perusing. Pleasant website. I will continue going by this web journal all the time. The Author Incubator

Affection to peruse

Affection to peruse it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks. Click here

Much obliged for each other

Much obliged for each other useful site. The spot else might just I understand that sort of data written in such a perfect means? I have an endeavor that I'm a few seconds ago working on, and I have been watchful for such data. http://adobecs.aedsoftware.info/

Awesome information! I as of

Awesome information! I as of late ran over your online journal and have been perusing along. I thought I would leave my first remark. I don't recognize what to say with the exception of that I have. electric dog fence installation companies

Best work you have done, this

Best work you have done, this online site is truly cool with incredible truths. Webhosting

Affection to peruse

Affection to peruse it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks. Yio Chu Kang EC

I discovered your this post

I discovered your this post while scanning for some related data on online journal search...Its a decent post..keep posting and upgrade the data. low cost 55 prints

Affection to peruse

Affection to peruse it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks. Hay Day Hack

Affection to peruse

Affection to peruse it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks. corrugated plastic

Howdy! A debt of gratitude is

Howdy! A debt of gratitude is in order for the immense data you havr gave! You have touched on crucuial focuses! RENT A CAR

Affection to peruse

Affection to peruse it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks. click here

A debt of gratitude is in

A debt of gratitude is in order for sharing us. read more

I take in some new stuff from

I take in some new stuff from it as well, a debt of gratitude is in order for sharing your data. read more

"Boredom is a killer—which is

"Boredom is a killer—which is why a cure for boredom can be a lifesaver. The truth is, portable Bluetooth speakers have been the handheld solution to elevate the moment, whether at the beach, the middle of a party, or a lazy afternoon at home for years now—and your brand can get in on that excitement. Right now—with C2BPromo.com, you can put you logo on a wide array of Promotional Bluetooth Speakers, in all different shapes and sizes, from waterproof to resilient wood—with models coming in at 6-7 dollars all the way up to high-end luxury designs. Multiple surfaces on almost every customized Bluetooth speaker can showcase your logo—so no matter which way it’s turned, your name is always center staged." Promotional Speaker

"With our nontraditional

"With our nontraditional students, gender trends have fluctuated depending on the times," Jorgensen said. "I'm not worried about it. We meet a need in the community, so whoever walks in our door we serve." continued

You have a genuine capacity

You have a genuine capacity for composing novel substance. I like how you think and the way you speak to your perspectives in this article. I concur with your state of mind. Much obliged to you for sharing. source

I"m happy to see the immense

I"m happy to see the immense subtle element here!. read full report

I was perusing your article

I was perusing your article and thought about whether you had considered making a digital book on this subject. You"re composing would offer it quick. You have a great deal of composing ability. recommended reading

Business solutions in

Business solutions in Singapore Precisely, you're exceptionally sort of us about remark!. Logo Maker

Much thanks for keep this

Much thanks for keep this data. our site

I felt exceptionally glad

I felt exceptionally glad while perusing this site. This was truly exceptionally enlightening site for me. I truly preferred it. This was truly a sincere post. Much obliged!. cheapest printers

Awesome post, you have

Awesome post, you have pointed out some incredible focuses , I in like manner think this s an extremely great site. makeup brush set

Affection to peruse

Affection to peruse it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks. guides from miami to key west

A debt of gratitude is in

A debt of gratitude is in order for sharing the post.. folks are universes best individual in every existences of individual..they need or must succeed to manage needs of the crew. certified court reporter

informative Blog! Thankyou

informative Blog! Thankyou for this wondrous post, I am happy I watched this site on yippee. Talcum Powder Cancer Lawsuits

Affection to peruse

Affection to peruse it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks. http://rewardedessay.blogspot.com/2017/05/beginners-guide-to-determine-great.html

Incredible post I might want

Incredible post I might want to thank you for the endeavors you have made in composing this intriguing and educated article. guides from miami to key west

Affection to peruse

Affection to peruse it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks. economic door hangers

Affection to peruse

Affection to peruse it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks. Cheap 55printing .com Discount Code

Much thanks for this

Much thanks for this extraordinary post. delhi to jaipur cab

This is exceedingly

This is exceedingly informatics, fresh and clear. I believe that everything has been portrayed in methodical way with the goal that peruser could get most extreme data and realize numerous things. kit tattoo

A debt of gratitude is in

A debt of gratitude is in order for sharing this valuable information.. packers and movers in pune

Affection to peruse

Affection to peruse it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks. places to visit in ajmer

The Ideal Dream Laser Clinic

The Ideal Dream Laser Clinic is a cosmetic-medical center offering only certified, result-oriented hair removal, Skin rejuvenating, body countering and weight loss services for both men and women. Our team includes certified technicians, Registered Dietitian and specialized skin and laser consultants. We offer the highest level of safety and service in an environment where the main priority is your safety, health and privacy. Our clinic located in heart of north York , Yonge and Steeles area close to public transit. 5 min walk to center of Yonge and Steeles, 88 Steeles Ave. East Toronto. laser clinic toronto