MATLAB/Simulink + RTW and generating code for a microcontroller



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!

RG
.



Relevant Pages

  • Re: MATLAB/Simulink + RTW and generating code for a microcontroller
    ... run on a microcontroller (any microcontroller, not only those TI chips on ... It should be able to read some data from a ADC, ... I have no idea how to interface to ADC and DAC. ...
    (comp.arch.embedded)
  • Re: interfacing 8051 with adc
    ... etc.this analog data is interfaced with the microcontroller with an ... The first step is to select an ADC that suits your task, ... with a SPI interface. ...
    (sci.electronics.design)
  • Re: interfacing 8051 with adc
    ... an adc & an rf transceiver.what are the steps that i have to take to ... interface the ... microcontroller with the adc and the rf transmitter?i am planning to ... There should be some kind of scaling system in between. ...
    (sci.electronics.design)
  • Re: interfacing 8051 with adc
    ... an adc & an rf transceiver.what are the steps that i have to take to ... interface the ... microcontroller with the adc and the rf transmitter?i am planning to ... There should be some kind of scaling system in between. ...
    (sci.electronics.design)
  • Microcontroller; any suggestions?
    ... I am trying to find a suitable microcontroller for a hobby-project. ... For my project I need an Ethernet-connector, one ADC and one DAC. ...
    (sci.electronics.design)