Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

RE: [AVR-Chat] Re: Any way to make interrupts faster, please?

2010-01-20 by Cat C

Thank you Don,
In the mean time I looked at the lss file and it looks like I should also save R24.
I didn't know but it looks like SREG is saved through the use of another register (can't push directly).
Apart from that, I suppose only the Rxx that are inside the ISR in the lss file need savin'

So now it's like this:

>>>
ISR(PCINT0_vect, ISR_NAKED)
{
    asm("push R24\n");        //Save R24 because it's used
 11a:    8f 93           push    r24
    asm("in    R24, 0x3f\n");    //Save SREG in R24
 11c:    8f b7           in    r24, 0x3f    ; 63
    asm("push R24\n");        //Push R24 again
 11e:    8f 93           push    r24
    if(bit_is_set(PINB,PORTB2))
 120:    1a 9b           sbis    0x03, 2    ; 3
 122:    04 c0           rjmp    .+8          ; 0x12c <__vector_3+0x12>
    {
        SPCR = _BV(SPIE) |_BV(SPE) | _BV(CPOL); 
 124:    88 ec           ldi    r24, 0xC8    ; 200
 126:    8c bd           out    0x2c, r24    ; 44
        GPIOR0 = sInByte1;
 128:    82 e0           ldi    r24, 0x02    ; 2
 12a:    8e bb           out    0x1e, r24    ; 30
    }
    asm("pop R24\n");        //Restore R24 for SREG
 12c:    8f 91           pop    r24
    asm("out 0x3f, R24\n"); //Restore SREG
 12e:    8f bf           out    0x3f, r24    ; 63
    asm("pop R24\n");        //Restore R24 for itself
 130:    8f 91           pop    r24
    asm("reti\n"); 
 132:    18 95           reti

<<<

See anything wrong with this?

Thanks again,

Cat


 		 	   		  

[Non-text portions of this message have been removed]

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.