Report1 Embeded Wong Setel
Report1 Embeded Wong Setel
DJM 50122
EMBEDDED SYSTEM APPLICATION
DIPLOMA ENGINEERING MECHATRONIC
LECTURER
EN. SYUKRUL HASSANI BIN JAMALUDIN
EN. SOFIAN BIN YUSOFF
NAME MATRIX NO
AHMAD DANISH BIN AHMAD WIRA 03DEM21F1051
INTRODUCTION
MPLAB X IDE and Proteus are well-known tools for embedded system and microcontroller
development. Microchip Technology's MPLAB X IDE is an integrated development environment
(IDE) for developing and debugging embedded applications based on their microcontrollers.
LabCenter Electronics' Proteus simulation software is commonly used for simulating
microcontroller-based projects.
OBJECTIVE
1. Able to write programs in C language in MPLABX IDE.
LIST OF EQUIPMENT
1. MPLAB X IDE software
2. Proteus software
3. LAPTOP/PC
FLOW CHART PROCESS
PROCEDURE(MPLAB&PROTEUS)
1) Make a PW folder on your desktop or any other drive. Create a subfolder in the folder.
2) Open MPLABX and go to File>New Project. Choose from the following categories:
Microchip Embedded, Standalone Project. Next, click.
3) Choose device PIC18F45K22 and tool simulator, then click Next.
4) Select compiler XC8 and then click Next.
5) Choose the option Select Project Name and Folder. Click Browse in the Project
Location section. Choose the PW folder you previously created. Enter PW1 in the
Project Name field. Ignore any other possibilities. Finally, click Finish.
6) Check your MPLAB X settings here. Dashboard-PW1 (the name of your project)
Device-PIC18F45K22 (your preferred PIC)Compiler Toolchain-XC8 (or your
preferred compiler)
7) Create a C programming file, Right click Source File>New>main.c
8) File name, “Lab1A”. Option C is default selection.
9) Click File>Project Properties>XC8 Global option.At C Standard, select C90.
10) Write the source code.
11) To compile your source code, click Production>Build Main Project or its icon.
12) If your program has no error, you will get BUILD SUCCESSFUL statement in output
window as below. If your program has error, you will get BUILD FAILED statement.
13) Open proteus, click New Project. Insert name Circuit1A, then click Next until Finish
14) Button P from libraries icon. Use keyword to find the component.Contruct the circuits.
15) Load the hex file into Proteus. In MPLAB X, at the output window, copy the statement
highlighted below and paste in program file in Proteus.
16) To write new program, right click on the previous source code and click remove from
project.
Explanation: LED(D1) will light up when the circuit is turned on.Both D1 and R1 are connected
to RA2 in PIC. The voltmeter will show the electric current flowing in the circuit. Negative
connected to ground.Power Supply is connected with R2 and connected to Pin 1 RE3
Lab1B Coding
Lab1B Output
Explanation: All the led from R3 to R10 are connected to the pins on the PLC in order from pins
15 to 18 and 23 to 26. All the Led also has its own earth ground and resistor.
CONCLUSION
In conclusion, MPLAB X IDE and Proteus are indispensable tools for embedded system
development. MPLAB X IDE provides a robust integrated development environment for writing,
compiling, and debugging code for a variety of Microchip microcontrollers. Proteus, on the other
hand, is a powerful simulation software that allows for the virtual modelling and testing of
electronic circuits and microcontroller-based projects.
REFERENCES