cancel
Showing results for 
Search instead for 
Did you mean: 

Can't plot a signal smoothly on STM32CubeIDE, STM32CubeMonitor or Keil uvision

salehrayan
Associate

Hello. I can plot an array in STM32CubeIDE, STM32CubeMonitor and Keil uvision with the Time Graph or Logic analyzer in Keil using this function and viewing signal_sample:

void plot_signal(uint32_t delay){
   for(int i=0;i<_5HZ_SIGNAL_LEN;i++){
      signal_sample=_5hz_signal[i];
      for(int j=0;j<9000;j++){}       // Delay
    }
}

The problem is that in all the software above, this gets plotted like a step plot, because the sample rate of the trace is so high it samples the constant value between the Writes to the signal_sample:

salehrayan_0-1749898520812.png Example from keil. This is similar in other software mentioned

 

The only remedy i have found, is to printf the signal_sample to Matlab or Arduino Serial Plotter with UART. Because of printf, only the value of the actual array gets plotted smoothly, not the constant samples in between the writes.

This would be good for me, the problem is i need multiple signal graphs at the same time, but UART can only send 1 signal array.

I can't come up with a better solution. If you can suggest something else it would be greatly appreciated 

0 REPLIES 0