Chaser LEDs Project Using PIC16F877A MUC
Components
1, PICF877A MUC ------------ 1
2, 12Mhz or 8Mhz XTL -------1 ( Change XTL value of program cod )
3, 22PF Capacitor --------------2
4, IC 7805 -----------------------1
5, 470 ohm Resistor-------------8
6, LED --------------------------8
---------------------------------------------------------------------------------------
ADITONAL COMPONENTS
1, 10 Ohm Resistor ----------1 (Connect min power +5 to ic VCC & VPP)
2, 33k Resistor ---------------1 ( Connect VPP/MCLR PIN AND +5V)
---------------------------------------------------------------------------------------
PROGRAM COD ( Hi Tech C)
-------------------------------------
//8 -LED Chaser example program written for
//PIC programming tutorial.
//Target device PIC16F877A
//Compiler HI-TECH C
//Author Arun.s : www.3gesoft.blogspot.com
#include <htc.h>
#define _XTAL_FREQ 12000000 //setting the crystal frequency to 12MHz
void main()
{
PORTB = 0xff;
TRISB = 0x00; //Sets port B as an output port
while(1)
{
PORTB=0b10000000;
__delay_ms(100);
PORTB=0b01000000;
__delay_ms(100);
PORTB=0b00100000;
__delay_ms(100);
PORTB=0b00010000;
__delay_ms(100);
PORTB=0b00001000;
__delay_ms(100);
PORTB=0b00000100;
__delay_ms(100);
PORTB=0b00000010;
__delay_ms(100);
PORTB=0b00000001;
__delay_ms(100);
}
}
-----------------------------------------------------------------------------------
PCB Layout
--------------
Comments
Post a Comment