I'm trying to add some debug to my ASM and wanted to see it on a scope. So I simply used
But I only see one condition not both? I know my analyzer runs 4 times as fast as my device and my DDRB is set correctly.
If I only run the set command I get [```````] condition is hi. if I run a clear command I get [_______] condition is clear. but when running a set and clear I see the last operation only. [_______] where I'd suspect to see [````_____] .
In my C code I can just set the PORTB receptively and I get exactly what I'd expect to see. Even if I set the condition in ASM and clear in C it works as expected. For some reason (unknown to me) I do not see the change when using the two asm commands only.
Here is an exmaple
sbi PORTB,2;//debug #if USB_CFG_IMPLEMENT_FN_WRITEOUT /* if we have data for endpoint != 0, set usbCurrentTok to address */ andi x3, 0xf ; breq storeTokenAndReturn ; mov token, x3 ; indicate that this is endpoint x OUT #endif storeTokenAndReturn: sts usbCurrentTok, token; doReturn: cbi PORTB,2;//debug POP_STANDARD ; 12...16 cycles USB_LOAD_PENDING(YL) ; sbrc YL, USB_INTR_PENDING_BIT; check whether data is already arriving rjmp waitForJ ; save the pops and pushes -- a new interrupt is already pending sofError: POP_RETI ;macro call RETI
but honestly my analyzer should have no issues picking up a
and does so in c with
PORTB |= 0x04
PORTB &= ~0x04