Studio4 gives error using SPSR for an ATMEGA2560 SOLVED

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

I just got around to plugging in my sort of new STK600 and I was playing around with the provided M2560.
I was converting a working program from a ATMEGA16 and it gives me an error that it doesn't like SPSR (also tried SPDR just to see and it didn't like that either.

The line it doesn't like:

WAIT_TRANSMIT:

SBIS SPSR,SPIF ;LOOP TILL XMISSION COMPLETE
RJMP WAIT_TRANSMIT

Error message:
C:\Documents and Settings\Roger\My Documents\STK600.asm(175): error: Operand 1 out of range: 0x2d

Any ideas?
I checked the def file and it looks OK.

Roger

edit

Sorry to distract anyone from real posts.
Solved it. SBIS only works on the lower 32 I/O registers. ( I hate that )

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

Quote:
( I hate that )
Then it's time for you to download AVR001 and start using macros to solve your problem. :)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Thanks for the headsup. I've been wanting to look into macros and conditional assembly, but haven't got around to it. This looks like a great place and time to start. Right after I get to most everything on the list ahead of it.

Already have it downloaded.

Of course this really doesn't solve my "problem"
The real problem is when I start playing with microcontrollers my better half figures I have better things to do :)

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

...that's why they invented divorce... :lol:

It took my wife some 35 years to understand that what I was doing with electronics was NOT for my enjoyment. Well it was, but it has also paid bills since I was about 14. :wink:

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Unfortunately or fortunately this is not how I make my living though it has crossed over on occasion. But if one of many ideas pan out it may contribute.

Fortunately: We would probably starve.
Unfortunately: It would be fun.