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

spi_interrupt not ocuurs

I am using spi_master.c for spi communication with nRF51822EK.

And i had sent and recieved data packet successfully for 1st time with spi_master_send_recv(). When i sending 2nd packet of data it writes the initial bytes(1st 2 bytes),enables spi interrupt also, but m not getting spi interrupt.

I am using sdk6 and sd7. SPI interrupt priority---3

Parents
  • hi pramithkv,

    i have a similar problem. I made a custom board and am communicating to another chip via SPI, sending 4 bytes at a time. The first 2 bytes are sent out just fine, but the next 2 are always 0. After consulting the nrf51822 product specification and reference manual, it seems that the SPI buffer needs to be reloaded (since buffer can hold just 2 bytes), for which i think an interrupt needs to occur. I am not using the original "spi_master_example" but rather "ble_app_hrs" example which i modified to include SPI communication. From the answers and comments posted on this link devzone.nordicsemi.com/.../ it seems like there is an issue with the timer. Indded, not initializing application timer in the "ble_app_hrs" example resulted in all 4 bytes being sent out on SPI. I didn't manage to figure out exactly how to correctly use the SPI, but for now seems like you might want to check the interrupt/timer initialization.

Reply
  • hi pramithkv,

    i have a similar problem. I made a custom board and am communicating to another chip via SPI, sending 4 bytes at a time. The first 2 bytes are sent out just fine, but the next 2 are always 0. After consulting the nrf51822 product specification and reference manual, it seems that the SPI buffer needs to be reloaded (since buffer can hold just 2 bytes), for which i think an interrupt needs to occur. I am not using the original "spi_master_example" but rather "ble_app_hrs" example which i modified to include SPI communication. From the answers and comments posted on this link devzone.nordicsemi.com/.../ it seems like there is an issue with the timer. Indded, not initializing application timer in the "ble_app_hrs" example resulted in all 4 bytes being sent out on SPI. I didn't manage to figure out exactly how to correctly use the SPI, but for now seems like you might want to check the interrupt/timer initialization.

Children
No Data
Related