Save custom settings to EEPROM

General discussion of using Roboclaw motor controllers
Post Reply
cengh
Posts: 7
Joined: Tue Jun 13, 2017 11:17 am
Save custom settings to EEPROM

Post by cengh »

I would like to save and read back custom settings to the EEPROM of the Roboclaw 2x7A. The amount of data is very small. I want to save a 64-bit serial number, a 32-bit bitwise bank of flags and perhaps four more 32-bit values. Is there any way to do this?

I only need to set the settings occasionally, perhaps once per day at the most so it shouldn't wear out the EEPROM. I need to read them back on startup.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Save custom settings to EEPROM

Post by Basicmicro Support »

Sorry. The Roboclaw does not allow user degined values to be saved to its internal EEPROM.
cengh
Posts: 7
Joined: Tue Jun 13, 2017 11:17 am
Re: Save custom settings to EEPROM

Post by cengh »

I see. What about commandeering a Roboclaw setting that isn't being used or doesn't apply to the particular board I have? Is that too dangerous?
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Save custom settings to EEPROM

Post by Basicmicro Support »

I would not recommend it.
robof
Posts: 36
Joined: Tue Jun 27, 2017 11:21 pm
Re: Save custom settings to EEPROM

Post by robof »

I believe the chip in the roboclaw supports user storage (512 bytes). What I'm not 100% sure on is whether this can only be written in bootloader mode.
If it's possible this can be written outside bootloader mode, is it possible this could be exposed to us? Or is it currently being used by roboclaw internally?

If it's not already being used and could be written in normal mode, I think it could be as simple as two functions, ReadUSR() and WriteUSR(). These would simply take/return a 512 byte array of the entire USR.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Save custom settings to EEPROM

Post by Basicmicro Support »

There is no access to the eeprom by the user on the Roboclaw currently and is only a wish list item at the moment.
robof3
Posts: 5
Joined: Thu Jun 28, 2018 8:08 am
Re: Save custom settings to EEPROM

Post by robof3 »

I saw in the latest firmware there is an update for writing to EEPROM. Is that related to this feature request or something entirely different?

When a new feature like that is added, how would we go about knowing (how to use) the change as the user manual appears to stay a few versions behind the firmware changes?
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Save custom settings to EEPROM

Post by Basicmicro Support »

The two new commands are 252(Read) and 253(Write).

Read Syntax: roboclaw address, 252, memory address(byte). Returns a word(word/2 bytes).

Write Syntax: roboclaw address, 253, memory address(byte), value(word/2 bytes).

There are 256 memory locations 2 bytes each for a total of 512bytes.

These commands have not been added to any of the libraries so for now you will have to implement them your self if you want to use them.
robof3
Posts: 5
Joined: Thu Jun 28, 2018 8:08 am
Re: Save custom settings to EEPROM

Post by robof3 »

What is the write limit/count that we should limit to?
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Save custom settings to EEPROM

Post by Basicmicro Support »

100,000 cycles(at 85C) is the rated write cycles for each location. If you are running over 85C alot you will need to take that into account. The eeprom is rated for 30,000 cycles at 105C.

Post Reply