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?
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.
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?
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.
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.
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.