cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103VCT6 SPI MOSI,MISO,SCK and NSS ?

antonius
Senior
Posted on August 02, 2015 at 02:04

Guys,

Does anyone of you have an experience on SPI1 for STM32F103VCT6 ?

I read one code and trying to understand, why one pin has 2 function ??

Please have a look :

/* Configure SPI1 pins: NSS, SCK, MISO and MOSI */

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7;

GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;

GPIO_Init(GPIOA, &GPIO_InitStructure);

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;

GPIO_Init(GPIOA, &GPIO_InitStructure);

How can I use 1 pins with different function ? NSS / MISO at once ?

Thanks

5 REPLIES 5
Posted on August 02, 2015 at 03:57

The last configuration takes precedence.

PA6 is MISO (Master IN Slave out), on the F1 things that are inputs are configured in IN mode rather than AF mode, and this doesn't interfere with anything as you can always read the pin state.

What you're missing here is an actual configuration for an NSS pin.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
antonius
Senior
Posted on August 02, 2015 at 23:45

I reckon this one is NSS

CSL()    (GPIOB->ODR &= ~(1<<12)) ===>GPIOB pin 12..

What do you reckon about DP83848 pin 40 and 39 ?

Thanks

Posted on August 03, 2015 at 00:41

What do you reckon about DP83848 pin 40 and 39 ?

Suggest you review working software/hardware on a WaveShare board.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
antonius
Senior
Posted on August 07, 2015 at 23:41

If I use STM32CubeMx, is the default code for LwIP already running ''ping'' service ?

or I only can see MAC address but I need to create a function for ''ping'' service ?

Thanks

Posted on August 08, 2015 at 00:47

Just to restate my position, a) I'm not a HAL/Cube advocate, b) the HTTP Webserver examples are easy to test, in that you can connect and see the device in a browser (Firefox, Chrome), c) I think you're at a point where you need to review/test known good hardware/software examples, and leverage that knowledge/understanding against what you've built.

You have too many unknowns in your design, whether it's the cables, connectors, magnetics, PHY, MAC, software, these really aren't things I can solve remotely and with zero cost.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..