Electronic – Best approach for PIC programming I need to do

microchipmicrocontrollerpicpickit

Many years ago now, I have used general purpose 8 bit PIC, like for example the PIC16F84A, writing their code in assembly, which I really like.

I haven't had the need to do anything related to this ever since, but now I'm aiming to use the PIC16F18323, which, despite its low pin count, has a lot more functionality and complex peripherals than the PIC16F84A… quite a leap there.

Also, most of the tools I used back then like DOS software, serial port programmer, etc., don't suit present day PC.

So I've now bought a PICkit 4 programmer but before make a start with it I need to make 2 choices for which I would appreciate your views:

  1. Assembly or C? Purely from a language perspective, I like both, and I have relevant experience with both. For simple things I favour assembly because it reflects the hardware best, saving you from thinking about an abstraction layer, how a particular piece of C code will actually and up executing (including clock cycle count), etc. For more complex things, I favour C because it's more readable, hence easier to maintain and less bug prone. So, for the level of complexity offered by this particular MCU, which would you use?

  2. What development software? Back in the day it was all 3rd party unofficial… Anyway, I read a little about MPLAB 8 vs. X and finally downloaded and installed MPLAB X IDE for Windows. The first thing that caught my attention is it uses something like 12 Gb hard disk, WTF??? I used to develop for this PIC16F84A using a text editor + simulator + programmer, all of which DOS stand alone apps you could fit in a floppy disk, literally!! And now the sensible, convenient way to burn some bytes inside a PIC16C84 is to install a 12 Gb suite?? Not that I mind or care from a hard disk use perspective, but I'm frightened about the amount of (unnecessary) complexity this may come with and I will likely need to face.

Thanks in advance for sharing your insight 🙂

Best Answer

You can use both C and Assembler. High end devices are optimized for C, they have a C architecture inside.

PIC16F18323 is best with assembler, but since the C XC8 compiler from Microchip is very good, there will be almost no difference in the result.

MPLAB X(10) is the used software(IDE) today, its very bulky, but its good. You can combine it with the Microchip free compilers XC8(8bit MCUs), XC16(16bit MCUs), XC32(32bit MCUs)

If you want you can install the XC8 compiler without the Mplab IDE and use a notepad editor.

https://www.microchip.com/wwwproducts/en/PIC16F18323