I need to directly make a GPIO pin low to High within 50 nano second
when i use API
It takes 1.5 micro seconds which is a huge time for my requirement
i have configured the TB-S1JA to operate at 48 Mhz so that i should be able to achieve 21 nano second but that is not happening
How to toggle a GPIO with only one instruction?
Unfortunately 50ns is an unrealistic requirement for an MCU that's clocked at 48MHz. IOPORT block is clocked from PCLKB, which by default is set to 24MHz (32MHz is the maximum). Assuming one PCLKB cycle to be around 40ns yields between 80 and 120ns to access IOPORT register:
Some improvement may be observed by setting system clock as HOCO @ 32MHz and specifying PCLKB divider as 1. IOPORT toggle delay in that case should be deterministic at 93.75ns however this still doesn't meet your requirement and USB peripheral now cannot be used.
All of the above is assuming that pin is toggled as soon as register is set but you may observe some additional delays associated with signal propagation. For fast IO toggling, I recommend looking into using a GPT timer.
I use these instructions for example on P000:
R_IOPORT0->PCNTR1 = 0x00000001; //P000 = 1
R_IOPORT0->PCNTR1 = 0x00000000; //P000 = 0