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
shyam
Tue Oct 07 2008, 03:36AM

 User Offline

Registered Member #2984
Joined: Mon Aug 06 2007, 11:33AM

Posts: 725
Thanked 108 times in 104 posts
for the past few days i have been working on my data logger.
here are the specification as well as the problem i am facing:

1.controller : LPC2138
2.memory : flash 512kb
3. Ram : 32 Kib
WINArm windows Xp

using IAP when i beed to erase data from the sectors i need to erase the complete sector.
that means to erase one data i need delete approx 128 records.
i have already used around 230 kbs for code.
section size addr
.text 210516 0
.data 2524 1073741824
.bss 7816 1073744348
.stack 8192 1073752320
.comment 1632 0
.debug_aranges 736 0
.debug_pubnames 7835 0
.debug_info 33986 0
.debug_abbrev 2730 0
.debug_line 10207 0
.debug_frame 5760 0
.debug_str 450 0
.debug_loc 7140 0
Total 299524

now i need to optimise the memory (flash use)
i can invest only 20 sectors from base 14 to 19
the rest (remaining) shall be used by code and configuration data..
my proble:
1. i need to edit one selected report (i.e. delete it from flash and update from RAM). without affecting any other record..
2.i can write minimum of 256 bytes at atime.. my record sze is only 100 bytes.. i need to utilise the (now wasted memory too..).

if some of u frnds have come across this problem before please help me by providing a logic to go by.
thnx in advance...


Post made: Sunday 05 October 2008 - 18:44:50
Posted by: pdi33

Post: maybe 'linked list' logic...
just an idea not sure still...




lProgress is not made by early risers or hard workers, but by LAZY people, trying to find easier ways to do the same........
Back to top


shyam
Tue Oct 07 2008, 03:40AM

 User Offline

Registered Member #2984
Joined: Mon Aug 06 2007, 11:33AM

Posts: 725
Thanked 108 times in 104 posts
hi Pdi33..

thnks for the reply..

maybe 'linked list' logic


well linked list is a handy tool when u r playing with RAM

here i am dealing with flash.. malloc (dynamic allocation of memory) may not work here.
i dont think i will be able to implement linked list in memory(flash), cause it has to be written sequentially 256 bytes at a time.


lProgress is not made by early risers or hard workers, but by LAZY people, trying to find easier ways to do the same........
Back to top


Ajay
Tue Oct 07 2008, 06:26AM
Rickey's World Admin

 User Offline

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

Posts: 4049
Thanked 754 times in 713 posts
shyam, i have a good explample that resembles your requirement, Wavecom's Flash APIs.

What they do is same what you want. Now think about logic.. how we can do the same

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


shyam
Tue Oct 07 2008, 07:28AM

 User Offline

Registered Member #2984
Joined: Mon Aug 06 2007, 11:33AM

Posts: 725
Thanked 108 times in 104 posts
this is what i am doing=>sector no.20 declare as SWAP.
each record = 60 bytes so in one page (256 bytes we can have 4 records!!)
so 1 record write to SWAP
2 record write to SWAP +256
3 record write to swap +512
4 record write to swap +768

5th record..
read record1 and save data1
read record 2 and save data2
read record3 and save data3
read record 4 and save data4

erase SWAP
catenate data1 data2 data3 data4 to data,

write @ TESTSLOT+0
...
...
...
write @ TESTSLOT+256


i already had some partial successs....

lets see. what is in store....
my client says i will have 2 stay @ his place unless this issue is solved!!!!!
missing my office




lProgress is not made by early risers or hard workers, but by LAZY people, trying to find easier ways to do the same........
Back to top


shyam
Tue Oct 07 2008, 03:23PM

 User Offline

Registered Member #2984
Joined: Mon Aug 06 2007, 11:33AM

Posts: 725
Thanked 108 times in 104 posts
with the help and suggestion of ExperimenterUK
I have almost solved one of my problems..

now i can write/use 240 kbs of the 256 blocks..
previously...
I cud write only 60 bytes in the 256 blocks!!

wish he wud had posted his suggestions here...
I wud have thanked him a hundred times...

will post the logic tommorrow.. almost similar yo the one in the previous post!


lProgress is not made by early risers or hard workers, but by LAZY people, trying to find easier ways to do the same........
Back to top


ExperimenterUK
Wed Oct 08 2008, 02:19PM
 User Offline
Registered Member #9602
Joined: Tue Aug 05 2008, 04:15PM

Posts: 207
Thanked 38 times in 37 posts

Still .. as admin you could add those thanks to my "Thanked" count

Not that I care about that sort of thing

[ Edited Wed Oct 08 2008, 03:32PM ]

Learning all the time
Back to top



This post has been thanked 1 time
 shyam 
Ajay
Sat Oct 25 2008, 02:08PM
Rickey's World Admin

 User Offline

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

Posts: 4049
Thanked 754 times in 713 posts
what was the logic?

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


 

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