cancel
Showing results for 
Search instead for 
Did you mean: 

SPI1 & SPI3 & JTAG

pant
Associate II
Posted on April 17, 2015 at 02:51

Hello!

I am fairly new to the specific Microcontrollers and of course to this forum, so first of all hello to everyone!

Even though my question might be simple enough for most of you, I would like to express you my thoughts about an issue I am facing and if you could please tell me whether I am correct or I am missing something :D.

I am using for an application the STM32F407 and what I would like to do, is use simultaneously SPIs 1,2 and 3 in order to communicate with 3 external ADCs. However I find some difficulty, while trying to think how I am going to debug this code, since the SS pins of SPIs 1 and 3 are sharing the exact same pins.

What I mean by that, is that SPI1_NSS and SPI3_NSS share their pins with JTDI and one solution would be to remap those 2 to some other pins, however according to the datasheet, the other pin at which we could remap those to is actually the same and it's PA4.

The only solution that I could think of is to control the slave selection using the SSM bit and ignore the NSS pin. Is that correct, or there is also a hardware solution which I am missing?

Thank you in advance for your help!

Regards,

Pantelis

#stm32f4-spi-jtag
3 REPLIES 3
patrick23
Associate II
Posted on April 17, 2015 at 03:20

Why not use another GPIO as your chip select?

In other words, ignore the hardware NSS pins, configure any other pin as GPIO Output PushPull, then toggle as needed to select the slave.
Posted on April 17, 2015 at 04:07

This is one of those times the ST engineers have be scratching my head over the poor choices made. The SS implementation is also somewhat broken, manually controlling the pin as a GPIO is the way to go.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
pant
Associate II
Posted on April 17, 2015 at 12:21

Thank you very much both for your answers. Of course... I don't know why I didn't think of that.

I would also like to ask a second question but since it is about a different topic, I wouldn't like to disorientate people, because someone might be interested in it and won't be able to find it! Therefore I 'll make a new post!

Once again thank you very much for your answers!

Have a nice day!