Exp 1
Exp 1
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
Theory
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.
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.