DS18B20 on STM32F103C8
-
- Posts: 6
- Joined: Wed Dec 23, 2020 8:01 pm
DS18B20 on STM32F103C8
Hi All,
I'm building a project of motorcycle computer like device. It displays some important informations for bikers. It works on Arduino Nano but Nano was too slow. Now I'm trying to port it to stm32. Almost all works fine but I have a problem with OneWire library. I would like to use DS18B20 temperature sensor but it require OneWire library. Unfortunatelly it doesn't work with my STM32F103. During compilation it returns error that it can't be compiled for this type of board. I saw OneWireSTM library in Arduino IDE but how to use it instead classic OneWire? Should I change definition in DS18B20.h file from onewire.h na onewirestm.h? What about declaration or initialization? Should I use onewirestm.begin (); or other? Or maybe there is a modified version of classical library. Did someone has the same problem? Could you please help me withthat?
Best regards and Merry Christmass,
Greg.
I'm building a project of motorcycle computer like device. It displays some important informations for bikers. It works on Arduino Nano but Nano was too slow. Now I'm trying to port it to stm32. Almost all works fine but I have a problem with OneWire library. I would like to use DS18B20 temperature sensor but it require OneWire library. Unfortunatelly it doesn't work with my STM32F103. During compilation it returns error that it can't be compiled for this type of board. I saw OneWireSTM library in Arduino IDE but how to use it instead classic OneWire? Should I change definition in DS18B20.h file from onewire.h na onewirestm.h? What about declaration or initialization? Should I use onewirestm.begin (); or other? Or maybe there is a modified version of classical library. Did someone has the same problem? Could you please help me withthat?
Best regards and Merry Christmass,
Greg.
Re: DS18B20 on STM32F103C8
Hi, which core you used? I guess you used libmaple core ?
-
- Posts: 505
- Joined: Fri Dec 27, 2019 4:53 pm
- Location: Munich, Germany
- Contact:
Re: DS18B20 on STM32F103C8
Which board have you selected in Arduino IDE?
-
- Posts: 6
- Joined: Wed Dec 23, 2020 8:01 pm
Re: DS18B20 on STM32F103C8
Hi,
I use STM32F103C8 "black pill" board with 64k memory. In board manager I've selected STM32F1xx/GD32F1xx boards ver. 2020.12.17 by stmduino and use Generic STM32F103C series with ST-Link programmer. My program works well without OneWire.h and DS18B20 libraries and commented all lines which use these libraries but if I uncomment them and libraries, I receive error.
I use STM32F103C8 "black pill" board with 64k memory. In board manager I've selected STM32F1xx/GD32F1xx boards ver. 2020.12.17 by stmduino and use Generic STM32F103C series with ST-Link programmer. My program works well without OneWire.h and DS18B20 libraries and commented all lines which use these libraries but if I uncomment them and libraries, I receive error.
-
- Posts: 505
- Joined: Fri Dec 27, 2019 4:53 pm
- Location: Munich, Germany
- Contact:
Re: DS18B20 on STM32F103C8
You should use in your sketch
as shown by this example: https://github.com/rogerclarkmelbourne/ ... rature.ino
Code: Select all
#include OneWireSTM.h
-
- Posts: 6
- Joined: Wed Dec 23, 2020 8:01 pm
Re: DS18B20 on STM32F103C8
IT WORKS!!!! Grrreeeeaaattt!!!
Thank You very much!!!!
Thank You very much!!!!
-
- Posts: 13
- Joined: Thu Dec 17, 2020 9:20 am
Re: DS18B20 on STM32F103C8
can we use this OneWireSTM library if our core is Arduino_STM32 core (not the rogerclark one)?
Re: DS18B20 on STM32F103C8
Fot STM32 core use the standard OneWire library.
Re: DS18B20 on STM32F103C8
Thanks a much!stevestrong wrote: Thu Dec 24, 2020 2:43 pm You should use in your sketchas shown by this example: https://github.com/rogerclarkmelbourne/ ... rature.inoCode: Select all
#include OneWireSTM.h
I would like to share also a library free code, available here: https://how2electronics.com/interfacing ... ith-stm32/