About PIC16F84 microcontroller.

Thread Starter

Shyamal805

Joined Mar 20, 2012
27
Sir,
I am new in microcontroller programming. Just started from now. I want to know for PIC16F84 microcontroller -

1. Which compiler is perfect?
2. Can i use/install MPLAB 8.5 for windows7 64 bit?
2. Can i use c programming?
3. Which programming language is best for this uC?

Please help me.

Shyamal
 

ErnieM

Joined Apr 24, 2011
8,377
1. Which compiler is perfect?

There is no such thing.

2. Can i use/install MPLAB 8.5 for windows7 64 bit?

Yes you can.

2. Can i use c programming?

Yes you can.

3. Which programming language is best for this uC?

The one you already know. An assembler (machine language) and simulator already comes inside MPLAB. Microchip lets you download their C compiler for free, and while it is limited it is quite serviceable. There are also other sources for compilers. The only other language I have seen used in Basic, and while I have used it in the past I no longer do so when C is available.
 

t06afre

Joined May 11, 2009
5,934
Well the 16f628 or 16f88 is a good replacement for for the old 16f84. Unless size matter. I would perhaps recommend to use a 28 or 40 pin PIC. However before you get any PIC. You must be sure it can be programmed with your current programmer. What kind of programmer do you have
 

Thread Starter

Shyamal805

Joined Mar 20, 2012
27
Sir, i'm new & have small knowledge on Microcontroller. I want to start working on PCI16F84 because i have some tutorials and tips on PCI16F8. For few pin(18) hope it will be good for me to easily understand & it is also available on my country for this reason i want to start working first.

After completing PCI16F84 project i will start working for newer PCIs like 16f628 or 16f88 that you give here.

Sir, I don't know what kind of programmer i can use. I search on google and get a site which gives PIC 16F84 Serial Programmer circuit diagram and layout. I want to make this but don't know is this programmer circuit diagram is ok?

please help me to make a pci programmer...

Thanks
Shyamal
 

spinnaker

Joined Oct 29, 2009
7,830
Sir, I don't know what kind of programmer i can use. I search on google and get a site which gives PIC 16F84 Serial Programmer circuit diagram and layout. I want to make this but don't know is this programmer circuit diagram is ok?

please help me to make a pci programmer...

Thanks
Shyamal
Save your money and buy the microchip programmer. Don't waste you money on third party programmers.

http://www.microchip.com/stellent/i...deId=1406&dDocName=en538340&redirects=pickit3


And please don't refer to forum members as "sir" in every paragraph. There are ladies on the forum too. Besides we are all equals here and there is no reason to call people sir or mam.
 

tshuck

Joined Oct 18, 2012
3,534
You could also get the pic kit 2


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

It is cheaper but does not programmer the newer chips. And I think support has been discontinued.

It does have a logic analyzer and serial port built in which would be useful for troubleshooting circuits.
The standalone application keeps the Pickit 2 a viable competitor to the Pickit 3. I have yet to find a device I can't program with a Pickit 2:D
 

takao21203

Joined Apr 28, 2012
3,702
MPLABX also has a standalone programmer software.

The PICKIT2 also can be destroyed, even if it takes a while (It will turn more and more erratic).
The PICKIT3 has much better protection.
 

takao21203

Joined Apr 28, 2012
3,702
The 16f84 is kind of a piece of foobar with it's 1K memory.

16f1503: 4K
16f1824: 8k

16f716: 2K

18f24j10: 16K
18f14k50: 16k

Why would one want to use a 16f84 these days?

You only limit yourself in terms you will not be able to write larger C programs.

So the 16f84 is definitively not some kind of allround PIC or "starting point" PIC.

Alternatively, get some 16F5X, all three: 16f54, 16f57, 16f59.
 

Thread Starter

Shyamal805

Joined Mar 20, 2012
27
Thanks,
Which reference book is perfect for microcontroller programming? C programming will be good for me so i need such kind of book. Give me some instruction for starting uC programming using c language.
 

takao21203

Joined Apr 28, 2012
3,702
Thanks,
Which reference book is perfect for microcontroller programming? C programming will be good for me so i need such kind of book. Give me some instruction for starting uC programming using c language.
Learn Windows Visual Studio C++.

It includes C as a subset. You can try out many things, but it is more painless, the debugger is much better.

I never used any books for embedded C.

In addition, read the original C language paper (I think written by Brian Kerninghan).
http://www.cs.cmu.edu/~mihaib/kernighan-interview/

I also recommend the CMOS cookbook to understand the CMOS technology. Microcontrollers are based on this.
 

spinnaker

Joined Oct 29, 2009
7,830
Learn Windows Visual Studio C++.

It includes C as a subset. You can try out many things, but it is more painless, the debugger is much better.

I never used any books for embedded C.
I completely disagree. Trying to learn Visual Studio is far, far more complicated than needed. The OP would easily get lost in all of the information that is completely irrelevant to MCU programming.

My suggestion would be to learn BASIC for the user that has never programmed before. The concept of pointers is a bit hard to grasp for the beginning programmer.

Mikro has some pretty good lessons on pics. Here is one on C

http://www.mikroe.com/products/view/285/book-pic-microcontrollers-programming-in-c/

But I believe they have BASIC too.
 

takao21203

Joined Apr 28, 2012
3,702
I completely disagree. Trying to learn Visual Studio is far, far more complicated than needed. The OP would easily get lost in all of the information that is completely irrelevant to MCU programming.

My suggestion would be to learn BASIC for the user that has never programmed before. The concept of pointers is a bit hard to grasp for the beginning programmer.

Mikro has some pretty good lessons on pics. Here is one on C

http://www.mikroe.com/products/view/285/book-pic-microcontrollers-programming-in-c/

But I believe they have BASIC too.
Yes but starting off with Visual Studio is fairly simple.

-Intellisense + context help
-MSDN documentation for every language feature (which is quite good actually). Including all the standard C stuff
-Large user base with a good forum (MSDN community).

Yes BASIC- then also download Visual Basic :)

You can argue it is irrelevant to embedded C but that's argueable. C is so much portable, you can take functions from embedded C programs, and use them for Windows.

Normally you'd isolate hardware dependent stuff into specialized functions.

For the trivial beginners stuff, that all can be tried out in Visual Studio. A char is a char under Windows C, and on a small microcontroller, all the same.

BASIC is far less portable...

On the microcontrollers you need some I/O at first, or complicate hardware debugging. In Visual Studio, you have a very powerful integrated debugger. You can very easily create a blank form with a few text labels, and manipulate their value with just one line code!

Once you are a bit familiar with the basic C stuff, make the transition to embedded C!

You don't have to use C++ features at all, even if it is called C++.

The point is, these days often USB is used. And in many cases, this will mean a USB host, for instance a PC, and a USB device. Unless you use LINUX already, you'd have to introduce Windows at this point anyway.

There are also some embedded evalution kits, that actually include such Windows sample applications.

If I put Windows C and embedded C on a scale, I give 3 to Windows, and 7 to 8 to embedded (difficulty).

At other places I even recommend to learn javascript- it is free, does not need a specialized IDE, and can be learned by only looking up webpages.
 

spinnaker

Joined Oct 29, 2009
7,830
Yes but starting off with Visual Studio is fairly simple.

-Intellisense + context help
-MSDN documentation for every language feature (which is quite good actually). Including all the standard C stuff
-Large user base with a good forum (MSDN community).

Yes BASIC- then also download Visual Basic :)

You can argue it is irrelevant to embedded C but that's argueable. C is so much portable, you can take functions from embedded C programs, and use them for Windows.
There is no reason to learn an environment that you will not use. Sorry.

Time is much better spent learning the much internals.

Now if op wants to expand and use Visual Studios to write apps to interface to micros then that is another thing.

As far as potability, even C is not that portable when it comes to micros. Even with the same family of chips, there are differences between C compilers.

Most hobbyists don't need to worry about portability anyway. They code for themselves for their own project and the code isn't going anywhere. Use the language that you feel most comfortable using and don't worry about it.

Again if you want to aspire to share your code with others then C is probably the better choice.
 

takao21203

Joined Apr 28, 2012
3,702
It is of course 2 different worlds- on embedded chips, you'd try to reduce memory footprint. You don't normally have malloc available.

On a Windows PC, you'd often use a graphic designer for the user interface. Drag a pushbutton, drop it on the form, click the button, and the designer spells the function skeleton for you. You only add code inside the function.

If you learn embedded C, you would maybe believe that saving memory is relevant.

It depends if you only want to produce a few small hobby programs, or if you really are kind of a programmer, or at least want to become one.

My point is to learn programming as such, embedded Microcontrollers are not particulary well suited. You will come accross problems, and then you'll encounter there is no easy way to deal with them.

If on the other hand you have learned mainstream C or C++, you will have it far more easy with embedded C. If you run into trouble, you'll know what to do, or at least you will have some ideas what is wrong.

Learning embedded technologies also includes digital I/O, all the pheripherals, I2C, LCD interfacing, just to name a few things.

Learning both things at once, programming and the embedded technologies, is very difficult. I had years of programming experience (for instance MSDOS assembler), and nonetheless, I also spent years with PIC assembler.

Learning Windows C++ only took me about 6 months, and back then, Visual Studio wasn't as powerful as it is now. All MFC based.
 
Top