Starting with Assembly
How to start with programming your own microcontroller with MPLab (V8.43)
The big lines:
|First of all you need a programmer. A programmer is a device that is capable of programming your microntroller. There are a lot of different programmers around, but i will show you the one I use. It's a cheap and easy to use programmer and you can communicate with it with USB. You probably have to do some fighting with finding the right drivers. The Olimex programmer I use, is communicating through USB with a FTDI chip. Check this website.|
|This is the PIC-MCP-USB programmer. Check the website : https://www.olimex.com/Products/PIC/Programmers|
|You will need to install Microchips MPLab. With this software you can write, test, debug and program microchip products. MPlab is a big program, that will enable you to create complex assembly code. I only use a small part of the total software package; enough for me to make nice electronics!|
|Make a choice which microcontroller you are going to use. There is a wide family of microcontrollers to work with. For my Ipson devices, I work with the following chips: PIC18F1220 :18 pin microcontroller, PIC18F2423: 28 pin microcontroller, PIC18F4523: 40 pin microcontroller. The chips pointed out, actually are of the same family (8-bit microcontroller), but mainly the amount of pins (read inputs and ouputs) are different|
Look for the right code that complies with your whishes of your project. You could start with some simple code, like a blinking led. I will add code examples on this website.
First thing you have to do is select your programmer. If you use the Olimex programmer, you have to select the 'PicstartPlus". If all drivers are there and if you selected the right port, the programmer will be happy to run. The next step is to load your .asm file into MPLab. In the case of the screenshots below, the file 'oscset3.asm' is already loaded.
Make sure you select the right device and the right configuration. Now you have to 'compile' your code into machine code and program the chip. This means that the compiler inside MPlab, "rewrites" your code into machine code, that will fit into the chip. Normally this is a file with the extension *.obj or *.hex.
The 'Build succeeded' means that the object code is generated.
Now you still have to upload the code into your chip. So place the chip in the socket, and make sure you have pin-1 on the right position. Go to 'programmer/program' and the chip will be prgrammed. In the left corner you can see the indication of the process.
Features of the different chips: