필터 지우기
필터 지우기

How to connect Raspberry Pi to DAC MCP 4921 using SPI Simulink blocks?

조회 수: 5 (최근 30일)
Ben Depoorter
Ben Depoorter 2023년 1월 30일
댓글: Sylvain 2023년 2월 16일
I want to set an output voltage with a RaspberryPi with an DAC MCP4921 using Simulink, in particular using the new block "SPI Register Write" available in the latest Simulink version (without writing C code or Matlab code). In this block is required a Register Address where SPI has to write the value from the slave. Can anyone help me?
  댓글 수: 1
Sylvain
Sylvain 2023년 2월 16일
Looking at the datasheet, the write command register is not defined.
Can you try the "SPI Master Transfer" block with a terminator for the output?
You should send the a vector of [2x1] uint8 for the upper half and the lower half.

댓글을 달려면 로그인하십시오.

답변 (1개)

Mark McBroom
Mark McBroom 2023년 2월 5일
Would you want to use the SPI Read/Write/Master blocks to communicate with this external device, similar to this example that uses SPI to communicate with an external EEPROM device?
https://www.mathworks.com/help/supportpkg/raspberrypi/ref/communicating-with-an-eeprom.html

카테고리

Help CenterFile Exchange에서 Installation Setup and Configuration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by