Hello community,
I'm wondering about a timing issue on my Concerto F28M35 , when i clear the gpio bit 26 and write data to the gpio23-16 register i have time gap of nearly 350 ns (without optimization), the time after clearing the data and setting the gpio bit 26 to hight is just 150 ns.
The yellow signal in the picture is gpio26 and the blue and green is the data, x-axis is in µs.
Here is my code:
setPinsWritable(); for (loop_counter = 0; loop_counter < array_size; loop_counter++) { GpioDataRegs.GPACLEAR.all = (((unsigned long int) (0x04) << 24) & GET_FOURTH_BYTE); //set low aktiv GPIO 26 write bit GpioDataRegs.GPASET.all = (((unsigned long int) (data[loop_counter]) << 16) & GET_THIRD_BYTE); // write to GPIO23-GPIO16 asm("nop");//wait one tick bevor rewrite the register GpioDataRegs.GPACLEAR.all = (((unsigned long int) (data[loop_counter]) << 16) & GET_THIRD_BYTE); //clear GPIO23-GPIO16 GpioDataRegs.GPASET.all = (((unsigned long int) (0x04) << 24) & GET_FOURTH_BYTE); //clear low aktiv GPIO 26 write bit }
and here my configuration of the gpio pins:
void configRead_WritePin(void) { // GPIO24 & GPIO26 are outputs, EALLOW; GpioCtrlRegs.GPADIR.all = (((unsigned long int) (0x01) << 24) & GET_FOURTH_BYTE);; // Output read bit GpioDataRegs.GPASET.all = (((unsigned long int) (0x01) << 24) & GET_FOURTH_BYTE); // set bit as default GpioCtrlRegs.GPADIR.all = (((unsigned long int) (0x04) << 24) & GET_FOURTH_BYTE); // Output write bit GpioDataRegs.GPASET.all = (((unsigned long int) (0x04) << 24) & GET_FOURTH_BYTE); // clear bit as default EDIS; } void setPinsWritable(void) { EALLOW; // set all GPIO D to output GpioCtrlRegs.GPADIR.all |= GET_THIRD_BYTE; // Output EDIS; }
Is there a way to reduce this gaps?
best regards