This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

1 wire code problem

Hello, Having a problem with the 1 wire sensor DS1820, I've created my own 1 wire protocol functions. They compiled without any errors. but when I run my program, it only shows the temperature value 4095 constantly. Kindly take a look into my code and let me know if there is any problem in it. Find the attached code file, please

Regards, Umair

1 wire.rar

Parents
  • I don't have any experience with this sensor or protocol, but have you actually verified that your high and low periods are correct? It seems a little odd that your comments says "// leave it low for 480us", and the code snippet is nrf_delay_us(29), which will normally pause for ~29 µs, not 380.

    I'd therefore recommend you to get hold of a logic analyzer and see what actually happens on your lines, to make sure that this is correct, and as you expect.

Reply
  • I don't have any experience with this sensor or protocol, but have you actually verified that your high and low periods are correct? It seems a little odd that your comments says "// leave it low for 480us", and the code snippet is nrf_delay_us(29), which will normally pause for ~29 µs, not 380.

    I'd therefore recommend you to get hold of a logic analyzer and see what actually happens on your lines, to make sure that this is correct, and as you expect.

Children
No Data
Related