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

Can I use the arduino libray if I implement arduino shiled on nrf52840 preview dk?

Hi DevZone, 

I am going to implement Arduino CAN bus shield on nrf52840 preview DK. I am wondering if I can use the Arduino CAN bus library in the nrf52840 preview DK. As the nrf52840 DK is Arduino compatible, the PIN interface seems matching with arduino board. Could you please give me guidance how to use the Arduino CAN bus library in nrf52840 preview DK? which part of the library I need to modify?

Best regards

  • Hi,

    The nRF52840 PDK kits are hardware compatible with the Arduino Uno Revision 3 standard, making it possible to use 3rd-party shields that are compatible to this standard. It is hardware compatible but your code have to be in C. The Arduino CAN bus library is written in C++.

  • Thanks! Is the nRF52840 PDK compatible with Arduino CAN bus shield at SPI interface? Do I need to modify nRF52840's SPI driver? To my understanding, if arduino CAN bus shiled is applied, nRF52850 will work as a SPI master.

    If so, which example from SDK14.2.0 I can use as the reference code? is it nRF5_SDK_14.2.0_17b948a\examples\peripheral\spi_master_using_nrf_spi_mngr? 

    For CAN bus library, do I have to rewrite the Arduino CAN bus library in C? I am using SEGGER embedded studio IDE. 

  • Yes, you can use SPI interface to communicate with the Arduino CAN bus shield. As you say,  nRF52850 will work as a SPI master if you are using it with the CAN bus shield. The spi_master_using_nrf_spi_mngr example can be used as reference.

    As for the library, you have to rewrite it in C like I said in my previous answer. 

Related