Go Down

Topic: EEPROMex "Exceeded maximum number of writes" (Read 3 times) previous topic - next topic

Paul Beaudet


The question is why do you need to store the data in EEPROM, instead of, say an SD card?


I have got the shield, and have run a couple of the example sketches. I just need to spend some more time with it. I'll likely need it for another part of the program I may or may not be able to implement. I'm a little concerned about the speeds but I'll need to do some testing to see if those concerns are valid.

If have come across detailed tutorials for using sd, I would love to see. What I breezed over in the playground left me a little blurry. Maybe I'll take a closer look latter today.


You have 2048 bytes of RAM.

I'm confused as to why you can't store 26 letters in that space.

26 is fine, maybe even 52 would be fine (adding capital letters). It is adding numbers, symbols, synonymous chord values and then combining this with the main program body where memory usage is going to get hairy. 

I should have disclaimed that the crashes I got were with arrays of 128 ints which are much bigger not just a little. I really thought with 2k of ram the arduino would have been able to even handle that, but apparently there is a bit of over head and with the bits and bobs of my example program, it choked.(what little serial debugging I was doing stopped midway and could get further depending on array size)  Could have been my code, however If things were getting hairy in an example/test program I would expect there to be issues with much more code to be added, so since then I've become conscious of memory usage.


It would be a good idea for you to describe the data you're trying to persist more clearly.

Is it all predefined and constant, or will it be modified at runtime? How much data is there? What is the structure? How is it accessed? How will it be modified?


I guess the gotcha to this whole thing is that the data needs to be modified during run time. The main body of code "guesses" what letter the user is trying to type and assigns it. It needs to interpret the chord, make the "educational guess" and the assign the chord with in at least a 50ms time window to be responsive (as far as I understand, might be more or less wiggle room)

I'm fairly new to programming so structure and access are all experimental to me. An int array seems like a good middle of the road approach since using a struct is too much. As far as access goes I'm just using for loops to iterate through the data till I find what I want.
There are probably better strategies for doing this I'm just not aware yet.

Nick Gammon

If you are running out of RAM, there are techniques, such as putting string literals into PROGMEM. That can save quite a bit.

PeterH


I guess the gotcha to this whole thing is that the data needs to be modified during run time. The main body of code "guesses" what letter the user is trying to type and assigns it. It needs to interpret the chord, make the "educational guess" and the assign the chord with in at least a 50ms time window to be responsive (as far as I understand, might be more or less wiggle room)


I have no idea how you're doing that - are you using some sort of lookup table, or something?

Assume I have no idea what your sketch does - what's the structure of your data, how is it accessed and which parts of it are modified at runtime?
I only provide help via the forum - please do not contact me for private consultancy.

Paul Beaudet


I have no idea how you're doing that - are you using some sort of lookup table, or something?

Assume I have no idea what your sketch does - what's the structure of your data, how is it accessed and which parts of it are modified at runtime?


the "guess" right now, isn't vary intelligent yet. Currently just a for loop that goes through unassigned letters (i.e. chordValue==0) alphabetically, then it prints the letter and assigns the value it was tested against (the chordValue coming from the user). This is the write during run time and it need to be keep persistently unless the user deletes that letter which signals that the letter was unwanted for that assignment in which case it goes back to zero. Representing another write situation during runtime

i would post code but its really too messy for anyone to make sense of yet.

PeterH

So it sounds like you have a 'letter' identifying the chord which is assigned by choosing the first unassigned letter when the chord is first encountered, and a 'chordValue' which somehow specifies the chord. What data type is 'chordValue'?
I only provide help via the forum - please do not contact me for private consultancy.

Go Up