Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

,,,, neEd assiStance..

Status
Not open for further replies.

wAnted

New Member
what is the problem if the PIC16F877A don't provide an output? and it cant read input..

when I tried to load this to my friends PIC it works properly but in my PIC, it wont provide an output? whats wrong?

Code:
void main()
{
    unsigned int adc_val;    //hold adc value

    init_LEDS();
    init_ADC();
           
    PORTB = 0X00;
    start:    
    adc_val = read_ADC();
    DelayMs(40);
        if(adc_val < 573)                        
            {
            RB6 = 0;
            RB5 = 1;
            }
        if(adc_val >=573 && adc_val <= 860)                 
            {
            RB6 = 1;
            RB5 = 0;
            }
            if(adc_val >=880)                    
            {
            RB6 = 1;
            RB5 = 1;
            }
DelayMs(20);
     
    goto start;    
}
 
Last edited:
No program?
Bad program?
Low power?
No power?
Bad chip?
Miswired?

Maybe you could provide a "little more" information.

Ken

Thanks for adding the program.
 
Last edited:
Operator that doesn't know how to use it?
Seriously, do people expect to get answers with questions like that?
 
...

coz the first time it used it, it works properly then when i tried to load a program again it wont provide an output..how come? i've already tried test all its port but it doesn't provide an output..
 
As far as I can see, you don't initialize which pin the ADC is to read let alone whether it is a digital, analog, input or output pin? ie: What library are init_ADC() and read_ADC() from?
A schematic would help also.
Post you code using the CODE tags to preserve formatting.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top