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 help on programming a pic16f877a

Status
Not open for further replies.

rossu704

New Member
i'm having some trouble wif my pic;

i use pin A0 and pin A1 as my inputs.
when a voltage of 2-5 volts is detected at either input, pic should give an output to a dtmf telephone to dial a certain number.

i have completed the programing its just that the pic still give output (dial the phone) even when no voltage is detected at the inputs, during this time the voltage is 0.102V. if any voltage ranging from 2-5 V is detected at either the input, output should be send out to dial the telephone.

so, can anyone point out the solution for me.
below is the c code i've written, feel free to correct any mistakes

https://www.electro-tech-online.com/attachments/programming-pic-c.12282/
 

Attachments

  • programming PIC.c
    2.8 KB · Views: 198
Hi, I just took a QUICK look at your source file, and saw one place which is giving you trouble:
else
{
while (x = 2)
{ test();
++x;
}

}

You are assigning the value of 2 to x, and I think you want:
while(x==2)

I didn't look much further, though.
 
Status
Not open for further replies.

Latest threads

Back
Top