Yahoo Groups archive

AVR-Chat

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

Message

Re: Re: [AVR-Chat] Stack Pointer - documentation conflict?

2006-04-05 by Don AE5K

David VanHorn wrote:

> If they've started preloading SP to the end of ram in the larger
> devices, that's news.
> It's no big deal either way, four instructions that execute once isn't
> anything to worry about.

Normally, I'd agree with you ... but in this particular instance I have
exactly 2 words left in some real tight code that I rewrote from a
AVRFreaks contribution -- the original author didn't init stack and uses
a rcall ;-)    The code works, but I started wondering if I was playing
Russian Roulette by no init of SP.

(And yes, I also agree that it is good and "normal" practice to init the
stack pointer to highest address in SRAM -- but even then you can easily
run into weird problems if you don't allocate enough space.  I was just
questioning the misleading "must" in Atmel's statement.)

I've submitted a query to Atmel support, so we'll see what is up.

Don

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.