16n-faderbank / 16n

Sixteen faders, a Teensy, MIDI over USB and jack, CV out, and I2C out. Phew.
Other
337 stars 58 forks source link

v2 Firmware: add force-factory-reset sysex message. #41

Closed infovore closed 3 years ago

infovore commented 4 years ago

A 16n with v2.0.x firmware starting up for the first time checks its EEPROM to see if it needs to do a factory initialisation. It does this by looking at the first byte of sort-of-EEPROM; if it's not 0xff, it assumes it's already been programmed; otherwise, it fills the EEPROM with default settings.

This is a problem if your Teensy has been used in a previous project, and has a non-0xFF first byte, but the rest of the EEPROM is not really 16n data; that data gets sent as garbage Sysex.

So:

modularev commented 4 years ago

I just ran for (int i = 0 ; i < EEPROM.length() ; i++) { EEPROM.write(i, 0xff); }

which made it get recognized by the editor and work as expected! Thanks and all the best!

infovore commented 4 years ago

@modularev Amazing! That's really good to know because it confirms that this is the issue. I've got the sysex end of things written, just need to work out how to add it to the editor in a sensible way - and then people who aren't editing code can have the same fix.

modularev commented 4 years ago

A weird thing I noticed with my solution is that the editor won't show any value of the fader when cc is set to sth else than "standard" e.g. fader 16 with init cc 47 doesn't show it's value in the editor when changed to cc 88 the 16n regardless sends the correct value on the correct midi channel...

modularev commented 4 years ago

nevermind, initializeFactorySettings(); solved it.

infovore commented 4 years ago

good to know: the change I'm making basically runs initializeFactorySettings() when sent a sysex message. should be done in the next few weeks.