This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28035: MATLAB Simulink/Stateflow Realtime Clock Problem

Part Number: TMS320F28035

Dear Professionals,

I'm using F28035 Piccolo Control Card with Matlab R2017a via Hardware Support Package and Code Generation Tool.  I'm using Control Card for controlling HVAC functions on a Test Bench. It is a combined Simulink model that includes LIN, CAN, GPIO and ADC functions.

I have time issues on my Stateflow Charts. You can find my simple Stateflow chart below. I have 'after(600, sec)' transition, but in a real-world application, Piccolo spends 660 seconds. I have also the same issue when I'm using 50 seconds. Piccolo spends 55 seconds at that time. There is also a time shift can be seen CAN sample times. We set out sample times to 0.2 seconds put when we inspect CAN network over Peak-CAN tool, we have seen sample time varies to 209 to 223 milliseconds.

Regarding these numbers, there is a %10 time error in our example.

How can I fix this issue with MATLAB? Is it related to CPU clock or something else?