A goldmine for the PIC programmer

ErnieM

Joined Apr 24, 2011
8,377
EVERY PIC has it's place. I also agree the 10,12 and 16F parts that have but 33 instructions are probably the best choice when learning assembly programming. That is a complete non-issue when using a compiler, and you have a choice of several free C compilers for the PIC.

When I did a TFT touchscreen I got tired of running out of code space and made the ultimate leap. I bit the bullet, bought a very nice platform that came with everything on it, including a nice PIC32 processor. Microchip provides some excellent display libraries to use when going that way (though they also work for other processor families).

Unless and until I'm making a product with that screen I'll keep on using these development boards. For 100 to 150 I get it tested and complete. I have built (breadboard) several display boards in the past but my time is worth more then what they cost to simply buy.
 

TCOP

Joined Apr 27, 2011
94
I am using pics the last 2 years. I was familiar with asm and it was quite easy for me to start programming. I am still using 16F series and even though I got some free samples of 18f pics, I still can't fill up 2k of the 16F628A flash memory. Why move up then? The cost for 16f against 18f from a local dealer is almost 50% more. Yes it's only few bucks,but why paying them if I am not going to use them? ( http://www.markidis.gr/advanced_search_result.php?keywords=Pic16% or pic18f%&sort=1a&view=all here are the prices of a local dealer in Athens. 18f are way more expensive)
The only reason I am thinking of switching to 18F is because of the USB interface.
Further more, i would not recommend to anyone to start with C. I've seen cases that people where easily driving LCD's using the ready made C libraries but could not perform easier tasks cause the had no understanding of the μC architecture. Asm is a must in order to realy understand the inner essense of the pic μC.

In addition...
when I built my first programmer i really understood what is ICSP and how it works.
If you don't dig a little, you miss all the nice things :)
 
Last edited:

TCOP

Joined Apr 27, 2011
94
Things change....
It has been some months since my last post and I can say that I have change my mind a little bit. I still mostly go for 16F cause they are cheap and lately much more powerful than some older 18F (see the tiny Giant,16F1847) but...
I finally believe that every pic has its purpose. My latest experience has shown that the 14bit instructions of the 16F, some times is just not enough. When you have to deal with large data tables, 18F got a great advantage. Since every instruction word is 16bits wide, you can store there two bytes of data. On the contrary on the 16F there is not enough room for storing 2 bytes, thus you'll end up occupying two memory words (in most cases a each word would be a RETLW + 1byte of Data). So at the end you'll need less memory for the 18F than for the 16F. Try to store few dozens of text lines for presenting them in an LCD and you understand exactly what i mean.
But again...
at the time I was about ready to start a new project using a 18Pin 18Fmcu, I noticed that I had either few to no options in the range of 4k to 8k of memory. On the other hand, I could find twice to triple the same number of available mcu's when i searched the 16F series.
Conclusion...examine very deeply your project before selecting an mcu. Judge based on your actual needs and most importantly on the mcu's availability. You'll probably get the job done either working on 16F or 18F but, if you underestimate your needs and initialy choose a 16F instead of an 18F, migrating to 18F will make you spend more working hours (non productive hours). If you overestimate your needs and go directly for the 18F instead of the 16F, youl'll and up spending more money than you should.
Judge carefully.
 

ErnieM

Joined Apr 24, 2011
8,377
Why a prebuilt board? I say that because I remember my first PIC circuit.

Back in the bad old days PICs were programmed via a parallel interface. To erase one, you have to buy a PIC in a special metal package with a quartz window and expose it to UV light for 10 minutes, otherwise they were called "one time programmable" (as they were). No in circuit debugger (MPLAB did have the simulator and I used it), no post program code verification, no on board oscillators, no compilers so everything was written in assembly.

Programmers were available for $200 minimum so I made one myself out of an ISA parallel board with 3 bytes of parallel digital output, plus something for power (wall wart?) for the 13V programming voltage. Program in one board (zero insertion force socketed) and plug into the target board. Nothing but blinky LEDs to show things were working.

I must have been lucky as the oscillator section always worked for me.

Damn, that was NOT an easy task. It took me at least 3 weeks of evening work (I'd do this at home for myself) until everything was running and I was productively making code.

Things get better these days with inexpensive programmers/debuggers, parts that erase themselves, free or inexpensive C and Basic compilers, and cheap ubiquitous development boards.

Let's look at all that must succeed to get a simple LED to blink:

- need a bug free program that compiles completely into a hex file
- need a programmer
- need a target board with the LEDs and power and the PIC all wired correctly.

That's the three main legs. If any link fails the whole chain fails, and you may have no idea where it went wrong.

Example: you forget to set a port pin to from it's default of analog to digital so the LED doesn't light. The program compiles, loads into the PIC, but the board just sits there. Is the LED bad? The PIC pin? Is the oscillator in the PIC running? Is it wired right? and if it is the program, what could it be?

Wow... if you can jump that hurdle you are damn good and will probably go on to a good career in embedded development. For the rest of us that do this part time an easier way is available: prebuilt & tested boards, and debugged source code along with tutorials.

For the PICkit 3 there is the PICkit Low Pin Count Demo Board Part Number DM164130-9. Do be sure to visit the board overview page with links to the user's guide, the tutorial source code, and the schematic.
You get your choice of C or assembly tutorials to learn the basics of driving a PIC.

It is a great way to start using these wonderful devices.
 
Top