cancel
Showing results for 
Search instead for 
Did you mean: 

ADC Sampling and Display

xwq370
Associate

As is well known, the ADC sampling rate is on the order of microseconds, while the display task may only refresh once every 100 milliseconds. In an RTOS, how can the display task and ADC sampling values be synchronized? With such a long display refresh cycle, how are the numerous ADC sampling values handled—should they be discarded or stored in a buffer? If stored in a buffer, would it occupy substantial memory space? How do people handle this issue in actual applications?

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Super User

The best method depends on the application.

Generally for a display you want to choose the update rate and show the latest value. It’s a human looking at it so tight synchronization isn’t important. If it’s a dc value like a multimeter you can average a bunch of readings and display that.

 

You don’t need to display every reading. If you don’t need a giant buffer, then don’t store one. You can also only take readings at the rate you want to display them.

 

Lots of options. No “right” or “best” one. Choose one that makes sense for the application and move forward.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Super User

The best method depends on the application.

Generally for a display you want to choose the update rate and show the latest value. It’s a human looking at it so tight synchronization isn’t important. If it’s a dc value like a multimeter you can average a bunch of readings and display that.

 

You don’t need to display every reading. If you don’t need a giant buffer, then don’t store one. You can also only take readings at the rate you want to display them.

 

Lots of options. No “right” or “best” one. Choose one that makes sense for the application and move forward.

If you feel a post has answered your question, please click "Accept as Solution".
MM..1
Chief III

Seems you asking DMA then start learning DMA.