Page 1 of 1
SPI With Reset Pin
Posted: Wed May 12, 2010 8:57 pm
by Hugoneus
Hi,
I have gotten the MATLAB code to work for SPI communication using MISO, MOSI, SCK & SS0.
But the circuit that I use also needs a Rest pin. I wanted to use SS1 for that purpose. Is that possible? Can you show me a few lines of code to do that?
Re: SPI With Reset Pin
Posted: Wed May 12, 2010 11:21 pm
by serg
Hi Hugoneus,
Even though using the SS1 as a reset signal is probbaly possible, why you don't consider using a GPIO pin instead?
Regards
Re: SPI With Reset Pin
Posted: Thu May 13, 2010 1:59 am
by Hugoneus
Yes, I know that is possible.
But for our product, we are running a single ribbon cable from the SUB-20 SPI port to our board. We don't want to splice that cable to get to one of the GPIO pins.
The only connection we wish to use is the 10-pin SPI connector.
Re: SPI With Reset Pin
Posted: Thu May 13, 2010 4:34 am
by serg
Ok, in this case the following should work for you (I didn't try)
dummy = NET.createArray('System.Byte', nclks )
sub20.SPI_Write( dummy, 1, 13 )
,where
nclks - length of the reset pulse on the SS1 pin in clocks
use sub20.SpiSS_LO for negative reset pulse as a third parameter(instead of 13)
I used the const 13 because the "sub20.SpiSS_HI" definition is missing in the current release of the SUB-20 .NET component,
please refer to the C header file for all numeric constants.
so from the libsub.h:
#define SS_HI 0x0D /* ____/-- - -\__ _ */
Regards