How to Select an Alternate Crystal Frequency when using NXP MBDT in MATLAB

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

How to Select an Alternate Crystal Frequency when using NXP MBDT in MATLAB

549 Views
em2
Contributor I

The MBDT in MATLAB only allows for the selection of two XTAL frequencies of 8 Mhz and 40 Mhz.

We are using a 32 Mhz crystal with an S32K1 processor, how can we change the XTAL frequency in MATLAB/Simulink to 32 MHz?

0 Kudos
2 Replies

488 Views
Arrellano17
Contributor I

Did you have a fix on this issue? I have the same problem with it.

0 Kudos

533 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @em2 

You can use another crystal oscillator with MBDT, but requires more settings and changes to our toolbox to be performed. I don't know which s32K11x or S32K14x you are using because the settings differ a bit. Anyway, when the code is generated, a file is copied from our toolbox, s32k_clock_init.c (the location differs if the board is s32k11x). SO if you want to use another clock configuration, you have to rewrite this file. 

mariuslucianand_0-1619078637376.png

If you change the input code frequency then all the clocks must be adjusted, because the contains you need to respect. Of course, you can do this with the S32DS fro Arm. In our toolbox you can find also the S32DS project for the above file. You can import it and adjust the configuration according to your needs.

mariuslucianand_1-1619078782824.png

Another similar post you can find here https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/Change-of-Crystal-and-Lock-Frequency-Model...

Hope this helps,

Marius

0 Kudos