You are on page 1of 4

POLITEKNIK SULTAN SALAHUDDIN ABDUL AZIZ SHAH

ELECTRICAL ENGINEERING DEPARTMENT

EC501- EMBEDDED SYSTEM
SIMULATION LAB

EXPERIMENT 3
TITLE: LIGHT A LED USING PIC HARDWARE TRAINER

OBJECTIVE :
AT THE END OF EXPERIMENT STUDENT SHOULD:

Explain verbally the basic function for Mplab software and PROTEUS 7.4 function.

Write and compile to get the HEXADECIMAL code from assembly code using Mplab
software.

Know how to draw and analyze the embedded system circuit using PROTEUS 7.4 software

Know how to compile the hex code and the schematic to make LED blink at desired time
frame.

Familiar with basic Proteus ISIS function

Familiar with PIC KIT 2 to download the program to devices

APPARATUS:
Mplab software version 8.63
Proteus 7.4
THEORY/BACKGROUND :
Good starting place for anyone new to micro's.. Well not completely new, as a general
knowledge of what micro controller is and basic electronic knowledge is assumed. Just in-case; LED's
are Light Emitting Diodes - like a traditional lamp but more efficient and "cutting edge". They can
only be powered when biased correctly, that is, one lead is a positive and the other is negative (also
known as anode and cathode). Here's what an LED looks like in a wiring diagram;

AZLAN (9M2 AGC)

Experiment 1

This amongst other program features is heavily commented below. one of them being the internal oscillator that runs at 4Mhz. got lots of on-board features. PROCEDURE: AZLAN (9M2 AGC) Experiment 1 . well you can calculate how big the resistor should be. so a delay needs to be incorporated to "burn cycles". OK. It's cheap. It's safe to say that 470 ohm or greater will be suffice for most LED's. back to the programming. Keeping in mind that PIC's physically run at 1/4 the OSC speed. this means that with the internal oscillator setup.EMBEDDED SYSTEM SIMULATION LAB An LED needs some sort of current limiting device in series as without it. And the wiring diagram. or be over-driven.POLITEKNIK SULTAN SALAHUDDIN ABDUL AZIZ SHAH ELECTRICAL ENGINEERING DEPARTMENT EC501. I've chosen to use the ever so popular 16F628 PIC micro. To turn the LED on and off in a continual loop would not even make it look like anything was happening. the PIC will run at 1Million Instructions Per Second (1 MIPS). A standard LED is generally rated for about 20mA. the LED will "burn out". and depending on the forward voltage drop of the LED.

EMBEDDED SYSTEM SIMULATION LAB Exercise 1   Open Mplab software and choose PIC 18f4550 as a main controller.1   Observe the output and make sure the result will indicate the D1 LED to blink.POLITEKNIK SULTAN SALAHUDDIN ABDUL AZIZ SHAH ELECTRICAL ENGINEERING DEPARTMENT EC501. and write the code (APPENDIX A) for C in C18 and APPENDIX B for Assembly language. AZLAN (9M2 AGC) Experiment 1 .2 and observe the both output to blink with different timing just like running light.1 below. Circuit diagram 1. Try to vary the speed of the blink by altering the code. Exercise 2  Use the code at APPENDIX B for the circuit diagram 1. and compile the code to get the hex code. Using Proteus software draw the circuit diagram 1.

Eaglewood cliffs.POLITEKNIK SULTAN SALAHUDDIN ABDUL AZIZ SHAH ELECTRICAL ENGINEERING DEPARTMENT EC501. (1997).2 Exercise 3  As a assignment Draw 8 output of LED from RD0 to RD7 and make sure all 8 output are blinking like running light start from RD0 and end RD7 and loop back to play a same routine. 5th ed. NJ: Prentice –Hall.EMBEDDED SYSTEM SIMULATION LAB Circuit diagram 1. 230-251 AZLAN (9M2 AGC) Experiment 1 . “Data and Computer Communication”. S. (HINT: modify the code from APPENDIX B to complete the assignment.)  Modify the code to form a led to blink like pattern below RD0 ON OFF ON RD1 ON ON ON RD2 OFF OFF ON RD3 OFF ON OFF RD4 ON OFF ON RD5 ON ON ON RD6 OFF OFF ON RD7 OFF ON OFF DISCUSSION: Give your observation and assumption based on theory along the experiments CONCLUSION: Give a conclusion obtained from the experiment REFERENCE: (Please refer to APA format. see example below) William.