Yahoo Groups archive

AVR-Chat

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

Message

Re: [AVR-Chat] Stack

2004-12-23 by Dave VanHorn

At 08:40 AM 12/23/2004, Paul Maddox wrote:


>Dear all,
>
>   Daft question, I'm trying to setup a couple of IRQs (in assembly) and I'm
>getting some odd results, here's the first part of my setup ;-
>
>   LDI  Temp, Low(Ramend)
>   OUT  SPL, Temp    ; setup stack pointer
>
>   LDI  Temp, High(Ramend)
>   OUT  SPH, Temp
>
>   ; **** setup IRQs
>
>   LDI  Temp, 0b00001010
>   OUT  MCUCR,Temp    ; Setup MCUCR for falling edge interupts.
>
>   LDI  Temp, 0b11000000   ; enable ext. INT1 and INT0
>   OUT  GICR,Temp    ; by setting General Interupt Control Register
>
>I assume the stack and IRQ setup is ok?
>or is it shot to peices?

What's the chip??

What's your vector table look like?

I've seen some systems that only partially fill the vector table, but I 
really get squeamish at that.
I prefer a full table, with at least RETI's on the unused ints, and ideally 
a little code to turn them off in case they get accidentally turned on.. 
Put that in your template for a given processor, and then just populate the 
ones you want.  If you get pushed for space, then sacrifice the turnoffs 
for RETI's again.

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.