2 Replies Latest reply on Jan 11, 2019 5:14 AM by AchimE_41

    Processor profiling - how to see how much processor utilization we have (in percent)


      Greetings All!


      We are using the PSOC 6 in a motor control application.  The M4 core is being used for the motor control loops (torque and velocity loops), and we want to use the M0 as an interface to a desktop computer app using BLE.


      --> The motor control laws themselves will use interrupts, while we want to use an RTOS for communication/background tasks.


      Is there an example on PSOC, or maybe one in general, that shows how we can profile the processor utilization?  For instance, if we run our motor control loop at 20kHz (50usec), we want to know how much time we are using doing the control law, and therefore how much time we have left to do "other things".


      We have done this in the past with a simple GPIO pin (raise the pin at the start of the 50usec interrupt, then lower it when the calculations are done, and view this pin on an oscilloscope).  I'm not sure if this method can be used when we are using both interrupts and an RTOS scheduler.