Simulation of dsPIC peripheral

Post Reply
aunanshi@yahoo.com
Posts: 5
Joined: Sat Jan 19, 2008 5:42 pm

Simulation of dsPIC peripheral

Post by aunanshi@yahoo.com » Sat Jan 26, 2008 6:13 pm

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

LubinKerhuel
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

Post by LubinKerhuel » Sun Jan 27, 2008 12:21 am

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.
Environment Controller Block
Environment Controller Block
environment_controller.png (458 Bytes) Viewed 3973 times

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests