Server Room Monitor

TMP102 STM32 I2C Exercise

Task

Print the room's temperature in whole degrees Celsius on J10. The registers and bit fields are on the Datasheet tab.

Circuit

Block view of the board: U2, an STM32F407, wired to J13 the SWD header, J10 the console header with a terminal at 115200 8N1, and J15 the sensor header with a TMP102 at address 0x48 that the schematic does not draw
An excerpt of the STM32F407 datasheet alternate function table: the AF4 to AF9 columns, which hold every I2C, SPI, USART, UART and CAN function, for twenty pins on ports A to D; a dash is an empty cell

Pass condition

J10 prints the reading as one line, and hidden cases read back your USART and pin setup. Keep J13 working.

Expected output with the room at 30 degrees: the TMP102's register 0x00 holds 1E 00, its first byte is whole degrees, and the terminal on J10 shows one line, 30

Notes

The TMP102 has the room's reading from power-on. U2 runs at its 16 MHz reset clock. On this bench, only the I2C blocks need a clock enable. Console, 115200 baud: BRR = 0x8B I2C at 100 kHz: FREQ = 16, CCR = 80, TRISE = 17

Related challenges

Loading the interactive arena.