Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] Need Help with PIC16F877A for a project

Status
Not open for further replies.

Hamzah Ghanem

Newbie level 2
Joined
Apr 19, 2014
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
28
hi, I have a project which involves making an automatic irrigation system... Im using the PIC16F877A with 4 DS18B20 temperature sensor multiplexed through a 4x1 digital multiplexer. 16 analog moisture sensors multiplexed through an analog 16x1 mux, and a DS1307 RTC. for now I want my project to behave as following ... Display the Time, the Date, the Value for the moisture sensor and the Temperature. I have created a code and I triple checked my hardware connection but for a reason or another it is just not working :( I really want some help I think I have some errors in My code ... I will attach my files here... If i put each one alone They work perfectly but when I integrate them together they stop working ... Please help me because my knowledge in controller is still basic ... so help me please thank you all .


View attachment PICFILES.rar
 

Show us your schematic. The DS18B20 is a 1-Wire interfaced device so it will not work with a normal digital multiplexer, you either need a bi-directional multiplexer with a direction control signal or you should use an analog multiplexer. If you know their serial numbers you can avoid the multiplexer altogether and wire them all in parallel.

Brian.
 

I think I have some errors in My code ... I will attach my files here... If i put each one alone They work perfectly but when I integrate them together they stop working

You need explain what errors are occurring...

By the way, taking an overview at some files, it is notorious that duplicated variables are being declared at each one, and this could be a possible reason for the problem.




+++
 

thank you all for the fast replies... My problem is that when I compile it there is no errors in the code but when I download it on the PIC and put it on the circuit Something goes wrong I really don't know why but it does not show the expected output.

you can see in the attached files the schematics (well, to an extent), the exact output I am receiving, and the .rar file including the latest file that I am working on. what I should have on the output is something like this

---------------------------
|TIME: HH:MM:SS AM.......|
|DATE: DD-MM-20YY........|
|SEN: XX VAL: YYY MOIST|
|..................................|
---------------------------

*The dots are just empty spaces*

and I also added in parallel to the Mux Select lines 4 LEDs just to see if the select lines are working properly or not. NO ONE IS ON :(

If i can make this work then I can hopefully integrate the DS18B20 Temperature Sensor. and then make the software that will follow my flow charts (Pages 16 - 21 in the attached PDF) so please guys help me I really want to pass this my senior project and finally graduate from University

- - - Updated - - -

By the way I did not write the code my self. I used some free to use files from libstock. Am posting this just to acknowledge the ownership of the uploader whom i forgot what was his name
 

Attachments

  • RTC_MOIST.rar
    56.5 KB · Views: 40
  • 2014-04-19 22.34.13.jpg
    2014-04-19 22.34.13.jpg
    887.1 KB · Views: 76
  • 2014-04-19 22.34.09.jpg
    2014-04-19 22.34.09.jpg
    842.7 KB · Views: 63
  • 2014-04-19 22.09.01.jpg
    2014-04-19 22.09.01.jpg
    1.1 MB · Views: 59
  • 2014-04-19 22.08.58.jpg
    2014-04-19 22.08.58.jpg
    1.1 MB · Views: 80
  • 2014-04-19 22.08.54.jpg
    2014-04-19 22.08.54.jpg
    1.1 MB · Views: 62
  • 2014-04-19 22.08.41.jpg
    2014-04-19 22.08.41.jpg
    1.1 MB · Views: 69
  • Automatic Irrigation Systems Senior Design Project Report.pdf
    1.7 MB · Views: 65

You code doesn't contain any code related to DS18B20. It only has RTC DS1307 code. If you have Proteus then draw schematic in it and Zip and post it. If you don't have Proteus then use OrCAD or any schematic drawing software and make the schematic and save the schematic as PDF file and post it.

Try the attached RTC DS1307 Code.

Edit: You have not posted the 4X1 Multiplexer circuit.
 

Attachments

  • RTC DS1307 rev1.rar
    75.5 KB · Views: 33
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top