# PIC Suggestions..

#### Mazaag

Joined Oct 23, 2004
255
Hey Guys,

I was planning on purchasing a PIC along with aprogrammer from Microchip just to tinker with.. I was wondering if anyone has any suggestions on a versitile PIC that i could use for a variety of applications ( basically used in robot building or something of that sort, LEDs and maybe some A/D stuff too )

Thanks guys

#### hgmjr

Joined Jan 28, 2005
9,029
Before you make your final decision, I would recommend you look at the AVR series from ATMEL and compare the cost of getting up and running with each.

The IDE (AVRSTUDIO4) and the C-Assembler (WINAVR) are both free.

You can download AVRSTUDIO4 right now from ATMELs website and program it in the simulation mode. WINAVR is at www.sourceforge.net.

The cost of a development board plus a 12VDC dc power adaptor is around 100 USD.

hgmjr

#### nanovate

Joined May 7, 2007
666
Microchip has a "PICkit 2" for $50 which can get you started. BUT the free compiler is limited to a small subset of devices. Plus the architecture is not common among their devices so you may need a different compiler depending on whether you use the PIC12/16 or PIC18 or PIC24/30 etc... Atmel's AVR architecture is common among devices and the free compiler is full strength. They also have a$50 USB Programmer and Debugger (AVR Dragon). Another option is getting a book + kit from www.smileymicros.com

I have used both PIC and AVR for both work and play and found that AVR is lower cost. But if money is no object then Microchip has many modules and little dem boards that you can buy and play with that are really nice.

John

#### spar59

Joined Aug 4, 2007
57
Personally I can only comment on the PIC since I have never tinkered with an AVR. I've never had any problems with MPLAB IDE v7.60 which is Microchip's freebie development environment and have not yet found a chip that it can't deal with (assuming of course that you have the appropriate .inc file for the chip in question) presuming that we are talking about compiling from assembler rather than C source code.

The chips themselves tend to be expensive from normal retail outlets but you can pick them up cheaply on EBay - search for PIC but limit the search to the "Business, Office & Industrial" category. Typical Ebay prices start around 70p ($1.40) per chip for a 28pin USB2 capable device including postage when buying in quantities of 5. Buy-it-now prices (i.e. from Ebay professional dealers) tend to be around £14 ($28) for 5 chips. Obviously availability of specific devices varies so get the chips before writing the code and designing the PCB.

Steve.

#### Mazaag

Joined Oct 23, 2004
255
Dumb quesion here...

I'm looking at aprogrammer from Microchip...

I just wanted to know if the PICs on these demo boards are REMOVABLE or not ?

like do you purchase aprgrammer with a demo board, and just mount whatever PIC you want to program on the board itself? or do these demo boards have one pic embedded on them which you cannot remove and are just used for evaluating that particular PiC ?

I'm basically looking for a programmer which i can use to program many different types of PICs ( number of pins)...

would I have to purchase one of those ... (http://www.microchipdirect.com/ProductDetails.aspx?Catalog=BuyMicrochip&Category=Programmers&mid=13)

thanks guys

#### spar59

Joined Aug 4, 2007
57
Every demo board from Microchip I have encountered so far with normal dual in line chips has the chip socketed (though beware if it is an evaluation board for one of the latest flavours of small-package device it will be soldered).

Unfortunately not a ZIF (zero insertion force - the ones with a latch lever)socket though so you need to be careful changing the chip.

The PCB side pins on a ZIF socket are too wide to plug into a standard socket since otherwise you could leave a ZIF plugged in permanently and plug the chip in and out of the ZIF.

It is however possible to solder a ZIF socket piggy back onto a TURNED PIN type IC socket which will then plug into the on-board socket.

A few demo boards have built-in programmer functions - the limitation is that most demo boards use the smaller chips i.e. 8 or 18 pin and though the programmer is probably capable of programming a larger device it simply won't fit on the board.

The picstart plus is quite good - I've used one for a few years and the latest versions have their firmware updateable via the comms lead, being connected via the serial port they aren't the fastest programmers but we are only talking seconds to program a device. The main limitation if you intend to sell products with PICs programmed by one of these is that Microchip don't guarantee the quality of the programmed device.

Apparently the more expensive programmers (over 4 x as expensive) verify the programming at reduced supply voltages to check compliance with specification of the programmed pic. The picstart plus does verify the programming but at normal supply voltage, hence if you then use the device on only a 2V supply the performance cannot be guaranteed.

I can't fault my picstart plus but the price keeps rising and £98.31 plus delivery (and beware Microchip charge a lot for delivery) unless you can buy it from a local retailer is a lot of money.

There are lots of 3rd party programmers out there, some of which are compatible with MPlab IDE which you can download for free from Microchip's website.

Try a quick search on Ebay for pic programmer, they start at £7.00 ($14.00) including a pic to play with. One equivalent to Microchip's ICD2 can be had for £33 including postage and will cope with chips up to 40pin in its ZIF socket and can also do serial programming of a PIC whilst it is still in-circuit (you PCB needs to make a few PIC pins available for this connection). Steve. #### hgmjr Joined Jan 28, 2005 9,029 If you have not already commited to a PIC as the basis for your design, assuming you use a microcontroller, I would recommend you look at the AVR just in case. hgmjr Thread Starter #### Mazaag Joined Oct 23, 2004 255 okay guys... i'm really lost right now and its getting frustrating... https://www.microchipdirect.com/Pro...p&Category=Getting Started Programmers&mid=13 which of these do i need to be able to program most PICs out there and debug them ? some of these come with development boards and demos boards and i really don't know what they are.... I want to be able to program most PICs out there and debug them aswell.... which of these products would do the job ? Thanks for the help guys.. #### hgmjr Joined Jan 28, 2005 9,029 okay guys... i'm really lost right now and its getting frustrating... https://www.microchipdirect.com/Pro...p&Category=Getting Started Programmers&mid=13 which of these do i need to be able to program most PICs out there and debug them ? some of these come with development boards and demos boards and i really don't know what they are.... I want to be able to program most PICs out there and debug them aswell.... which of these products would do the job ? Thanks for the help guys.. You would not be faced with this frustration if you were to choose the AVR microcontroller. One programming tool and one software development tool fits all. hgmjr Thread Starter #### Mazaag Joined Oct 23, 2004 255 with AVR , what exactly do I need ? and would i be able to use the same thing with different microcontrollers ? #### hgmjr Joined Jan 28, 2005 9,029 If you are interested in doing a bit hardware and software development there is the STK500 (Check with Digikey ATSTK-500). It is priced at$84 dollars US at the moment. You will also need an AC to 12VDC power adaptor to power the board at about 20 to 30 dollars.

I have purchased a couple of the boards myself and have found them to be extremely useful in developing code. You will see that there are several IC sockets on the board. This is so that you can devevlop on the different microcontrollers in the AVR family.

Did I mention that the software is FREE... C and Assembly language compilers both.

hgmjr

#### Mazaag

Joined Oct 23, 2004
255
so this baby hooks up to my pc , and I hook up any chip from Atmel to it and I can program it no problem ? anything else I need ?

#### hgmjr

Joined Jan 28, 2005
9,029
The STK500 has the programming hardware on it. This programming hardware can be used to program your own AVR based designs also. All you need to do is provide your AVR based design with the standard programming header. There is the ISP10PIN and the ISP6PIN. Both are support by the STK500.

hgmjr

#### Mazaag

Joined Oct 23, 2004
255
Excuse my ignorance, but i'm not quite sure what you mean.

So the STK comes with a microcontroller that I can program by writing my code on the software and burning it onto the chip..... I can also do the same to other Microcontrollers that I can connect to the other sockets available (which are there for different pin number microcontrollers)

is that correct so far ?

if so, can i debug the code while the microcontroller is connected ?

#### Mazaag

Joined Oct 23, 2004
255
Another thing... this board has a built in clock and a voltage regulator I believe... If i am to use this microcontroller on say a robot, will i require to have an external clock and/or voltage regulator attached ?

#### Mazaag

Joined Oct 23, 2004
255
do you happen to have the part number for the DC supply required aswell ?

Thanks alot for your help

#### hgmjr

Joined Jan 28, 2005
9,029
So the STK comes with a microcontroller that I can program by writing my code on the software and burning it onto the chip..... I can also do the same to other Microcontrollers that I can connect to the other sockets available (which are there for different pin number microcontrollers)

is that correct so far ?
Yes. Yes. Yes.

if so, can i debug the code while the microcontroller is connected ?
You use the full-featured AVRSTUDIO4 software development tool (It's FREE) to do everything. It has a simulation that allows you to single step through your code (C-code or Assembly) and observe on virtual registers the result of the code execution.

This software tool does not single step through the code within the AVR microcontroller itself. It is a simulator. This is not a restriction however. YOu run the simulation and find where your code is misbehaving. You can then immediately make a correction in the code and rerun the simulation or you can download the modified code and run it on the real microcontroller.

The STK500 has 8 switches and 8 LED that you can configure as you choose. You can hook up the switches and write the program to read them and then light one or more LEDs as a result.

I would recommend before you do anything, go to www.atmel.com and download the AVRSTUDIO4 software (its FREE) and play with it. I think you will see that it is very powerful. Especially when you consider its FREE.

hgmjr

#### hgmjr

Joined Jan 28, 2005
9,029
Another thing... this board has a built in clock and a voltage regulator I believe... If i am to use this microcontroller on say a robot, will i require to have an external clock and/or voltage regulator attached ?
The use of an external crystal or oscillator depends on your application. If your robot needs precise timing then a crystal or oscillator is the way to go. If your timing issues are not that strict then you can use the internal RC oscillator that does a pretty good job in my experience.

I built a headbot using the ATMEGA88 and it works just fine using the AVR's internal RC oscllator.

hgmjr

#### Mazaag

Joined Oct 23, 2004
255
GREAT!

Thanks alot for your help man.. I'm going to be ordering it soon

#### hgmjr

Joined Jan 28, 2005
9,029
do you happen to have the part number for the DC supply required aswell ?

Thanks alot for your help
Take a look at his 12VDC 4A power supply from Digikey.

You don't need to worry about the output plug on the power supply being the correct size. The ATSTK500 comes with short length of cable that has the correct connector on it. If the connector is the wrong size on the power supply just cut it off and solder the one that comes with the ATSTK500.

The ATSTK500 is capable of taking either polarity at the power connection. It works best if you wire it with positive voltage on the outside of the connector and ground on the inside.

hgmjr