2016-02-08 04:18 AM
Good morning.
I have a problem setting the system clock of SPC560EL. I want to use the internal clock, but I cannot. Each time I execute the code, reading the main status register, I see that the SYSCLOCK switch to PPL. I cannot understand why this is the case.In the wizard, the external oscillator bypass is not checked. Is this the correct behaviour?Someone could be so kind to explain me how to configure the micro via wizard so that i don't use external oscillators? The board on which the micro is mounted doesn't have one.Thank you, Ivan #clock-generation-internal2016-02-23 07:39 AM
/**
* @brief RUN0 mode settings.
*/
#if !defined(SPC5_ME_RUN0_MC_BITS) || defined(__DOXYGEN__)
#define SPC5_ME_RUN0_MC_BITS (SPC5_ME_MC_SYSCLK_FMPLL0 | \
SPC5_ME_MC_IRCON | \
SPC5_ME_MC_XOSC0ON | \
SPC5_ME_MC_PLL0ON | \
SPC5_ME_MC_PLL1ON | \
SPC5_ME_MC_FLAON_NORMAL | \
SPC5_ME_MC_MVRON)
#endif
if you want to use IRC ,
/**
* @brief RUN0 mode settings.
*/
#if !defined(SPC5_ME_RUN0_MC_BITS) || defined(__DOXYGEN__)
#define SPC5_ME_RUN0_MC_BITS (SPC5_ME_MC_SYSCLK_IRC | \
SPC5_ME_MC_IRCON | \
SPC5_ME_MC_XOSC0ON | \
SPC5_ME_MC_PLL0ON | \
SPC5_ME_MC_PLL1ON | \
SPC5_ME_MC_FLAON_NORMAL | \
SPC5_ME_MC_MVRON)
#endif
in the wizard, the oscillator bypass is checked and set this register :
#if defined(SPC5_OSC_BYPASS)
/* If the board is equipped with an oscillator instead of a crystal then the
bypass must be activated.*/
CGM.OSC_CTL.B.OSCBYP = TRUE;
#endif /* SPC5_OSC_BYPASS */
if you use internal clock .. do not enable Oscillator bypass.
Best regards
Erwan
2016-02-29 06:45 AM
Hello Erwan,
thank you for the reply. Following your exmple I managed to chang the clock and use internal oscillator. Regards, Ivan