4

Trying for a while now, but I cannot find an EEPROM memory with some address bit mapped to a GPIO. Or from a different angle, a GPIO expander with an EEPROM memory to save the config.

Do such devices exist in the market?

EDIT: of course the easier way would be to use an MCU, but that is not an option, as it requires additional dependencies. This is the required functionality:

A CPU can boot from either NOR flash 1 or NOR flash 2. The only way to switch between the flashes is to switch the #CS pin. Before the CPU boots, the #CS pin info (0 or 1) has to be set in hardware. That can be done by the external entity that has a GPIO and an EEPROM. The configuration can change during run time, that's why it has to programable somehow (i.e, via I2C). So I am either looking for an EEPROM that maps one of its addressed values to GPIOs (although I just need 1), or I am looking for a GPIO expanded with (as mentioned) a non volatile memory. This way at power up, the programmed GPIO value is preserved.

There is more logic to that, but this explains it in a nutshell. I simply need to preserve a state of a GPIO (programmed before shutdown) at power up. The gpio state has to be valid for infinity in theory, that's why charging a capacitor or other solution is a no go.

Łukasz Przeniosło
  • 1,619
  • 1
  • 19
  • 37

3 Answers3

7

And I think I found a solution to my problem: this Maxim DS4520 Non Volatile I/O Expander.

TonyM
  • 21,742
  • 4
  • 39
  • 62
Łukasz Przeniosło
  • 1,619
  • 1
  • 19
  • 37
  • 2
    That seems to be a rather pricey part - another option would be a non-volatile digital potentiometer (you'd only use the extreme ends of its range). They're available in 2- or 4-channel versions if you need more than one such configuration bit. – jasonharper Feb 18 '22 at 22:39
-1

Afaik, the usual way is to split your requirements in two:

  • Storing the information on the EEPROM (of your MCU)
  • Having a GPIO expander

The typical steps are:

  • The Arduino reads the configuration from the EEPROM
  • The Arduino uses this configuration to send signals to the GPIO expander

And of course you need to write code for changing the configuration.

Michel Keijzers
  • 13,867
  • 18
  • 69
  • 139
  • tbh the configuration is unlikely to be huge, it can simply be a hardcoded array of config to be transmitted to the expander, which gets off the memory stack as soon as the function is done – Ilya Feb 18 '22 at 11:39
  • @Ilya I assume when EEPROM is needed, the configuration can change – Michel Keijzers Feb 18 '22 at 11:41
  • tbh if there is an MCU attached, I can't find a valid reason to hold any of that in eeprom pretty much ever. I mean, unless there are several config sets? Even then they can be hardcoded and will only use RAM 1 config set at a time when they're needed ¯\\_(ツ)_/¯ – Ilya Feb 18 '22 at 11:45
  • I can imagine it is user selectable or something, but indeed, it's unclear from the question. – Michel Keijzers Feb 18 '22 at 11:51
  • 3
    I added more details. MCU is of course the go to solution, like attiny, but it requires programming, which adds complexity. – Łukasz Przeniosło Feb 18 '22 at 12:13
  • Yes, now your solution seems best. – Michel Keijzers Feb 18 '22 at 16:35
-3

While it seems you found a commercial option to suit your needs, the other alternative is to roll your own. A general purpose microcontroller with NVram or eeprom can function as a digital port expander. There are multiple libraries online to deploy one like this quickly. It's basically trivial for anyone with microcontroller experience. This gives you more leeway than a purpose built one as you may not want i2c, or need more or less ports, or need other functionality.

Passerby
  • 72,580
  • 7
  • 90
  • 202
  • 2
    This takes a hobbyist view of it and does not consider the considerable business costs of software development and support. Even having just a one-line program incurs significant costs. OP's question discounts MCUs, possibly for that reason. As an aside, it's not trivial, merely straightforward. Downvoting for those reasons, I'm afraid. – TonyM Feb 18 '22 at 12:58