New to pic programming, help needed please.

Markd77

Joined Sep 7, 2009
2,806
Although it is expensive, I think the PIC16F84A-04/P is a good choice for the first few projects. Don't forget the 2 capacitors to ground from the crystal (15-33pF datasheet section 6.2). It's very simple, there are a lot of tutorials for it, and most of what you learn can be used for the whole midrange PIC range.
The PIC12F509 is probably not a bad choice if you find a decent tutorial, but it is lacking interrupts which are a good thing to learn early.
 

DerStrom8

Joined Feb 20, 2011
2,390
I was able to simply buy a PICkit2 and a couple of 18F1330s and had a great start. The 1330s are good chips for a beginner, and also have useful attributes, such as an internal oscillator, etc. That might be a good route to take. ;)
Der Strom
 

Markd77

Joined Sep 7, 2009
2,806
Admittedly the 18F1330 is a better chip, but for assembly language at least I would imagine it is much more complex to get to grips with.
For example here are the SFRs for the 16F84A:


And here are the SFRs on the 18F1330:

 

Attachments

DerStrom8

Joined Feb 20, 2011
2,390
Admittedly the 18F1330 is a better chip, but for assembly language at least I would imagine it is much more complex to get to grips with.
Ah yes, good point. I forgot the OP was planning on using ASM. However, if he would rather learn C, or if he is willing to put up with more complex registers, the 1330s are cheap and easy to obtain. I got two for $15, including shipping. You may even be able to find it for cheaper.
I can understand, bainsk8, if you would rather get the 16F--it is simpler, but as you gain experience, you may find yourself feeling the need to upgrade anyway. Just something to consider. :)
Der Strom
 

Thread Starter

bainsk8

Joined May 31, 2011
25
Wow, lots of replies packed with great info, thanks guy's. Yes I have pretty much resided with the idea of using the 16F for the assembly language tuts. to begin with. Once I complete them and I gain a bit more experience I shall step up to a more capable PIC and turn to learning C.

Thank you Markd77 for mentioning the two capacitors from the crystal, I covered that last night while searching for info and also noticed them in the schematic DerStrom8 posted residing in the tut. link.

I have lots of info posted here by you guy's that should keep me busy researching for a bit, then I will place an order for programmer and some PIC16F's. Although I don't have a PIC programmer or PIC in my hands I have still learnt quite a bit associated with them from all the posts made here and researching where to start with it all. I can't thank you all enough for your help and input, it really is very much appreciated. Thank you. :D
 

ErnieM

Joined Apr 24, 2011
8,377
You are quite welcome.

Oh, and did any of us mention that MPLAB is a free download, it contains an assembler AND a simulator?

Right now, for free, you can download it and start trying to make a program run inside the simulator for any PIC they make.

Looking at some of the Pickit packages it seems they are going for C tutorials. I have the older ones all in assembler. The licence agreement doesn't prevent me from sharing them as long as you use them on Microchip's product, which is your intent anyway.

I attached em here.
 

Attachments

DerStrom8

Joined Feb 20, 2011
2,390
Oh, and did any of us mention that MPLAB is a free download, it contains an assembler AND a simulator?

Right now, for free, you can download it and start trying to make a program run inside the simulator for any PIC they make.
Ah, yes. I thought I had posted this here, but I guess that was a different thread. Here is a link to download MPLAB:

http://www.microchip.com/stellent/i...E&nodeId=1406&dDocName=en019469&part=SW007002

I heard that MPLAB X has a few bugs, but should still work. Otherwise, just choose one of the older versions.
Der Strom
 

Thread Starter

bainsk8

Joined May 31, 2011
25
Thank you for the tuts. ErnieM I will put them to good use. I did read that MPLAB was also a simulator and thought about checking it out but was a little unsure what version to use, thanks for the link Der Strom. It would appear that I have decided to learn PIC programming at an interesting time what with new programmers and software available, it sure makes it all that little bit more confusing. :D

Just a quick question I have gone to download the MPLAB X and there are a list of compilers, do I need all of them or just the one that is applicable to the PIC I am going to use?

http://ww1.microchip.com/downloads/mplab/X_Beta/installer.html
 

DerStrom8

Joined Feb 20, 2011
2,390
Just a quick question I have gone to download the MPLAB X and there are a list of compilers, do I need all of them or just the one that is applicable to the PIC I am going to use?

http://ww1.microchip.com/downloads/mplab/X_Beta/installer.html
I believe the compilers there are just the ones that come with it. If I were you, I would just download them all, unless there is one that you are ABSOULUTELY SURE you would never use. I would still just download them all, though ;)
Der Strom
 

Thread Starter

bainsk8

Joined May 31, 2011
25
Thanks Guy's I went for MPLAB v8.70, but I don't think it installed correctly as I got an error warning telling me that MPswitch could not be installed. I am also getting a lot of unsigned warnings for drivers flashing up every so often.

I guess I will have to test the software and if there are problems do a clean install. I think it don't like Vista, as most things including myself. ;)

I did read that I have to run the software as administrator, I wonder if this was meant for installation too?
 

ErnieM

Joined Apr 24, 2011
8,377
Gee, I'm not sure. I run it at home on NT where I don't even know what the admin password is (I don't seem to need one), and at work where all the computers are locked down I have "super user" privileges on another NT system. I do have a dim memory of having trouble with running it after a real admin installed it.
 

Thread Starter

bainsk8

Joined May 31, 2011
25
Thanks Ernie for your reply. I solved the problem, I had already installed MPLAB X previously the night before and had forgot that I had done so, (it was a very late one!). At a guess I would say its a conflicting registry issue, I will have to remove both, clean up the registry and do a clean install MPLAB v8.70.

Can anyone recommend a bit of free software for drawing electrical schematics, ideally I would like one that I can use on my Linux and Windows PC for easy of use.
 

Markd77

Joined Sep 7, 2009
2,806
As a side note, you can probably install MPLAB on linux. I've got MPLab 8.63 running using WINE on Ubuntu with only a few issues. I use PK2CMD on the command line to program the chips using the PICKIT2.
 

nerdegutta

Joined Dec 15, 2009
2,684
As a side note, you can probably install MPLAB on linux. I've got MPLab 8.63 running using WINE on Ubuntu with only a few issues. I use PK2CMD on the command line to program the chips using the PICKIT2.
So do I. Had a bit of a struggle with installing the Hi-Tech C compiler, but now its working smoothly.:)
 

ErnieM

Joined Apr 24, 2011
8,377
Eagle seems OK, I never used it.

I worked a bit with Kicad which does capture and PCB design.

I very much like the schematic capture app from ExpressPCB which also works with their PCB design software. I actually prefer it for tossing something up fast, if you've seen me post schematics here they were probably done in that program, screen scraped and stored on ImageShack. ExpressPCB is one house that breaks the "good fast cheap" rule (pick any two) by delivering 3 excellent PCBs in just a few days for $60 total which is "good fast cheap" in my book.

Kicad

ExpressPCB
 

nerdegutta

Joined Dec 15, 2009
2,684
With Eagle, you can run an Eagle3d script, which will produce another file. This file you can render in PovRay. That will make an image of how your board will be.
 
Top