We doing simple ADC acquisitions, and we have this piece of code to write the data from the ADR result to external SRAM:
GpioDataRegs.GPFCLR.bit.GPIOF14= 1; // clear gpioF14 (signal LO) DEBUG
adcConvRslts.adcA1[adcConversionCount] = AdcRegs.RESULT2 >> 4;
GpioDataRegs.GPFSET.bit.GPIOF14= 1; // set gpioF14 = signal HI DEBUG
The purpose of the GPIO is to help us try to figure out how long does it take to do this access. To our astonishment when we monitor the SRAM CS pin, we see 16 accesses (CS goes down 16 times).
Why does one simple write take 16 SRAM access? We tried removing the shift operation, but nothing changed.