DAC0 pin from Arduino DUE is not working becouse of 12 bits settings on SImulink

16 ビュー (過去 30 日間)
Daniel Puentes
Daniel Puentes 2024 年 3 月 19 日
コメント済み: Daniel Puentes 2024 年 3 月 30 日 21:54
Hi,
I'm programming an Arduino Due on Simulink, I wanted to generete a 12 bits signal from DAC1 pin.
When I tried this solution, it worked with the DAC1 pin, but my DAC0 pin stoped working and i only get 0V signal from this pin. Before implementing this code DAC0 was working perfectly.
I guess this pin is not broken, becouse I did a reset with Arduino ide and the pin started to generate a 3,29V signal, but, when I gave another code I got 0V signal again.
An important thing is that I tried to delete the code from the link and put preset code, but the DAC1 pin is still working with 12 bits.
Does anyone know how I can fix this problem or I have to give up to lost DAC0?

回答 (1 件)

Debadipto
Debadipto 2024 年 3 月 28 日 7:47
After reviewing the code from the other post, it seems to me the DAC0 issue might stem from an incorrect configuration of the channelFlag parameter. Notice that the code requires channelFlag to be zero for DAC0 to output a value. I recommend adding serial print statements to your code to debug the value of channelFlag and value before they are used in the analogWrite function. This can help confirm if the function is receiving the expected inputs.
  1 件のコメント
Daniel Puentes
Daniel Puentes 2024 年 3 月 30 日 21:54
Could you tell me how I do that? Programming is not my best and really I don't understand the code completly

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeArduino Hardware についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by