Pic Programming/Debugging questions..

Thread Starter

osx-addict

Joined Feb 9, 2012
122
So.. I'm planning on using a PIC24 cpu on my next project and have never used one before (any PIC for that matter but have experience with other parts -- arduino, embedded PPC,etc) and want to ensure I can debug to the best extent possible once the part is mounted on my custom PCB.. To that end, I gather I can program it in place via ICSP and noticed that Ernie prefers to use the ICD3 in-circuit debugger over the pic-kit3 setup.. I'll likely start out with the cheaper pic-kit3 initially but want to ensure my design will work with the ICD3 system if needed.. So, a few questions arise :


  1. I gather I need to run some lines from the PIC24 out to a header for external programming/debugging.. At this point, are these lines fairly standardized (what lines to include, any needed capacitors/resistors,etc)
  2. What if anything is needed to ensure I can use my custom board with an ICD3 setup? I poked around on the microchip site and saw info for various parts and headers but nothing specific to my part specifically..
I think that's about it -- I just want to ensure I can program my PIC24 directly in it's circuit w/o removal and also want to be able to debug as best as possible.. Thx!!
 

be80be

Joined Jul 5, 2008
2,072
You don't say what pic24 your using some use headers some don't need the part number to tell you what you needed
 

ErnieM

Joined Apr 24, 2011
8,377
Hey now, if you had an Audi and a VW in your garage which one would you drive?

I already had several PICkit 2's when the 3 came out, not without some controversy. Somehow I wound up with my ICD 3, so anything the PICkit 2 can't handle the ICD 3 can. I really don't notice any performance differences. Actually, since the ICD needs a fancy connector with pins not on a .1" centers the PICkit is actually easier to breadboard and is my first choice (where it works...)

The main reason I don't glowingly recommend the PICkit 3 is I don't own one and never used one. From what I read it is now a useful stable platform and I expect to pick one up soon.

For best use for both programming or debugging a PIC no matter which unit you use I find it best to leave the program and data lines free of all other uses. You may reuse these pins if you never do in circuit debugging but life is too short to go that way without a huge reason (like the damn PIC you need to use only has 8 pins and you need every one of them).

MCLR also needs to be free, and work as MCLR and not an I/O line. Power is always power and ground is always ground, so if you keep these 3 other pins devoted to programming and debugging you will always be good to go.

Program and data need no other parts, connect direct to the debug header. MCLR needs a pull up once you disconnect the debugger and try to run the release code, so add it early on because you will forget it later (so you avoid the "why does it only work in debug mode?" moment).
 

t06afre

Joined May 11, 2009
5,934
If this is a hobby project. It is a good idea to select a PIC with somewhat more IO than you stricly think you need. As mentioned the debug programming lines will steal some IO. And it is always a good thing to have some extra IO space just in case. For the hobbyist the extra cost is next to nothing.
 

ErnieM

Joined Apr 24, 2011
8,377
If this is a professional project. It is a good idea to select a PIC with somewhat more IO than you stricly think you need. As mentioned the debug programming lines will steal some IO. And it is always a good thing to have some extra IO space just in case. For the professional the extra cost is next to nothing.
 

Thread Starter

osx-addict

Joined Feb 9, 2012
122
Thanks guys.. To be completely honest, I've not quite settled on a particular PIC24 part -- yet! I must have spent more than an hour using the Microchip part search tool to narrow down what I want.. Ideally, this will hopefully turn into a professional part and to that end I'd obviously need sufficient I/O ports to drive my hardware (which in this case will primarily be used to drive a 8-bit LCD or OLED display which I'm still working on sourcing) and perhaps a few things beyond that (so -- perhaps 10-12 I/O ports min).. However, I'm also tempted to keep it as general as possible (for the most part) so that it can be used for other projects if my I/O lines are brought out to headers,etc.. I was initially looking at the PIC24HJ series but that may be overkill as I'm also trying to keep individual parts costs down and most PIC24's with RTCC are close to $6ea in low qty's..

In thinking about things last night I realized that I could probably get away with using something lesser than the PIC24 line and save some $$ along the way -- I just checked Microchips parts selector with my minimum needs and it came out with several PIC18F's that would work fine (e.g. PIC18F27J13) which is a bit better priced and comes in an SPDIP package which is really one of the features I'm looking for.. Yes, I realize using that package will limit the I/O port count among other things and I'm fine with that if it will make my life easier for assembly purposes...

So, the next question, IS there any compelling reason to skip the PIC18's in favor of the 24F's? If it matters, this would be my first PIC project...
 

takao21203

Joined Apr 28, 2012
3,702
18F = 8bit, 24F = 16bit.

For a character LCD you often only need 8 bit.

For graphics it can well make sense to use 16bit MCU.

I tend to buy mainly SOIC PICs- need less space to store, and shipping maybe is cheaper. They always need SMD adapter, $1, but that does not really matter. And it's quite handy, can solder wires on the top side for instance.

If I would have to start over again, I would buy a 28pin SOIC, or TQFP44.

PDIP I bought one 12f1822 recently...

There is 24F and 24H/E by the way, the 24F not clearly more expensive than 18F.

But if you only buy one PIC model, some few pcs., I don't really know, I have maybe 100 PIC chips here or more, never counted them. Including some TQFP80 chips, and some PIC32.

Why people use PDIP and not SOIC remains a riddle to me- fairly easy to solder to PCBs with no extra equipment.
 

Thread Starter

osx-addict

Joined Feb 9, 2012
122
18F = 8bit, 24F = 16bit.

For a character LCD you often only need 8 bit.

For graphics it can well make sense to use 16bit MCU.

I tend to buy mainly SOIC PICs- need less space to store, and shipping maybe is cheaper. They always need SMD adapter, $1, but that does not really matter. And it's quite handy, can solder wires on the top side for instance.

If I would have to start over again, I would buy a 28pin SOIC, or TQFP44.

PDIP I bought one 12f1822 recently...

There is 24F and 24H/E by the way, the 24F not clearly more expensive than 18F.

But if you only buy one PIC model, some few pcs., I don't really know, I have maybe 100 PIC chips here or more, never counted them. Including some TQFP80 chips, and some PIC32.

Why people use PDIP and not SOIC remains a riddle to me- fairly easy to solder to PCBs with no extra equipment.
Ok.. So for driving a graphic display via either SPI or 8-bit parallel (which is what I believe my display can handle), a 16-bit CPU is preferred? Any particular reason? Seems like as long as I can shove out 8-bits at a time to write into it's memory that ought to be OK.. But, I've never done this before so perhaps I'm missing something.. until I try it.. ;)

As for DIP/SPDIP vs SOIC, I've got no issues with using SOIC parts as they look like a surface mount version of a DIP package -- hence no need for thru-holes. Any particular reason you buy the SMD adapters? Is that just for simplicity sake or for programming,etc? I would think that if you're going the SOIC route you'd perhaps use an adapter for development work but not for a final product..

As for TQFP44's, I see that you can get adapters for those as well but I'm a bit concerned about being able to properly solder/attach parts that small hence my interest in the more.. um.. conventional parts.. :D.. I'm getting to be an old fart and as such my hands are not quite as steady as they used to be.. :eek:
 

takao21203

Joined Apr 28, 2012
3,702
I use mostly SOIC parts even for circuits that are only built as single piece.

16bit is useful when you deal for instance with 16bit bitmaps. If you only use SPI displays they aren't so fast anyway.

Some even have 16bits for data.

If you know the exact application then it's possible to consider 18F or 24F.

The 24F also have 12bit A/D while 18F only has 10 bit A/D.

The differences are many however for more simple applications there is sometimes not much difference, so buy whatever you think is appreciate.

24F is more powerful I think.

If you only use 8bit in your programs it's not so much a point to use 16bit MCU. What do you use, C, or assembler? MPLAB 8 or MPLABX?

Just for saving money, it's not a big difference. Some 24F PICs are pretty low price now.
 

Thread Starter

osx-addict

Joined Feb 9, 2012
122
Well.. Thanks.. in light of this conversation I thought I'd take a peek at the PIC32MX series and while they're overkill likely for anything I'd like to do, I can get a fully featured version (e.g. PIC32MX150F128B) for almost the same price as the PIC18F (e.g. PIC18F27J13).. If I can jump right in on the 32-bit family I might as well do that.. Gotta go do more reading! :D

Sorry for being wishy-washy!! Too many decisions!!!
 

ErnieM

Joined Apr 24, 2011
8,377
Actually when the time came to find a bigger processor when my PIC18 couldn't cut it anymore I jumped over the PIC24's and went straight to the 32's.

I looked and looked and no where did it say you have to go in order. <grin>
 
Top