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...)

I adore this site!! The blaze

I adore this site!! The blaze up the top is great!! Mahesh babu photos

sirking79

Great survey, I'm sure you're getting a great response. Questions to ask your girlfriend

I imagine that a debt of

I imagine that a debt of gratitude is in order for the valuabe data and bits of knowledge you have so given here. click for source

Magnificent article, a debt

Magnificent article, a debt of gratitude is in order for assembling this! This is clearly one extraordinary post. A debt of gratitude is in order for the important data and experiences you have so given here. clicking here

Exceptionally valuable post.

Exceptionally valuable post. This is my first time i visit here. I discovered such a large number of fascinating stuff in your site particularly its exchange. Truly its awesome article. Keep it up. https://www.cheap55printing.com/blog/cheap-business-card-advertising-ideas/

Much obliged to you for

Much obliged to you for peopling get the data they require. Incredible stuff not surprisingly. Keep up the considerable work!!! Questions to ask your boyfriend

A debt of gratitude is in

A debt of gratitude is in order for the post and extraordinary tips..even I likewise believe that diligent work is the most essential part of getting achievement.. cheapest 55 printing

That is the amazing attitude,

That is the amazing attitude, in any case is simply not make each sence at all proclaiming about that mather. Practically any system an abundance of thanks notwithstanding i had attempt to advance your own particular article into delicius in any case it is obviously a predicament utilizing your data destinations would you be able to please recheck the thought. much appreciated yet again. warehousing in lagos

A debt of gratitude is in

A debt of gratitude is in order for imparting pleasant data to us. i like your post and all you impart to us is uptodate and very useful, i might want to bookmark the page so i can come here again to peruse you, as you have made a brilliant showing. More Bonuses

Its an extraordinary delight

Its an extraordinary delight 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. gta5cash

I truly delighted in perusing

I truly delighted in perusing this post, huge fan. Keep doing awesome me when would you be able to distribute more articles or where would I be able to peruse more on the subject? The Magic of Making Up

Extremely intriguing online

Extremely intriguing online journal. Alot of web journals I see nowadays don't generally give anything that I'm keen on, however I'm most definately inspired by this one. Recently felt that I would post and let you know. visqueen

I have perused your online

I have perused your online journal it is exceptionally useful for me. I need to express profound gratitude to you. I have bookmark your site for future redesigns. best morocco tour companies

Brilliant .. Astounding ..

Brilliant .. Astounding .. I'll bookmark your online journal and take the nourishes likewise… I'm glad to discover such a large number of valuable information here in the post, we need work out more procedures in such manner, much obliged for sharing. corrugated plastic

I needed to thank you for

I needed to thank you for this phenomenal read!! I unquestionably adored each and every piece of it. I have you bookmarked your site to look at the new stuff you post. read this

This article is an engaging

This article is an engaging abundance of enlightening information that is intriguing and elegantly composed. I praise your diligent work on this and thank you for this data. You have what it takes to get consideration. Free printing near me

This is an awesome post. I

This is an awesome post. I like this topic.This site has heaps of advantage.I discovered numerous fascinating things from this site. It helps me in numerous ways.Thanks for posting this once more. Benefits of Cucumbers

I went over this site and I

I went over this site and I trust you have a ton of brilliant data, spared to my bookmarks www.cheap55printing.com/blog/cheap-color-copies-new-york-2/

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. Goedkope AdWords campagnes

SEO

Positive site, where did u

Positive site, where did u think of the data on this posting? I'm satisfied I found it however, sick be inquiring soon to figure out what extra posts you incorporate. Hero Instinct

Love what you're doing here

Love what you're doing here folks, keep it up!.. full report

I'm happy I discovered this

I'm happy I discovered this site, I couldn't discover any learning on this matter earlier to.Also work a webpage and on the off chance that you are ever inspired by doing some guest composing for me if conceivable don't hesitate to tell me, im dependably search for individuals to look at my site. click for more info

Greatly composed article, if

Greatly composed article, if just all bloggers offered the same substance as you, the web would be a much better place.. related site

Pretty nice post. I just

Pretty nice post. I just stumbled upon your weblog and wanted to say that I have really enjoyed browsing your blog posts. After all I’ll be subscribing to your feed and I hope you write again soon! more

I truly value this superb

I truly value this superb post that you have accommodated us. I guarantee this would be helpful for a large portion of the general population. continue reading

Howdy, I discover perusing

Howdy, I discover perusing this article a delight. It is to a great degree supportive and fascinating and all that much anticipating perusing a greater amount of your work.. Preparing Company Accounts

A debt of gratitude is in

A debt of gratitude is in order for your post. I've been contemplating composing an exceptionally equivalent post in the course of the last couple of weeks, I'll most likely keep it quick and painless and connection to this rather if thats cool. Much obliged. get more Info

We Are Website Design is a

We Are Website Design is a general blog about tech, web design, business, SEO and everything in between. We Are Website Design

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. web marketing

I have perused your online

I have perused your online journal it is exceptionally useful for me. I need to express profound gratitude to you. I have bookmark your site for future redesigns. gclub download

Only aspire to mention ones

Only aspire to mention ones content can be as incredible. This clarity with your post is superb and that i may think you’re a guru for this issue. High-quality along with your concur permit me to to seize your current give to keep modified by using approaching blog post. Thanks a lot hundreds of along with you should go on the pleasurable get the job done. search engine optimization

A debt of gratitude is in

A debt of gratitude is in order for setting aside an ideal opportunity to examine this, I feel unequivocally about it and adoration adapting more on this subject. On the off chance that conceivable, as you pick up aptitude, would you psyche overhauling your web journal with additional data? It is to a great degree accommodating for me. Accountant Tax Return

Simply respecting your work

Simply respecting your work and thinking about how you dealt with this online journal so well. It's remarkable to the point that I can't bear to not experience this significant data at whatever point I surf the web! private law

This is extremely fascinating

This is extremely fascinating substance! I have completely appreciated perusing your focuses and have reach the conclusion that you are right about a significant number of them. You are extraordinary. plataforma de e-commerce

You finished a couple fine

You finished a couple fine focuses there. I did an inquiry on the subject and discovered about all persons will oblige with your online journal. Cheapest Panoramic Canvas Prints

A debt of gratitude is in

A debt of gratitude is in order for imparting pleasant data to us. i like your post and all you impart to us is uptodate and very useful, i might want to bookmark the page so i can come here again to peruse you, as you have made a superb showing. http://cheapprinting.doodlekit.com/#

Much obliged to you for some

Much obliged to you for some other instructive site. The spot else might just I understand that sort of data written in such a flawless strategy? I have an endeavor that I am essentially now running on, and I"ve been at the look out for such data. curso google adwords

I just couldn't leave your

I just couldn't leave your site before letting you know that I genuinely delighted in the top quality data you present to your guests? Will be back again as often as possible to determine the status of new posts. look at this

I have perused your online

I have perused your online journal it is exceptionally useful for me. I need to express profound gratitude to you. I have bookmark your site for future redesigns. cheap door hangers

The data you have posted is

The data you have posted is extremely helpful. The destinations you have alluded was great. A debt of gratitude is in order for sharing... http://aedsoftware.info/inventorcam.html

We provide professional and

We provide professional and affordable services to clients in the Jacksonville area. Leave the worry out of the equation by taking advantage of our screen repair service, and letting the experts handle it. We'd love the opportunity to work with you and show why our exceptional service sets us apart from the rest of the field. We have... professional installers, free estimates, satisfaction guaranteed, Phifer sun and shade control products. We do... Screen Enclosure Repair, Pool Enclosure Repair, Screen Repair Service, Per Panel Screen Repair, Window Screen Repair, Screen Door Repair, Window Screen Replacement, Sliding Screen Door Repair, Full Re-Screen Service, Rusty Bolt Replacement, and More. Screen Enclosure Repair

Brilliant showed data. I

Brilliant showed data. I thank you about that. Undoubtedly it will be extremely valuable for my future ventures. Might want to see some different posts on the same subject! check it out

Amazing! This could be a

Amazing! This could be a standout amongst the most helpful web journals we have ever go over on thesubject. Really great data! I'm likewise a specialist in this point so I can comprehend your exertion. visit clickhowto

I have perused your online

I have perused your online journal it is exceptionally useful for me. I need to express profound gratitude to you. I have bookmark your site for future redesigns. Curso marketing digital

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