Internal EEPROM cause arduino to freeze

Hi everybody,

I running into a strange problem with internal eprom with an arduino Nano (I got only this version). From the Arduino datasheet http://arduino.cc/en/Main/ArduinoBoardNano I can see that a 1KB eprom is avaible.

When I try to write the full eprom the arduino seem to freeze.

for(int i=0;i<1024;i++) EEPROM.write(i,0);

When I use a value much smaller (like write only 600 bytes) it work fine.

In the same code I’m also using also the F("") macro (http://playground.arduino.cc/Learning/Memory), but seem that the string should be memorized into the flash memory and not the eprom.

Any idea of what can be?

thank you in advance.

inode

Show us your sketch.
PS: Arduino nano 2.x has got only 512b eeprom.

512 bytes in a '168, 1024 bytes in a '328P.
Even so, writing past 512 in a 168 would only wraparound and restart at 0.

Each byte takes 3.3mS, so 1024 bytes = ~3.3792 seconds.
Even so, odd for the code to totally freeze.

I did some more test, on an empty sketch the code is working fine and I can access to all 1024 bytes... unfortunately I cannot post my code here.

It's possible that EEPROM.write will get trouble inside a routine called by an Interrupt? I saw that serial line got problems on this case, but no mention to EEPROM stuff.

Regards.

inode

It's possible that EEPROM.write will get trouble inside a routine called by an Interrupt? I saw that serial line got problems on this case, but no mention to EEPROM stuff.

How long did CrossRoads say that the loop would take to execute? Now, is it anywhere near reasonable for an interrupt to take that long?

I didn't think so.

If you can't post, because your sketch is too long, click Additional Options below and Attach your sketch.

I don't know but the code work correcly outside the interrupt call. I will check again inside a interrupt when I have some free time...

Thank everybody.

inode

Perhaps you are running out of RAM? Try to hold all stable values like output strings for a display in the flash-ROM. Instead ofprintln("Hello World");type println(F("Hello World")); This will save you some space in the RAM. The problem is that the arduino IDE doesn't tell you about RAM problems. But this can occur the more complex your sketch is.

Elektrix