FORUM TOPIC · READ ONLY
Simulation of dsPIC peripheral
Simulation of dsPIC peripheral
Forum : Request for new functions / Peripheral / Chip support
2 message(s) · archive en lecture seule
Dear Lubin,
Is it possible to view the PWM signals in simulink platform :roll: 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
Is it possible to view the PWM signals in simulink platform :roll: 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
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.