I am trying to toggle a port pin, using the code below, and I see using MQX on a 52259EVB takes a performance hit which I cannot explain.
Here is the test code I used in the scenario using MQX
reg_ptr = _PSP_GET_IPSBAR();// Internal Peripheral Base Addr Reg
gpio_ptr = ®_ptr->GPIO;
gpio_ptr->PORTAN = 0x00 ;
gpio_ptr->DDRAN = 0xEE ; // Select AN1 thru AN3 and AN5 thru AN7 as output pins
gpio_ptr->PANPAR = 0x11 ; // Assign AN0 and AN4 to A/D inputs, all others GPIO.
gpio_ptr->PORTAN |= 0x04;
gpio_ptr->PORTAN &= ~0x04;
And the test code in non MQX scenario
PORTAN = 0x00 ;
DDRAN = 0xEE ; // Select AN1 thru AN3 and AN5 thru AN7 as output pins
PANPAR = 0x11 ; // Assign AN0 and AN4 to A/D inputs, all others GPIO.
PORTAN |= 0x04;
PORTAN &= ~0x04;
Both the test codes are trying to toggle the a port pin, the non MQX case taking around 500nsec to toggle a port pin, whereas an MQX test code takes around 2.5 usec.
I checked the core frequency for both, and they both are equal.
So is there something in MQX, which is causing this issue?