Unable to find the information related to SENT clock , SENTTX bus clock rate.
Do we have any external oscillator in the DEVKIT-S12ZVC Evaluation board? How much internal oscillator clock frequency (Fosc) in the Eval board?
What is the SENTTX bus clock rate with below PLL configuration?
In the example code PLL is initialized with below configuration.
/********************************************/
/************ PLL INITIALIZATION ************/
/********************************************/
CPMUCLKS_PLLSEL = 1; //FBUS = FPLL/2. FBUS = 32MHz,
CPMUREFDIV_REFFRQ = 1; //Reference clock between 2MHZ and 6MHZ.
CPMUREFDIV_REFDIV = 0x1; //FREF=8/(1+1) = 4MHZ
CPMUSYNR_VCOFRQ = 0x1; //FVCO is between 48MHZ and 80MHZ
CPMUSYNR_SYNDIV = 0x7; //FVCO = 2xFREFx(SYNDIV+1) = FVCO = 2x4x(7+1) = 64MHZ
CPMUPOSTDIV_POSTDIV = 0x0;//FPLL = FVCO/(POSTDIV+1). FPLL = 64MHZ/(0+1) FPLL = 64MHz
CPMUOSC_OSCE = 1; //External oscillator enable. 8MHZ. FREF=FOSC/(REFDIV+1)
while(!CPMUIFLG_LOCK){} // Wait for LOCK.
CPMUIFLG = 0xFF; // clear CMPMU flags
Hi,
The MCU can be clocked for either internal or external oscilátor. The internal oscilátor is 1MHz in this devices family and i tis default configuration after reset. The default bus clock is 6.25MHz but you can change it by PLL setup.
PLL calculator.. https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MagniV-PLL-Calculator/ta-p/1104351
Examples…
Chapter 8.7.3 Application Information for PLL and Oscillator Startup in the reference manual
Best regards,
Ladislav
Hi Ladislav,
Thank you for the PLL info.
Below PLL code is from NXP example code (DEVKIT S12ZVC). As per below code bus clock is set to 32MHZ (FBUS = FPLL/2 = 64MHZ/2 = 32MHZ) correct?
SENT TX bus clock is nothing but bus clock (FBUS) correct?
/********************************************/
/************ PLL INITIALIZATION ************/
/********************************************/
CPMUCLKS_PLLSEL = 1; //FBUS = FPLL/2. FBUS = 32MHz,
CPMUREFDIV_REFFRQ = 1; //Reference clock between 2MHZ and 6MHZ.
CPMUREFDIV_REFDIV = 0x1; //FREF=8/(1+1) = 4MHZ
CPMUSYNR_VCOFRQ = 0x1; //FVCO is between 48MHZ and 80MHZ
CPMUSYNR_SYNDIV = 0x7; //FVCO = 2xFREFx(SYNDIV+1) = FVCO = 2x4x(7+1) = 64MHZ
CPMUPOSTDIV_POSTDIV = 0x0;//FPLL = FVCO/(POSTDIV+1). FPLL = 64MHZ/(0+1) FPLL = 64MHz
CPMUOSC_OSCE = 1; //External oscillator enable. 8MHZ. FREF=FOSC/(REFDIV+1)
while(!CPMUIFLG_LOCK){} // Wait for LOCK.
CPMUIFLG = 0xFF; // clear CMPMU flags
/********************************************/
Our requirement is to set SENT tick rate to 3us (3 microseconds). Is my below understanding correct? If not please let us know how to calculate SENT TX tick rate.
SENT TX tick rate in frequency -> 1/3us-> 333,333.3333333333Hz
SENT TX bus clock = 32MHZ (FBUS)
Our assumption is SENT TX bus clock is nothing but bus clock (FBUS).
SENTTX tick rate = SENTTX bus clock rate / (PRE+1)
PRE+1 = SENT TX bus clock rate/SENT TX tick rate
= 32MHZ/333,333.3333333333HZ
= 96
PRE = 96-1
PRE = 95
If we set PRE to 95 then SENT TX tick rate is set to 3us correct?
Hi,
yes, you are right for given busclk and required tic time.
BTW, I am not going to think about BUSCLK setup because I do not know wheter you use internal or external oscillator and whether you use PEI, PEE or PBE mode.
Best regards,
Ladislav
Hi Ladislav,
We are using S12ZVC-DEVKIT. As per the S12ZVC-DEVKIT schematic we are using external 8MZ oscillator.
Below is the NXP provided sample code. If we flash below code after enabling external oscillator software is entering unknown state. Could you please help us in this? We want to set FBUS 32MHZ clock using PLL.
The BUSCLK can be measured at ECLK (PT7).
If you use the values from the PLL calculator:
https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MagniV-PLL-Calculator/ta-p/1104351
And check the registers after configuration, you should measure 32MHz BUS_CLK at ECLK.
Note that 32MHz is the max. allowed BUS_CLK freq at Tj < 150C.
Regards,
Daniel
Hi Daniel,
Same settings I used as per the PLL calculator.
Immediately after executing statement "CPMUOSC_OSCE = 1;" software entering unknown state.
Hello @UmaMaheswaraReddy,
I just tested the attached project on S12ZVC128 DEVKIT with 8MHz XTAL.
I measure 32MHz at ECLK (PT7).
Can you test it on your side?
Regards,
Daniel
Hi,
Sorry for the delay in response.
I am using S12ZVC-DEVKIT. I selected micro as S12ZVCA192.
Same issue with the attached software also.
What do you see in the registers of the S12ZMMCV1 module when this happens?
Are all the interrupt routines implemented in the project.
Refer to this interrupt catcher:
Is there a machine exception rising?
Regards,
Daniel