Hi everyone,
I would like to know how to use and trim the MKE02Z ICS_C3. I was following the example
20.5.1.1 FEI mode initialization routine
and I found this line ICS_C3 = TRIM_VALUE_35.15625kHZ; obviously this must be a define, but what value does it have and how
was it created?
I am not using PE, so please use the registers.
Thank you,
Neil
Hello Neil.
Which IDE do you use ?
You can check the header file after you create one project .
For example , in KDS IDE, you can directly use like this ICS_C3 , for it have define it in the MKE02Z2.h file :
If i misunderstand your meaning , please tell me ,thank !
Hope it helps
Alice
Hi Alice,
I am using KDS 3.0 with KSDK 1.3.0
My include "MKE02Z2.h"
The example is in the : KE02 Sub-Family Reference Manual pdf.
In the example in the manual they have the line ICS_C3 = TRIM_VALUE_35.15625kHZ;
TRIM_VALUE_35.15625kHZ has to be a define, for example
#define TRIM_VALUE_35.15625kHZ 0x45
My question is, how did they calculated the trim value?
Regards,
Neil
Hello Neil,
For the example of RM, in my opinion, the trim value is not calculated , it is provide
by the data sheet , from the ke02 data sheet , we can see that :
And we need not configure the register of ICS_C3, for one chip , the data has trimmed by factory .
Hope it helps
Alice
Hi Alice,
I did find that reference data sheet and see that the trim is 31.25, but I believe that trim value is from factory.
If you look at the following example from KE02 Sub Family Reference Value:
20.5.1 Initializing FEI mode
The following code segment demonstrates setting ICS to FEI mode.
Example: 20.5.1.1 FEI mode initialization routine
/* the following code segment demonstrates setting ICS to FEI mode generating 36MHz bus*/
ICS_C2 = 0x00; /*BDIV=0, no prescalar
ICS_C1 = 0x04; /* internal reference clock to FLL */
ICS_C3 = TRIM_VALUE_35.15625KHZ; /* FLL output 36MHz */
What is the formula or how do they calculate the 36MHz bus clock?
Hello Neil,
This demo is a lite version , so it default the register of SIM_BUSDIV -> BUSDIV is 0,
so the bus clock is the same as ICSOUTCLK , for the BDIV =0, so the ICSOUTCLK is the
same as FLL output 36MHZ.
Of course in you code ,you need configure the register "SIM_BUSDIV" .
Hope it helps
Alice
Hello Alice, how are you?
I have the same question as Neil and Ivan, running on the same board, with the same IDE.
I'll try to explain the problem differently, maybe you can help us!
I want to configure the chip to run at 40Mhz using the internal oscillator only. No external crystal or oscillator.
It seems to me that all I have to do is to change the ICS Internal Reference Clock from 21.25Khz to 39.0625Khz. Is that correct?
Now the tricky question is: what value must I set to ICS_C3[SCTRIM] to achieve the clock of 39.0625Khz? And how do I calculate it?
Thank you!
Hi all,
I have the same question as Neil, that seems unanswered.
What is and how to calculate the value of TRIM_VALUE_35.15625KHZ?
In other words: how to calculate the trim value that goes into ICS_C3 and ICS_C4?
If anyone has an answer, please give it in a way we can set those values into registers and not by IDE or JTAG brand dependent.
Thank you.