Poll

i've make a read rom command with no respond why ?

wrong timing in the 1 and 0
0 (0%)
sequence not right
0 (0%)

Total Members Voted: 0

Author Topic: “Dallas 1-wire”  (Read 1230 times)

0 Members and 1 Guest are viewing this topic.

Offline david faridTopic starter

  • Newbie
  • Posts: 1
  • Country: eg
“Dallas 1-wire”
« on: March 18, 2020, 02:23:47 pm »
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
 

Offline Ccandrews

  • Contributor
  • Posts: 27
  • Country: us
    • SBC-85, 8085 Single Board Computer ecosystem
Re: “Dallas 1-wire”
« Reply #1 on: March 18, 2020, 04:11:36 pm »
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
« Last Edit: March 18, 2020, 04:19:02 pm by Ccandrews »
Retired, but with passion and a sense of urgency.
8085 advocate, lover of vintage computer hardware. Maybe take a gander at my YouTube channel.
https://www.youtube.com/c/helloworld0000.   https://hackaday.io/ccandrews    https://SBC-85.com
 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2138
Re: “Dallas 1-wire”
« Reply #2 on: March 18, 2020, 04:46:08 pm »
after that i try to send 0x33 command read rom command but i didn't receive any reply i have no idea why
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
 

Offline Ccandrews

  • Contributor
  • Posts: 27
  • Country: us
    • SBC-85, 8085 Single Board Computer ecosystem
Re: “Dallas 1-wire”
« Reply #3 on: March 18, 2020, 11:01:50 pm »
Good catch. Presuming that the end of the code posted is the end of the code, I think you got it.
Retired, but with passion and a sense of urgency.
8085 advocate, lover of vintage computer hardware. Maybe take a gander at my YouTube channel.
https://www.youtube.com/c/helloworld0000.   https://hackaday.io/ccandrews    https://SBC-85.com
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: “Dallas 1-wire”
« Reply #4 on: March 18, 2020, 11:42:49 pm »
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.
 
The following users thanked this post: I wanted a rude username


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf