C++ inappropiately uses extended i/o?

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

Having trouble converting C++ code from Mega8 to Mega88. It appears that class variables are beginning at RAM location 0x60 at the start of the extended I/O space. I have looked in iom88.h file and cannot find a way to change the beginning of usable RAM. Two questions: is my analysis reasonable, and is there a work around that I can use to quickly get my Mega88 working?

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

Did you forget to apply the -mmcu option to the linker command-line?
That's where the offset is supposed to be applied.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

That is my problem. It's time to brush off my MAKE manual and bring my makefile up to date. Thanks for the help.

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

If you are using WinAVR then I suggest using the installed sample makefile as your base. Also installed with WinAVR is the MFile utility which helps you to generate a makefile for your project. MFile (for Windows) uses the WinAVR sample makefile as it's template. This template is very full-featured; it contains many things in there that would probably make your life simpler.

If you are using Linux or FreeBSD, MFile is also available for those platforms. See here:
http://www.sax.de/~joerg/mfile/

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

I took the MFILE prototype and made the following changes that seem to work (are there other changes necessary/recommended?):

Change the eight .c references to .cpp (lines 46, 101, 245, 248, 373, 280, 411, 412)
Remove “-Wstrict-prototypes” from line 100
Delete lines 80 and 103 that reference c standards
Change “avr-gcc” to “avr-g++” on line 211