cancel
Showing results for 
Search instead for 
Did you mean: 

SS pin as SPI master

jodonnell
Associate II
Posted on January 22, 2006 at 10:30

SS pin as SPI master

9 REPLIES 9
jodonnell
Associate II
Posted on January 11, 2006 at 16:50

Can the SS pin be used as an output (CS for the slave) when the SPI is a master? I am never going to be a slave and the datasheet is ambiguous.

Also, delay needed when reading SPI bug still present and is it relevant as a master?

Thanks.

doug2
Associate II
Posted on January 11, 2006 at 17:59

I'm wondering the same thing. From my experimentation, the SS pin must be pulled up, rendering the pin useless when using the SPI as the master.

There must be something I'm not understanding.

shangdawei1
Associate II
Posted on January 12, 2006 at 03:39

http://www.propox.com/products/t_135.html

shangdawei1
Associate II
Posted on January 12, 2006 at 03:41

http://www.propox.com/download/docs/MMstr71xF_sch.pdf

Serial DataFlash memory 32Mb (4MB) - STR71x.SS to DataFlash.CS (BPSI as master, SS can be drived to LOW to select DataFlash)

[ This message was edited by: shangdawei on 12-01-2006 08:14 ]

________________

Attachments :

BPSI_and_DataFlash.JPG : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtPq&d=%2Fa%2F0X0000000aPh%2FpfrbwY_bsqJtzimMBvGmf0WJspQJTKdvwieTgRMgNDM&asPdf=false
rsherry
Associate II
Posted on January 12, 2006 at 12:24

When the SPI is configured as a master, the SS pin must be pulled high (i.e. rendering it useless for your application). You have to use a separate GPIO pin as the CS for your slave device. The last time I worked with the Philips LP ARM7s the SPI worked this way as well...I'm not sure about the Atmel SAM7s.

Best regards,

Ryan.

shangdawei1
Associate II
Posted on January 12, 2006 at 21:26

http://www.propox.com/download/docs/MMstr71xF_sch.pdf

is this sch error ?

rsherry
Associate II
Posted on January 13, 2006 at 11:30

Hello shangdawei,

This schematic does seem to be in error. I don't believe this will work since I have been burned by this same problem myself (twice now...on the STR71x and the Philips LP21xx). For some reason they decided to not free up the !SS pin for GPIO when the device is configured as a Master. ( I assume that all the BSPI pins are treated as a block, so that when you select the Alternate Function AF for the SCLK/MISO/MOSI the SS pin is forced to the Alternate Function as well...which means that for a master it MUST be pulled high).

On page 230 of the STR71x Referfence Manual you can find the description of the !SS pin. The description may be a bit confusion as it states...

'' Slave Select. The !SS input pin is used to select a slave device...''

This part of the description is what causes the confusion I believe, since what they really mean is that when the BSPI is configured as a Slave, then this INPUT pin is used to select the STR71x as a slave SPI device. Based on my experiences, it DOES NOT mean that you can use the pin to select another slave device from an STR71x that is acting as the master (even though thats what the wording sounds like).

It goes on to say that...'' The !SS on the master must be deasserted high''. This is true at all times when the BSPI is configured as a master, otherwise you will have trouble with the BSPI.

Hopefully this helps.

Can any of the Moderators verify my observations?

Best regards,

Ryan.

gnoutsa
Associate
Posted on January 21, 2006 at 13:11

Hi,

that means to Configure the BSPI as Master.

MOSI should be AF ?

MISO ......... AF ?

SCLK .............. AF ?

!SS .............. AF ?

or ?

thx

shangdawei1
Associate II
Posted on January 22, 2006 at 10:30

Quote:

On 21-01-2006 at 17:41, Anonymous wrote:

Hi,

that means to Configure the BSPI as Master.

MOSI should be AF ?

MISO ......... AF ?

SCLK .............. AF ?

!SS .............. AF ?

or ?

thx

yes, i think too