Page 1 of 1

SPI configuration

Posted: Tue Jul 13, 2010 10:19 am
by dsp28x
Hi,
Does sub20 SPI_read and SPI_FIFO_Read have supports in Matlab? Because this 2 function does not work.

% SPI data read
if ~ sub20.SPI_Read(Data, Arr)
break;
end

% SPI FIFO read data
if ~ sub20.FIFO_Read(Data,10,64,10000)
break;
end
There is error all the time.
??? No method 'SPI_Read' with matching signature found for class 'Xdimax.Sub20'.
??? No method 'FIFO_Read' with matching signature found for class 'Xdimax.Sub20'.

Are there any Matlab examples code or how one can use this functions.
Thanks

Re: SPI configuration

Posted: Wed Jul 14, 2010 1:38 am
by serg
Hi,
% SPI data read
if ~ sub20.SPI_Read(Data, Arr)
break;
end
The SPI_Read accepts three arguments. The following call is correct

success = sub20.SPI_Read(Data, 2, sub20.SpiSS_H);
% SPI FIFO read data
if ~ sub20.FIFO_Read(Data,10,64,10000)
break;
end
The same for the FIFO_Read method. It accepts three arguments as well and returns status and number of bytes actually transferred

[success transferred] = sub20.FIFO_Read(Data, 1000, 0 );

See the sub20.net document for more information

Regards

Re: SPI configuration

Posted: Wed Jul 14, 2010 8:24 am
by dsp28x
Thanks serg, it helps :) .

Regards
dsp28x