ATmega128 sub-routine issues

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am new to AVR's, and am using asm coding on the avr stuo

when I call a sub routue

RESET:
   ldi Temp, 0b01000100

LOOP:
   CALL CHECK
   nop
   jmp LOOP

CHECK:
    in R31, PORTB
   ret

it will pause in debuggin mode, and go back to the to of the code, (stack stay 0x0000 all the time)

I know I am a newb, and this might have something to do with a 103 compatibility mode, but could some one help me out?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you initiliasing your stack pointer?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly