Thread Subject: Using custom code in the C2000 target

Subject: Using custom code in the C2000 target

From: Kevin

Date: 8 Jan, 2008 10:25:05

Message: 1 of 4

Hello,

I have to use the C2000 target for a project. I *think* I am
getting used to the simpler blocks, but now I would like to
re-use some code I wrote on CCS before. This code should be
called on a timer interrupt.
How exactly can I do it? I've read that you can do it in
Real Time Workshop, but I am still new to all this I don't
know if I can use both RTW and the C2000 target together. Is
it possible?

Subject: Using custom code in the C2000 target

From: Matt Jardin

Date: 8 Jan, 2008 14:11:00

Message: 2 of 4

Are you asking if you can integrate previously-written C-code with your new
project? If so, you can do this using a variety of legacy code mechanisms.
Start with Legacy Code Tool, which you can read about in the help doc:
>> doc legacy_code

"Kevin " <kedecuyp@mathworks.com> wrote in message
news:flvj21$41c$1@fred.mathworks.com...
> Hello,
>
> I have to use the C2000 target for a project. I *think* I am
> getting used to the simpler blocks, but now I would like to
> re-use some code I wrote on CCS before. This code should be
> called on a timer interrupt.
> How exactly can I do it? I've read that you can do it in
> Real Time Workshop, but I am still new to all this I don't
> know if I can use both RTW and the C2000 target together. Is
> it possible?

Subject: Using custom code in the C2000 target

From: Kevin

Date: 8 Jan, 2008 15:34:02

Message: 3 of 4

Thank you for your answer

So, if I have a piece of code written in C for the C2000
that I want to call on an interrupt:
- I convert the code to a s-function using legacy_code
- I make a mdl file with the "hardware interrupt" component
and the "RTW s-function" component

Am I right?



"Matt Jardin" <mjardin@mathworks.com> wrote in message
<fm009m$fgr$1@fred.mathworks.com>...
> Are you asking if you can integrate previously-written
C-code with your new
> project? If so, you can do this using a variety of legacy
code mechanisms.
> Start with Legacy Code Tool, which you can read about in
the help doc:
> >> doc legacy_code

Subject: Using custom code in the C2000 target

From: Praetorian

Date: 8 Jan, 2008 16:37:16

Message: 4 of 4

On Jan 8, 8:34 am, "Kevin " <kedec...@mathworks.com> wrote:
> Thank you for your answer
>
> So, if I have a piece of code written in C for the C2000
> that I want to call on an interrupt:
> - I convert the code to a s-function using legacy_code
> - I make a mdl file with the "hardware interrupt" component
> and the "RTW s-function" component
>
> Am I right?
>

Absolutely, that is the right way to go about it.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
c2000 Kevin 8 Jan, 2008 05:30:07
rtw Kevin 8 Jan, 2008 05:30:07
custom code Kevin 8 Jan, 2008 05:30:07
rssFeed for this Thread

Contact us at files@mathworks.com