#avr Logs

Mar 05 2021

#avr Calendar

02:49 AM vgtw_ is now known as vgtw
04:41 AM Sponge5: Hi, I have a quick question. I've read that EEPROM has 100.000 r/w cycles. I'd like to write to it a handful of times (each FW update), but read from it more than 100.000 times, is that possible?
05:06 AM mouseghost: ive heard that flash has worse lifetime at writing
05:06 AM Helle: read life cycles are near infinite, though the EEPROM may only be good for 10-20 years due to charge migration
05:07 AM mouseghost: Sponge5, are you sure these are called "r/w" cycles?
05:07 AM Helle: they are write cycles
05:08 AM Helle: and yes, flash has/had worse lifetime, but it really depends on the process and some AVR chips have such flash that they emulate the EEPROM on flash with similar write cycle lives as old EEPROM
05:08 AM Sponge5: I've read it on multiple sites and I think in ATmega reference as well
05:08 AM mouseghost: Helle, hence why am asking bout the "r" there
05:09 AM Helle: yeah, reading is not enough of an event to really matter
05:09 AM Sponge5: Since I got u here, Is EEPROM read slower than reading from SRAM?
05:09 AM Helle: life span is more due to natural migration over time
05:09 AM Helle: yes, by a ton
05:09 AM mouseghost: ye
05:09 AM Sponge5: thanks
05:10 AM mouseghost: Helle, as per flash, i always though that eeprom=flash, but turns out not so lol
05:10 AM Helle: mouseghost: yeah, they are fundamentally different technology
05:10 AM mouseghost: i see, hmm
05:11 AM mouseghost: well, both can be killed pretty easily afaik...
05:11 AM Helle: including the most important fact, EEPROM is byte accessible in read/write, flash only block accessible for clear
05:11 AM Helle: eeeh
05:11 AM mouseghost: ah
05:11 AM Helle: https://hackaday.com/2011/05/16/destroying-an-arduinos-eeprom/
05:12 AM Helle: and several other people have done such experiments
05:12 AM Helle: it's just 100k is guaranteed (like, I think 10k is guaranteed for the flash)
05:14 AM mouseghost: 47 days is most certainly a reachable time in a normal use
05:14 AM Helle: mouseghost: sure, but you have to set out to destroy it basically
05:15 AM Helle: like, be aware that it has a limited life and if you need to even approach it, take appropriate measures to spread out the writes
05:15 AM mouseghost: im not sure if a write cycle constitues a whole memory rewrite? Helle
05:15 AM Helle: for EEPROM, each byte individually counts (technically each bit)
05:16 AM Helle: so if you include a counter and spread out the writes over the whole EEPROM in a ring pattern
05:16 AM mouseghost: so the limited life awareness makes it easy to kill it, imo
05:17 AM mouseghost: for example, if you write 3 bytes a second
05:17 AM Helle: I mean if you are doing that much writing, you need to start using a large external EEPROM and do the ring buffer on there
05:18 AM Helle: because you won't get something with much more then 1 million cycles guaranteed
05:18 AM mouseghost: but imo that already makes it in "easy to kill" cat.\
05:18 AM mouseghost: if it wasnt, a bad design decision wouldnt matter that much
05:19 AM mouseghost: i guess it depends on the definition of easy to kill uhh..
05:20 AM mouseghost: Helle, iirc tesla had eeprom or flash soldered and they died now and then
05:20 AM Helle: they have TLC/MLC flash soldered in....
05:20 AM Helle: which is uuuuh, yeah, many times more vulnerable
05:20 AM Helle: but a Tesla also runs Linux and had extensive logging turned on in production.....
05:21 AM Helle: not exactly things you have on a small MCU
05:23 AM mouseghost: what is the definition of easy to kill then ;x
05:23 AM Helle: mouseghost: if you write to each every few minutes, or every time a user interacts with the device, you don't have much to worry about
05:24 AM Helle: the small size of the EEPROM really means you can't use it for a log or the like anyway
05:24 AM mouseghost: s-size doesnt matter! Helle
06:33 AM Sadale_ is now known as Sadale
08:58 AM rue_mohr: I should use 7 bits with the eeprom so I have a parity bit
10:56 AM samantaz_ is now known as samantaz
07:04 PM karthyk: what if i configure a pin as input pin and then toggle it using PIN
07:07 PM cehteh_: you can just try it
07:07 PM karthyk: DDR and PORT registers may be both written to, and read. PIN registers correspond to the state of inputs and may only be read. in datasheet it says we can write
07:07 PM cehteh_: i forgotten what the datasheet says, could be that it generates a interrupt on the pin, or nothing
07:07 PM Thrashbarg: internal pullup?
07:08 PM cehteh_: nope thats the PORT
07:08 PM cehteh_: and the interrupt generation was only a guess
07:09 PM Thrashbarg: "If PORTxn is written logic one when the pin is configured as an input pin, the pull-up resistor is activated." yt
07:09 PM Thrashbarg: *yea
07:10 PM cehteh_: i know that, just dont know if PIN has any meaning
07:10 PM Thrashbarg: I was just confirming
07:14 PM Thrashbarg: says they're read only on the datasheets I'm reading hrm
07:14 PM karthyk: it says read only but later on it says However, writing a logic one to a bit in the PINx register, will result in a toggle in the
07:14 PM karthyk: corresponding bit in the data register
07:15 PM Thrashbarg: sure ok
07:15 PM karthyk: whtat does that mean
07:15 PM karthyk: i am confuse
07:16 PM Thrashbarg: write 0x1 to PINA, it toggles the PA0 pin
07:16 PM Thrashbarg: so if PA0 was 0, it becomes 1, if it was 1, it becomes 0
07:17 PM cehteh_: you can toggle the bits on a whole port (up to 8 pins) in one cycle
07:17 PM Thrashbarg: yup
07:17 PM Thrashbarg: just change the number written to the port
07:17 PM karthyk: That is exactly what i wanted to know thanks
07:17 PM karthyk: holy shit
07:17 PM Thrashbarg: heh
07:18 PM cehteh_: where arduino needs 800 cycles toggle a single pin :)
07:18 PM Thrashbarg: haha
07:18 PM karthyk: how do you guys know all this stuff
07:18 PM cehteh_: havent measures, but prolly close to reality possibly even worse
07:18 PM cehteh_: by reading datasheets?
07:19 PM cehteh_: how else?
07:19 PM Thrashbarg: practice
07:21 PM karthyk: in arduiono documentaion it says PIN registers are read only
07:21 PM karthyk: why is that
07:21 PM Thrashbarg: says the same in the datasheet too
07:21 PM Thrashbarg: probably a mistake. Datasheets aren't guaranteed to be 100% accurate all of the time lol
07:22 PM cehteh_: never look at 3rd party hereday docs, esp arduino, hackaday or instructable
07:22 PM cehteh_: s
07:22 PM cehteh_: thats so often inaccurate
07:22 PM Thrashbarg: Instructables are the worst lol
07:22 PM cehteh_: always look at the oriignal docs/datasheets of the part you are using
07:22 PM Thrashbarg: yup
07:22 PM karthyk: ok boss
07:27 PM karthyk: why is there a PIN register cant we just use the PORT register and change it to toggle
07:27 PM karthyk: but using some bit mask
07:27 PM cehteh_: with PORT you set it some some defined states, with PIN you toggle
07:28 PM karthyk: ok
07:34 PM karthyk: man i feel like a hacker reading the datasheet
07:48 PM rue_mohr: PIN is read and toggle
07:48 PM rue_mohr: PORT is write and get past assigned value vs real value
07:48 PM rue_mohr: DDR is direction
07:48 PM rue_mohr: rw