18Views0Replies

Author Options:

Question Answered

hi everyone and respected teachers i am jimi. and i felt in great problem i'm new one who is using ccs c and i took some tutorials about basic programming for available chips are PIC16F877A and have also ATMEGA32PU. related to PIC16F877A i wrote a program in CCS C and its compiled well with no errors or warnings and got a hex file/ output file checked on proteus8 downloaded/written on PIC16Fxxx by TL866 programmer but the hardware still not being functional i'm struggling to find a solution but i'm failed. and i have written 4 programs in different examples compiled with no error but hardware is not functional can you help me to take contribute in my first step ?? one of the code is given below i shall be thankful to you

#include "D:\DEVELOPE CCSC\two inputs four led\two input 4 output.h"

Void Main() {

Setup_adc_ports(no_analogs);

Setup_adc(adc_off);

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);

#use Delay(clock = 8000000)

Output_low(pin_b0);

Output_float(pin_d0);

Output_low(pin_b1);

Output_float(pin_d1);

While(true)

{

If(input_state(pin_d0) == 0)

{

Output_high(pin_b0);

Delay_ms(2000);

Output_low(pin_b0);

}

If(input_state(pin_d1) == 0)

{

Output_high(pin_b1);

Delay_ms(2000);

Output_low(pin_b1);

}

If(input_state(pin_d0) &(pin_d1) == 0)

{

Output_bit(pin_b0 , 0 & Pin_b1 , 0);

}

}

}

Discussions