c code and mplab

Create new topics, add your comment, remark, bugs...
Post Reply
arci
Posts: 7
Joined: Thu Apr 19, 2007 11:44 pm

c code and mplab

Post by arci » Wed May 09, 2007 8:55 pm

can we make a project in mplab with c code(s) which are generated in your tool.

Thanks

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Bayonne- France
Contact:

Post by LubinKerhuel » Sun May 13, 2007 2:09 am

I get some C files transferred into MPLAB with the new microchip tool. But Compilation with MPLAB was not successful.

I gave up with the microchip 'Matlab function' since I am a simulink uses and I prefer to add my C code directly into the simulink model ( using the C function block or using the C that can be added directly in the Real Time Workshop configuration dialog box of simulink). Note however that I added C code only once until now.

I never had to debug using MPLAB a model generated with simulink. I have no more erratic peripheral behaviour (like the first time you try to make them work ! ). I concentrate only on the logic, the math and the fixed point optimization problems of my model.

If you can provide one good reason to look further so as to make the microchip tool work with the blockset, I will perhaps do it.

ropeekollee
Posts: 1
Joined: Tue Jan 08, 2008 2:07 pm

doubt in simulink c code import for any other microprocessor

Post by ropeekollee » Sat Jan 12, 2008 7:13 pm

hello sir,

i have created a pwm circuit using simulink and i have generated the c code using RTW in simulink.. now my problem is how to import those codings in any microcontrollers or any dsp processors. i need these c codes for my hardware implementation.. can u suggest me some microcontrollers or any dsp processors which can use those simulink generated c code..


thank u..

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Bayonne- France
Contact:

Re: c code and mplab

Post by LubinKerhuel » Sat Jan 12, 2008 10:52 pm

ropeekollee,

C code generated by simulink can be imported into any microcontrollers or DSP that have a C compiler which can compile "standard C".

Anyway, most microcontrollers (and dsPIC) have an PWM peripheral. In other word, the PWM signal is generated by the internal electronics. You just need to set-up the peripheral. The block Output Capture (OC) or PWM motor generate the C code that set up and configure the peripheral for dsPIC for you if you use a dsPIC.

Post Reply

Who is online

Users browsing this forum: No registered users and 37 guests