Other Parts Discussed in Thread: TMS320F28335
Hello,
I have the following section of code that I am running on a TMS320F28335 using the experimenter kit.
I'm using Code Composer Studio 3.3.81.28 and am compiling for release. I am most interested in the
amount of time that it will take to execute this section of code. To measure the time for the code to execute
I monitor the GPIO32 pin which set as the code begins, and is cleared when the code ends. This
takes about 94 nanoseconds with the processor running at 150MHz.
At the one line indicated with a comment, if it is changed to GpioDataRegs.GPBCLEAR.bit.GPIO33 = 1;
then the code takes 630ns to execute.
Does anyone know why this is so, and is there some better way to toggle I/O bits?
Thanks,
Chris
GpioDataRegs.GPBSET.bit.GPIO32 = 1;
//========================================
count=0;
evensample=*adc_ptr++;
count += abs(evensample-oddsample);
oddsample=*adc_ptr++;
count += abs(evensample-oddsample);
evensample=*adc_ptr++;
count += abs(evensample-oddsample);
oddsample=*adc_ptr++;
count += abs(evensample-oddsample);
evensample=*adc_ptr++;
count += abs(evensample-oddsample);
oddsample=*adc_ptr++;
count += abs(evensample-oddsample);
evensample=*adc_ptr++;
count += abs(evensample-oddsample);
oddsample=*adc_ptr++;
count += abs(evensample-oddsample);
if (count > 1900)
{
GpioDataRegs.GPBSET.bit.GPIO33 = 1; // <<<<<<< Slows if you change this with GPBCLEAR
}
else
{
GpioDataRegs.GPBSET.bit.GPIO33 = 1;
}
GpioDataRegs.GPBCLEAR.bit.GPIO32 = 1;
//========================================