Electronic – What do I need to put the code onto a microcontroller

compilermicrocontrollerpic

I learned about coding a controller, but never actually put the code on the physical device. I am trying to figure out what I need to order to start developing a basic embedded system.

For example, if I have a PIC18F1330, I have MPLAB IDE and XC8 compiler. Great, so I have the code compiled, and I'm ready to put this on the controller. What do I need to have to have to transfer my compiled code on my PC, onto the controller?

I've seen things like an in-circuit debugger, and a PIC kit. I'm just lost at this point.

Best Answer

There are several ways to flash your code to a microcontroller.

On the web, you will find quite a lot of self-made programmers, but they usually also have self-made software and are not (well) integrated in the MPLAB IDE.

The cheapest solution from Microchip is a PicKit for ~40€ which is just connected to the PC via USB. Though the PicKit has some debugging options, there is also the more powerful 'In Circuit Debugger' ICD for ~180€, which has more debugging features, but of course can also flash the chips.

I always felt the PicKit is sufficient for me.

There are third-party versions out there, as microchip publishes firmware and schematics for the PicKit, but if you buy them, be sure you really get what you think what you get. I once saw an offer for PicKit 3, but I was not sure if it isn't a PicKit 2.


Just as comment: There are Microchip MCUs, which can flash themselves. For example, we used the PIC18F2450/2550/4450/4550 family with embedded USB and put a boot loader on it. When a jumper is closed, the MCU enteres the boot loader mode on startup, and you can flash your MCU with your code. That stuff is all available from Microchip.

To use this, you need a few modifications to your code. And of course, you need a regular programmer to initially flash the boot loader on the MCU. So, this feature does not make sense if you have a programmer. But it's nice if you want firmware updates to your customers.