Pular para o conteúdo principal
Renesas Brasil - Knowledgebase

Setting the System Clock Control Register (SCKCR)

Last Updated:06/08/2017


The system clock control register (SCKCR) is not setting to the target frequency after changing the register. What is wrong?


Check and see if the following rules are kept.

1. Precautions on sequential write
If you write to the system clock control register (SCKCR), and try to write again before the frequency is successfully changed for the initial writing, the later attempt is ignored.  For the above reason, when writing to the SCKCR in sequence, make sure that the written values can be read out from the SCKCR before attempting a subsequent write.

For the above reason, if you fail to check the values while setting ICLK/PCL/BCLK in sequence, the written values may be ignored. To set ICLK/PCLK/BCLK, write into the SCKCR together. To set ICLK/PCLK/BCLK in sequence, read out the set value for each setting and make sure that it is written correctly before continuing. 

2. Precautions on the size relation of frequencies
The frequency setting has a limitation of the size relation.
When writing the system clock control register (SCKCR) by specifying a bit field, the size relation may exceed the limitation depending on procedures.

For example:
For the RX64M, there are the following restrictions. "Do not make a setting such that the ICLK runs at a lower frequency than the external bus clock." Therefore, the setting cannot be executed properly in the following procedures.

<Source codes>
SYSTEM.SCKCR.BIT.ICK = 1; // (1)ICLK divided by 2
while (1! = SYSTEM.SCKCR.BIT.ICK);
SYSTEM.SCKCR.BIT.BCK = 4; // (2)BCLK divided by 16
while (4! = SYSTEM.SCKCR.BIT.BCK);

When changing the division ratio of ICLK and BCLK when the SCKCR register values is 0x00000000 (the initial value), if you try to divide (1)ICLK by 2, BCLK is divided by 1 at this point, so it reaches the limit.

Check with the user’s manual of your device, since precautions differ depending on the particular device. 
“Clock Generation Circuit” > “Precautions for Use” > “Precautions on Clock Generation Circuit”

Suitable Products
RX Family