Jump to content
  • 0

MCC-128 Buffer overrun and hardware overrun for continuous scan mode


fpandpf

Question

Hi, I've been using mcc128 hats for data aquisition, but as I increase the total number of hats to 4. My data aquisition code will encounter overrun error more frequently. Hope to get some suggestions to solve this issue.

 

My setup:
Raspberry Pi 4 with four stacked MCC 128 hats, all of them were read with sampling rate of 100 kS/s in continuous mode, and data were saved every second. All hats were were synchronized by connecting the CLK pins together and using flag EXTCLOCK.

For the function a_in_scan_start(channel_mask, samples_per_channel, sample_rate_per_channel, options), i set the samples_per_channel = 100ksample_rate_per_channel=50k (my understanding is this parameter is only for buffer size).

Now after start my data aquisition code with the set up described above, I usually encountered the buffer overun error or hardware overrun in a few minutes. However, when I had the 3-hats setup (one hat less than the current setup), such issue was much less frequent, I usually see a buffer overrun error after tens of hours. 

Could anyone share insights on why i am seeing such error for 4 hats setup while no issue for my 3 hats setup? Also, can someone explain in detail what exactly buffer overrun and hardware overrun errors are? what's the difference between those two errors?

 

Thank you!

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

The limiting factor with multiple devices is the SPI bus speed since all the HATs share a single SPI bus and we limit the SPI frequency for the HATs.  Using an RPi 5 does not increase the throughput rate.

Link to comment
Share on other sites

  • 0

Thank you, Fausto.

Below is my understanding,  let me know if it is correct.

If the HAT's SPI frequency is limited to, for example, 4 MHz, the Raspberry Pi will set the SPI bus speed to 4 MHz when communicating with that HAT. Even though the Raspberry Pi's SPI bus can operate at speeds up to 125 MHz, it will adhere to the 4 MHz limit set by the HAT to ensure reliable communication.

Is my understanding correct?

Link to comment
Share on other sites

  • 0

Hello @fpandpf.

The maximum aggregate throughput of the RPi 5 is also 320 kS/s.  For the MCC DAQ HATs, we limit the SPI frequency to 18 MHz for the microcontroller timing.  However, it's up to the kernel to set the speed closest to what the hardware can achieve.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...