Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

//////////////////////////////////////////////////////////////////////////

// Program: flashing LED every 0.5s


// Device: 16F628A PIC Compiler: CCS
// Note: flashing LED every 0.5s by the port B pin RB0
//Eng.F.Abdelaziz
//3/3/2013
///////////////////////////////////////////////////////////////////////////
#include <16f628a.h>
#fuses XT,NOWDT,NOPROTECT,PUT
#use delay (clock=4000000)

//pic to use
//orders for the programmer
//Fosc=4Mhz

///PROGRAM
void main(void)
{
set_tris_b(0xFE);
disable_interrupts(GLOBAL);

//PORTB as output (RB0, the other off)


//all interrupts disabled

do{
output_low(PIN_B0);
delay_ms(500);
output_high(PIN_B0);
delay_ms(500);
output_low(PIN_B1);
delay_ms(500);
output_high(PIN_B1);
delay_ms(500);
}while(TRUE);
}

//led off
//led on
//led off
//led on
//infinite loop

You might also like