Storing and comparing SRAM memory address

Is the value at that address should be always 92 ?
If so, you can store it in the code as integer constant and compare with actual content of the memory address after reset. Is it what you want?

sorry, but the same nonsense as before

you all are not helping. saying nonsense doesn't help my case.
from the code I have printed my value on the Serial monitor.
is my code all messed up that no one can suggest anything for me?
this is for research purposes so I must work with the raw value of the SRAM memory address printed out.
I have uploaded the code up to the printed-out point.
suggestions on how to save the printed value for comparison. With another variable or condition? Anything or direction will help

/* 
 CS: pin 12  
 MOSI: pin 8
 MISO: pin 10
 SCK: pin 9
 
*/

#include <SPI.h>

//SRAM opcodes
#define RDSRAM        5  //00000101 
#define WRSRAM        1  //00000001
#define READ          3  //00000011
#define WRITE         2  //00000010
int CS = 12;
int CSS = 8;
uint8_t value;
uint8_t Spi23K640Rd8(uint32_t address){ 
uint8_t read_byte;

int nval;
digitalWrite(CS,LOW);
SPI.transfer(READ);
//SPI.transfer((uint8_t)(address >> 16) & 0xff);
SPI.transfer((uint8_t)(address >> 8) & 0xff);
SPI.transfer((uint8_t)address);
read_byte = SPI.transfer(0x00);
digitalWrite(CS,HIGH);
return read_byte;
  }


void setup() {
  char data[100]; 
  short pos=-1;
  uint64_t i; 
  uint8_t value;
  byte *ptr;
 /* all pins on the Port B set to output-low */
  pinMode(CSS, OUTPUT);
  digitalWrite(CSS, HIGH);
  pinMode(CS, OUTPUT);
  Serial.begin(9600);
  delay(2500);
  SPI.begin();


  //for (i=0; i<=92; i) {  // check exact location memory locations, 64 Kbit SRAM = 65536 / 8 = 8192 i=545 
  //Spi23K640Wr8(i, (uint8_t)i);
    value = Spi23K640Rd8(i);
    Serial.print("challenge = Ox");
    Serial.println(Spi23K640Rd8(545), DEC);
    
  } 


Where do you plan to save it, that it will be available after the reset? EEPROM? SD-card? Internet?

@astroman1, you still haven't answered this question. And that error is still in your code.

I connected an SRAM to the feather m0 rm95.
the printed value is embedded in the SRAM and that's the data I want to work it.
are you saying I need another place to save it other than the code before comparing it?
and if so, I would like to use the internet because LoRaWAN will be built on top, and I will appreciate a link or a knowledge source to achieve that. thanks

it was used in the for statement when i printed all the addresses of the SRAM.
but it has been redundant since commenting it since I knew the exact location of the SRAM I wanted to print.
is there a way to call the value of the printed-out address using i?

What Arduino board are you using?!?

Those pins don't match an Arduino UNO, Nano, or Mega. What do they match?

Of course not. Your chance of coding "random stuff" that does what you want is essentially zero.

If you want this project to actually work, you will need to learn more about programming. Start by studying some line C/C++ language tutorials, and the examples that come with the Arduino IDE.

its an adafruit feather m0 (rm95) lora module

Did you mean "RFM95"?

The pinout diagram:

shows:

 MOSI: pin 22
 MISO: pin 23
 SCK: pin 24

Did you wire to the correct pins or to the pins you list in the sketch?

yes RFM95 and i wired it exactly how the data sheet for the feather and SRAM.
find attached a picture showing it

Sadly, the picture is too blurry to read the labels on the board and most of the wires go off the top of the picture.

uploaded a clearer one

yes, exactly that. just seeing this reply. thanks.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.