How to Make some Arduino SRAM memory locations write protected?

Hai Guys,

Is it possible to make some SRAM memory regions write protected (Not Read Protect) ?
For example, I am using Atmega 328p, if my knowledge is correct it's SRAM memory starts from 0x0100 to 0x08FF. I want the arduino sketch program to use only 0x0100 to 0x08B9. Is it possible to read that unused memory locations (0x08b9-0x08FF) in arduino sketch.

Thanks in advance

Boney:
Is it possible to make some SRAM memory regions write protected (Not Read Protect) ?

No.

Why would you want to do this? What are you trying to achieve? Give us the problem, not the solution.

Boney:
Is it possible to make some SRAM memory regions write protected (Not Read Protect)

The closest thing you can do to simulate this is to declare certain variables PROGMEM, which will place the data into flash memory, so it will be readable but not writeable during program execution. It won't really be SRAM, but will (mostly) look as if it is to your program (which is the basic idea of PROGMEM).

You could write data to an array also, and not allow the sketch to make changes to the array. Maybe this?

const byte dataArray[] = {0,1,2,3,4,5,6,7,8,9,}; // stored in SRAM, but not changeable by the sketch.

Thanks for your replays guys.
So it is impossible to control the SRAM memory =(. Guys could you please help me finding good resources for AVR programming. I really want to edit the arduino bootloader (Optiboot) to read initial (Power On) SRAM random values for finding any pattern they are following. I know that it is completely random but i need to know how the values depends on temperature and voltage.

I really want to edit the arduino bootloader (Optiboot) to read initial (Power On) SRAM random values for finding any pattern they are following.

well, you could look at this thread on avrfreaks: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=141279
(Isn't that you? I thought we had well-covered the idea that you don't need to modify optiboot to be able to look at the initial RAM values.)

:0 WestFw you got me... i am pretty done with that..i need some more with bootloader.... Wherever i go you are there. ]:smiley:

Boney:
Guys could you please help me finding good resources for AVR programming.

Try the datasheet.

(Which would also answer the question "How to Make some Arduino SRAM memory locations write protected?")

Boney:
Thanks for your replays guys.
So it is impossible to control the SRAM memory =(. Guys could you please help me finding good resources for AVR programming. I really want to edit the arduino bootloader (Optiboot) to read initial (Power On) SRAM random values for finding any pattern they are following. I know that it is completely random but i need to know how the values depends on temperature and voltage.

I would suggest that the best method to achieve your goal, is not to write protect the memory (which is impossible), but rather carefully construct your code to avoid using those areas. That means that you shouldn't use any libraries until you understand how they use memory. Personally, I would skip the Arduino IDE environment for this and deal with the AVR chip yourself directly. That way you have complete control over how and what areas of memory you use. While you can do this in C/C++ you need to write this code with an understanding of the assembly language produced by your code, since that will dictate how memory is used.

That and a thorough understanding of the data sheet for the particular AVR your intending to use is all you need to accomplish your purpose.

Ok, its about time you give us some solid info on what you are doing, apart from spamming forums.

You did not respond to your thread created 3 months ago. Reading Initial SRAM memory values of Arduino Uno - #11 by pYro_65 - Project Guidance - Arduino Forum

There has also been help over at AVR freaks, now we are back again here with the same question. You're starting to sound like elico and his endless quest to find an RTOS.

Info please!