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] 16F877A with DS18B20 Thermometer.

Status
Not open for further replies.

cagrikrdnz

Newbie level 3
Joined
Jun 20, 2014
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
19
Hi guys. I have to program 16F877A to use it in the laser cooling system. I know how 877A and 18B20 works. However, I should do it in C which I am completely foreign. I know assembly from 8051 but assembly for PIC also a little rough for me. Any kind of help will be appreciated. How can I find basic thermometer codes for 16F877A and DS18B20 in both assembly and C.
 

If it's not a homework, you can do it in Proton+ (BASIC)

Code:
MeasureTemperature:
	OWrite DQ, 1, [$CC,$44]
	Repeat
		DelayMS 5
		ORead DQ, 4, [C]
	Until C <> 0
	OWrite DQ, 1, [$CC, $BE]
	ORead DQ, 2, [Temperature.LowByte,Temperature.HighByte]
	
	If Temperature.11 = 1 Then
		Prefix = "-"
		Temperature = ~Temperature + 1
	Else
		Prefix = "+"
	EndIf
	Whole = Temperature >> 4
	Decimal = (Temperature.LowByte & %00001111) * 100 / 16
	Print At 1, 1, "Temp:", Dec Whole, ".", Dec2 Decimal, " C"
Return

A snipet of code that I regularly use.

HTH
 
Thank you for your fast response. There are other codes (giving feedback to pump, variable duty cycle for fans, etc) related with the business that written in MPLAB and mikroC. One way or another I have to decide language and then compiler. I will try proton+ . If it is ok with me, I can go along with it.
 

i will recommend you c language .
here is proteus simulation and c source file .
 

Attachments

  • ds18b20.rar
    53.1 KB · Views: 87

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top