Professional Documents
Culture Documents
Practical Work 1
Practical Work 1
1.
LECTURER : 2.
3.
GROUP MEMBERS NAME REGISTRATION NUMBER
STUDENT 1 1.
STUDENT 2 2.
STUDENT 3 3.
STUDENT 4 4.
80%
B. LAB REPORT ASSESSMENT
SCORE
Excellent Good Average Weak Very Weak
SCALE SCORE
5 4 3 2 1
ASPECT
Able to write Able to write Able to write Write discussion Discussion was
discussion discussion with discussion with not related not written
clearly related clearly related to related to to practical work clearly and was X1
to practical work practical work practical work objective unrelated to
Discussion objective. Use objective objective the practical
good and work
appropriate objective.
language in
writing
Accurate Accurate A statement of A statement of No conclusion
statement of the statement of the the results of the the results of the included or
results of the lab results of the lab lab indicates lab indicates shows little X1
Conclusion indicates indicates whether results whether results effort and
whether results whether results support the support the reflection on
support the support the hypothesis hypothesis the lab
hypothesis hypothesis
Excellent. All- Almost of the Almost of the Some of the Incomplete/
important results have results have results are incorrect
trends have been correctly been correctly misinterpreted interpretation.
been interpreted and interpreted and and there is no Not answer
interpreted discussed. some correctly clear answer to the question
Question X2
correctly and Answer the answer the the question
discussed. question question
Answer the correctly
question
correctly.
20%
STUDENTS S1 S2 S3 S4
OBJECTIVES
Upon completion the experiment student should be able to :
a) Construct some simple C code in MPLAB (P3).
b) Assemble an output of C program using Program Memory and Disassembly Listing (P3).
c) Build and simulate PIC18 circuit in Proteus (P4).
EQUIPMENTS
1. Microchip C18 Tool suite
2. MPLAB IDE v8.85 software
3. Proteus software
4. Computer
THEORY
MPLAB IDE
MPLAB IDE (Integrated Development Environment) is professional software implemented by
Microchip, compatible with Windows 7, Vista and XP. MPLAB IDE is used as a powerful aid to
the development of systems based on PIC microcontrollers. Its distribution is free. Download
may be made from Microchip site.
C18 COMPILER
The C18-MPLAB ® IDE, is a C compiler for PIC18 professional MCU, and a powerful tool for ANSI compatible
PIC18 family of PICmicro ® 8-bit MCU. The C18 compiler is a 32-bit Windows ® environment fully integrated with
Microchip MPLAB IDE and allows developing and debugging programs using their software tools. MPLAB C18
compiler makes development of embedded systems applications easier because it uses the C standard language.
The advantage of the C language is that it is widely used, is portable across different architectures, has many
references and textbooks, and is easier to maintain and extend than assembly language. Additionally, MPLAB
C18 can compile extremely efficient code for the PIC18XXXX microcontrollers.’
PROTEUS
ISIS provides the means to enter the design in the first place, the architecture for real time interactive level
simulator. This software combines mixed mode circuit simulation, micro-processor models and interactive
component models to allow the simulation of complete micro-controller-based designs.
a) Simulation and a system for managing the source and object code associated with each project. In
addition, a number of graph objects can be placed on the schematic to enable conventional time,
frequency and swept variable simulation to be performed.
b) True Mixed Mode simulation based on Berkeley SPICE3F5 with extensions for digital simulation and true
mixed mode operation.
c) Support for both interactive and graph-based simulation.
d) CPU Models available for popular microcontrollers such as the PIC and 8051 series.
e) Interactive peripheral models include LED and LCD displays, a universal matrix keypad, an RS232 terminal
and a whole library of switches, pots, lamps, LEDs etc.
1) At desktop, create a folder named PW1. In the folder, create subfolder PROGRAM and CIRCUIT. Then run the
MPLAB IDE v8.85.
2) Select menu Project – Project Wizard – Select Device: PIC18F458 – Select Active Tool suite as
below:
3) Browse the folder that was created at the desktop and give file name as project.mcp.
4) Click Next button until Finish.
5) Double-clicks at MPLAB IDE shortcut and workspace window will display as below and then create a new file editor.
//project.c
void main(void)
if (PORTB == 1) {
PORTCbits.RC1 = 1; //Pin C1 as ON
PORTCbits.RC1 = 0;
7) Right click at Source Files folder in Project.mcp and add your C file.
3) Choose CIRCUIT folder that you created earlier. Then give file name as project.pdsprj. Then click Next. Choose
DEFAULT template for schematic circuit and choose Do not create PCB layout.
4) Choose Create Firmware Project. Choose Family>PIC18, Controller>PIC18F458, Compiler>MPLAB C18. Then click
Next, and Finish.
5) Schematic capture and source code work area will appear as below. Write source code in source code editor as
below. Then compile (build project) source code until compiled successfully.
6) Connect the circuit shown in the figure below. Select button P or Pick parts from libraries icon. Pick Device
window will appear. Type the components name in Keyword box or select in Category option.
7) Simulate the circuit by click Play button and observe the output at the circuit
RESULT
TASK
2. Modify the connection and Task 1 source code to make the push button:
a. Press – LED and Buzzer ON
b. Release – LED and Buzzer OFF
DISCUSSIONS
CONCLUSIONS