Hi! Tried using GPxTOGGLE register to change pin level. It works only when switching from 0 to 1.
Here is an example of working code (placed inside while(1) { ... } ):
GpioDataRegs.GPCCLEAR.bit.GPIO70=1;
for (k=0;k<1000000;k++) ;
GpioDataRegs.GPCTOGGLE.bit.GPIO70=1;
for (k=0;k<1000000;k++) ;
And this code does not work (the only difference marked with bold):
GpioDataRegs.GPCSET.bit.GPIO70=1;
for (k=0;k<1000000;k++) ;
GpioDataRegs.GPCTOGGLE.bit.GPIO70=1;
for (k=0;k<1000000;k++) ;
This example also does not work (inside while-loop!):
GpioDataRegs.GPCTOGGLE.bit.GPIO70=1;
for (k=0;k<1000000;k++) ;
Modifying GPCTOGGLE in CCS Registers window have an affect only when corresponding bit in GPCDAT is cleared. And nothing happens if it is set to 1 while writing to GPCTOGGLE.
The MCU is F28M35H52C1