Fallback

Sensor Glitch Filter Debug

Symptom

A glitch on the sensor line printed TEMP:-1. The registers and bit fields are on the Datasheet tab.

Circuit

Block diagram: U2, a temperature sensor at I2C address 0x48 whose reading is 0 to 255, on SCL and SDA with pull-ups R1 and R2 to PB6 and PB7 of U1, an STM32F4, whose USART1 transmit on PA9 runs to a serial console

Pass condition

After the five boot reads, USART1 prints one line. If any reading is 0 to 85 -> TEMP:<n>, the last such one. If none is -> TEMP:SAFE. Other readings are discarded.

Expected output for five good readings: register 0x00 of the sensor read five times, returning 0x16, 0x17, 0x17, 0x19 and 0x19, then the line TEMP colon 25 on the serial console

Notes

The bench plays the sensor from power-up. It sends each reading as 0 to 255, glitches too. Only I2C1 needs its clock enabled on this bench, and the program does that.

Related challenges

Loading the interactive arena.