Forums » Req. Waijung 1 Tech Support »
Reading i2c from sensor
Added by Coskun A. over 3 years ago
Hi,
I want to read bldc motor position with magnetic encoder on board stm32f429zi. I am using as5600 as a encoder. While reading position i can see my data on docklight program. But i couldn't see on my matlab scope.
docklight.PNG | View docklight.PNG | 32.9 KB | |||
i2c_encoder.slx | i2c_encoder.slx | 30.1 KB | |||
i2c_encoder_rx.slx | i2c_encoder_rx.slx | 23.3 KB | |||
AS5600_DS000365_5-00.pdf | View AS5600_DS000365_5-00.pdf | 811 KB |
Replies (4)
RE: Reading i2c from sensor - Added by Chandima Jayaneththi (จันทิมา) about 3 years ago
Hello Coskun,
Thank you for using Waijung blockset.
The issue is in the host serial receiving model file (i2c_encoder_rx.slx). I think you have mistakenly used a stm32F4 target specific UART Rx block in the host serial receiving model file.
If you remove that block and use a Host Serial Rx block, you can display the data on the scope.
I hope you can resolve this issue with this solution. If not please let us know.
Thank you.
RE: Reading i2c from sensor - Added by Coskun A. about 3 years ago
Hi,
Thank you for reply. This my mistake using uart rx block but when i change it to host serial rx block matlab give me fatal error. I tried many times but never changed.
Host.PNG | View Host.PNG | 44.3 KB | |||
error.PNG | View error.PNG | 171 KB | |||
i2c_encoder_rx.slx | i2c_encoder_rx.slx | 20.3 KB |
RE: Reading i2c from sensor - Added by Chandima Jayaneththi (จันทิมา) about 3 years ago
Hello Coskun,
Could you please replace the Waijung source files with the attached source files in amg_usbconverter_n_patch.zip file. Please refer following instructions.
- Close Matlab and Simulink if you've already opened.
- Extract amg_usbconverter_n_patch.zip
- Copy all the mex files and replace them in the \waijung_17_03a\src\blocks
RE: Reading i2c from sensor - Added by Coskun A. about 3 years ago
Hi,
Thanks for reply i did what you said. First i couldn't succes but now i don't get error for now. Thank you for helping to find answer.