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

Not able to see log output in COM port for SPI.

Hello,

I am using NRF51 DK for developing an application. I tried running the default SPI example in the SDK 12.3 which uses the spi and spis example. The location of those examples are SDK ->examples -> peripheral -> spi & spis. When I run these examples in two different boards I can see the led blinking showing that the spi transfer is completed but when I connect my COM port to Putty software I am not seeing any output in the log. I want to connect nRF51822 boards using SPI but I cannot figure out if they are working or not without the log. If you can please let me know how do I make the log work for this specific example.

Thank You.

Parents
  • By default, the logger module is not enabled in the examples. You need to set the following define in sdk_config.h:

    #define NRF_LOG_ENABLED 1

    Hein said:
    Not sure about the 51, but in the 52 you can not run the SPI0 and UART0 at the same time, are they both configured for instance 0 ?

    This is not correct, UART does not share instance with other serial devices. Only SPI/SPIM/SPIS/TWI/TWIM/TWIS share base address.

  • Unless you are using the SD Card/FatFS library, I would recommend that you control SS pin manually, rather than modifying the driver as suggested in the link.

    You cannot transmitt data from more than one device at a time on a single bus, then you need to setup multiple SPI instances. nRF51 support two SPI master instances. 

    The simples solution would be to configure the transmitter as a SPI master device and the 4 others as SPI slave. You can then set SS pin manually for each device and transmitt/receive from that device. Then move to the next device.

  • So for changing the SS pin manually do I not do the changes in the nrf_drv_spi.h and nrf_drv_spi.c file and what other changes do I have to do for it to work. Also, when 4 slaves are transmitting how do I manage the timing because they cannot transmit simultaneously right. Is there a way to know whether the other slave is currently using the SPI pin or not?

    Thank You.

Reply Children
No Data
Related