free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
say2paul
Sat Aug 02 2008, 04:32AM
 User Offline
Registered Member #8461
Joined: Tue Jun 17 2008, 10:56AM

Posts: 123
Thanked 6 times in 6 posts
I am facing a very strange problem with string length in my program.

I am getting following compiler error with Keil compiler:
*** ERROR L107: ADDRESS SPACE OVERFLOW
SPACE: DATA
SEGMENT: _DATA_GROUP_
LENGTH: 002EH
Program Size: data=111.2 xdata=0 code=2709

The problem occurs if I take the size of string more than 40 i.e. char str[50]

But if I reduce the size of string to 40 or less than 40 then code compile without any error.

Please help me I need a string of around 160 length so that I can send an SMS using that string.

Back to top


pdi33
Sat Aug 02 2008, 09:12AM

 User Offline
Registered Member #1329
Joined: Mon Jun 04 2007, 09:28AM

Posts: 621
Thanked 135 times in 131 posts
hi say2paul,
maybe the problem is because the string is occupying the valuable RAM space( which is only 128 bytes in case of 8051). If the string is a fixed value ( u r not modifying the content in the program), try changing it to the following:
constant char str[50]
this will ensure that the string is stored in the program memory space instead of occupying the data RAM.


* inspired to develop,developing to inspire *
Back to top



This post has been thanked 1 time
 say2paul 
say2paul
Sat Aug 02 2008, 10:26AM
 User Offline
Registered Member #8461
Joined: Tue Jun 17 2008, 10:56AM

Posts: 123
Thanked 6 times in 6 posts
pdi33 wrote ...

hi say2paul,
maybe the problem is because the string is occupying the valuable RAM space( which is only 128 bytes in case of 8051). If the string is a fixed value ( u r not modifying the content in the program), try changing it to the following:
constant char str[50]
this will ensure that the string is stored in the program memory space instead of occupying the data RAM.



I cannot take it as constant as I need to append data to same string..

I think idata can work in this case as I am using AT89C55WD with 256 bytes of RAM.
Back to top


sashijoseph
Sat Aug 02 2008, 11:22AM

 User Offline
Registered Member #5870
Joined: Mon Feb 04 2008, 06:26PM

Posts: 524
Thanked 124 times in 117 posts
Yup...an idata variable should work.It allows you to use all of the 256 bytes.

Let there be music........
Back to top



This post has been thanked 1 time
 say2paul 
say2paul
Mon Aug 04 2008, 04:27AM
 User Offline
Registered Member #8461
Joined: Tue Jun 17 2008, 10:56AM

Posts: 123
Thanked 6 times in 6 posts
Can I use AT24C08 (external memory) instead??

[ Edited Mon Aug 04 2008, 04:28AM ]
Back to top


say2paul
Tue Aug 05 2008, 12:31AM
 User Offline
Registered Member #8461
Joined: Tue Jun 17 2008, 10:56AM

Posts: 123
Thanked 6 times in 6 posts
Anybody . . !
Back to top


Ajay
Tue Aug 05 2008, 09:13AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3681
Thanked 685 times in 647 posts
128 bytes of memory of 8052 architecture is accessible directly using variables stored in ram, rest of 128 can only be accessed using indirect addressing.

as sashi said try using idata (use the indirect part of your controller ram)

e.g.
CODE:

unsigned char idata abc[50];
 


also if you want to use the external memory, its good but i would say a hectic process as reading and writing from eeprom is slow.

try giving idata a chance

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top



This post has been thanked 1 time
 say2paul 
pdi33
Tue Aug 05 2008, 11:30AM

 User Offline
Registered Member #1329
Joined: Mon Jun 04 2007, 09:28AM

Posts: 621
Thanked 135 times in 131 posts
hi say to paul,
As so truely said by ajay, EEPROM programming is slow but if u are planning to use 160 bytes for ur application ,then the uC will have only 96 bytes for all the other processing including the stack.
So i feel u should keep the other global variables and static variables to a minimum. Try using local variables (variables inside functions) wherever possible so that the same RAM can be reused by the uC for multiple functions making the code more efficient.
good luck.

* inspired to develop,developing to inspire *
Back to top



This post has been thanked 1 time
 say2paul 
 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems