메인 콘텐츠로 건너뛰기
Knowledgebase
Home
Renesas Korea

How should I count 11 cycles in hardware cycles?

Latest Updated:06/20/2013

Question:

In the hardware manual, it says "The interval between writing to the SCKCR and issuing of the WAIT instruction must take up at least 11 cycles of the system clock." How should I count 11 cycles?

Answer:

Here is one example program.

#pragma inline_asm SetIOreg32
static void SetIOreg32(unsigned long , unsigned long);
static void SetIOreg32(unsigned long adrs , unsigned long data)

{
MOV.L      R2,[R1]
CMP        [R1],R1
MOV.L      #3,R2
SetIOreg32_LOOP:
SUB        #1,R2
BGTU.B ?  SetIOreg32_LOOP
}

In the standby transition program, call the above SetIOreg32bit function with:
the address of the SCKCR register as the first argument, and
the setting data for SCKCR register as the second argument,
and then execute a WAIT instruction to transition to software standby mode.

Suitable Products
RX62N, RX621
RX62T
RX610
RX62G