I am using an AT32UC3A3256 running at 66MHz. I poll a GPIO pin continuously via the local bus and toggle an LED via the local bus when it goes high. Monitoring both of these signals with an oscilloscope I see a jitter on the LED drive signal of 6 clock cycles that I can’t explain by examining the .lss file. The signal that I am polling has a rise time of around 5ns (one clock cycle is approximately 15.2ns) and the assembly of my polling loop consists of 3 instructions. Below is the relevant part of the .lss file:
while((AVR32_GPIO_LOCAL.port.pvr & (1 << 11)) == 0); 8000783e: ee f8 02 60 ld.w r8,r7 80007842: e2 18 08 00 andl r8,0x800,COH 80007846: cf c0 breq 8000783e <main+0x7a2> AVR32_GPIO_LOCAL.port.ovrt = 1 << 0; 80007848: ef 46 00 5c st.w r7,r6
From the above code I would expect a jitter of 2 clock cycles. Can anyone explain why I see a jitter of 6 clock cycles?