ULP DS18B20 1-Wire code

fhng11214
Posts: 8
Joined: Wed Nov 01, 2017 10:35 pm

ULP DS18B20 1-Wire code

Postby fhng11214 » Wed Mar 14, 2018 8:18 pm

Wrote ULP assembly code to get temperature from a DS18B20 to save energy. Its for learning purpose. In case someone is new and wants to learn ULP, it is pretty simple to read. Feel free to ask question. https://github.com/fhng/ESP32-ULP-1-Wire/

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ULP DS18B20 1-Wire code

Postby WiFive » Thu Mar 15, 2018 2:53 am

Thanks for sharing!

Nespressif
Posts: 76
Joined: Tue Sep 12, 2017 11:25 am

Re: ULP DS18B20 1-Wire code

Postby Nespressif » Mon Mar 19, 2018 7:41 pm

Thank you very much for your code. I hope to test the code soon and if I have any questions, I'll let you know.
Greetings

fhng11214
Posts: 8
Joined: Wed Nov 01, 2017 10:35 pm

Re: ULP DS18B20 1-Wire code

Postby fhng11214 » Fri Apr 06, 2018 8:00 pm

Added a few more subroutines since then. Before it was a single DS18B20 environment without CRC8 checking. Now it can talk to multiple DS18b20 and has CRC8 checking. But it is a lot more messy and harder to read. Overall, great learning experience.

-- search_rom - look for 64bit Rom Identification of devices on the bus. (tested with two DS18B20, I only have two) (this should run on main CPU and in C but it was fun to do it in assembly)
-- checkCRC8_bytes - crc8-maxium checking against RomID or Scratchpad memory.
-- read_romid_single_device -not very useful
-- send_rom_id - For talking to multiple DS18b20

*remember there is a 8K memory limits.

Hi Nespressif and WiFive.

Who is online

Users browsing this forum: No registered users and 21 guests