Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: Dudekiller on December 02, 2008, 05:58:21 PM

Title: PIC Tutorials
Post by: Dudekiller on December 02, 2008, 05:58:21 PM
I have two questions

1) What's the programming language use for PIC microcontroller
2) Is it necessary to have a programmer header in this tut http://www.pyroelectro.com/tutorials/pic_breadboard/schematic.html (http://www.pyroelectro.com/tutorials/pic_breadboard/schematic.html). Can't I use this to program the PIC http://www.sparkfun.com/commerce/product_info.php?products_id=3 (http://www.sparkfun.com/commerce/product_info.php?products_id=3)
Title: Re: PIC Tutorials
Post by: ArcMan on December 02, 2008, 06:12:13 PM
1. A PIC can be programmed using assembly language, C or BASIC (or any other language for which a compiler exists).
2. No.  That header is used for ICSP (In-Circuit Serial Programming), which is very handy, but you can unplug the chip from the breadboard, plug into your programmer for programming, and then plug it back into the breadboard.
2b. Absolutely yes.  I've been using the USB version of that programmer for years to program PICs.  It's a beauty.  Notice the white header on the right of the board.  That plug is connected to the programmer header on that breadboard schematic you linked for the aforementioned ICSP programming.  The cable is included with the programmer.
Title: Re: PIC Tutorials
Post by: Dudekiller on December 07, 2008, 05:11:05 PM
Hi! I have another question. Is it possible to hook up a crystal to a PIC 18 Pin 20MHz 1K - 16F84A like in this schematic http://www.pyroelectro.com/tutorials/pic_breadboard/parts/schematic.gif (http://www.pyroelectro.com/tutorials/pic_breadboard/parts/schematic.gif) or do I need to attach capacitors next to the crystal. Also, can anyone point to me a schematic showing the proper way to set up a PIC 18 Pin 20MHz 1K - 16F84A?
Title: Re: PIC Tutorials
Post by: paulstreats on December 07, 2008, 06:08:46 PM
There is a schematic here: http://www.mstracey.btinternet.co.uk/pictutorial/pipage2.htm (http://www.mstracey.btinternet.co.uk/pictutorial/pipage2.htm) That website will also tell you more about using the pic.(I think it actually uses the same pic as what you have there)

Capacitors should be used when using straight crystals (if you have a ceramic resonator they arent necessarry). Also the value of the capacitors is important when using crystals. If they arent correct then expect erratic behaviour like sometimes working, sometimes not, only working if you put your hand near the board, working at slower speeds or skipping oscillations, or of course just no working at all...

 If you find the datasheet for your crystal, it will more than likely tell you what value capacitors to use (there is usually a range say for that particular one it could be to use anything between 18 - 26 pf should be fine just stick within the range)
Title: Re: PIC Tutorials
Post by: Dudekiller on December 12, 2008, 10:08:01 AM
K, I was reading an article http://letsmakerobots.com/node/715 (http://letsmakerobots.com/node/715)here  saying that the PIC16F690 does not require any external capacitors. My only question is if it can be programmed with a programmer rather than using ICP?
Title: Re: PIC Tutorials
Post by: ArcMan on December 12, 2008, 07:28:32 PM
I'm assuming you mean ICSP (In-Circuit Serial Programming).
The PDIP version can certainly be programmed in a programmer by inserting the PDIP chip in the programmer's socket.  BTW, you still need a programmer for ICSP.