Not applicable
Dec 06, 2017
04:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 06, 2017
04:02 AM
Hi,
I would like to change the clock frequency but i don't now what the functions use. Could anyone explain to me how to change the clock frequency ? I use XMC4500 Relax.
Thank you for help
Best regards,
Szymon
I would like to change the clock frequency but i don't now what the functions use. Could anyone explain to me how to change the clock frequency ? I use XMC4500 Relax.
Thank you for help
Best regards,
Szymon
- Tags:
- IFX
3 Replies
Dec 06, 2017
05:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 06, 2017
05:34 AM
Hi Szymon,
check "CLOCK_XMC4" APP. Under "Clock Selection Settings" you should find exactly what you need 😉
Best regards,
Deni
check "CLOCK_XMC4" APP. Under "Clock Selection Settings" you should find exactly what you need 😉
Best regards,
Deni
Not applicable
Dec 06, 2017
06:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 06, 2017
06:01 AM
Hi,
thank you for help but i don't use DAVE APP. This is my code:
In my code I try set frequency to 4MHz but the frequency is still 12MHz.
Do you have any idea what I'm doing wrong?
Best regards
Szymon
thank you for help but i don't use DAVE APP. This is my code:
#include
#include "GPIO.h"
void thedelay (unsigned long delay)
{
while (delay--)
{
__NOP();
}
}
int main(void)
{
uint32_t coreClock_1 = 4000000U; /* Variables to store core clock values */
uint32_t coreClock_2 = 4000000U;
coreClock_1 = SystemCoreClock; /* Store value of predefined SystemCoreClock */
SystemCoreClockUpdate(); /* Update SystemCoreClock according to register settings */
coreClock_2 = SystemCoreClock; /* Store value of calculated SystemCoreClock */
if (coreClock_2 != coreClock_1) { /* Without changing the clock setting both core clock values should be the same */
// Error Handling
}
P1_1_set_mode(OUTPUT_PP_GP);
P1_1_set_driver_strength(STRONG);
P1_0_set_mode(OUTPUT_PP_GP);
P1_0_set_driver_strength(STRONG);
P1_14_set_mode(INPUT);
while(1)
{
P1_1_toggle();
thedelay(12000000);
P1_1_toggle();
thedelay(12000000);
if(P1_14_read()==0){
P1_0_toggle();
thedelay(3000000);
P1_0_toggle();
thedelay(3000000);
}
}
return 0;
}
In my code I try set frequency to 4MHz but the frequency is still 12MHz.
Do you have any idea what I'm doing wrong?
Best regards
Szymon
Dec 08, 2017
01:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 08, 2017
01:10 AM
Hi Szymon,
you didn´t specify exactly which clock do you want to change but for example system frequency you can change with something like:
where variable "divider" is decremented by 1 before configuring. To verify that your system frequency clock really changed use "XMC_SCU_CLOCK_GetSystemClockFrequency()" function.
Best regards,
Deni
you didn´t specify exactly which clock do you want to change but for example system frequency you can change with something like:
XMC_SCU_CLOCK_SetSystemClockDivider(divider);
SystemCoreClockUpdate();
where variable "divider" is decremented by 1 before configuring. To verify that your system frequency clock really changed use "XMC_SCU_CLOCK_GetSystemClockFrequency()" function.
Best regards,
Deni