DEVKIT-S12ZVC SENTTX bus clock rate

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

DEVKIT-S12ZVC SENTTX bus clock rate

2,153 次查看
UmaMaheswaraReddy
Contributor IV

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?

UmaMaheswaraReddy_0-1726076959882.png

 

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

0 项奖励
回复
9 回复数

2,120 次查看
lama
NXP TechSupport
NXP TechSupport

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.

lama_0-1726217081388.png

 

lama_1-1726217081392.png

 

 

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

https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVM-clock-module-and-PLL-configuration-S...

https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVL-PLL-configuration-with-CPMUPLL/m-p/8...

 

Best regards,

Ladislav

0 项奖励
回复

2,109 次查看
UmaMaheswaraReddy
Contributor IV

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.

UmaMaheswaraReddy_0-1726222835784.png

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?

0 项奖励
回复

2,066 次查看
lama
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复

2,042 次查看
UmaMaheswaraReddy
Contributor IV

Hi Ladislav,

 

We are using S12ZVC-DEVKIT. As per the S12ZVC-DEVKIT schematic we are using external 8MZ oscillator.

 

UmaMaheswaraReddy_0-1726643050206.png

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.

UmaMaheswaraReddy_1-1726643234018.pngUmaMaheswaraReddy_2-1726643253989.png

 

 

/********************************************/
/************ 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
0 项奖励
回复

2,037 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @UmaMaheswaraReddy,

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.

danielmartynek_1-1726655289653.png

 

danielmartynek_0-1726655084212.png

 

 

Regards,

Daniel

0 项奖励
回复

2,033 次查看
UmaMaheswaraReddy
Contributor IV

Hi Daniel,

Same settings I used as per the PLL calculator.

UmaMaheswaraReddy_0-1726657578978.png

 

Immediately after executing statement "CPMUOSC_OSCE = 1;" software entering unknown state.

 

UmaMaheswaraReddy_1-1726657646965.png

 

0 项奖励
回复

2,003 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复

1,942 次查看
UmaMaheswaraReddy
Contributor IV

Hi,

Sorry for the delay in response.

 

I am using S12ZVC-DEVKIT. I selected micro as S12ZVCA192.

Same issue with the attached software also.

 

UmaMaheswaraReddy_0-1727083872985.png

UmaMaheswaraReddy_1-1727083890174.png

 

标记 (1)
0 项奖励
回复

1,892 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @UmaMaheswaraReddy,

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:

https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Interrupt-catcher-for-unexpected-inter...

Is there a machine exception rising?

 

Regards,

Daniel

0 项奖励
回复