Using Arduino Due for an ADC in Simulink

Hi everyone,

For a project, I want to use Simulink to design a controller.
I need to use the Arduino board to supply voltage to the circuit and also be able to see the output result in Simulink.
For now I've just simply connected the DAC0 to pin 4 on the board and wish to see the same sine wave on the scope.
The output of the DAC is the desired sine wave as I checked with an oscilloscope so the problem must be with reading the signal.
Can anyone point me in the direction of what I've done wrong?

Thanks in advance.

Mersh:
For a project, I want to use Simulink to design a controller.

Why ?

Mersh:
I need to use the Arduino board to supply voltage to the circuit

To power what circuit ?

Mersh:
For now I've just simply connected the DAC0 to pin 4 on the board

DAC0 outputs between 1/6 * 3.3V and 5/6 * 3.3V. Pin 4 of arduino DUE is NOT an analog pin !!!!

ard_newbie:
Why ?

I was required to do so by my employer.

ard_newbie:
To power what circuit ?

I should have clarified this a bit more.
Any circuit that is needed for identification or just simply showing the step response. Mainly for use in a laboratory and for research purposes. however, the circuit is irrelevant here since I've connected the two pins directly.

ard_newbie:
DAC0 outputs between 1/6 * 3.3V and 5/6 * 3.3V. Pin 4 of arduino DUE is NOT an analog pin !!!!

My bad. By pin 4 I meant the analog input pin 4 (A4) of the board.

I don't know Simulink, search tutorials for arduino DUE, maybe this one could be helpful:

Anyway, for ADC and DAC conversions with a DUE, there are numerous example sketches in this forum, e.g.(reply #10):

https://forum.arduino.cc/index.php?topic=224672.0

Be careful with DAC0 and DAC1 output current, no more than 3 mA or you will burn your DACs: