A STM32 microcontroller project. Used Nucleo-F446RE development board. The MCU reads from a digital temperature sensor (TMP75B) with I2C and logs it into a serial EEPROM chip (25AA640A) using SPI communication. USART also logs the temperature value into the serial port. This project should be compatible with most Ti I2C temperature sensors and Microchip serial EEPROMs. Also HAL drivers makes it easy to be compatible with other STM32 MCUs that possess the same used peripherals.
Prototyped in STM32CubeIDE and exported as a makefile project using the CubeMX generator.
- Download GNU ARM Embedded Toolchain and use make. The HAL drivers do need to be downloaded. Then upload using the .bin, .hex, or .elf files.
- The .ioc file is also there to generate code using CubeMX for other IDEs. Simply copy the main.c source file after generation.
Above shows the temperature reading of the sensor in the serial monitor after I have let go off my thumb from the sensor for less than a second. 12-bit or higher resolution digital temperature sensors are usually only found in surface mount packages, like the one I bought, so I used a SMD-to-DIP adapter that I soldered the sensor onto for this project. The digital temperature readings are in two's complement format, according to datasheet by Ti, with 0.0625 degrees Celsius/LSB. Decoding the 12-bit digital format is specified as well if you want to read the values in the EEPROM.