LED Blinking in PIC 16F877A using CCS complier

 LED Blinking in PIC 16F877A using CCS complier 

#BYTE PORTD =0X08
#BYTE TRISD = 0X88

void main()
{

   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_CLOCK_DIV_2);
   setup_psp(PSP_DISABLED);
   setup_spi(SPI_SS_DISABLED);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);

   // TODO: USER CODE!!
                // Clearing a TRISA bit (= 0) will make the corresponding PORTA pin an output

TRISD=0x00;
while(1)
{
PORTD=0x3F;
Delay_ms(1000);
PORTD=0x06;
Delay_ms(1000);
}
}

Share on Google Plus

About CONSPEAR TECH

0 comments:

Post a Comment