Hello master,
this is my second thread continue last thread about my final project program avr barcode,
I have made program in code vision avr, based on mikro atmega8535
First i have compiled and no errors,
and then I building appear errors "Linker error: global RAM variables size: 1488 bytes is too large"
Anyone can solve my problem because i just newbie.
pliss master
2048 to be exact, but anyway first you need to get rid of any strings that are present in the code and move them to program memory That is usually the biggest memory hog. Second thing you can do if you have some large buffers then you need to declare them in global scope and re-use them for different parts of code.
Thanks master kubeek,
sorry i wanna ask u again,
first, do you mean strings code have to move in program memory flash,right?
And the second thing for some large buffers can you learn me a little bit, because i still not understand to "declare in global scope" and re-use them for different parts of code..
Thanks master kubeek,
sorry i wanna ask u again,
first, do you mean strings code have to move in program memory flash,right?
And the second thing for some large buffers can you learn me a little bit, because i still not understand to "declare in global scope" and re-use them for different parts of code..
Frankly I have no idea how your code works, but I doubt you really need 1500 bytes of ram.
Global scope means you dont declare your variables inside main or any other function, but you declare them outside of main, right after includes. This way any function can access those variables, so for example if you need some large buffer for strings coming through UART and then you neeed a similar buffer for something else at different time, you can reuse the buffer for multiple purposes without decalring another one and wasting ram.
Imagine you´re writing it in assembler, there you need to be as compact as possible and try to use only the 32 registers, and using ram as little as possible.
save the strings that go to lcd in code memory and use pointers to fetch data. you can use the ram as buffer, read the data and sent the data to lcd without storing it in buffer. scanning time will get affected but worth a try