ajaykumar988
Member level 5
Here are the steps in programming a microcontroller:
Step 1. Write the code. To write the code, you will need to find an IDE (integrated development environment) that is easy to use and supports the language you want to use. The most commonly used languages for microcontrollers are probably C and BASIC. I program in BASIC and therefore I don't know much about programming microcontrollers in any other language. I would suggest writing the code in BASIC, as it is quite simple. I downloaded an IDE for use with BASIC, and it makes things really quite easy! Here's the link: Proton IDE Lite
Step 2. Compile the code into assembly code. No matter what language you write the program in, the code will have to be turned into assembly code eventually. You can write the assembly code right from the start, but I do not recommend this as it is somewhat difficult if you are just beginning. To compile the code, you will need a compiler. Most IDE's (such as Proton IDE) come with a compiler, so this step is fairly easy. Look in the help file of the IDE for specifics on how to use the compiler. Usually you just have to click a button, and the IDE will create an assembly file (.asm) in the same folder as the code file.
Step 3. Assemble the code to create a .hex file. After you have written the code and compiled it, you will need to create a .hex file that the PIC microcontroller can use. This is done using an assembler. The Proton IDE comes with a built in assembler, but sometimes you may need a separate assembler (if your IDE doesn't come with one). A good one to use is the MPASM Assembler.
Step 4. Load the code onto the microcontroller. This is done through an interface board called a programmer and an application that can send information to the programmer. With this application, you open the .hex file you created in Step 3. Then, as long as the programming board is connected properly, all you need to do then is click a button and the program will be loaded onto the microcontroller. It usually takes a few seconds.
Step 1. Write the code. To write the code, you will need to find an IDE (integrated development environment) that is easy to use and supports the language you want to use. The most commonly used languages for microcontrollers are probably C and BASIC. I program in BASIC and therefore I don't know much about programming microcontrollers in any other language. I would suggest writing the code in BASIC, as it is quite simple. I downloaded an IDE for use with BASIC, and it makes things really quite easy! Here's the link: Proton IDE Lite
Step 2. Compile the code into assembly code. No matter what language you write the program in, the code will have to be turned into assembly code eventually. You can write the assembly code right from the start, but I do not recommend this as it is somewhat difficult if you are just beginning. To compile the code, you will need a compiler. Most IDE's (such as Proton IDE) come with a compiler, so this step is fairly easy. Look in the help file of the IDE for specifics on how to use the compiler. Usually you just have to click a button, and the IDE will create an assembly file (.asm) in the same folder as the code file.
Step 3. Assemble the code to create a .hex file. After you have written the code and compiled it, you will need to create a .hex file that the PIC microcontroller can use. This is done using an assembler. The Proton IDE comes with a built in assembler, but sometimes you may need a separate assembler (if your IDE doesn't come with one). A good one to use is the MPASM Assembler.
Step 4. Load the code onto the microcontroller. This is done through an interface board called a programmer and an application that can send information to the programmer. With this application, you open the .hex file you created in Step 3. Then, as long as the programming board is connected properly, all you need to do then is click a button and the program will be loaded onto the microcontroller. It usually takes a few seconds.