[sdiy] Rotary Switch -> illuminated PB w/ multicolor LED?
Roman Sowa
modular at go2.pl
Fri Feb 18 11:58:44 CET 2022
A) there's a tiny difference between writing one byte to EEPROM, and
possibly megabytes bursts of data to eMMC flash. Let's compare apples to
apples at least
B) AFAIK PicKit is not recommended because it can't precisely regulate
Vpp voltage. It does that in larger steps, while ICD can adjust both,
VDD and Vpp in 15mV steps or so. ICE and those "production programmers"
are overpriced toys for companies with no budget limits, and do the same
as ICD in most cases while costing thousands of dollars - that came from
the mouth of former Microchip employee, although not literally. $300
price range is ICD, not ICE, which is $1.5k IIRC.
Whatever programmer it was, that's still programming with external Vpp.
Writing EEPROM during normal code execution involves internally
generated voltages, so no matter what it was programmed with at the
factory, writing EE is always done by the chip itself later on.
Datasheet explicitly says that specified supply voltage for writing EE
is between lowest operation voltage for specific part (usually 2V) and
maximum 5.5V.
What other companies say about their totally different products does not
necesarily bother me when I use something well specified in datasheet.
Roman
W dniu 2022-02-18 o 00:15, Brian Willoughby pisze:
> I'm looking at two data points for my statement:
>
> A) Recent work with eMMC chips, which are NAND based, where they've added power supply voltage monitoring and an internal firmware mechanism that specifically avoids writing to the NAND memory when voltage is present but below a particular threshold.
>
> B) Microchip recommendations to never ship PIC processors to end-user customers when programmed with their inexpensive PICkit emulator, due to insufficient voltage during programming. Even though the code flash may verify as programmed, it may not read back reliably under all conditions, especially when the supply voltage varies during read-back. Microchip provides another programmer, their ICE product, that maintains a strong voltage during programming, such that read-back data is correct no matter what the supply voltage is at the time. I had a client who wanted to use the $20 PICkit to program commercial products because they didn't want to pay for the $300 programmer. Microchip specifically stated that they would not support this process.
>
> So, it still seems to me that it would be a bad idea to wait for voltage to drop before writing to EEPROM (even though EEPROM is distinct technology from NAND or NOR Flash) when one company avoids writes altogether during low voltage and another company warns that read data is unreliable when data is written during low voltage conditions.
>
> You raise a good point because perhaps EEPROM is able to function perfectly under low-voltage conditions, but I'd say it would be more important to prove that this tactic is 100% reliable, rather than assume it's reliable and expect proof that it will fail. At least, I say this when using a timer costs nothing and will certainly be reliable (unless the user thinks it's fun to change the settings a few seconds before powering off).
>
> Brian
>
>
> On Feb 17, 2022, at 12:06, Roman Sowa <modular at go2.pl> wrote:
>> How can you judge something as "bad idea" with so much self-confidence without providing any figures to back your claims?
>> Power hungry assumption is wrong, because current draw during EEPROM write is around 5mA, and write cycle takes about 5ms. That is 25uC, something that 47uF capacitor is able to deliver while loosing merely 0.5V - more than good enough to complete EE write. And that is only if main power supply voltage drops immediately, which is never the case.
>> "Over-engineering" in this case is 47uF capacitor and shottky diode. We're replacing $10 Grayhill switch here, so money and size is still way below.
>> I'm not talking about some of the modern non-volatile devices, but sub dollar PIC microcontroller, which does write EE in low supply conditions.
>> Writing EE with a timer after a change is still writing after a change, so it doesn't reduce many writes, it all depends on playing style. That's more like battery backed RAM way of doing things.
>>
>> Roman
>>
>> W dniu 2022-02-16 o 07:10, Brian Willoughby pisze:
>>> Bad idea to wait for the supply voltage to drop before writing to non-volatile memory, because the write operation requires more power. It will not be reliable unless you completely over-engineer the supply to be able to sustain sufficient power after it's turned off. Sure, it can be done, but there are other ways to solve this that don't increase size and cost of the circuit.
>>>
>>> Some of the modern non-volatile devices have onboard firmware that detects drooping voltage, and actually refuse to write to the NV memory unless the power is at full levels. They'll cache the data in internal SRAM and only write it after power is restored. If power is never restored, that data is lost rather than risk starting a write operation that cannot be completed due to falling power.
>>>
>>> An easier approach is to set a timer every time the value is changed. If the user changes the value before the timer expires, then simply restart the timer from the beginning again. But if the timer expires without any further changes, that's a good time to save the most-recent value. There aren't many musical uses for changing a setting right before turning off the power, and users probably won't be upset if such an erratic change is lost. In contrast, if the value if left steady and used musically for a while then it makes sense for it to be retained. You can choose whether the timeout is 1 second, 10 seconds, 30 seconds - anything that makes sense for the typical workflow.
>>>
>>> The replies about EEPROM versus Flash are correct. An EEPROM will last through 10 times as many writes as a Flash device. Some of the high capacity devices are actually 1/100 of an EEPROM's duration, but I doubt anyone is putting 16GB of NV memory in a module. The only downside is thet EEPROM memory sizes are much smaller, but that won't affect storage of a 2-bit or 3-bit setting. Many PIC and other micro controllers have both Flash and EEPROM for code and settings, respectively.
>>>
>>> But, yeah, nothing beats a mechanical rotary switch ... provided the price is reasonable.
>>>
>>> Brian
>>>
>>> On Feb 11, 2022, at 13:05, Roman Sowa wrote:
>>>> Power off and one button + LEDS was discussed here exactly 8 years ago.
>>>> There's no endurance issue, because how many times do you plan to turn off the modular? Some people never do it at all. But let's say everyday for 40 years, so that's still about 15% of typical EEPROM endurance in microcontrollers, and probably less than 1% of standalone good quality EEPROMs.
>>>> EEPROM should be written only when supply voltage is detected to fall below some threshold. Those 8 years ago I've made an example with PIC12F683 and even posted video about it. Of course at the moment you can forget about getting any PIC12F683, but it can be rewritten to anything else with self-writing capability.
>>>>
>>>> Surely nothing beats Grayhills, although for me they are too stiff for 1/2'' knob. OTOH the already mentioned NKKs work with perfect feel.
>>>>
>>>> Roman
>>>>
>>>> W dniu 2022-02-11 o 18:52, grant pisze:
>>>>> I haven't found one small enough and even the closest competitors seem
>>>>> like $10+ (recent prices). The Grayhill 56 series is pretty tiny as
>>>>> rotary switches go.
>>>>>
>>>>> The other thing that's nice about a rotary switch versus an electronic
>>>>> pushbutton/MCU/LEDs is memory. Not only does the switch already tell you
>>>>> what bank you are on as you switch it, but it remembers it when the
>>>>> power goes off. :-) So that needs to be factored into the MCU probably
>>>>> (EEPROM or emulation in flash, but endurance could be an issue).
>>
>>
>
More information about the Synth-diy
mailing list