Dear Lubin,
Is it possible to view the PWM signals in simulink platform upon "start simulation" ? for example i start simulation in the example
"servo_ADC". Like to see the simulation output before download to the chip.
Any extra thing to add in?
Regards,
Nanshi
Simulation of dsPIC peripheral
-
- Site Admin - Expert
- Posts: 616
- Joined: Wed Mar 07, 2007 11:23 pm
- Location: Bayonne- France
- Contact:
Re: view the PWM signals in simulink platform
Hi Nanshi,
The aim of the dsPIC blockset is not to simulate the behavior of the dsPIC or PIC24 peripheral. Its aim is to automatically generate the C code to configure these peripheral, and to integrate this code into the C code generated by Simulink and the Real Time Workshop Embedded Coder toolbox.
If you need to simulate the behavior of the dsPIC peripheral, you can do it using the standard simulink block library. However, you will probably have to reduce the time step of the model. The PWM peripheral is a good example: The resolution of the dsPIC peripheral Pulse Width is independent from the model time step! A model running on the dsPIC at 1 KHz (model time step = 1ms) could have a physical PWM resolution higher than 1ms!
If you want to simulate and to generate C using the same model, the block Environment Controller from the standard simulink library could be helpful.
The aim of the dsPIC blockset is not to simulate the behavior of the dsPIC or PIC24 peripheral. Its aim is to automatically generate the C code to configure these peripheral, and to integrate this code into the C code generated by Simulink and the Real Time Workshop Embedded Coder toolbox.
If you need to simulate the behavior of the dsPIC peripheral, you can do it using the standard simulink block library. However, you will probably have to reduce the time step of the model. The PWM peripheral is a good example: The resolution of the dsPIC peripheral Pulse Width is independent from the model time step! A model running on the dsPIC at 1 KHz (model time step = 1ms) could have a physical PWM resolution higher than 1ms!
If you want to simulate and to generate C using the same model, the block Environment Controller from the standard simulink library could be helpful.
Who is online
Users browsing this forum: No registered users and 1 guest