Page 1 of 1

Need Help with SPI1

Posted: Tue Nov 28, 2017 5:24 pm
by ep.hobbyiest
Hi,
I am using STM32F103c8t6 and NRF24L01 rf module.
I am using PA4, PA5, PA6, PA7 pins for SPI.(PA4 - Chip Select).

I am refering code but in that code Software SPI was implemented.
While using code in RX mode it is getting stuck some where. Not able to communicate properly.
Here is PIN Configuration i am using

Code: Select all

#define NRF_PORT_CSN            GPIOA
#define NRF_PORT_SCK            GPIOA
#define NRF_PORT_MOSI           GPIOA
#define NRF_PORT_MISO           GPIOA
#define NRF_PORT_IRQ            GPIOB
#define NRF_PORT_CE            GPIOB

#define NRF_PIN_CSN             4
#define NRF_PIN_SCK             5
#define NRF_PIN_MISO            6
#define NRF_PIN_MOSI            7
#define NRF_PIN_IRQ             1
#define NRF_PIN_CE              0


Here is code i am using.
https://github.com/devstm32/nrf24l01

I think problem is while reading SPI register but not able to figure out exact problem.

Re: Need Help with SPI1

Posted: Tue Nov 28, 2017 7:01 pm
by Giovanni
Are the pin assignable to SPI1? not all pins can be used, the table is on the Data Sheet.

Giovanni

Re: Need Help with SPI1

Posted: Tue Nov 28, 2017 7:21 pm
by ep.hobbyiest
Yes. SPI1 is functional. I could read and write data to NRF24L01 module.
And also i took reference from SPI example.

I have narrowwed down the problem. I am facing problem while Receiving only. I think i use spisend and spireceive one after another then this problem comes.

Re: Need Help with SPI1

Posted: Tue Nov 28, 2017 7:56 pm
by Giovanni
Do you perform select/unselect between operations? you may need to add time between an unselect and the next select, the driver does not do that for you.

If in doubt use a logic analyzer and look what's going on.

Giovanni