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

spi with ble in nrf52832

Hi

I am using nrf52832 doing a project and I 'm new to this MCU.

My project concerns sending data from APP via BLE to nrf52832 to config parameters of SPI (data and clock frequency).

I have read example codes : ble_app_uart and spi respectively.

I am wondering if I can just combine these two codes together to get what I want?

And if there's any conflict between uart and spi service?

Should I just add codes in main.c?

Thanks for reading and appreciate for your advice.

Parents
  • Hey masloooo,
    The UART, SPI and TWI peripherals share HW resources. This means that you cannot use UART0 and SPI0 at the same time. You can however use UART0 and SPI1. 

    I suggest you stick to ble_app_uart unless you want to go deep into BLE and create your own service and characteristics. 
    You can add the SPI driver to the ble_uart example and set up the driver configurations in main.c, then you need to create a command line interface to parse the UART strings into SPI driver function calls. 

    Cheers Håkon.

Reply
  • Hey masloooo,
    The UART, SPI and TWI peripherals share HW resources. This means that you cannot use UART0 and SPI0 at the same time. You can however use UART0 and SPI1. 

    I suggest you stick to ble_app_uart unless you want to go deep into BLE and create your own service and characteristics. 
    You can add the SPI driver to the ble_uart example and set up the driver configurations in main.c, then you need to create a command line interface to parse the UART strings into SPI driver function calls. 

    Cheers Håkon.

Children
Related