I want to know how much instruction cycles are each line of a program, is there a way to do that?
It's important to me because i'm having a problem with the oscillator (or might be something else) doesn't seem be as fast as i want.
The pic in question a a PIC32MX470F512L
.
I'm using the following config with MCC:
I made a simple program which only toggles a pin that i will see with an oscilloscope:
#include "mcc_generated_files/mcc.h"
/*
Main application
*/
int main(void)
{
// initialize the device
SYSTEM_Initialize();
while (1)
{
// Add your application code
IO_RG0_Toggle();
}
return -1;
}
On the oscilloscope it toggles every ~13.8us.
This seems to be super slow.
Note: Using the timer with 1ms calculated period
and alternating the signal of the port with the timer callback it alternates every 1ms.
But if i set the timer period to 8us the value goes to 16us: