smallsolar 345d16b542 Update readme.MD
Added example code (will obviously need to setup timers etc.
2025-04-19 16:43:02 +00:00
2025-04-19 16:43:02 +00:00

DS18B20 for the STM32F0 using libopencm3

Introduction

A simple driver written for libopencm3 and stm32f0, it was written from first principles and uses a GPIO to read and write bits to the DS18b20.

Limitations:

  • It ignores the ROM Search therefore can only have a single ds18b20 sensor on each bus (but you can use multiple buses)
  • It uses NOP for some of its timing which is probably not ideal
  • The timings are rough, it could need some optimisation (but works with the fake ds18b20s I have.)

Example Usage

#include "ds18b20.h"

//Get Data from DS18b20 Sensor 1
ds18b20_start_conversion(GPIOB, GPIO1);
// Wait for conversion to complete
delay_ms(750);
int16_t ds_temp = ds18b20_read_raw_temperature(GPIOB, GPIO1);

References

Description
No description provided
Readme 39 KiB
Languages
C 100%