PDA

View Full Version : Question Suggest a good starter PIC


Accu157
May 08, 2008, 12:22 AM
I'm getting much more knowledge about how to work with circuitry lately. Pardon my lack of onological depth, but this stuff is awesome. I'll take my time until I am ready for PIC programming, since I barely understand a 555 timer at this point. I'll even buy an old ibm 5150 if I need to. (well... those can be had for less than a current 64 mb flash drive so... lol)

I'd prefer that I follow the tried and true method of learning this stuff. I'm willing to buy some books (half-price books ok? :) ), but I have a few requests.

-I'd like an IC with a socket type that will work with the breadboard I have (no more than 40 pin).
-I'd like a kit programmer
-I'd like to be able to use my education to help out (calc + phys knowedge)
-That's all I have to request at this point

Here are some intriguing sites I've come across:
http://www.kitsrus.com/pic.html
http://sq-1.com/
http://www.allelectronics.com

Acetronics
May 08, 2008, 04:43 AM
Hi,

1) For the money ... buy a GENUINE PICKIT2 from Microchip ...
2) Plus, the AC 162051 ICD Header (40 Pins )
AC 162050 .................(8 Pins )
AC .... etc, etc ( following your pic model )
note a breadboard adapter AC162069 ...

You will be able to use that on your BreadBoard ... or directly on your app. !!! Programming + Debugging !!!
Or even use a MikroElelektronika EasyPic5 board ...

For the PIC Model ...

The 16F84A is THE Beginner's model ... enough simple to put hands on, but too small for further "serious projects" : just 1K memory

The 16F877A is THE second model or third model, cause, in between, you can test your skills on a 16F648A ... ( some more interesting features, a 4 k memory but still 18 pins and 16F84 compatible ...

After that, skip to 18F series ... 18F4520 i.e ... to there, some time will have passed ...
and you'll be able to help yourself !!! :)

Alain

BushmanLA
May 08, 2008, 04:57 AM
I pretty much agree with Ace here.

My favorite standard duty pic is usually a 16F628A

If you are new to programming I suggest not trying to start with assembly.
Here are some good places with demo software that will work fine for most hobby projects.

BASIC compiler - it integrates into MPLAB which is nice
http://www.melabs.com

C Compilers - most integrate into MPLAB
http://microchip.htsoft.com/products/compilers/PICClite.php

http://www.sourceboost.com/

http://www.ccsinfo.com/

http://www.mikroe.com/en/

Microchip also has the C18 C compiler but it only works for 18 series PICs



Get familiar with this place.
http://www.sparkfun.com


This is the programmer that I use and LOVE http://www.sparkfun.com/commerce/product_info.php?products_id=8558

But the PICKIT2 will serve you just fine and is cheaper.


You will need one of these for so you can talk and listen to the PIC over a com port without dealing with messy Max232 chips.
http://www.sparkfun.com/commerce/product_info.php?products_id=133


I love PICs, if you are unsure how to get started just ask :)

XJet
May 08, 2008, 05:07 AM
The 16F84 is all but superseded and is missing some cool stuff such as ADC and PWM.

Yes, it is simple but it's also expensive (for what it is) and I'd recommend starting with something a little cheaper. Remember that things like ADCs and PWM don't have to be used just because they're there but will be great to play with later on.

You don't say what language you'll be programming in but if you want to get quick results I'd advise using C, Basic Pascal or some other high-level language to get you going -- it'll reduce the learning curve somewhat and you can always drop down to assembler later on once you've got the hang of things.

SparkFun Electronics (http://www.sparkfun.com) have some useful PIC stuff including processors, prototyping boards and programmers.

The 16F88 is a great chip (cheaper than the 16F84 but with lots more features) and if you want to get straight into the software side of things you could do worse than to buy a "ready to go" development board from Sparkfun. This one (http://www.sparkfun.com/commerce/product_info.php?products_id=1) will take an 16F84 or a 16F88 and has a built in serial-port programmer to make life even easier.

As for programming languages, the MikroEleletronika (http://www.mikroe.com/en/compilers/) range of compilers is pretty cool and they offer free versions that will produce up to 2Kbytes (I think) of object code which is *more* than enough when you're learning. You can choose from C, BASIC or Pascal with great libraries for just about anything you can think of (LCD displays, communications, serial I/O, SPI, PWM, etc).

These compilers will produce code for just about every chip in the 16F and 18F family although I admit that I use the MicroChip C18 on my commercial projects.

And make sure you visit the MicroChip support forums -- there's a *wealth* of information there with lots of folks willing to answer any questions you might have.

Acetronics
May 08, 2008, 09:23 AM
The 16F84 is all but superseded and is missing some cool stuff such as ADC and PWM.

Yes, it is simple but it's also expensive (for what it is) and I'd recommend starting with something a little cheaper. Remember that things like ADCs and PWM don't have to be used just because they're there but will be great to play with later on.

.

Hi, XJET

Here you speak like someone USED TO the Pics ...

as the first thing is to understand How to configure the chip ... having lots of peripherals cause more trouble than learn you useful things ...

I do agree :D 16F84 is an old dinosaur ... but there's no substitute as a beginner's first toy ... and expensive is very relative !!! ( just one or two to buy !!! )

By the way, ... IF you're an accurate programmer ... even in BASIC ;) you can do lots of things with a 16F84 ... so, the day to throw this chip to the trash box is not tomorrow ...

We are a bit too much used to waste our chip resources, don't you know ???

In the List, I could have added 16F88 ... see the config. $ for not :D

Mikroelektronika : yes ... nice tools ( or should I say nice TOYS ) ... but the biggest resource wasting tools of the market !!! The 2K limit is quite easy to cross when using their libraries !!! No good at all for a comprehensive PIC learning course ...

But very good to play with their peripherals ... their boards ... their compilers, their examples ... etc,etc. ( Note I'm a MkE user ... ;) , so I can ALSO say : Their BUGS !!! :eek: )

Alain

Richard Ingram
May 08, 2008, 01:18 PM
A good thing in favor of the 16F84 is the wealth of example code on the internet. These examples are very helpful in learning to use PICs.

podavis
May 08, 2008, 01:24 PM
Agree, as someone who recently learned PIC from scratch, learning how to configure the PIC is number one. Also the intricacies of finding a cheap (free) C compiler seemed more difficult than learning 39 Op Codes and doing it that way. I learned C on a Z-World Jack Rabbit but that came with a terrific C editor.

I created a template that lays out all the configuration under my nose so I didn't have to keep digging through the AppSheet. It's in the attached .asm file. If you open this in the free MicroChip MPLab it formats nicely. I built the servo tester on the development board that comes with the PICKit 2 but this code is probably not the final version.

AndyOne
May 08, 2008, 05:39 PM
There's also some good stuff in this thread

http://www.rcgroups.com/forums/showthread.php?t=217886&highlight=pic

see also...

http://www.rc-float-flying.rchomepage.com/RCWeb/PIC/PIC.htm

Andy.

XJet
May 08, 2008, 06:41 PM
Hi, XJET

Here you speak like someone USED TO the Pics ...

as the first thing is to understand How to configure the chip ... having lots of peripherals cause more trouble than learn you useful things ...

You're right Alain, configuring the TRIS bits and other configuration bits is the cause of many headaches for newbie PIC programmers (how easy it is to forget those early days ;-)

Perhaps the 16F84 is a good "beginners" chip from that perspective -- although folks have to learn about those control bits eventually.

As for the MikroElectronica compilers, you'd be surprised how much complex stuff you can fit into 2Kbytes. I wrote an entire jet engine ECU using their C-compiler and it (just) fitted into the allowed "free" codespace (using a 16F88) -- but as I said, I use the C18 compiler for most projects.

There's quite a learning curve for anyone trying to get to grips with microcontrollers if they have no previous assembly-level programming experience, which is why I recommend they use a language more familiar to them, at least to get started. That way they can learn about the configuration and I/O capabilities of the device before they have to get to grips with the PIC's arcane machine-level architecture.

kfong
May 08, 2008, 08:23 PM
Here is our design, fits on any protoboard. Programmer is built in. It just plugs into your parallel port for programming. The design allows you to cut the programmer board off, making it smaller for such things as dataloggers, ect. It will work with any of the pic16FXXX family. The programmer can program larger parts as well since it only limited by ic-prog. Bare board is $10.

http://www.embeddedtronics.com/picmee.html

Kin

Acetronics
May 09, 2008, 09:07 AM
Hi, Kfong

Just a comment to be read as is ... ( no offending intention )

What about Parallell ports aboard nowadays computers ??? ... no more available ...

my PC is PIII equipped ( say it's an old machine ! ) ... and the parallell port is only used by a DONGLE ( I must do with it ...) !!! none of the peripherals I have need anymore a // port ... programmers and dev tools included.

When will you turn to serial or USB ???

Alain

Unterhausen
May 09, 2008, 11:02 AM
I was asking this same question in my thread about the storm launcher lipo charger:
http://www.rcgroups.com/forums/showthread.php?t=859460#post9697456
It has a pic16f716 on there.

It appears to have the ICSP pins run out to the edge of the board
http://www.rcgroups.com/forums/attachment.php?attachmentid=1643124
I guess I'll have to trace the pins to make sure they are for programming. But I don't see what else they would be for. What would be the best programmer to try this with? Sparkfun has a cable for $12 that I think someone listed in this thread, would that work? http://www.sparkfun.com/commerce/product_info.php?products_id=9#

I have used AVRs, MSP430, and rabbit microcontrollers, and have done a reasonable amount of assembly, c and c++ programming, so I'm not afraid to do some programming.

Accu157
May 10, 2008, 07:18 PM
Wow, thank you everyone! There's a lot to chew through here for decision making, but I thought I'd answer one of the questions that stood out:

What programming language would you like to use?

I don't really care. :D I have enough experience with C++ and Java to get me by, but I'd like to know C, BASIC, and Assembly. I'd like a diversity of languages, I've not written enough complex programs to have a big appreciation for OOP.

XJet
May 10, 2008, 09:30 PM
When you're dealing with program memory sizes of as little as 1K words, there's not a lot of benefit to OOPs and in many cases they actually offer too much abstraction (IMHO) which means you're less 'in touch" with the hardware.

The vast majority of code I cut for PICs is in C with assembler only if/when needed.

Unterhausen
May 11, 2008, 10:02 PM
I think C is a good language for a PIC. It allows you to do almost everything you would do with assembler, but without all the nonsense. Some of the things you have to do with assembler gets really tiring, especially on an architecture where the registers aren't all the same, like a Z-80 for example.

BushmanLA
May 11, 2008, 11:42 PM
I have enough experience with C++ and Java to get me by, but I'd like to know C, BASIC, and Assembly. I'd like a diversity of languages, I've not written enough complex programs to have a big appreciation for OOP.


If you already know C++, then you already know C, and if you already know C there really isn't much reason to even bother with BASIC other than the fact that it might be handy for really small and quick projects.

Knowing Assembly helps you get a better understanding of whats going on 'under the hood' of your microcontroller. This knowledge if of significant value when dealing with microcontrollers in general. It is also helpful when you have extremely time dependent actions to perform or if you must write the most efficient code possible with respect to execution time.

Most C compilers for the PIC will let you insert inline assembly code within your C code. Microchip's C18 does this, the only drawback is that C18 only supports the larger pics.

The upside is that the student edition is free, very unrestricted, and of course it works with MPLAB. Not to mention that you will find tons of support for it out there.

Honestly, it isn't a bad way to start.

MPLAB for editing, compiling, debugging, and interfacing with the PIC programmer.
C18 for doing all of the above within MPLAB in the C language.
PICkit 2 for programming the pic.
and a nice big fat 18F452 to play with.


Actually, I just noticed that the PICkit2 comes with demo software and tutorials for HiTech and CCS C compilers. They sell it with a demo board that includes a sample PIC for less than 50 bucks. You can't go wrong there.

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en023805


Edit: I'm somewhat sad that they didn't have this when I started with PICs. It took me a month of buying trying all the wrong stuff just to get an LED to blink :D

arocholl
May 13, 2008, 08:18 AM
I would also recommend starting with a PIC18F series (PIC18F2620 is my favourite for multi-task, but PIC18F2520 is also a good one, note PIC18F252 or 452 are obsolete which means more expensive, less capable and with more silicon bugs).

I would recommend a PICKIT2 from Microchip or a bit cheaper clone from http://www.sureelectronics.net , not need for ICD2 as the PICKIT2 can program and also debug in recent firmware versions.

Then go to a Microchip C18 free student version, you can download it for free from Microchip website, it has some limitations but will take you years as a hobbyst to notice them.

I would definitely not suggest to go with PIC16F84. Again, don't go with 16F84. Learn with a good PIC18F2620 and C18 compiler, then if when you are familiar on how a PIC works, you can choose more specific PIC families and program in assembler, but dealing with BANKing and ASM in an obsolete PIC16F84 to start is the worse advise you can get.

Accu157
May 13, 2008, 11:57 PM
Looks like a lot of the chips being recommended have an 18 in them. ;) Are they mostly 40 pin micro controllers?

Another question. Assuming I go with 18F, what are some models I should absolutely stay away from? I see there are some that you cannot reprogram after burning them once. Any easy indications as to which ones are these?

BTW, after nearly completing my physics courses, I looked back at a book on electronic circuits which looked like a bunch of... not nonsense, what's the word? gibberish? Now it all seems to make sense, and I can't wait to dive into it. :D What's even better, is it's a slightly old professional review copy, and I got it for only 8 bucks! Best money I've spent yet! The guy at the cash register saw the title of it and flipped through a few pages and had the screwiest look on his face. Not a concerning look, but an overwhelmed, :confused: :eek: look.

arocholl
May 14, 2008, 04:21 AM
There are plenty of 18F with 28 pins, as the PIC18F2620 I suggest you to start with. First thing you have to learn in this world is how to read a datasheet and how to know different product options, so take a walk to www.microchip.com and use the product tree to know better which options are out there. Then you can realize you have a 18F with only 18pins such as PIC18F1320. You can also see PIC16C are OTP (one time programming) whereas PIC16F are flash (100K times programming). Datasheets are you best friend.

Accu157
May 18, 2008, 10:33 PM
I saw a few books at the store that were ok... but none went into the pic18 series. They thoroughly covered 10-16. I also picked up some really nice second hand books, one that gives several hundred practical circuits (non-pic), and one that is a maybe 7 year old college text on digital design. Didn't seem daunting at all, and coincides with where the other more intimidating book I have leaves off... :) Not much about pic though. It details more general controllers, the 74XX series, and talks about the ABEL compiler. I don't know what else to describe with the college text. What is ABEL? I looked a little up on it and it seems that it's an obsolete programming tool... I'm sure that the book is not tied too strongly to ABEL.

rmteo
May 18, 2008, 10:44 PM
Start with this free one (covers a PIC16) for background:
http://www.mikroe.com/en/books/picmcubook/

Then take a look at this one:
http://www.mikroe.com/en/books/dspicbook/mikrobasic/

You may want to skip the PIC18 (and the other 8-bit devices) and go for the 16-bit devices - much more powerful and versatile, and in my opinion, easier to use.