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.

DS18B20 digital temperature sensor

Status
Not open for further replies.

HighTechPower

Member level 5
Joined
Jul 10, 2020
Messages
91
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
703
Hi. I want to use DS18B20 with PIC16F690. I read somewhere that it's protocol is 1-wire which is different than I2C protocol of PIC controllers. Any idea how to convert it to I2C or any link for header file to be used with XC8 compiler? I have seen somewhere source code but that works only for Arduino.
 

I2C is only one of many protocols and isn't specific to PIC devices.
1-Wire is very easy to implement if you can't find a library, just remember that the DS18B20 can be wire-or'ed so you need a pull-up resistor and the pin you use to communicate only needs to pull down to logic zero or sense the state of the line. Hint: leave the pin driven permanently low and use the TRIS register to make it an output or input. As an input it will read the line, as an output it will pull it to logic low state.

Brian.
 
Hi,
. I read somewhere that it's protocol
Somewhere? Why not read the most reliable source of information? --> the datasheet

Converting "1-wire" to I2C makes no sense. It's way more difficult than writing a "1-wire" function from the scratch.
It needs custom made hardware.

I have seen somewhere source code but that works only for Arduino.
Again "somewhere". Why doing random search?
Simply try an internet search "PIC16 1-wire"

Klaus
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top