Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC16 vs PIC18

Status
Not open for further replies.

Jon Wilder

Active Member
Something I don't think has been mentioned about 16F vs 18F is the analogue peripherals (op-amps/comparitors & DAC) & high reselution PWM capability that seems to be a 16F specialty. I use the 16F1782 that I must admit can be a pain to program. I had to move up to the PIC24EP series to get more performance with similar peripherals, maybe there is something in 18F but I skipped it for some reason (could be I was fedup doing 16 bit math on an 8 bit chip).

If you code in assembly I can see where that would be a pain. But with C, the programmer is blind to all of that as you just pitch the equation to the compiler and it handles all of the device specific low level math stuff. Sure, a 16-bit device can do 16-bit math with less code overhead but with newer 18F parts coming with 128KB flash who really cares?
 

gophert

Well-Known Member
Most Helpful Member
And, in C, and the microchip IDE, it becomes easier to use the hardware timers and interrupts (specifically why those hardware pieces are on the chip). Now, counting executed commands to measure time seems archaic.
 

fourtytwo

Active Member
If you code in assembly I can see where that would be a pain. But with C, the programmer is blind to all of that as you just pitch the equation to the compiler and it handles all of the device specific low level math stuff. Sure, a 16-bit device can do 16-bit math with less code overhead but with newer 18F parts coming with 128KB flash who really cares?
Except when you are interested in execution speed.
 

gophert

Well-Known Member
Most Helpful Member
Unless you're doing extremely time critical stuff execution speed is normally irrelevant.

Mike.
“There's nothing worthless about being wordless, it will only save your mouth from talking gibberish.”
― Michael Bassey Johnson
 

Jon Wilder

Active Member
Unless you're doing extremely time critical stuff execution speed is normally irrelevant.

Mike.

Exactly! I used to worry about the same thing as assembly was my first language and I was glad to have learned and used it, but quite honestly I haven't yet coded anything THAT time critical to where assembly was an absolute requirement.

I do still use crystal oscillators in all of my designs though, only because I favor their precision over the temperature dependent on chip oscillator.
 

fourtytwo

Active Member
Try control loops in digital smps!
Anyway I thought this thread was about PIC16vsPIC18 not some discussion about the merits or otherwise of programming languages.
 

Pommie

Well-Known Member
Most Helpful Member
Try control loops in digital smps!
Anyway I thought this thread was about PIC16vsPIC18 not some discussion about the merits or otherwise of programming languages.
I used an 8 pin 12F683 to do the control logic for a 170V Nixie tube power supply in assembly. However, as you pointed out, this is not about the merits of programming languages.

Mike.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Top