1

I would like to read analog data with frequency sampling around 2 MHz and send it to PC to be processed with python for digital oscilloscope. I use Arduino Nano. I have found ADC (AD9057, PDF) that can handle up to 40 MSPS into 8 bits parallel, but I still face some problems

  1. How could I read digital pin data quickly around 2-4 MHz? I read that it is possible using direct port manipulation.

  2. How could I send the data to PC with that sampling rate? I know that the maximum baud rate of arduino is around 2.000.000 or let say 2 MegaBytes/s, so for 2 MHz sampling, i could only send one character per micro second, could it be more faster?

Thank you

9
  • 1
    ad 2. With asynchronous serial interface it's actually 2Mega bits, not mega bytes. In synchronous it's possible.
    – KIIV
    May 14, 2018 at 7:09
  • Read this and this. Actually you might just want to write assembly code to read a specific PORT (e.g. PORTD) and push it into the UART registers. If that is not sufficient, get a better, faster microcontroller (ESP8266 / ESP32). Also this might interesting. May 14, 2018 at 7:42
  • Do you want do read analog values (using the ADC) vor digital data using the PIN registers directly? This is a huge difference and write both is your question.
    – chrisl
    May 14, 2018 at 8:07
  • @MaximilianGerhardt thanks mate, i'll read it
    – Zahi Azmi
    May 14, 2018 at 8:51
  • 1
    Then how do you have connected the external ADC to the Nano? What external ADC do you use? Please provide a link to a datasheet
    – chrisl
    May 14, 2018 at 10:07

1 Answer 1

1

In short? You can't.

To have a 2MHz transmission you need 2*Nbit MHz of serial clock to send it to the PC, where Nbit is the number of bits per sample. Since the minimum is 8, englecting the synchronization or additional bits the serial clock has to be at least 16MHz. Which is the system clock of the nano. So no way.

Now, with the alternatives. First question: what is your ADC's interface? I found the LTC2204. It is a parallel ADC, so you need something to convert it to anything readable by the PC.

I'm not sure about the feasibility of this, but a nano is not enough. I'd use an STM32 (because I have their Nucleo boards, but you can search for other 32-bit boards) and a high speed serial interface. Since even SPI can be slow, maybe ethernet needs to be used. I was not able to search for boards with native ethernet interface; anyway the STM32F4 microcontrollers should (see this article) have an ethernet interface and you will "only" need the PHY. I think that this is the only applicable way to follow..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.