I have a project using the AT32UC3C that works great with compiler optimization turned off. But with it turned on, the TWI hardware (in slave mode) doesn't function properly. I am able to get a few TWI transfers out but that is it. BTW, I'm using the PDCA along with the TWI hardware.
Things work fine if I add at least two break points and one is prior to my function that initiates the TWI transfers. Any other break point configurations or free-running execution cause the TWI hardware to become unresponsive until things are re-initialized.
Does anyone have an idea how optimization might effect operation of the TWI hardware?
Thanks in advance.