PSoC4S CY8C4126AXI-S445 EXTCLK settings

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Hi,

In order to operate PSoC4S with an external clock,
Enabled EXTCLK of Configure System Clocks.

Frequency is 24MHz
Accuracy is -2% to + 2%.

HFCLK set to EXTCKL

pastedImage_0.png

No error occurs after Build.

The clock of the SG-8002CE24MHSTB-L3 oscillator is input to P0 [6].

However, PSoC4 does not start after programming.
Are there any restrictions on how to use an external clock?

For example, are there any application notes listed?

Regards,

0 Likes
1 Solution
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello Masashi,

The device always starts up using the IMO and the external clock must be enabled in user mode; so the device cannot be started from a reset, which is clocked by the external clock. When manually configuring a pin as the input to the EXTCLK, the drive mode of the pin must be set to high-impedance digital to enable the digital input buffer.

Please refer to the External Clock(EXTCLK) section in the Architecture TRM for PSoC 4100S for more details on this: https://www.cypress.com/file/280681/download

Best Regards

Ekta

View solution in original post

0 Likes
10 Replies
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Additional information.
If EXTCLK is disabled and set to IMO, it operates normally.
Is there a relationship between the power-on sequence and the timing at which the external clock becomes valid?
?

0 Likes
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello Masashi,

The device always starts up using the IMO and the external clock must be enabled in user mode; so the device cannot be started from a reset, which is clocked by the external clock. When manually configuring a pin as the input to the EXTCLK, the drive mode of the pin must be set to high-impedance digital to enable the digital input buffer.

Please refer to the External Clock(EXTCLK) section in the Architecture TRM for PSoC 4100S for more details on this: https://www.cypress.com/file/280681/download

Best Regards

Ekta

0 Likes
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Ekta-san,

thank you for your answer.
We understand that there is also a description of the API in the system guide.

However We think that waiting time until the main clock changes is stable is important.

Do you have application notes or sample code?

Regards,

0 Likes
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello Masashi-san,

At present we do not have any application note on external clock for psoc 4100s device.

As per my understanding you are using API  CySysClkWriteHfclkDirect (uint32 clkSelect) to change the clock source from IMO to EXTCLK after the device starts.

The clock source will change to ExtClk from the next cycle onwards as soon as the API for the change of HFCLK source from IMO to EXTCLK is executed.

Best Regards

Ekta

0 Likes
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Ekta-san,

Thank you for your supoort.

We understood this issue.

I will try to change clock using the API.

I look forward to the release of the application note.

Regards,

0 Likes
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Ekta-san,

/* Clock Settings */

IMO : 24MHz

EXTCLK : 24MHz

Initial setting of HFCLK is IMO(24MHz)

After PSoC starts, the clock is switched with the following API.

/* Clock Change Code */

CySysFlashSetWaitCycles(24u);

CySysClkWriteHfclkDirect(CY_SYS_CLK_HFCLK_EXTCLK);

PSoC operation stops at the timing of clock changing.
Are there any necessary conditions for changing clocks?

Is a delay required for the clock to stabilize after the change is made?

Regards,

0 Likes
lock attach
Attachments are accessible only for community members.
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

I confirmed that it would switch normally if I created a simple code.
I think other factors are not switching properly.
We apologize for the inconvenience.

0 Likes
lock attach
Attachments are accessible only for community members.
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Hi,

As we confirmed, even PSoC4 does not work depending on the series.

PSoC4S has confirmed the operation of changing clock.
However, it does not work with PSoC4S +.

PSoC4S : CY8CKIT-149

PSoC4S+ : CY8CKIT-145

Both of them have the same project contents and input the external clock to P0[6].

Is there any necessary steps to switch clocks?


Attach a simple project.
Please could you confirm it?

Regards,

0 Likes
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello Masashi,

I tried progrmming both PSoC 4000S and PSoC 4100S PLUS with the project provided by you.

I was able to recreated the issue mentioned by you.

The Extclk switching was working fine with the PSoC 4000S device. However, it is not working with 4000S plus device.

I will update on this thread once the issue is resolved.

Best Regards

Ekta

0 Likes
lock attach
Attachments are accessible only for community members.
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello Masashi-San,

Please use the following code for switching clock to EXTCLK in case of PSoC 4100S Plus

#include "project.h"

int main(void)

{

    CY_SET_REG32((void *)(CYREG_HSIOM_PORT_SEL0), (CYVAL_HSIOM_IO0_SEL_ACT_0 << (6 * 4))); /* HSIOM_IO0_SEL_ACT_0 */

    CY_SET_REG32((void *)(CYREG_GPIO_PRT0_PC), (LED_DM_DIG_HIZ << (6 * 3))); /* High Impedance Digital */

    /* 6 is a pin number, 3 and 4 are bitfield widths */

    CySysClkWriteHfclkDirect(CY_SYS_CLK_HFCLK_EXTCLK);

    for(;;)

    {

        LED_Write(0);

        CyDelay(500);

        LED_Write(1);

        CyDelay(500);

    }

}

I have attached the sample project below.

Best Regards

Ekta

0 Likes