Read and Write Eeprom Problem, Programming Atmega32 with Arduino IDE

i have test the Eeprom Library, work perfectly in Arduino uno and Proteus Simulation, but cant read/write in ATmega 32 with custom development board.

Anyone can give me a sample code, how to Read and Write Eeprom via Programming Atmega32 with Arduino IDE?

thanks

Are you using MightyCore?

What exactly do you mean by "cant read/write"?

the program cant write or read value from Eeprom,

i used this

the librrary used this

You didn't really answer either of my questions.

Most importantly:

pert:
Are you using MightyCore?

Which hardware package are you using?

zifank:
i used this

Woah, old school! Did you make that?

zifank:
the librrary used this
https://github.com/ryantenney/EEPROMex/blob/master/EEPROMex.h

Why would you use that? The EEPROMex is completely obsolete and even worse you're using an outdated version of the library.

pert:
You didn't really answer either of my questions.

Most importantly:Which hardware package are you using?
Woah, old school! Did you make that?
Why would you use that? The EEPROMex is completely obsolete and even worse you're using an outdated version of the library.

1, no, i don't use MightyCore,
2. yes, very old school.. :wink:
3. what the best or newest library for use Eeprom for Programming Atmega32 ?

thanks pert..

zifank:
1, no, i don't use MightyCore,

The Arduino IDE doesn't have built-in support for an ATmega32-based board. So you must have done something to add support for the ATmega32. So tell me what you did and then I can answer your question.

First, i have a 3 variable o write a code to write to eeprom in arduino uno, use Eepromex.h library with this code :

#include <EEPROMex.h>
int var1;
int var2;
float var3;

int ledpin;

int avar1 =0;; //var 1 address
int avar2 =10;//var 2 address
int avar3 =20;//var 2 address

void setup() {
 Serial.begin(9600);
 pinMode(ledpin, OUTPUT);
 digitalWrite(ledpin, HIGH);
 writeep();
 readep();
 Serial.println(var1);
 Serial.println(var2);
 Serial.println(var3);
}

void loop() {
  
}
void readep(){
 var1 = EEPROM.readLong(avar1);
 var2 = EEPROM.readLong(avar2);
 var3 = EEPROM.readFloat(avar3);
}

void writeep(){
 EEPROM.writeLong(var1, 8000);
 EEPROM.writeLong(var2, 9000);
 EEPROM.writeFloat(var3, 1.23);
}

the led used for sign when my development board working with my code;

and upload to Uno. the result work perfectly in Uno.

Next, I try to upload using programmer to gelatino -32 w/Atmega32 with USBasp.

Then the chip move to my development board, and led light normally, but the program can’t read or write internal eeprom, the variable value still zero;

That’s my problem