[go: up one dir, main page]

0% found this document useful (0 votes)
15 views2 pages

Exp 1

The document outlines an experiment to control LEDs using a PIC microcontroller on a GOTT PTK-40A Training Board, demonstrating LED blinking through a pre-built code. It details the necessary apparatus, theoretical principles, and step-by-step procedure for setting up the project in MPLAB IDE and programming the microcontroller. The conclusion emphasizes the successful demonstration of microcontroller concepts such as GPIO control and timing in embedded systems.

Uploaded by

anum.shahzad1000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views2 pages

Exp 1

The document outlines an experiment to control LEDs using a PIC microcontroller on a GOTT PTK-40A Training Board, demonstrating LED blinking through a pre-built code. It details the necessary apparatus, theoretical principles, and step-by-step procedure for setting up the project in MPLAB IDE and programming the microcontroller. The conclusion emphasizes the successful demonstration of microcontroller concepts such as GPIO control and timing in embedded systems.

Uploaded by

anum.shahzad1000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

LED BLINKING

Objective:
To demonstrate control of LEDs using a PIC microcontroller through a pre-built code that causes
the LEDs to blink in a sequence.

Apparatus

1. GOTT PTK-40A Training Board


2. Computer with MPLAB IDE
3. PICkit 2 Software

Theory

The blinking of LEDs is a fundamental application in microcontroller programming. In this


experiment, the PIC microcontroller controls the state of the LEDs (on or off) based on a simple
program. The basic principle involves: The microcontroller has several GPIO pins that can be
configured as inputs or outputs. The pins connected to the LEDs will be set as outputs to control
their state. The program uses a delay function to create a time interval between turning the LEDs
on and off, resulting in a blinking effect. The pre-built code utilizes the C programming language
for ease of understanding and modification. It controls the logic of how the LEDs are activated in
sequence.

Procedure

1. Connect the LEDs to the appropriate GPIO pins on the GOTT PTK-40A Training Board,
using resistors in series to limit current and protect the LEDs from damage.

2. Start MPLAB IDE and create a new project for the PIC16F877A microcontroller. Include
the main code file (Main E_1.c) and the ADC configuration file (adc.c). Also, add the header
files (adc.h and system.h) to the project for function definitions and system configurations.

1. Open MPLAB IDE on your computer.


2. Load the pre-built code designed for blinking LEDs.
3. Connect the UIC00B USB ICSP programmer to the training board and the
computer.
4. Use the PICkit 2 software to upload the compiled code (hex file) into the PIC
microcontroller.
5. After programming, reset the microcontroller if necessary to start the program.
6. Observe the LEDs blinking in the specified sequence as defined in the code.
4. Take note of the LED blinking pattern, including the timing intervals between each blink.

Code:

adc.c file
Main E_1.c

adc.h

system.h

Conclusion

The experiment successfully demonstrated the ability to control LEDs using a PIC
microcontroller on the GOTT PTK-40A Training Board. By utilizing a pre-built code, we
achieved a blinking LED effect, illustrating fundamental concepts in microcontroller
programming, such as GPIO pin control and timing. This hands-on experience enhanced our
understanding of embedded systems and the practical applications of microcontrollers in
controlling electronic components.

You might also like