S32K344 Dio Fast Switch Time?

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

S32K344 Dio Fast Switch Time?

215 Views
RegulusCheng
Contributor III

Hi, Friends

I am using the S32K3X4EVB-T172 board, and I met a problem, I need some help.

Here is the background: I have a slave board that can send position and velocity data through the SPI. However, it also needs an additional digital signal "Sample" to refresh the data buffer (refresh when the signal falls low from high, the high level should keep 216 ns). 

In the demo program of the slave board, it pushes the sample pin to a high level and then pulls it down to a low level with two near commands(demo code is for STM32). so I use a Stateflow chart to set the Dio module input to 1 and then to 0, to finish this process. See in the Picture.

RegulusCheng_0-1727608135465.png

RegulusCheng_1-1727608148708.png

 

 

But I can't detect the peak on the oscilloscope, so I don't know if this signal is created. if the time too tiny to make the signal high?

May oscilloscope can catch fast signals up to about 15ns, and I can catch the SPI SCK signal clearly.

Please help me with my problem, thanks.

 

Regulus.

 

0 Kudos
Reply
1 Reply

156 Views
FlorinCiuca
NXP Employee
NXP Employee

Hello @RegulusCheng 

Thank you for your interest in Model-Based Design Toolbox for S32K3!

My understanding is that for the model to work as expected the value of SamplePin has to be 1 for 216 ns and then it should switch to 0. Based on the current Stateflow implementation, this will not be achieved, due to the way in which Matlab interprets the Stateflow code and how it is further generated into C code. If you try to assign 2 different values on the same variable on the same State action(e.g: entry, during, exit), only the latter will be kept.

More specifically, the Stateflow chart present in the attached project is "seen" as:

FlorinCiuca_1-1728413549584.png

Therefore, no transition on the SamplePin output wil be detected, nor on the A0Pin and A1Pin. 

Assiging those values on different State actions won't work either, since the time period between 2 model StepFunction calls is significantly larger than 216 ns.

You need to implement a mechanism that sends the first value, waits for ~216 ns(or slightly less due to basic instruction execution time) and then sends the second value on the desired variables.

I hope you find this short explanation helpful. Please let me know if I can assist you further.

Best regards,

Florin.

 

0 Kudos
Reply