chipKIT® Development Platform

Inspired by Arduino™

Max32 memory remaining

Created Fri, 23 May 2014 16:50:25 +0000 by Ian Billing


Ian Billing

Fri, 23 May 2014 16:50:25 +0000

I had an idea to connect a 256K eeprom to a Max32 in order to store initialization settings and customized messages and save on RAM in the Max32. Technically this works well but, practically, the time taken to retrieve bytes from eeprom during sketch execution is far too long.

So, if an input toggles, I need to look up the customized message linked to that input. From the Max32 RAM (having looked up the message during boot and written it to a global variable) it's 21mS whilst from eeprom its over 200mS - far too long.

So I would like to look up all of the messages from eeprom during boot up and write them to global variables for easy retrieval later on but that is going to eat into available memory.

How do I keep tabs on what the memory status is and how much these global variables are taking up?

All input appreciated.


pito

Fri, 23 May 2014 17:15:48 +0000

From the Max32 RAM (having looked up the message during boot and written it to a global variable) it's 21mS whilst from eeprom its over 200mS - far too long.

How big are your messages??


Jacob Christ

Fri, 23 May 2014 18:13:08 +0000

Is your EEPROM I2C or SPI?

I2C has a 400kHz buss speed. While you can clock SPI close if not at 20MHz. Also, your may have lots of overhead if you read a byte at a time. Most serial EEPROM will allow you to send an address then read byte after byte forever (looping around to the beginning if your hit the end of memory).

Jacob


Ian Billing

Sat, 24 May 2014 02:52:09 +0000

1358 bytes and it's I2C. Jacob you're right - I was doing it a byte at a time so I'll change that - it is sure to make it more efficient. BTW - any ideas on how to check memory overhead?


Jacob Christ

Sat, 24 May 2014 05:23:55 +0000

Off the top of my head, no, but I am pretty sure the topic has come up previously and the question has been answered. I think I asked.

Jacob