SPI configuration

All about Sub-20 Multi Interface USB Adapter USB to I2C, SPI, GPIO, RS232, RS485, Ir, LCD

Moderator: serg

Post Reply
dsp28x
Posts: 5
Joined: Tue Jul 06, 2010 8:00 am

SPI configuration

Post 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

serg
Posts: 143
Joined: Mon Aug 31, 2009 9:17 pm

Re: SPI configuration

Post 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

dsp28x
Posts: 5
Joined: Tue Jul 06, 2010 8:00 am

Re: SPI configuration

Post by dsp28x »

Thanks serg, it helps :) .

Regards
dsp28x

Post Reply