2017-07-23 04:57 AM
What is the use of SPI-NSS?
Is it chip select pin or something else?
shall i use external gpio pin for chip select or i can use SPI-NSS?
Please explain.....
Thank you.
2017-07-23 07:47 AM
yes its the slave select
2017-07-23 11:40 PM
Thank you.
SPI-NSS operate automatically?
Or need to operate it by manually (means need to write separate code for it)?
i.e is it inbuilt SPI engine line LPC2148 microcontroller?
Because i want to interface Flash Memory AT45DB041 via SPI and it is not working.
Same thing i did in
LPC2148 microcontroller but in STM32F405 I don't know what happened.
i used HAL_SPI_Transmit
and
HAL_SPI_TransmitReceive
API's.
can you please help me?
Thank you.
2017-07-23 11:54 PM
If you only intend to communicate with one slave in total, then you can use the hardware _NSS pin and have the SPI peripheral manage that pin automatically.
Otherwise you have to bit-bang the NSS (CS) pin(s) manually.
2017-07-24 12:30 AM
Thank you.
how can i send a hex command through HAL_SPI_Transmit
and
HAL_SPI_TransmitReceive
API's.
I want to send following commands,
SPI_Write(0x82);
SPI_Write((UCHAR)((PageId>>7) & 0xFF));
SPI_Write((UCHAR)((PageId<<1)|(ByteId>>8)) & 0xFF);
SPI_Write((UCHAR)(ByteId & 0xFF));
Because there is a character array in above API's.
2017-07-24 05:45 AM
HAL_GPIO_WritePin( SPI2_CS1_GPIO_Port, SPI2_CS1_Pin, GPIO_PIN_RESET );
status = HAL_SPI_TransmitReceive( &hspi2, (uint8_t *)(&txarray), (uint8_t *)(&rxarray), cnt+1, 5); while( hspi2.State == HAL_SPI_STATE_BUSY ) {};HAL_GPIO_WritePin( SPI2_CS1_GPIO_Port, SPI2_CS1_Pin, GPIO_PIN_SET );