Electronics > Projects, Designs, and Technical Stuff

“Dallas 1-wire”

(1/1)

david farid:
Hello
i'm David we talked on the YouTube channel on the below link



i've been trying to communicate with ds18b20
i make the reset pulse and i had the presence pulse

after that i try to send 0x33 command read rom command but i didn't receive any reply i have no idea why

attached is my code in c language txt file
also is a pic on the scope

i wish this info is enough

Ccandrews:
Can you post the waveforms from your scope please.  Also, it is useful to take another output line from the processor and write a short pulse to it when you are reading the 1wire bus then watch this on the logic analyzer. Problems like this are often due to timing and you can only know when things are happening.  Write an output pulse like in these videos so you know for sure.  I will look this over to see if I see anything.  Obviously you have tried a different chip in case this one is bad?

Wait..
What is this in your code?   

CyDelayUs(1u);//due to contect switching time 

Are you using something mechanical in this?


Finally, a logic analyzer is worth its cost when doing these sorts of projects.
Craig

Andy Watson:

--- Quote from: david farid on March 18, 2020, 02:23:47 pm ---after that i try to send 0x33 command read rom command but i didn't receive any reply i have no idea why

--- End quote ---
There is no reply because you are not reading the device - you have to read the data back by initiating each bit-read with a short strobe pulse - 1us IIRC.
I

Ccandrews:
Good catch. Presuming that the end of the code posted is the end of the code, I think you got it.

james_s:
A shortcut for figuring out this sort of thing, pick up one of the $3 arduino clones and get it running with that, this sort of part is well supported making it very easy to get it working.

Once you have it working on that, scope the signals and see what it is doing that you are not. I find it very helpful to have a working baseline like this from which to compare.

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod