Author Topic: Widening my uC repertoar on to include PIC - how/where to start?  (Read 6809 times)

0 Members and 1 Guest are viewing this topic.

Offline MidteideElectronicsTopic starter

  • Newbie
  • Posts: 6
    • Midteide's Electronics Blog
Hi folks,

With Dave being the number 1 fanboy of PICs I figured his forum would have an abundance of people knowing about how to start out with them. I'm quite experienced with Atmels AVR series, so I guess (hope) it will be a rather smooth transistion.

So what would you recommend for getting started? I would like a dev board with some buttons and LEDs, able to program the most common types of PICs.

Any suggestions are appreciated!


- Alex

Offline oPossum

  • Super Contributor
  • ***
  • Posts: 1447
  • Country: us
  • Very dangerous - may attack at any time
Re: Widening my uC repertoar on to include PIC - how/where to start?
« Reply #1 on: January 27, 2011, 02:55:19 pm »
PICkit 3 Debug Express

The PICkit 3 can program and debug most PICs.

The Debug Express package comes with a board with a PIC18F45K20, 8 LEDs, pot, pushbutton, and prototype area.

 

Offline glossywhite

  • Regular Contributor
  • *
  • !
  • Posts: 241
Re: Widening my uC repertoar on to include PIC - how/where to start?
« Reply #2 on: January 27, 2011, 02:56:07 pm »
Hi folks,

With Dave being the number 1 fanboy of PICs I figured his forum would have an abundance of people knowing about how to start out with them. I'm quite experienced with Atmels AVR series, so I guess (hope) it will be a rather smooth transistion.

So what would you recommend for getting started? I would like a dev board with some buttons and LEDs, able to program the most common types of PICs.

Any suggestions are appreciated!


- Alex

This site is EXTREMELY good, and deals with assembly mainly:

http://www.pictutorials.com/index.htm

This page is very useful also, but again - assembly (I love asm personally):

http://www.mstracey.btinternet.co.uk/pictutorial/picmain.htm

[EDIT] I just bought the PICkit 3 Debug Express, and it truly is VERY good.

« Last Edit: January 27, 2011, 02:58:16 pm by glossywhite »
 

Offline MidteideElectronicsTopic starter

  • Newbie
  • Posts: 6
    • Midteide's Electronics Blog
Re: Widening my uC repertoar on to include PIC - how/where to start?
« Reply #3 on: January 27, 2011, 03:16:01 pm »
Ok i might go for the pickit 2 debug express thingy then - even here in Norway where everything is expensive its only costing about 77USD! That's pretty cheap!

What developing tools are used for C programming of these?

Oh, and I'm not interested in .asm dev tools - I find it a waste of time for 99% of all projects.


Thanks for your replies people  :)

Offline glossywhite

  • Regular Contributor
  • *
  • !
  • Posts: 241
Re: Widening my uC repertoar on to include PIC - how/where to start?
« Reply #4 on: January 27, 2011, 03:17:14 pm »
Ok i might go for the pickit 2 debug express thingy then - even here in Norway where everything is expensive its only costing about 77USD! That's pretty cheap!

What developing tools are used for C programming of these?

Oh, and I'm not interested in .asm dev tools - I find it a waste of time for 99% of all projects.


Thanks for your replies people  :)

Don't you mean PICkit *3*?
 

Offline MidteideElectronicsTopic starter

  • Newbie
  • Posts: 6
    • Midteide's Electronics Blog
Re: Widening my uC repertoar on to include PIC - how/where to start?
« Reply #5 on: January 27, 2011, 05:19:37 pm »
Ok i might go for the pickit 2 debug express thingy then - even here in Norway where everything is expensive its only costing about 77USD! That's pretty cheap!

What developing tools are used for C programming of these?

Oh, and I'm not interested in .asm dev tools - I find it a waste of time for 99% of all projects.


Thanks for your replies people  :)

Don't you mean PICkit *3*?

Yes I do :)

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19941
  • Country: gb
  • 0999
Re: Widening my uC repertoar on to include PIC - how/where to start?
« Reply #6 on: January 27, 2011, 05:41:19 pm »
AS usual I'd recommend learning assembly first but I accept that some people find that difficult so are better of with C or BASIC.
 

Offline MidteideElectronicsTopic starter

  • Newbie
  • Posts: 6
    • Midteide's Electronics Blog
Re: Widening my uC repertoar on to include PIC - how/where to start?
« Reply #7 on: January 27, 2011, 10:48:08 pm »
AS usual I'd recommend learning assembly first but I accept that some people find that difficult so are better of with C or BASIC.

Who said I don't know assembly? I've done my fair share of assembly before, but if you keep doing all your projects with assembly code then you're a moron in my opinion. Assembly is worth the time when you need full control over when events occur and/or when you need the absolute fastest running code. As I said, for 99% of my projects there is NO reason for using assembly code, C is more than adequate.


Offline glossywhite

  • Regular Contributor
  • *
  • !
  • Posts: 241
Re: Widening my uC repertoar on to include PIC - how/where to start?
« Reply #8 on: January 28, 2011, 12:57:36 am »
@Hero999 I have to agree with the OP, although he may have confused your geniune helpfulness with you being condescending, which I don't think you were, personally. You're being helpful, but by way of analogy, to assume that just because one has never been to France, they cannot speak French, is a little too much of an assumption. You're a star for helping him! :)

@MidteideElectronics Asking for help, and then veiling insults by implication is pretty rude mate! You've basically implied that anyone who codes 100% ASM is a moron? How bold a statement to make! How can you possibly know the tasks set before any one individual "moron" whom you've never met? They may be writing codecs or critical stuff that demands ASM over anything else. Yes, C certainly has many uses, but he could equally be perfectly entitled to call you a moron for such a sweeping statement - in fact, it is pretty moronic to make such judgements, and, as such, your opinion i
on this matter alone, is pretty worthless, possibly arrogant and certainly laughable.

I often wonder how people have the gall to make such ignorant statements - *ignoran* being the operative regex here ;)
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11713
  • Country: my
  • reassessing directives...
Re: Widening my uC repertoar on to include PIC - how/where to start?
« Reply #9 on: January 28, 2011, 02:05:27 am »
this is no place to quarrel on asm and C stuff. everybody know their stuffs, and everybody only give suggestion based on their preferences/condition/experience.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline CafeLogic

  • Regular Contributor
  • *
  • Posts: 117
    • Cafe Logic
Re: Widening my uC repertoar on to include PIC - how/where to start?
« Reply #10 on: January 28, 2011, 02:43:08 am »
It's the same thing really. If you use the PIC18 series, the registers have different names but otherwise you should have no trouble. 2 Gotchas

#1: the direction register is TRIS instead of DIR and the direction is inverted. TRISA = 0 sets all of porta as output, PINA on the avr would be PORTA on the pic and PORTA on the avr would be LATA on the pic
#2: no fuses set in menus. the boot options are set in code with the #pragma directive (for C18). There is a very convenient help file with all the options for each MCU in "C:\MCC18\doc" called "hlpPIC18ConfigSet.chm", some standard functions like delay stuff is in "hlpC18Lib.chm", don't use the I2C in that help file that is bit-bang, you probably want hardware I2c

One thing you will love is not having to deal with that BV macro shit. Every PIC register a struct for the bits. for example,
Code: [Select]
TRISAbits.TRISA1 = 0;
sets pin 1 as output with a single instruction (compiles to a BCF instruction)
the best place to get a list of those structs is the header file for your device in "C:\MCC18\h"

Other than that it is the usual data sheet surfing to find the register names and register breakouts for your peripheral of interest. You will find the PIC peripheral registers to be less consistent than the AVR, they tend to change with each new generation of pics.

I really don't think you need a tutorial if you are proficient with the AVR, just go download MPLAB and C18 and go to work.

I know you said Pickit 3, I just want to reenforce that. I like the pickit 2 better like everyone else but it is close to useless at this point (part support) so don't be tempted.

Last thing is check out the official microchip application library, it is very nice to have a manufacturer supported library for all those complex things (captouch, usb, ethernet, etc.)
 

Offline Jon Chandler

  • Frequent Contributor
  • **
  • Posts: 539
    • Throw Away PIC
Re: Widening my uC repertoar on to include PIC - how/where to start?
« Reply #11 on: January 28, 2011, 03:03:08 am »
Unless you plan on using some of the newest PICs, you might still consider the PICkit 2 over the '3.  Since Dave's rant...err...review...not much has changed even though it's been a year.  I use the UART tool often and the logic analyzer once in a while.  It's a pity the PICkit 3 doesn't have those features.

I'm a fan of Basic, namely Swordfish Basic for the PIC18F-series.  It's a powerful language with a structure similar to VB.  A very active site supporting Swordfish (as well as other PIC languages) is Digital-DIY.
 

Offline MidteideElectronicsTopic starter

  • Newbie
  • Posts: 6
    • Midteide's Electronics Blog
Re: Widening my uC repertoar on to include PIC - how/where to start?
« Reply #12 on: January 28, 2011, 07:41:47 am »
(...) @MidteideElectronics Asking for help, and then veiling insults by implication is pretty rude mate! You've basically implied that anyone who codes 100% ASM is a moron? How bold a statement to make! How can you possibly know the tasks set before any one individual "moron" whom you've never met? They may be writing codecs or critical stuff that demands ASM over anything else. Yes, C certainly has many uses, but he could equally be perfectly entitled to call you a moron for such a sweeping statement - in fact, it is pretty moronic to make such judgements, and, as such, your opinion i
on this matter alone, is pretty worthless, possibly arrogant and certainly laughable.

I often wonder how people have the gall to make such ignorant statements - *ignoran* being the operative regex here ;)


First of all, I'm not President Obama - I don't spend my whole evening looking for words or sentences to be sure not to offend anyone. And I really didn't try to offend anyone either. I said it was my opinion that if you are 100% determined to use .asm for ANY project no matter what the project is then I THINK you are doing things in a very inefficient way and I must say I think thats a bit moronic (is that a word?). And I might have gotten a bit fired up as yes, he came across to me as a huge fanboy (I might have jumped to conclusions there too) of .asm - the type that usually laugh of people using C as they are "such noobies".

Further, I said that I fully understand it for time critical applications and if those kinds of projects make out 100% of his work - then I fully understand why to only use .asm ever. But in just about every other case there is just no point to it. There is a reason why software engineers use C++ and now mostly C#. They could too use .asm, but it would be a massive waste of time.

To be honest, I've never experienced such sensitivity on a forum before. My mother tongue is not English, maybe you guys think of moron as a worse name than I thought. Now you've called me moron back, in addition to arrogant and laughable. What about calling it even and get on with the original topic? :)

No wonder there is war in the world...

Offline qno

  • Frequent Contributor
  • **
  • Posts: 422
  • Country: nl
Re: Widening my uC repertoar on to include PIC - how/where to start?
« Reply #13 on: January 28, 2011, 08:01:57 am »
My introduction was http://www.oshonsoft.com/pic.html some time ago.
You can simulate without the hardware

The examples give you a flying start and you get a quick insight into the PIC hardware in a few hours.
If you have a Pic programmera pic and a display  you have the "Hello world" working in a few minutes.

After this you can deside the way to go, C, ASM or stay with the Basis.
Why spend money I don't have on things I don't need to impress people I don't like?
 

Offline tyblu

  • Frequent Contributor
  • **
  • Posts: 287
  • Country: 00
    • blog.tyblu.ca
Re: Widening my uC repertoar on to include PIC - how/where to start?
« Reply #14 on: January 28, 2011, 08:28:26 am »
Put your chips in for a PICkit3 debug kit (comes with little prototyping board) and a Microstick for dsPIC33F and PIC24H (may not have as many broken-out IOs or LEDs as you want). There's a whackload of other dev boards:
http://www.microchipdirect.com/NewProductTree.aspx?mid=13&Catalog=BuyMicrochip&Category=devtooltree&TreeID=6
I personally want the DM240011 - MPLAB Starter Kit for PIC24F, but can't justify it at the moment...
« Last Edit: January 28, 2011, 08:31:11 am by tyblu »
Tyler Lucas, electronics hobbyist
 

Offline MidteideElectronicsTopic starter

  • Newbie
  • Posts: 6
    • Midteide's Electronics Blog
Re: Widening my uC repertoar on to include PIC - how/where to start?
« Reply #15 on: January 28, 2011, 01:54:30 pm »
Put your chips in for a PICkit3 debug kit (comes with little prototyping board) and a Microstick for dsPIC33F and PIC24H (may not have as many broken-out IOs or LEDs as you want). There's a whackload of other dev boards:
http://www.microchipdirect.com/NewProductTree.aspx?mid=13&Catalog=BuyMicrochip&Category=devtooltree&TreeID=6
I personally want the DM240011 - MPLAB Starter Kit for PIC24F, but can't justify it at the moment...

That's gold! Ill buy both of these, they are both dirt cheap compared to Atmel's kits. What software do you recommend for programming them?

Offline oPossum

  • Super Contributor
  • ***
  • Posts: 1447
  • Country: us
  • Very dangerous - may attack at any time
Re: Widening my uC repertoar on to include PIC - how/where to start?
« Reply #16 on: January 28, 2011, 03:34:59 pm »
MPLAB is used for assembly and C programming, simulation, and debugging of all PICs.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf