Hi, I've followed the tutorial through and had some success. I'm trying to use the eeprom for counters so I know how often and on what mode the product is used and so at a point I want to increment one in an array of counters.
I tried to follow through on the example code but convert it to uint16_t array. Some save, some don't. Is my eeprom update block statement correct? Can I even do this?
Posted by avrcandies: Sun. Apr 25, 2021 - 07:56 PM
1
2
3
4
5
Total votes: 0
I know it's been a long time since you posted this, but is there such library for the Arduino.
Cant you access EEAR, EEDAR, & EECR??...if you can you can easily get the value you need from EEPROM or store it...what more would you need to do? That assumes you have a specific location you wish to access.
When in the dark remember-the future looks brighter than ever. I look forward to being able to predict the future!
I know it's been a long time since you posted this, but is there such library for the Arduino.
The EEPROM.h library is part of the standard Arduino distribution (and 3rd party cores) for those MCUs that have on-chip EEPROM, which include the common AVRs. Other MCUs, e.g. Arm, that don't have on-chip EEPROM may offer an emulation library using flash.
EEPROM is usually presented as an array, e.g. EEPROM[42] = 7; you can also write this as EEPROM.write(42, 7);
Thanks you for helping
...
- Log in or register to post comments
TopEvery Atmel Datasheet I've seen has code examples on how to access the EEPROM similar to this:
Containing a wait loop looking at the EEPROM busy bit. No external delay needed. How did you miss that?
Jim
FF = PI > S.E.T
- Log in or register to post comments
TopHi, I've followed the tutorial through and had some success. I'm trying to use the eeprom for counters so I know how often and on what mode the product is used and so at a point I want to increment one in an array of counters.
I tried to follow through on the example code but convert it to uint16_t array. Some save, some don't. Is my eeprom update block statement correct? Can I even do this?
Thanks in advance,
markah
- Log in or register to post comments
Top10 bytes is not the length of a 10 element array of 16bit values. The size is actually 20 bytes (10 lots of 2 bytes). Of course you could just use:
This way if you value the [10] dimension the number of bytes read/written will vary.
- Log in or register to post comments
TopDoh!
Not the first time you have come to my rescue! Much appreciated
Mark
markah
- Log in or register to post comments
TopI know it's been a long time since you posted this, but is there such library for the Arduino.
- Log in or register to post comments
TopCant you access EEAR, EEDAR, & EECR??...if you can you can easily get the value you need from EEPROM or store it...what more would you need to do? That assumes you have a specific location you wish to access.
When in the dark remember-the future looks brighter than ever. I look forward to being able to predict the future!
- Log in or register to post comments
TopThe EEPROM.h library is part of the standard Arduino distribution (and 3rd party cores) for those MCUs that have on-chip EEPROM, which include the common AVRs. Other MCUs, e.g. Arm, that don't have on-chip EEPROM may offer an emulation library using flash.
EEPROM is usually presented as an array, e.g. EEPROM[42] = 7; you can also write this as EEPROM.write(42, 7);
- Log in or register to post comments
TopPages