1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

MATLAB/Simulink + RTW and generating code for a microcontroller

Discussion in 'Embedded' started by argee, Mar 18, 2009.

  1. argee

    argee Guest

    Hi all,

    I seem to be stuck with what seemed a very simple task. I want to
    convert a Simulink model with one input and one output to a C program
    that I could run on a microcontroller (any microcontroller, not only
    those TI chips on those development boards). It should be able to read
    some data from a ADC, do some processing (as defined by the model --
    amplify/multiply by 2 is a fine starting point) and send the result to a
    DAC. I have no problem generating the "middle part", i.e. processing,
    but I have no idea how to interface to ADC and DAC. What I need are some
    "read_inputs()" and "write_outputs()" functions into which I could add
    my own code and those functions would be called automatically by the
    generated code when needed.
    I was checking the C-API for Interfacing with Signals and Parameters and
    External mode communication channels, but these don't seem to be able
    to do the job. I was also reading on the execution models and browsing
    the Embedded Coder documentation, but to no avail. So, is there a simple
    way to that? And is there some sort of a cookbook available?

    Many thanks!

    argee, Mar 18, 2009
    1. Advertisements

  2. argee

    argee Guest

    Well, the entire university is on academic licences, so I really don't
    think we'll be getting any free training (except from our own
    in-university support center which doesn't do RTW). Especially since
    we're in what MathWorks probably considers a third-world country. :/

    And, besides, if I'm not able to figure something like this for myself
    (with a few pointers, hopefully), then either something's amiss with my
    engineering skills or MATLAB's help.

    So, any pointers, links, ...?

    argee, Mar 19, 2009
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.