Widening my uC repertoar on to include PIC - how/where to start? - Page 1
Forum section: electronics / general

author: MidteideElectronics
author_rank: Newbie
timestamp: January 27, 2011, 02:32:22 pm
content: 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

author: oPossum
author_rank: Super Contributor
timestamp: January 27, 2011, 02:55:19 pm
content: PICkit 3 Debug ExpressThe 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.

author: glossywhite
author_rank: Regular Contributor
timestamp: January 27, 2011, 02:56:07 pm
content: Quote from: MidteideElectronics on January 27, 2011, 02:32:22 pmThis site is EXTREMELY good, and deals with assembly mainly:http://www.pictutorials.com/index.htmThis page is very useful also, but again - assembly (I love asm personally):http://www.mstracey.btinternet.co.uk/pictutorial/picmain.htm I just bought the PICkit 3 Debug Express, and it truly is VERY good.

author: MidteideElectronics
author_rank: Newbie
timestamp: January 27, 2011, 03:16:01 pm
content: 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

author: glossywhite
author_rank: Regular Contributor
timestamp: January 27, 2011, 03:17:14 pm
content: Quote from: MidteideElectronics on January 27, 2011, 03:16:01 pmDon't you mean PICkit *3*?

author: MidteideElectronics
author_rank: Newbie
timestamp: January 27, 2011, 05:19:37 pm
content: Quote from: glossywhite on January 27, 2011, 03:17:14 pmYes I do

author: Zero999
author_rank: Super Contributor
timestamp: January 27, 2011, 05:41:19 pm
content: 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.

author: MidteideElectronics
author_rank: Newbie
timestamp: January 27, 2011, 10:48:08 pm
content: Quote from: Hero999 on January 27, 2011, 05:41:19 pmWho 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.

author: glossywhite
author_rank: Regular Contributor
timestamp: January 28, 2011, 12:57:36 am
content: @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 basicallyimpliedthat 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 couldequallybe perfectly entitled to callyoua moron for such a sweeping statement - in fact, it is pretty moronic to make such judgements, and, as such, your opinion ion 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

author: Mechatrommer
author_rank: Super Contributor
timestamp: January 28, 2011, 02:05:27 am
content: 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.

author: CafeLogic
author_rank: Regular Contributor
timestamp: January 28, 2011, 02:43:08 am
content: 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 I2cOne 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: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.)

author: Jon Chandler
author_rank: Frequent Contributor
timestamp: January 28, 2011, 03:03:08 am
content: 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) isDigital-DIY.

author: MidteideElectronics
author_rank: Newbie
timestamp: January 28, 2011, 07:41:47 am
content: Quote from: glossywhite on January 28, 2011, 12:57:36 amFirst 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...

author: qno
author_rank: Frequent Contributor
timestamp: January 28, 2011, 08:01:57 am
content: My introduction washttp://www.oshonsoft.com/pic.htmlsome time ago.You can simulate without the hardwareThe 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.

author: tyblu
author_rank: Frequent Contributor
timestamp: January 28, 2011, 08:28:26 am
content: 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=6I personally want the DM240011 - MPLAB Starter Kit for PIC24F, but can't justify it at the moment...

author: MidteideElectronics
author_rank: Newbie
timestamp: January 28, 2011, 01:54:30 pm
content: Quote from: tyblu on January 28, 2011, 08:28:26 amThat'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?

author: oPossum
author_rank: Super Contributor
timestamp: January 28, 2011, 03:34:59 pm
content: MPLABis used for assembly and C programming, simulation, and debugging of all PICs.