A development system for embedded controllers is a system of programs running on a computer that help to write, edit, debug and program code – which is the intelligence of embedded systems applications – into a microcontroller. MPLAB X IDE is such a system, it contains all the components needed to design and deploy embedded systems applications.
The typical tasks for developing an embedded controller application are:
Of course, each of these steps can be quite complex. The important thing is to concentrate on the details of your own design, while relying upon MPLAB X IDE and its components to get through each step without continuously encountering new learning curves.
Step 1 is driven by the designer, although MPLAB X IDE can help in modeling circuits and code so that crucial design decisions can be made.
MPLAB X IDE really helps with steps 2 through 4. Its Programmer’s Editor helps write correct code with the language tools of choice. The editor is aware of the assembler and compiler programming constructs and automatically “color-keys” the source code to help ensure it is syntactically correct. The Project Manager enables you to organize the various files used in your application: source files, processor description header files and library files. When the code is built, you can control how rigorously code will be optimized for size or speed by the compiler and where individual variables and program data will be programmed into the device. You can also specify a “memory model” in order to make the best use of the microcontroller’s memory for your application. If the language tools run into errors when building the application, the offending line is shown and can be double clicked to go to the corresponding source file for immediate editing. After editing, you will rebuild and try your application again. Often this write-compile-fix loop is done many times for complex code as the sub-sections are written and tested. MPLAB X IDE goes through this loop with maximum speed, allowing you to get on to the next step.
When the code builds with no errors, it needs to be tested. MPLAB X IDE has components called “debuggers” and free software simulators for all MCUs to help test the code. Even if the hardware is not yet finished, you can begin testing the code with the simulator, a software program that simulates the execution of the microcontroller. The simulator can accept a simulated input (stimulus), in order to model how the firmware responds to external signals. The simulator can measure code execution time, single step through code to watch variables and peripherals, and trace the code to generate a detailed record of how the program ran.
When the hardware is in a prototype stage, a hardware debugger, such as an in-circuit emulator or an in-circuit debugger, can be used. These debug tools run the code in real time on your actual application by using special circuitry built into many devices with Flash program memory. They can “see into” the target microcontroller’s program and data memory, and stop and start program execution, allowing you to test the code with the microcontroller in place on the application.
After the application is running correctly, you can program a microcontroller with one of Microchip’s devices or development programmers. These programmers verify that the finished code is programmed correctly into the device.
MPLAB X IDE supports most PIC MCUs, all dsPIC DSCs, and a growing number of AVR and SAM MCUs.