Development board/kit for PIC18F2331/2431/4331/4431

Thread Starter

strantor

Joined Oct 3, 2010
6,794
I have decided to break into the PIC world for my latest project (calculating rotational speed with a quadrature encoder) that is probably going to require a PIC18F2331/2431/4331/4431. I would like to cut the learning time down by using some sort of kit, either preassembled or containing all the necessary parts. Is there a generic PIC18F kit that would work? I saw that the PICkit 3 Debug Express comes with a development board with PIC18F45K20 on it. Can I desolder this PIC18F45K20 and replace it with my PIC18F2331/2431/4331/4431?
 

Thread Starter

strantor

Joined Oct 3, 2010
6,794
Well I don't see it as cutting corners but I don't really know what I'm looking at yet. To the best of my knowledge, all there is to the development board is the IC and and all supporting components (Vreg, clock, caps, etc.). I suppose paying for a premade board with all that icing already on it is cheap shot, but I perceive that most of my time spent learning will be on the programming side. I could just copy the hardware into my own design.
 

nerdegutta

Joined Dec 15, 2009
2,684
If the pin configuration is the same, I think you can swap IC's, if that's what you mean. I haven't read any datasheets, so just thinking out loud. :rolleyes:
 

t06afre

Joined May 11, 2009
5,934
If the pins are the same no problem at all. But I think it should be more easy to just using bread board and a DIP variant in the beginning. And then just get a standalone PICKIT 3
 

takao21203

Joined Apr 28, 2012
3,702
I don't understand what's so difficult soldering a PIC to a proto PCB.

You need to look at the datasheet, add a crystal perhaps, and some capacitors. Then you need 5 wires for ICSP. A row header for the PICKIT3.

Many circuits can run from the PICKIT3!

SOIC or TQFP adapters are good because you can solder flywires on the pads, even components.

Most 18F PICs need an extra capacitor and 3 volts, even if some are 5 volts capable. So you can use a MC34063, a LM2576, or a 7805 + 3 diodes.

I use 78l05 sometimes for PICs when they run from wall adapters.
 

Potato Pudding

Joined Jun 11, 2010
688
DM164120-2 and DM164130-4 are both spare demo board packages with one populated board and two bare boards.

Look at page 11 for the DM164120-2

And for some reason I can't find the equivalent manual for the DM164130-4 to check its supported chips.
 

spinnaker

Joined Oct 29, 2009
7,830
The mentioned Development board uses smd. Your soldering skills better be pretty darn good to be change out that chip. Why you would want to do that in the first place is beyond me. Far easier to build your own. board.​
 
Last edited:

ErnieM

Joined Apr 24, 2011
8,377
As the PIC18F45K20 is a larger,faster device then any of the PIC18F2331/2431/4331/4431 series why not just use the PICkit 3 Debug Express board to develop the program, then move it to the smaller PIC on the modified breadboard.

I definitely do NOT ever recommend a beginner build their own board. You need to connect code written on a PC to a programmer to inject code to a device running on it's own hardware connections. There are so many links in that chain you need to use as many tested good and working pieces as you can to get these to work.
 

Thread Starter

strantor

Joined Oct 3, 2010
6,794
If the pins are the same no problem at all. But I think it should be more easy to just using bread board and a DIP variant in the beginning. And then just get a standalone PICKIT 3
Well after looking at the boards tater puddin linked to, I feel a little more confident about breadboarding it. I thought there was more to it. The link has the parts list right there. I'm a little confused though, as I thought there was supposed to be a crystal.


As the PIC18F45K20 is a larger,faster device then any of the PIC18F2331/2431/4331/4431 series why not just use the PICkit 3 Debug Express board to develop the program, then move it to the smaller PIC on the modified breadboard.

I definitely do NOT ever recommend a beginner build their own board. You need to connect code written on a PC to a programmer to inject code to a device running on it's own hardware connections. There are so many links in that chain you need to use as many tested good and working pieces as you can to get these to work.
What's the difference between developing on the express board and then transferring to my board, and just developing on my board? Aren't all the same good connections and good parts required in both scenarios? When you say "then move it to the smaller PIC on the modified breadboard" you are referring to software, correct? no actually transferring the chip?
 

ErnieM

Joined Apr 24, 2011
8,377
Right... load a new copy of the software onto the next board with the smaller pic.

There *will* be differences in the code, the device to be sure, probably the config words, possibly moving some pins about. But most (98%+) will be same-same code and thus pre-tested.

And it will then be your SECOND PIC project, and that makes you an experienced old hand at this. <grin>
 

JohnInTX

Joined Jun 26, 2012
4,787
If the pins are the same no problem at all. But I think it should be more easy to just using bread board and a DIP variant in the beginning. And then just get a standalone PICKIT 3
This one
is a little spendy at 99.00 but might save a lot of time. You can use DIP parts and it has all of the required stuff pre-wired. Check out the schematic to see how it all plays with what you have in mind.

I would normally agree with ErnieM about developing on a similar chip and have done that exact thing but if you are going to use the chip-specific motion control stuff (encoder/PWM) you might as well start with the target chip. You can run basic PIC stuff on it then fire up the specialty stuff when you feel ready. As Ernie says, buy the biggest chip so that you don't run out of resources half way. Assign your resources (RAM/ROM etc) as if they were in a smaller chip. Then when done, if everything would fit, you can migrate to the smaller one.

You could probably hand wire something that would work but it would take time and as I recall, you are now working for yourself and time is money.

Have fun.
 

Thread Starter

strantor

Joined Oct 3, 2010
6,794
Take a peek at The RB's method for reading a quadrature encoder (about a year ago)

That should help get you started.
The majority of that thread was over my head head for the time being. However I did read (or skim) all of it and my noob impression is that the OP was using an ordinary PIC with no designed quadrature encoder input module, and trying to make it read quadrature encoder input via a couple of different work-around methods. My noob impression was also that both methods stretched the capability of the PIC with max input frequency of 250Hz (300rpm * 50PPR / 60). I plan to go up to tens of KHz. It also seemed that both (or all 3) methods were bound to fail in some way at some point, either by missing pulses or by incorrect reversal due to glitches or lack of debouncing.

I say all that not to detract from the lead you've given me, but to provide a basis for discussion following. I do truly appreciate the lead.

Firstly, are my noob interpretations of the linked thread accurate?

Secondly, If I am to use one the higher capability PIC devices with quadrature encoder input, will I still be faced with having to devise a method of counting pulses similar to the methods that were discussed in the linked thread? Or does the PIC with QEI come with some more elegant solution engineered into it? I was hoping that the PIC with QEI would be more of a ready-made solution with debouncing already worked out, and pulse counting/ direction resolution already worked out, and would just feed that data to me without me having to engineer a method of constructing it (the data, that is).
 

JohnInTX

Joined Jun 26, 2012
4,787
Secondly, If I am to use one the higher capability PIC devices with quadrature encoder input, will I still be faced with having to devise a method of counting pulses similar to the methods that were discussed in the linked thread? Or does the PIC with QEI come with some more elegant solution engineered into it? I was hoping that the PIC with QEI would be more of a ready-made solution with debouncing already worked out, and pulse counting/ direction resolution already worked out, and would just feed that data to me without me having to engineer a method of constructing it (the data, that is).
Most of these concerns go away if you use the QEI PIC and if I were doing it, that's what I'd do.

Its not particularly difficult to decode a quadrature knob or glass-scale (I've done my share) but there are things that have to be carefully considered to avoid just what you wrote, missing pulses due to latencies, debouncing/deglitching, how to read a multibyte position counter that is driven by IRQ without missing any etc.etc. All of these have been addressed in the QEI module. Assuming it works (check the errata) it should be pretty straightforward. Even if you decide for some reason that you need something else, you can use the same chip for any of the other methods you'll find on the site, just disable QEI.

My only reservation is that the max program memory is 8K words. I don't know if there are QIE PICS with more memory but I'd start with the max available.

Whichever way you go, code the encoder first and test it to see 1)if its fast enough and 2)if it leaves enough processing power to get done whatever else it has to do.

Have fun.
 

Potato Pudding

Joined Jun 11, 2010
688
I'm a little confused though, as I thought there was supposed to be a crystal.

That board allows for adding a crystal, but as provided it uses the internal oscillator.

Two small surface mount caps and a surface mount crystal added to the parts list and you are done for hardware. Configure the project for crystal oscillator clock and you are running a crystal clock.

The internal oscillator is all you need for most of the basic projects.
 
Top