Yahoo Groups archive

AVR-Chat

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

Message

Re: [AVR-Chat] why unintialized stack errors?

2007-01-02 by David VanHorn

Some have objected to this table, but the .eseg directive should result in
this table data being pulled into EEprom and not included in the hex that's
put in the program memory, so you should be executing ldi r30, ramend as the
first instruction.

Have you simmed it?


;
> RESET:
>   rjmp START
>   reti      ; Addr $01
>   reti      ; Addr $02
>   reti      ; Addr $03
>   reti      ; Addr $04
>
>
>
> ; Program starts here after Reset
> ;
> START:
>
>
>    .eseg
>
> TABLE:
>    .db    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 3, 3, 4, 5, 6, 6
>    .db    8, 9, 10, 11, 13, 14, 16, 18, 20, 22, 24, 26, 29, 31, 34, 36
>    .db    39, 44, 48, 52, 55, 59, 62, 66, 70, 74, 78, 82, 86, 90, 94, 99
>    .db    103, 108, 112, 117, 121, 126, 130, 135, 140, 144, 149, 153
>    .db    158, 163, 167, 172, 176, 180, 185, 189, 193, 197, 201, 205
>    .db    209, 212, 216, 219, 223, 226, 229, 232, 234, 237, 239, 242
>    .db    344, 346, 247, 249, 250, 252, 253, 254, 255, 255, 255
>
> ;
>     .cseg
>
>
> BEGIN:
>
>    ldi    r30,    RAMEND                    ; initialize stack pointer
>    out    SPL,    r30
>


[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.