mathertel / DmxSerial2

An Arduino library for sending and receiving DMX RDM packets.
BSD 3-Clause "New" or "Revised" License
99 stars 30 forks source link

Saving RDM data issue #50

Closed piotr555 closed 11 months ago

piotr555 commented 11 months ago

Hi all, First of all, thank you for sharing this wonderful library! I'm struggling with some stange issue, maybe you have already encountered a similar problem and will be able to help me. I have several light sources with the driver based on mega328P. So the hardware is almost identical like Arduino + DMX shield, but the PCB is own design. I use DMXcat as DMX/RDM controller. I'm able to control every single device, set device address and properties. Everything seems to work fine until the power goes off. The issue is that after switchhing on the whole set, some of the devices are run again with the defaualt settings (address: 1 and the device name "new"). As I'm not sure if the problem is the EEPROM data saving or reading, I modified the library code a little bit to add additional CRC in EEPROMVALUES struct. Additionally I try to save / read data again when the the verification of CRC fails. But after all the issues still exists. Do you have any suggestions what could be wrong? I'm wondering if sending respondMessage (interrupts?) just after _eepromSaved is called could somehow affected saving process as it takes a few milliseconds?

piotr555 commented 11 months ago

I found the source of the problem. EEPROM was corrupted (one or more bytes has been randomly changed) after a few circuit resets. The solution is to set Brown-out detection at e.g. 2.7V. It is disabled by default for brand new chips.