Hello,
I'm using the F28069 Experimenter's kit.
When my program starts, I would like to set all of the pins to GPIO, direction to output, and value to low. This is so I can easily check if I'm initializing all the pins to the correct value later on. This is the code I'm using to do this:
EALLOW;
GpioCtrlRegs.GPAMUX1.all &= 0x00000000;
GpioCtrlRegs.GPAMUX2.all &= 0x00000000;
GpioCtrlRegs.GPADIR.all &= 0xFFFFFFFF;
GpioDataRegs.GPACLEAR.all |= 0xFFFFFFFF;
EDIS;
Unfortunately, when I set a breakpoint after these lines of code and I check the GPADAT values within the expressions, not all of them are 0. There are 2 or 3 GPIOs that have values of 1. Not only that, but when I try to manually change the values in the expressions window, it won't let me change the value of 1 to a value of 0.
Here are some things I've tried doing to resolve the issue:
- Using GPADAT.all = 0x00000000; instead of GPACLEAR.
- Individually coding the pins by each bit with GPADAT = 0 and GPACLEAR = 1
- Trying both GPADAT and GPACLEAR
- Adding asm("NOP") in between each line of code
- Trying a different C2000 Experimenter's Kit
Any ideas what might be going wrong? I can just skip these pins and move on (it tends to be the same pins each time that are held at 1), but it would be nice to see what the cause of this issue is and to be able to fix it.
Best,
Matt