Skip to content

Commit 478ecd2

Browse files
committed
Added ## Temperature Sensor to readme
1 parent 707d62d commit 478ecd2

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,22 @@ Example:
8282
8383
The X macros are the single point of truth, and all data structures are automatically generated by the preprocessor. Similar macros are used to generate the field bit positions and masks.
8484
85-
## ADC Driver
85+
## Temperature Sensor
86+
The module provides the MCU temperature on demand. Internally, the built-in temperature sensor is sampled periodically through ADC3.
87+
88+
The following configuration is used:
89+
- ADC conversions are triggered every 1 second using TIM2.
90+
- Samples are transferred to CM7 through DMA1.
91+
- DMA operates in double-buffer mode using the HAL multi-buffer DMA API. This provides deterministic low-latency access while avoiding torn reads.
92+
- In addition to the temperature sensor, the Vrefint channel is also sampled to compensate measurements for supply-voltage variation.
93+
- ADC3 is supplied with a 100 MHz clock. To achieve the ≥ 5 µs effective sampling time typically recommended by ST, the sampling time is configured to 810.5 cycles (~8.1 µs).
94+
95+
Three modes of calculating the temperature are provided:
96+
- Floating-point arithmetic.
97+
- Integer arithmetic.
98+
- Fixed-point (Q2.30) arithmetic to reduce division overhead.
99+
100+
As the internal sensor is relatively noisy, smoothing is applied in all three modes.
86101
87102
## Lightweight Logging (LWL)
88103
LWL is a lightweight logging system designed for low runtime and memory overhead. It is intended primarily for crash and failure analysis, by enabling high-granularity logging during normal operation with minimal impact on system performance. It is most useful when combined with a more verbose, higher-level logging system.

0 commit comments

Comments
 (0)