doubts about PIC microcontrollers

BobTPH

Joined Jun 5, 2013
8,804
Ah, you haven't heard of In Circuit Programming.

See the little connector on the top with 5 pins? You put that on each board you build with a PIC, then you just plug that PICKIT 2 or 3 into that and program the PIC in place.

You really don't want to do it any other way. Unplugging the PIC each time you want to program it, is a real pain and you will eventually break a pin off. And for surface mount it would be even worse, you would need a special adaptor for each package, and they would each cost as much as the programmer.

And, if that isn't enough, the PICKIT can then be used as a real-time in circuit debugger on your actual hardware.

Bob
 

MaxHeadRoom

Joined Jul 18, 2013
28,617
As pointed out by Dave's Utube rant, the Pickit2 does not require the particular PIC update every time you change the Pic type as does Pickit3.
Max.
 

Thread Starter

adam555

Joined Aug 17, 2013
858
Ah, you haven't heard of In Circuit Programming.

See the little connector on the top with 5 pins? You put that on each board you build with a PIC, then you just plug that PICKIT 2 or 3 into that and program the PIC in place.

You really don't want to do it any other way. Unplugging the PIC each time you want to program it, is a real pain and you will eventually break a pin off. And for surface mount it would be even worse, you would need a special adaptor for each package, and they would each cost as much as the programmer.

And, if that isn't enough, the PICKIT can then be used as a real-time in circuit debugger on your actual hardware.

Bob
Yes, the process I had in mind didn't include the possibility of in-circuit programming. Now I clearly see the advantages.

that is a good one, really, because the Arduino is 8bit and how can you program a 32bit chip with 8bit controller? And even the PICKIT3 must reload firmware if you change between PIC families.

Serial port? What is that please? (OK I do know it).

I think few PIC users program them with "their Arduino".

Actually I do have USBASP programmers here, and soon also blank mini Arduino boards.

Is it actualy possible to program PICs with them? How do I transfer the PIC firmware? Interesting. I could save money to buy another PICKIT3, because I have some circuits with more than one PIC and need to reload the firmware all the time.

I could build my own PIC programmer but its too much effort.
I'm not sure what you mean by 32bits chips... aren't the PIC16F88 that I bought for testing, and the PIC16F1459 that I need for the project both 8bits?... which chip is 32bits?

A serial port is what connects the Arduino to the computer; how else would you send the code to the PIC?

As to your question on how to transfer the PIC firmware, see this page: http://forum.arduino.cc/index.php/topic,92929.0.html... I haven't tried it yet; but I intend to with the PIC16F88 before my pickit arrives.

This is what I use the Picdem board for, you leave the PIC socketed, the idea is to program and immediately run or debug.
Max.
I just downloaded MatlabX and the XC compilers to have a look, and I'm not sure about something... do I need to install just the 8bit version, or does the 32bit also covers the lower ones?

By the way, I'm finding MatlabX a nightmare; not because there's anything wrong with it, but because it has so many options and so many new things to learn that I feel completely lost -as I felt 20 years ago when I tried to pass from C to C++.
 

MaxHeadRoom

Joined Jul 18, 2013
28,617
but it not supporting new PICs
Yes that has already been noted in my earlier posts, all but the very latest.

I just downloaded MatlabX and the XC compilers to have a look, and I'm not sure about something... do I need to install just the 8bit version, or does the 32bit also covers the lower ones?

By the way, I'm finding MatlabX a nightmare; not because there's anything wrong with it, but because it has so many options and so many new things to learn that I feel completely lost -as I felt 20 years ago when I tried to pass from C to C++.
I just use MPLAB and program in assembly.
Max.
 

Brownout

Joined Jan 10, 2012
2,390
I tried XC8, but went back to c18 compiler. Unless they've ironed out the bugs, I wouldn't recommend it. If you try it and get frustrated with it, try c18 compiler. None of my programs have done well with XC8.

I do like MPLABX, however.
 

Thread Starter

adam555

Joined Aug 17, 2013
858
I've been watching some videos and reading some websites about PICs and microcontrollers, and have some new doubts...

Some of the videos had crystal oscillators in their circuits, and some didn't. So I'm not sure if I need to buy crystals? I've been looking at the datasheet of the PIC16F88, for example, and it says:
Oscillators:
• Three Crystal modes: LP, XT, HS: up to 20 MHz
• Two External RC modes
• One External Clock mode: ECIO: up to 20 MHz
• Internal oscillator block: 8 user selectable frequencies: 31 kHz, 125 kHz, 250 kHz, 500 kHz, 1 MHz, 2 MHz, 4MHz, 8MHz
Which PICs need external crystals, and how do I know which frequencies to buy.

Then I was thinking... why designing the prototype with Arduino (which has an Atmel), and go through all the trouble of buying, learning (which won't be easy) and re-design the whole thing for a PIC? Are there many differences in price and features between PICs and Atmel?

And last... Why should I not get instead one of those other cheaper programmers that work with many microcontrollers (PIC, ATmel, etc.), and instead get the one that's exclusively for PIC; apart from the in-circuit programing?

It would be great if anyone could recommend a good beginner's guide that would explain all these questions...
 

takao21203

Joined Apr 28, 2012
3,702
You can do everything with PICs.

Just any crystal will do.

The 16F88 is a bit old.

With the MPLABX project templates, you can easily use 24F or PIC32 as well.
 

NorthGuy

Joined Jun 28, 2014
611
And last... Why should I not get instead one of those other cheaper programmers that work with many microcontrollers (PIC, ATmel, etc.), and instead get the one that's exclusively for PIC; apart from the in-circuit programing?
In-circuit debugging?
 

Thread Starter

adam555

Joined Aug 17, 2013
858
In-circuit debugging?
I finally decided and placed the order for the pickit2.

I understand that many of you might need the pickit3 for the latest chips, but considering that I'm just going to be using it for learning and for this small project -for which older chips are good enough (and probably cheaper)- the pickit2 should be more than enough... and everyone says it's better than the pickit3. :)
 

takao21203

Joined Apr 28, 2012
3,702
I finally decided and placed the order for the pickit2.

I understand that many of you might need the pickit3 for the latest chips, but considering that I'm just going to be using it for learning and for this small project -for which older chips are good enough (and probably cheaper)- the pickit2 should be more than enough... and everyone says it's better than the pickit3. :)
it was dated already some years ago, cant imagine anyone would want to buy it these days.
 

MrChips

Joined Oct 2, 2009
30,706
Just ignore takao. He's just jealous.

There's nothing wrong with playing with a PIC 16F628A and a PICkit 2.
It's a good way to get started learning how to use Microchip PICs.
 

Thread Starter

adam555

Joined Aug 17, 2013
858
I don't think I'll ever get deep enough into PIC programming to need the features of the latest chips; so I guess I'll ever miss the pickit3. My local shop doesn't even sell the newer chips.

Anyway, apart from this project, most of the time I'll be using Arduino. It's way easier and faster for the type of stuff I do... which is basically playing around to learn.

Besides, today I noticed 2 things about the pickits: All the tutorials I watched chose the pickit2 over the pickit3, and I didn't see anyone getting rid of their old dated pickit2s on ebay. So I wouldn't be surprised if they are still selling more pickit2s than pickit3s.
 

MaxHeadRoom

Joined Jul 18, 2013
28,617
+1
When I looked at getting up to speed with PIC's I used Nigels tutorial, the instruction set is pretty much the same for all 16F's, when searching the web for small projects, many used the 16f628/a.
The pickit 2 helped with the signal generator and analyzer functions.
Once I felt I had a handle on PIC in general, I graduated to the 18F which has a little more advanced instruction set and made some functions easier, which you may want to explore later.
Max.
 
Top