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

What is the inherent nRF52840 sample rate and how do you change it?

Hello,

I'm working on a project and we're using the nRF2840 to get data from a BNO080 IMU. 

Someone already wrote arduino code which works. How does one change the sample rate of the nRF2840? Looked at the datasheet/documentation packet and I couldn't find anything related to sample rate (used F-search). 

https://www.mouser.com/pdfdocs/Nordic_nRF52840-DK_UG.pdf

Thanks,

Maurie (also new to this)

Parents
  • Hi Maurie,

    Can you specify which protocol are you using to communicate with the BNO080? It seems the BNO080 can communicate with a host over various serial interfaces : SPI, I2C (also called TWI) and UART.

    Can you also specify what you mean by sample rate? When we talk about sample rate we are usually talking about how fast samples from a sensor are taken. Usually you need to write to an specific register given in the sensor datasheet to change the sample rate of the sensor.

    From the host side (the nRF52840) you can change the configuration of the communication protocol. For example if using UART you can change the frequency and the baudrate.

    And BTW the link you posted was for the devkit user guide, for a complete product specification (datasheet) of the nRF52840 take a look at this document or go to the nRF52840 pages in our infocenter. You will find more information about the different serial interfaces there.

    Best Regards,

    Marjeris

Reply
  • Hi Maurie,

    Can you specify which protocol are you using to communicate with the BNO080? It seems the BNO080 can communicate with a host over various serial interfaces : SPI, I2C (also called TWI) and UART.

    Can you also specify what you mean by sample rate? When we talk about sample rate we are usually talking about how fast samples from a sensor are taken. Usually you need to write to an specific register given in the sensor datasheet to change the sample rate of the sensor.

    From the host side (the nRF52840) you can change the configuration of the communication protocol. For example if using UART you can change the frequency and the baudrate.

    And BTW the link you posted was for the devkit user guide, for a complete product specification (datasheet) of the nRF52840 take a look at this document or go to the nRF52840 pages in our infocenter. You will find more information about the different serial interfaces there.

    Best Regards,

    Marjeris

Children
  • Thanks Marjeris. The Arduino code specifies an SPI protocol. The original question was about how the sampling rate for the arduino or MC could be changed. 

    It seems to be included though - I just didn't understand it when I was reading it the first time. 

    SPI.begin ()

    SPI.setClockDivider(SPI_CLOCK_DIV2);

    .... more lines

    //reset commands

    //write to register

    WriteReg(REG_REF, 0x10);

    WriteReg(REG_MODE0, 0b00101000);//50SPS with SINC1 digital filter 50 HZ and 60HZ normal mode rejection

Related