User defined EEPROM

I can read/write the EEPROM on an Ardunio Nano and know about wear leveling. I'd like to create a product that provides say 6 outputs and I'd want the user to be able to set the behavior of every output. The only way I can think of doing this is using the EEPROM. Assuming this is correct: is it possible to connect the Arduino Nano to a Mac/PC and write user settings to the EEPROM? I'd like to do this with a simple little standalone GUI and not via Ardunio IDE. Mac preferred. Thanks.

Yes, GOOGLE : Arduino Serial Basics - This will give you almost everything you need. the rest is in the EEPROM examples.

At boot time or at runtime? Frequently, once in a while, or once and forever? How much info do you want to store about each output? On/off? A PWM value? Something else?

You can take serial input and write the values you get to EEPROM?

From your perspective or from that of your users? If it's the latter, it's best to design something as OS-agnostic as possible.

At boot time or at runtime? Frequently, once in a while, or once and forever? How much info do you want to store about each output? On/off? A PWM value? Something else?

User connects device to Mac/PC, makes his choices, unplugs device and uses it without connection to Mac/PC. I would expect changes every few months (maybe less) after an initial setup. I only need to store very little data, approx 6 addresses with values from 0 to 255.

You can take serial input and write the values you get to EEPROM?

Yes exactly what I am trying to accomplish.

From your perspective or from that of your users? If it's the latter, it's best to design something as OS-agnostic as possible.

From user perspective. So OS-agnostic would be best, yes. What OS-agnostic solution have you got in mind? I have coded quite a few things over time and usually find my way using Google etc. I haven't done serial communication until now and I am trying to get a good starting point.

Robin's Serial Input Basics - updated can give you some ideas.

1 Like

Now that I have a better picture, I can see where the difficulty lies. You want to distribute the device with as little burden on the users as possible, so it won't do to have them install the Arduino IDE if they aren't into arduinos and just want to use the thing and update it from time to time. The best solution would be to write a little companion program yourself and ship it with the product along with a manual of some kind. Writing a CLI application in a high-level language (Perl, Python, Ruby) shouldn't be too hard if you know how to code and find the libraries you need. On the other hand, a GUI app would be more involved and less portable, maybe it's doable in Java? Then, again, not all users are familiar with a terminal emulator and a CLI, so maybe a text app would be too much of a burden for them. Maybe go for a middle-of-the-road solution, something like a curses app with some menus (no idea if Wndoze will run it, though).

On the other hand, what if you forwent this idea of an external computer and made your product the self-contained configurator of itself? If the product comes with a display, make a configuration menu. Otherwise a couple of buttons and 8 LEDs will do. The LEDs can, in turn, represent the pin to be configured and the value to assign to it, in binary. If you don't expect your users to know binary, a lookup table mapping ....***. to 14 and so on and a few lines of explanation will do wonders. It's a quick job to make such a table programmatically.

1 Like

@sterretje Many thanks for the link!

@330R: Thank you for the extensive write-up, your are spot on: I can't expect my potential clients to install Arduino IDE or use anything command line related. I did multiple projects with little screens but in this case one requirement is that the device is as light as possible. Adding a screen and pushbutton/joystick I'll therefore only use as last resort. The hint with Java is great, I've watched a few things on Youtube that are very promising. I'll look into that one and report back in a few weeks.

GUI apps based on scripting languages can be just as portable. I used to code in Tcl/Tk many moons ago; develop under Linux, run under Windows :wink:

It's the "many moons ago" that has me worried. The Redmond disease has gotten more severe in recent years, or so I'm told (I've been out of the scene since win 3.1). I know the affected machines tend to have a JVM, but the last time I cared to check, they didn't have Perl, for instance. Cygwin should take care of that, but what about the GUI libraries?

a common terminal emulator app can communicate with an Arduino thru the serial/usb interface.

the arduino can support commands entered thru the terminal emulator. no need for some external app (Perl, Python, Ruby, Java, ...). include a "?" command to show what commands are available