# Setting clocks

While configuring your peripherals, you may need to adjust the clock settings. For instance, a clock speed of 48 MHz might be too fast for UART communication. Let's now discuss clock configurations.

The diagram below illustrates the clock tree, showing how all clocks are distributed.

<figure><img src="https://2412084329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L9GLtaxrQtBdBRsFIJB%2Fuploads%2FAG3E95mpWPLyOTn9TGC5%2Fimage.png?alt=media&#x26;token=ca33790c-3b2c-45d5-abbe-e1f3bcb377c2" alt=""><figcaption><p>Clocks tool interface. The button for accessing it is highlighted in the top right</p></figcaption></figure>

In the Peripheral Clock View tab, each peripheral is assigned a specific clock. These clocks will be utilized in subsequent driver configurations through the Microcontroller Unit (MCU) RTD driver.

<figure><img src="https://2412084329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L9GLtaxrQtBdBRsFIJB%2Fuploads%2FxwDuAWbIU4XTSUA0VN3o%2Fimage.png?alt=media&#x26;token=c34fe160-6fb5-4e17-b8ff-3c0c0d2aa27e" alt="" width="482"><figcaption></figcaption></figure>

In the Peripherals we go to MCU -> McuModuleConfiguration -> McuClockSettingConfig -> McuClockReferencePoint. Here you can see all the references to the clocks we are using in the project.&#x20;

<figure><img src="https://2412084329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L9GLtaxrQtBdBRsFIJB%2Fuploads%2FHnQEd3K5g1KPVu5GaGYX%2Fimage.png?alt=media&#x26;token=027d5885-5c51-4be2-96ab-5854498215c5" alt=""><figcaption></figcaption></figure>

The last one (Lpuart1ClockReferencePoint) is used in the UART configuration we've talked about before.

<figure><img src="https://2412084329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L9GLtaxrQtBdBRsFIJB%2Fuploads%2Fd2D42IetAaHeAJoSpVN7%2Fimage.png?alt=media&#x26;token=899b7303-799c-459c-8bfd-6af882d40bc9" alt=""><figcaption></figcaption></figure>

For example let's say that we want to use the clock of LPUART2, another hardware channel for the UART module.&#x20;

We go to McuClockReferencePoint and add a new reference. We give it a suggestive name like "Lpuart2ClockReferencePoint" and choose the pheripheral clock,  "LPUART2\_CLK".

<mark style="color:red;">Note : This example is for demonstration purposes only, and the LPUART1 peripheral should use its own clock.</mark>

<figure><img src="https://2412084329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L9GLtaxrQtBdBRsFIJB%2Fuploads%2FlizoEeWHuazD9cTwmaw0%2Fimage.png?alt=media&#x26;token=1e147890-753a-469a-863e-18e119eeb617" alt=""><figcaption></figcaption></figure>

After this if we go back to the UART interface we can find the new clock reference.&#x20;

<figure><img src="https://2412084329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L9GLtaxrQtBdBRsFIJB%2Fuploads%2FfDM6vWF6mssmDjC2IYNS%2Fimage.png?alt=media&#x26;token=44e0280e-5b9e-45e9-871c-c105f2ff9a0f" alt=""><figcaption></figcaption></figure>

