This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can't get nRF52 spi master to work.

Hello,

I couldn't understand the predefined header files for the spi, so I'm building the spi code from scratch. 

To build init_spi function, It's clearly mentioned in the datasheet that I have to configure the pins to be used before enable the spim.

So, I did, and no signal from sck pin nor mosi pin.

My questions are: 

Is there any function I need to build and initialize before using any peripheral specially spim, as I'm not using any of the predefined headers?

Do I've to build spi slave to get them work together as the master won't send without a slave to send to, and if so, can both of them initialized and work on the same devkit? 

Any insights will be appreciated, thanks.

  • Are you able to build the SPI Master Example in SDK 16? It's located in <InstallFolder>\examples\peripheral\spi. What are the reasons you're trying to build SPI Master from scratch? Is it because you want to understand it better? If I explain those "predefined header files" to you, can you then use the example in <InstallFolder>\examples\peripheral\spi?

    However, if you would like to build it from scratch, on a low (register) level, I can help you with that.

    I couldn't understand the predefined header files for the spi, so I'm building the spi code from scratch. 

     What, specifically, about the header file do you not understand?

     

    Is there any function I need to build and initialize before using any peripheral specially spim, as I'm not using any of the predefined headers?

     I'll wait to answer this question until I've gotten an answer to the questions above.

    Best regards,

    Simon

  • Thanks for your reply.

    Yes, I'm building it from scratch, on a low level, to understand it better. So, your help wil be really appreciated.

  • It would be nice to know on what level of abstractions you are trying to build the application? Down below I have shown the different layers used in SDK 16:

    Please specify, on what level of abstraction you would like to use. In NordicSnippets, many examples using the registers directly are provided, but unfortunately SPI Master is not there.

    Maybe you could share your application? then I'll get an idea of what you are trying to achieve.

    Best regards,

    Simon

Related