ES_lab_file
ES_lab_file
Embedded Systems
. Choose File > New Project > Standalone Project & click next.
) At last, the nal project has been built successfully. Now user can start adding
les & writing codes in the given project.
Result: We have successfully studied about PIC Microcontroller, and gained overview of
how to create Hex le in MPLAB and select components in proteus in order to make
schematic.
Simulation Results:
All LED’s are turned OFF. All LED’s are turned ON.
Simulation Results:
Aim: To blink LEDs in a one-by-one pattern and Sandglass pattern using PIC.
Software: MPLAB X IDE v . and Proteus Professional.
Theory:
The Microcontroller that has been used is PIC F A on Proteus Software and then
several LEDs are connected to the output ports of the microcontroller. These LEDs are
then grounded as shown below and then we used the code on MPLAB X and generated
the hex- le for it. Now nally the hex le is used by the microcontroller to generate the
blinking of LEDs in one by one & sandglass pattern.
Code 1: One by One Pattern
void main(){
TRISB = 0x00; //Port B as OUTPUT
PORTB = 0x00; //Port B set as LOW
int i, j, k;
j = 0x01;
while(1) {
for (i = 0; i < 8; i++) {
PORTB = j << i;
for (k = 0; k < 800; k++);
}
}
return;
}
Simulation Results 1:
and so on…