Assignment 01 Report - 22ug1-0819
Assignment 01 Report - 22ug1-0819
#include <xc.h>
#define _XTAL_FREQ 8000000
void main(void) {
TRISB=0x00;
while(1) {
PORTB=0x00000000;
__delay_ms(100);
PORTB=0x11111111;
__delay_ms(100);
}
return;
}
Explain the Operation of the Circuit
In this project, the PIC16F877A microcontroller serves as the central processing unit, executing programmed commands in
C language to control the LED. The LED is wired so that its positive terminal connects to one of the microcontroller's
digital output pins, while its negative terminal links to ground through a resistor to limit current flow and ensure safe
operation.
To keep accurate timing, a 16MHz crystal oscillator, along with 22pF capacitors, stabilizes the microcontroller's clock
signal, crucial for its functions. Ceramic capacitors are strategically placed for filtering out noise and providing clean
power, enhancing stability. Additionally, specific resistors are used for functions like pull-up or pull-down configurations
to set initial pin states as needed.
A steady 5V power supply ensures the microcontroller operates reliably within its specifications. Finally, a PIC
programmer such as PICkit3 is employed to upload custom code onto the microcontroller
Page 2 of 2