Component module WAIT1

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Component module WAIT1

590 Views
arnaldogomes
Contributor III

Hi Erich!

I'm using your component module WAIT1 at KL25Z. When I use with "Internal Oscillator" works well, but when is configured for External Crystal the delays are divided by 2. Can you help me?

Note: Component Inspector - Cpu 

System oscillator 0  --> Enable

MCG mode              --> PEE

MCG output[MHz]    --> 96.0

Core clock                --> 48.0

Bus clock                  --> 24.0

Regards,

Arnaldo

Labels (1)
Tags (1)
0 Kudos
Reply
1 Reply

441 Views
BlackNight
NXP Employee
NXP Employee

Hi Arnaldo,

For me, the delay time are around 10 ms both for the internal clock and the clock configuration you have. Keep in mind that because it is using a number of nops to wait, the timing is in the ~10% range.

Below is the code for toggling the blue LED (PTD1) on the FRDM-KL25Z:

Default internal clock:

pastedImage_0.png

With your clock settings:

pastedImage_1.png

The number of wait cycles is based on the core clock:

  #define WAIT1_INSTR_CLOCK_HZ   CPU_CORE_CLK_HZ /* for Kinetis, use core clock as base for instruction execution */

Which 48MHz in that configuration:

#define CPU_CORE_CLK_HZ             48000000U /* Initial value of the core/system clock frequency in Hz.  */

I know there was an issue with what clock to be used (it used the bus clock instead of the the core clock) in a very old Wait component (about 2 years ago).

Are you really using the latest version from SourceForge (see https://mcuoneclipse.com/2014/10/21/mcuoneclipse-releases-on-sourceforge/ )?

In any case, I have attached my test project so you can compare the code and component version numbers.

I hope this helps,

Erich

PS: I recommend to report issues in the GitHub tracking system here: Issues · ErichStyger/McuOnEclipse_PEx · GitHub

0 Kudos
Reply