Skip to content

3.6

Choose a tag to compare

@Lukasz-Juranek Lukasz-Juranek released this 03 Nov 09:29

Accurate clock without a crystal

The uLC has no crystal: its internal 48 MHz RC oscillator (HSI48) clocks the CPU, the USB interface and the LIN UART, and it drifts with temperature. The STM32F042's Clock Recovery System (CRS), made for exactly this case, was not enabled.

From this release the CRS trims HSI48 continuously to the host's USB Start-of-Frame packets, which arrive every 1 ms from the PC's crystal. The LIN baud rate and master slot timing therefore keep crystal-like accuracy over temperature. This matters most when the uLC is the LIN master, since all slaves synchronise to its clock.

On one test unit the CRS moved the oscillator trim from 32 to 35, so without it that converter's clock ran measurably slow even at room temperature.

Testing

Two converters on one LIN bus, both on 3.6: full test suite 63/63 with both role assignments; master slot periods within about 1 ms of the configured delay. The CRS state was checked with a separate test-only build (not this release): synchronised to USB SOF within seconds, no errors afterwards.

Unchanged from 3.5: USB ID 1209:2779 from pid.codes, master slot timing from 3.4.

Firmware version string: v0306. Flash over USB DFU (send boot, then STM32CubeProgrammer).

SHA-256 of LUC_0306.bin: ed24dd8913a7c19a21a47660470487f84573c48fef94e3904068d9ffb63c8322