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

read high speed analog sensor data and send data to pc

Hi,

I'm working on a project where I need to collect and process analog data coming from high speed sensor measurements. The data needs to be read at a speed of 25k samples/sec. In which way do I need to adapt the saadc example file to increase the sampling speed? I tried changing

uint32_t ticks = nrf_drv_timer_ms_to_ticks(&m_timer, 400);

into

uint32_t ticks = nrf_drv_timer_us_to_ticks(&m_timer, 40);

but when I then look at the result in the Termite-terminal, it says 'overflow'. Is the limiting factor here the sampling frequency of the ADC-pins or the rate with which the data is send to the terminal? And is there a way to avoid just getting 'overflow'?

Also, to be able to process the data, I would like to save the samples in an array and then send the entire array all together to my computer once every second for example. I wanted to do this just via the USB-connection that is already established but I don't know if something like this is possible. Do you have some example code where something similar is done?

-Thank you

Parents
  • Hi Tim,

    The SAADC peripheral support sampling rate up to 200 ksps, with aquisition time set to 3 us. With default settings from SAADC example from SDK (10 us aquisition time), you should be able to achieve 83.33 ksps sample rate.

    The overflow message you are seeing is from the UART printing. You could try increasing the baudrate, for instance to 1 Megabaud.

    If you are using the nRF52840, there is an USB CDC ACM example in the SDK, which emulates a virtual COM port over the USB interface. You should be able to modify this to transfer the ADC data to the computer. If you are using the nRF52832, there is no USB interface on this chip, but the Segger J-Link IF MCU on the nRF52 DK also provide Virtual COM port interface.

    Best regards,

    Jørgen

  • The driver is not automatically installed when I connect the device to my computer. I added the nordic_cdc_acm_example.inf file manually in the driver settings but still the device doesn't show up as a removable disk so I can't retrieve any of the .txt files that should be created in this example.

Reply Children
No Data
Related