The weirdest problem. Is my code too big?

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

This is the weirdest thing i've ever experienced.

So before I tell you the problem, here's some quick background.

My project is a GPS tour guide. It's a hanheld device, and when you walk by a certain location it will show information on the location on he screen. It also has audio feedback so you can hear a voice speaking the text.

this is all built around a Mega128.

I've gotten to point where i'm just fleshing out the guide with real locaiton information. (i.e. history information about a location.. etc.. etc..)

here's where the problem comes in..

So i have 5 locations i want my guide to locate. I programmed 3 of them. They work awesome.. i add the 4th location, and then my unit just acts retarded, like my LCD just goes blank.. and the thing just doens't work anymore..

i figured.. maybe it's just my code. SO what i did was comment out a known working location, and leave in the new location (the one i thought i programmed bad).. the unit works perfectly.. it's like i can't have more than 3 locations on it.

I'm only using 7Kb of the flash in the micro controller.

ANy clues? i'm still looking over my code, but could there be some sort of hardware issue here? are there fuse bits i'm not setting?

thanks

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

Quote:
I'm only using 7Kb of the flash in the micro controller.

It sound like you are having a stack collision. If that is the case, it is ram that you are running out of, not flash.

Regards,
Steve A.

The Board helps those that help themselves.

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

Koshchi wrote:
Quote:
I'm only using 7Kb of the flash in the micro controller.

It sound like you are having a stack collision. If that is the case, it is ram that you are running out of, not flash.

huummmmmmmm well now..... doesn't that suck...

is there anyway to see how much RAM i'm using..

but i thought only variables get stored in RAM.. i don't have that many variables.. and many of them are created in a function, and destroyed in the same function..

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

Does using
FDEV_SETUP_STREAM()

so that i can use printf() with my LCD eat up SRAM?

EDIT: it appears it does.. i'm setting up a lot of strings to send... like printf("Hello world");

stuff like that.. i thought the "Hello world" part would be stored in Flash not SRAM.. is there a way to switch it to flash ram??

I'm reading the documentation.. but it's confusing

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

Okay,

I think i know what my problem is... I think anyway..

so Basically i hav a bunch fo

printf("blah blah blah");

type stuff in my code.. i want the string

"blah blah blah"

to be stored in FLASH not RAM.. is there an easy way to do this?? please say yes, have sooo much damn code i would die if I have to overhaul the project... my grade depends on this lol..

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

See this tutorial to find out how to keep all your strings in flash.

Regards,
Steve A.

The Board helps those that help themselves.

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

Koshchi wrote:
See this tutorial to find out how to keep all your strings in flash.

DUDE!!!

you freaking ROCK!!!

WOOOOOOOOOOOooooooooooooooooo!!!

haha thanks a million man.. everything is A okay now.. :D :D :D

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

Does any of that thanks extend to the author of that tutorial? ;)

Glad you got it working.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

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

I pass 2.837% of the thanks on to you, Dean :D

Regards,
Steve A.

The Board helps those that help themselves.

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

I guess some of the praise should be directed towards Marek Michalkiewicz ?? ;)

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

A quick Google search for "Marek Michalkiewicz" indicates that 40.214% of my praise should be directed at him. That's a grand total of 1.14087118% of the total original praise.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

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

abcminiuser wrote:
Does any of that thanks extend to the author of that tutorial? ;)

Glad you got it working.

- Dean :twisted:

LOL of course..