how to acces different registers with simulink raspberry pi i2c master write

조회 수: 2 (최근 30일)
Hi together i have a project were i want to acces different registers on one i2c slave divice. the device is setting a pwm-frequency. i'm using the simulink block in the raspberrypi hardware supportpackage "i2c master write". if i enable register acces, there is only a fix register adress i can choose. does anybody know ho to acces different registers or how to change the addres of the registers with only one i2c master write block? thanks for you help in advance. i'm using matlab 2017a
regards Fabi

답변 (2개)

Vandana Ravichandran
Vandana Ravichandran 2017년 4월 12일
Refer to the following page on I2C Master Write for Raspberry Pi: https://www.mathworks.com/help/supportpkg/raspberrypi/ref/i2cmasterwrite.html?s_tid=gn_loc_drop
You are correct, you need enable register access, in order to write to a register on the slave device. The register address is set to 0 by default. Under "Slave register access" you need to enter the register address on the slave device that you need to write to. Please refer the sequence of steps under "I2C Register Read/Write" section of the following page:

Ali El-Saeed
Ali El-Saeed 2017년 4월 18일
i can't find the i2c blocks in simulink even after installing the latest version of the support package !! i am using matlab 2016a . can anybody help me ?

카테고리

Help CenterFile Exchange에서 Run on Target Hardware에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by