Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

AVR efficient ram usage

Status
Not open for further replies.

artem

Advanced Member level 4
Advanced Member level 4
Joined
May 22, 2003
Messages
1,347
Helped
126
Reputation
252
Reaction score
32
Trophy points
1,328
Location
Turkey
Activity points
13,451
avr with ram

My appliaction on avr atmega uses ucos and can have 2 operation modes :
- gui mode where text based widget alike menu is running
- and traffic mode where all port scanning connectivity .. are executing

These 2 moduloes are not executing at the same time - when gui active traffic module does not work and vice versa . These modules are communicating through eeprom - gui stores data to , traffic module retrives data from eeprom .

To get one hex file i have to compile them both but it means that there will be unnecessary ram usage as ram for gui and traffic modules occupy noncrossing sram locations .

Atmega has bootloader feature so may be this can be used to divide program into 2 integal independent parts .

My question - is there any other than bootloader like way to put 2 independent application to the atmega to reduce system requirements ? or in other words is it possible to compile modules as their flash positions will be assigned different memory locations assuming they share same sram, interrupt vectors for both modules are not crossed and absolute jump can be used to switch between modules .
Issue could also be usefull if bigger than 64 kb external sram is used - if modules can work independently being loaded into one program space each one of them can have its own 64 kb sram page switchable via gpio port .
 

efficient ram usage

Hello

1) You have to set up your linker to place both program in different location
2) You will need to run a set up program that allow you to choose the running module
3) Jump between module using function pointers in c language


All the best

Bobi
 

avr32 executing in ram

steps 2 and 3 isn't problem.

How may i instruct linker to allocate same ram positions to different modules assuming there will be one resulting binary hex file?
Currently i am using iar compiler.
 

get sram usage avr

Hello

To alocate the same RAM posion for 2 memeory module you can use ptr to the ram location

But i think you want to alocte 2 modules (2 sperate program ) on the same memory {FLASH memory not RAM memory ) - use the linker or read the linker manual or ask for help from the compiler manufacture

All the best

Bobi
 

avr ram location

I can nto use the pointer because linker performs absolute allocation at compile time and if 2 modules compiled together - their symbol (e.g. var const ) allocation will be unambiguous .
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top