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.

programming PIC16F887

Status
Not open for further replies.

salim alfarsi

New Member
hi,

i am having problem with my code. i compiled this code by using MiKroC and when i load it to PIC16F887, the circuit did not function ! PIC detect signal from gas sensor and measure the value of gas exposed in PPM and display it in LCD as ppm value then the PIC will close the solenoid valve to isolate the gas source and send SMS through GSM modem to the concerned person informing him by gas leak.

right now, non of this functions act in the circuit. the power is in every part of the circuit, so i am suspecting the problem is from the code. the code is in this link:

https://pastebin.com/VqZ6948T

and i attached the schematic diagram of my circuit. i hope someone contribute to review the code and help me to correct it if this is anything need to be corrected
 
You should have posted your circuit as a .gif or a .jpg, etc.

It is time consuming to open .pdf files just to see a drawing.

I'm sorry, but I can't help you with the code as I do my programming in assembly.

Also, the code could have been included here as Code. See the # icon (second last) in the "Post a reply" window. You will see it if you reply to this post.
 
Last edited:
hi,

i am having problem with my code. i compiled this code by using MiKroC and when i load it to PIC16F887, the circuit did not function ! PIC detect signal from gas sensor and measure the value of gas exposed in PPM and display it in LCD as ppm value then the PIC will close the solenoid valve to isolate the gas source and send SMS through GSM modem to the concerned person informing him by gas leak.

right now, non of this functions act in the circuit. the power is in every part of the circuit, so i am suspecting the problem is from the code. the code is in this link:

https://pastebin.com/VqZ6948T

and i attached the schematic diagram of my circuit. i hope someone contribute to review the code and help me to correct it if this is anything need to be corrected

I believe I already mentioned this in chat. You have not set any fuses, such as the watchdog timer (WDT). It often defaults to on, and if you don't set it to off, it will stop your program after a fraction of a second. You will need to look up how to set fuses in MikroC, as I have not used it before. I'd suggest looking into the libraries for mikroC and your chip to determine which fuses you need to deal with.

You should have posted your circuit as a .gif or a .jpg, etc.

It is time consuming to open .pdf files just to see a drawing.

I'm sorry, but I can't help you with the code as I do my programming in assembly.

Also, the code could have been included here as Code. See the # icon (second last) in the "Post a reply" window. You will see it if you reply to this post.

The code is kind of long, and I think it would have taken up a lot of space in one post. I think the pastebin link is fine.

Regards
 
Post removed...I keep forgetting this forum is all about handing answers/code to people on a silver platter rather than making people actually put forth the effort to LEARN anything.
 
Last edited:
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top