s32ds clock & MCAL Mcu module

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

s32ds clock & MCAL Mcu module

1,845 Views
jwjung
Contributor II

hi, 

 

i wanna enable the PLL, FXOSC, etc.. but the checkbox is disable . so can you guide me to do that?

 

jwjung_0-1753868209633.pngjwjung_0-1753868209633.png

jwjung_1-1753868234661.pngjwjung_1-1753868234661.png

 

0 Kudos
Reply
5 Replies

1,746 Views
jwjung
Contributor II

and i followed the S32K3xxRM.pdf page 963, Reduced speed mode.(Clock configuration)

0 Kudos
Reply

1,822 Views
_Leo_
NXP TechSupport
NXP TechSupport

Thank you for your interest in our products and for contributing to our community.

Could you please let us know which device you are using?

0 Kudos
Reply

1,811 Views
jwjung
Contributor II

thanks for reply leo.

 

chip : NXP S32K312

RTD : SW32K3_RTD4.4_R11-21_3.0.0_DS2303

DS : S32 Design Studio for S32 Platform, Version: 3.5

 

thanks.

0 Kudos
Reply

1,771 Views
_Leo_
NXP TechSupport
NXP TechSupport

Checkboxes are disable, but PLL and FXOSC are enable. Could you please give me more details about what you want to do?

0 Kudos
Reply

1,758 Views
jwjung
Contributor II

i tried to blink the led for 100ms.

 

i write the code like below.(use the reference code of example)

 

void OsIfDelay(uint32 timeoutMs) {
uint32 currentTime = 0u;
uint32 endTime = 0u;
uint32 timeoutCount = 0u;
 
currentTime = OsIf_GetCounter(OSIF_COUNTER_DUMMY);
 
timeoutCount = OsIf_MicrosToTicks(timeoutMs * 1000u, OSIF_COUNTER_DUMMY);
 
while (1) {
// endTime - (start count + currentCount ) = 0
endTime += OsIf_GetElapsed(&currentTime, OSIF_COUNTER_DUMMY);
if (timeoutCount <= endTime) {
break;
}
}
}
 
int main(void) {
/* Write your code here */
/* Initialize the Os */
OsIf_Init(NULL_PTR);
 
/* Initialize the Mcu */
Mcu_Init(&Mcu_Config);
 
/* Initialize the Mcu Clock*/
Mcu_InitClock(McuClockSettingConfig_0);
 
while ( MCU_PLL_LOCKED != Mcu_GetPllStatus() )
    {
        /* Busy wait until the System PLL is locked */
    }
 
Mcu_DistributePllClock();
 
Mcu_SetMode(McuModeSettingConf_0);
 
// timing set
Port_Init(NULL_PTR);
 
// deactive WatchDog
Dio_WriteChannel(DioConf_DioChannel_WDT_EN,STD_HIGH);
 
 
// TURN LED ON/OFF, period : 100ms
while (1) {
 
Dio_WriteChannel(DioConf_DioChannel_LED1,STD_LOW);
OsIfDelay(100);
Dio_WriteChannel(DioConf_DioChannel_LED1,STD_HIGH);
OsIfDelay(100);
}
 
return 0;
 
}
 
but actually LED blink every 250ms so i think the clock initialize is wrong.
 
Can you help me make it work?
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2143433%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Es32ds%20clock%20%26amp%3B%20MCAL%20Mcu%20module%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2143433%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ehi%2C%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ei%20wanna%20enable%20the%20PLL%2C%20FXOSC%2C%20etc..%20but%20the%20checkbox%20is%20disable%20.%20so%20can%20you%20guide%20me%20to%20do%20that%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22jwjung_0-1753868209633.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jwjung_0-1753868209633.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F350224iD15472AE0F8E9B61%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22jwjung_0-1753868209633.png%22%20alt%3D%22jwjung_0-1753868209633.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Ejwjung_0-1753868209633.png%3C%2Fspan%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22jwjung_1-1753868234661.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jwjung_1-1753868234661.png%22%20style%3D%22width%3A%20387px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F350226iC047B61ACC8B6252%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22jwjung_1-1753868234661.png%22%20alt%3D%22jwjung_1-1753868234661.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Ejwjung_1-1753868234661.png%3C%2Fspan%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2146479%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32ds%20clock%20%26amp%3B%20MCAL%20Mcu%20module%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2146479%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Eand%20i%20followed%20the%20S32K3xxRM.pdf%20page%20963%2C%20Reduced%20speed%20mode.(Clock%20configuration)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2146443%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32ds%20clock%20%26amp%3B%20MCAL%20Mcu%20module%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2146443%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ei%20tried%20to%20blink%20the%20led%20for%20100ms.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ei%20write%20the%20code%20like%20below.(use%20the%20reference%20code%20of%20example)%3C%2FP%3E%3CBR%20%2F%3E%3CDIV%3Evoid%20OsIfDelay(uint32%20timeoutMs)%20%7B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Euint32%20currentTime%20%3D%200u%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Euint32%20endTime%20%3D%200u%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Euint32%20timeoutCount%20%3D%200u%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EcurrentTime%20%3D%20OsIf_GetCounter(OSIF_COUNTER_DUMMY)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EtimeoutCount%20%3D%20OsIf_MicrosToTicks(timeoutMs%20*%201000u%2C%20OSIF_COUNTER_DUMMY)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Ewhile%20(1)%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F%2F%20endTime%20-%20(start%20count%20%2B%20currentCount%20)%20%3D%200%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EendTime%20%2B%3D%20OsIf_GetElapsed(%26amp%3BcurrentTime%2C%20OSIF_COUNTER_DUMMY)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Eif%20(timeoutCount%20%26lt%3B%3D%20endTime)%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Ebreak%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%7D%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CDIV%3Eint%20main(void)%20%7B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F*%20Write%20your%20code%20here%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F*%20Initialize%20the%20Os%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EOsIf_Init(NULL_PTR)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F*%20Initialize%20the%20Mcu%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EMcu_Init(%26amp%3BMcu_Config)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F*%20Initialize%20the%20Mcu%20Clock*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EMcu_InitClock(McuClockSettingConfig_0)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Ewhile%20(%20MCU_PLL_LOCKED%20!%3D%20Mcu_GetPllStatus()%20)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%2F*%20Busy%20wait%20until%20the%20System%20PLL%20is%20locked%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EMcu_DistributePllClock()%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EMcu_SetMode(McuModeSettingConf_0)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F%2F%20timing%20set%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EPort_Init(NULL_PTR)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F%2F%20deactive%20WatchDog%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EDio_WriteChannel(DioConf_DioChannel_WDT_EN%2CSTD_HIGH)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F%2F%20TURN%20LED%20ON%2FOFF%2C%20period%20%3A%20100ms%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Ewhile%20(1)%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EDio_WriteChannel(DioConf_DioChannel_LED1%2CSTD_LOW)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EOsIfDelay(100)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EDio_WriteChannel(DioConf_DioChannel_LED1%2CSTD_HIGH)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EOsIfDelay(100)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Ereturn%200%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%7D%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3Ebut%20actually%20LED%20blink%20every%20250ms%20so%20i%20think%20the%20clock%20initialize%20is%20wrong.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3ECan%20you%20help%20me%20make%20it%20work%3F%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2146415%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32ds%20clock%20%26amp%3B%20MCAL%20Mcu%20module%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2146415%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ECheckboxes%20are%20disable%2C%20but%20PLL%20and%20FXOSC%20are%20enable.%20Could%20you%20please%20give%20me%20more%20details%20about%20what%20you%20want%20to%20do%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2143960%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32ds%20clock%20%26amp%3B%20MCAL%20Mcu%20module%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2143960%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ethanks%20for%20reply%20leo.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Echip%20%3A%20NXP%20S32K312%3C%2FP%3E%3CP%3ERTD%20%3A%20SW32K3_RTD4.4_R11-21_3.0.0_DS2303%3C%2FP%3E%3CP%3EDS%20%3A%20S32%20Design%20Studio%20for%20S32%20Platform%2C%26nbsp%3BVersion%3A%203.5%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ethanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2143936%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32ds%20clock%20%26amp%3B%20MCAL%20Mcu%20module%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2143936%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThank%20you%20for%20your%20interest%20in%20our%20products%20and%20for%20contributing%20to%20our%20community.%3C%2FP%3E%0A%3CP%3ECould%20you%20please%20let%20us%20know%20which%20device%20you%20are%20using%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E