MATLAB Answers

Matlab cannot read data from MAX6675 through Arduino

OSCAR BELLON-HERNANDEZ 님이 질문을 제출함. 18 Sep 2019 21:47
I tested a MAX6675 module using "max6675.h" library on Arduino IDE to measure temperature with type K thermocouple. It worked well.
Then I connected Arduino UNO with Arduino Support Package in Matlab to read data from the MAX6675 module.
a=arduino('com4','uno','Libraries','SPI');
And I set SPI object:
max6675=spidev(a,'D10')
This was what command window showed:
Matlab support 01.png
I tested the reading with these commands:
din=zeros(1,2);
dato=writeRead(max6675,din,'uint16')
And the result was:
Matlab support 02.png
It is not possible those values. Temperature in the room is tipically 19°C. The result must be [0 76] or something like that. I used a digital multimeter to test "CS" and "D10" pins and voltage remained in high state while "writeRead" function was executed. It should change from high to low level according to SPI protocol during reading operation on MAX6675.
What am I doing wrong?

  댓글 수: 0

로그인 to comment.

제품


릴리스

R2018b

답변 수: 0


Translated by