#avr | Logs for 2014-09-04

Back
[05:31:13] <wulax> Can someone tell me if I have calculated this right? I have a 24LC64 EEPROM, which can store 64*10^3 bytes, every second day, I will write 200 bytes to it. I'll use some wear-leveling algorithm so wear is pretty much even. It has 10^6 write cycles capability. This should give me 64*10^3 / 200 * 10^6 / 2 = 160*10^6 days of use.
[05:35:53] <twnqx> i'd thing that 64*10^3 should be 2^16 :P
[05:36:30] <wulax> hmm
[05:36:45] <wulax> yeah, you are right I think
[05:37:05] <wulax> thanks
[05:41:50] <wulax> twnqx: But 2^16 is in bits isn't it? Then I would have to change the 200 bytes to a power of 2. So then the ratio would be the same wouldn't it?
[05:42:53] <twnqx> 64*10^3 = 64000 bytes
[05:43:09] <twnqx> judging from that number you'd have 2^16=65536 bytes
[05:43:18] <twnqx> not bits
[05:44:01] <wulax> oh, I see, thanks for the explanation
[05:44:11] <twnqx> The device is organized as eight blocks of 1K x 8-bit
[05:44:14] <twnqx> so no
[05:44:20] <twnqx> you have 8192bytes
[05:44:34] <twnqx> or roughly 8*10^3
[05:44:58] <twnqx> 64kbits/8kbytes
[05:45:55] <wulax> interesting, thanks
[05:47:05] <twnqx> so with 200bytes/day you have a full cycle every 40 days, or 40MDays at the given 1M cycles
[05:47:30] <wulax> yeah
[05:48:25] <twnqx> though i can't guarantee how that really works, you might actually want to do block erases once you move on to next block - i don't know if the flash memory inside eeproms really does single bit erases.
[05:49:45] <wulax> I was wondering if I should use some kind of volatile memory with a battery backup instead of an eeprom at that data rate
[05:49:49] <twnqx> since the eeprom seems to use 32byte pages you might wannt to format your data to 256 bytes, and erase the 8 matching blocks before writing to achiave higher durability... though i guess it might not matter over the lifetiem of your device
[05:50:09] <twnqx> since in worst case i'd just your durability might drop from 40Mdays to ~ 1MDays :P
[05:50:20] <twnqx> i'd think*
[05:50:28] <wulax> sounds reasonable
[05:50:56] <twnqx> which would be... 3000 years, very rougly
[06:06:28] <Lambda_Aurigae> StevenS, so, the CKDIV8 fuse is set on your device and doing that CLKPR write sequence changes the prescaler from 8 to 0.
[06:07:37] <specing> wulax: first rule of eeprom is not to worry about it wearing out
[06:08:05] <specing> that doesen't mean you should use it as RAM extensions.
[06:08:22] <Lambda_Aurigae> copiers use eeprom all the time and don't bother with wear leveling.
[06:08:25] <specing> but for what it is meant for (saving settings and stuff) it wont ever wear out
[06:09:28] <Lambda_Aurigae> heck, xerox copiers have an eeprom in most drums and toner cartridges and update them every time a page goes through the copier...drums can go as much as 200000 cycles sometimes too...some even more.
[06:18:32] <wulax> specing: yeah, I am starting to realize that :)
[06:36:02] <Lambda_Aurigae> http://dangerousprototypes.com/2010/05/25/prototype-flash_destroyer/
[06:36:10] <Lambda_Aurigae> just for a reference and whatnot wulax
[06:36:24] <Lambda_Aurigae> multiple million writes to some eeproms.
[06:36:42] <Lambda_Aurigae> way beyond the documented lifetime.
[06:39:37] <Lambda_Aurigae> if I had something I needed to write to a lot and fast I would use nvram....
[06:40:57] <Lambda_Aurigae> microchip 23LCV1024...1Mbit serial sram in an 8pin package with a battery backup capability...just use a little lithium battery to keep it live when main power goes out.
[06:41:16] <Lambda_Aurigae> http://www.microchip.com/wwwproducts/Devices.aspx?product=23LCV1024
[06:42:00] <wulax> that flash destroyer is a pretty interesting device, thanks for the link
[06:42:10] <wulax> and thanks for the suggestion of RAM too
[07:15:27] <Jartza> wii emma
[07:15:47] <Jartza> cool, fumble
[07:16:23] <Jartza> quite a ping-timeout flood on all channels
[07:54:54] <Jartza> just out of curiosity, has anyone tried overclocking attinys?
[07:54:55] <Jartza> ;)
[08:01:02] <Steffann> some have Jartza. This funny project is (ab)using it: http://spritesmods.com/?art=avrfmtx
[09:57:38] <Duality> imagine
[09:57:44] <Duality> z80 in every computer
[09:57:48] <Duality> in every watch
[09:57:52] <Duality> in every laptop
[09:57:56] <Duality> in every phone
[09:58:00] <Duality> in every home
[09:58:02] <Duality> basicly
[09:58:12] <Duality> wouldn't that be awesome :)
[09:58:39] <twnqx> ... no
[10:00:44] <dunz0r> Duality: No?:D
[10:01:01] <dunz0r> Everything would be slow and use huge amounts of power
[10:01:27] <Tachyon`> at least poeple would learn proper asm again
[10:01:36] <twnqx> lol
[10:01:43] <twnqx> it's not proper if it's not SIMD :P
[10:01:44] <Fleck> dunz0r: there are new chips
[10:01:47] * Tachyon` started with z80 and 6502
[10:01:53] * twnqx started with 6502, too
[10:01:56] <Tachyon`> BBC?
[10:02:01] <twnqx> c64
[10:02:03] <Tachyon`> ahhh
[10:02:07] <Tachyon`> well, you really had to with that basic
[10:02:07] <twnqx> c128, to be honest
[10:02:18] <dunz0r> 8 bits is more than anyone will ever need?:)
[10:02:19] <Tachyon`> there's a C128D to the right of me now actually
[10:02:27] <twnqx> i sold mine in 1994
[10:02:29] <twnqx> or 1993
[10:02:31] <Tachyon`> ahh -.o
[10:02:43] <Tachyon`> http://kupo.be/pics/fixedplus2b.jpg
[10:02:48] <Tachyon`> you can just see it to the right of the spectrum, lol
[10:02:49] <twnqx> and i stopped ASM programming after the 80486
[10:03:02] <twnqx> on the other hand
[10:03:08] <twnqx> i have a few c64 behind me :)
[10:03:13] <Tachyon`> ahh, lol
[10:03:23] <Tachyon`> I'm not sure how many c64s I have
[10:03:26] <Tachyon`> depends if DTVs count
[10:03:44] <twnqx> are theat on the top left corner of the image manga? :3
[10:04:28] <Tachyon`> there are
[10:04:30] <Tachyon`> lol
[10:04:56] * twnqx was in tokyo last weekened
[10:04:59] <Tachyon`> http://kupo.be/pics/oldsystems.jpg <- more visible there but that pic is out of date
[10:05:00] <twnqx> weekend*
[10:05:11] <Tachyon`> the 1200 has replaced the 500+drive now
[10:05:52] <Tachyon`> the BBC drives need repair though
[10:05:58] <twnqx> nice, even learning japanese. i never got around to do that
[10:06:15] <Tachyon`> oh, nor did I, I gave it a try, realised how compllex it was and gave up, lol
[10:06:43] <Tachyon`> it's not a language for those without a lot of staying power
[10:07:22] <twnqx> yeah
[10:07:27] <Tachyon`> I do like hiragana though as it's entirely phonetic, a word written in that text can be pronounced one way and one way only
[10:07:30] <Tachyon`> if only english were so logical
[10:07:33] <twnqx> i still intend to learn at least hiragana though
[10:08:11] <Tachyon`> yeah, hiragana/katakana aren't so bad
[10:08:22] <Tachyon`> it's kanji where you have to learn liek 4000 characters to read a paper like the sun
[10:08:24] <Tachyon`> that's the problem, lol
[10:08:43] <twnqx> heh, i just crossposted your pic, first comment "xxx sees some good books there"
[10:09:19] <Tachyon`> also some bad ones, jag in space is as terrible as you'd think
[10:09:30] <twnqx> hm. i need some "rotate, enhance" on that Achtung! sign
[10:09:32] <Tachyon`> but tehy were only 50p each in a second hand shop, NCIS they aisnt
[10:09:49] <Tachyon`> I'm sure you've seen similar signs, let me find you the text
[10:10:07] <twnqx> hm, terry brooks
[10:10:28] * twnqx should check if there's a second part to "running with the demon", ends so abruptly
[10:10:54] <twnqx> haha, other comments
[10:11:15] <twnqx> "wow, that's a lot of 6502" "the nostalgia"
[10:11:52] <Tachyon`> http://wpcontent.answcdn.com/wikipedia/commons/thumb/8/83/Blinkenlights-original.png/300px-Blinkenlights-original.png
[10:12:18] <Tachyon`> the text, lol
[10:12:20] <twnqx> what is that, dutch? :S
[10:12:23] <Duality> i have a 6502 laying around .. curently building me a z80 system :)
[10:12:23] <Tachyon`> mock german
[10:12:38] <twnqx> hm
[10:12:55] <twnqx> it's closer to dutch than german :P
[10:12:59] <Tachyon`> ahh
[10:13:09] <twnqx> but yeah
[10:13:13] <Tachyon`> the germans do it seems have a mock english variant
[10:13:27] <twnqx> given that dutch feels like stuck in the middle between german and english
[10:13:30] <twnqx> and i am german :P
[10:14:28] <twnqx> so english-made mock-german can only feel like dutch :D
[10:14:54] <Tachyon`> ahh, I see
[10:15:39] <Duality> twnqx: dutch is nothing like english, and it's a long way away from german imo
[10:15:42] <Tachyon`> http://alternativeberlin.com/blog/wp-content/uploads/2010/03/original1.png
[10:15:45] <Tachyon`> the mock english one
[10:16:00] <twnqx> Duality: for me it feels like stuck in the middle, speaking both german and english :P
[10:16:17] <Duality> dutch has a "few" English words yes :)
[10:16:33] <Duality> but i don't know of any german we use.
[10:16:36] <twnqx> nah, it's more like stuck in the middle of a soundwise transition
[10:16:58] <twnqx> i can read simple dutch even
[10:19:04] <Duality> nee het is niet "stuck" in het midden, en gramatica van het "nederlands" is in mijn mening niet te vergelijken met dat van Engels, ik vind persoonlijk de gramaticaale constructie van Engels simpeler en logischer.
[10:19:42] <twnqx> yeah, the grammar is closer to german i think
[12:15:09] <Casper> does anyone have a good opamp thru-hole suggestion for low offset and rail to rail iput/output? so I can use them for current shunt voltage amplification....
[12:53:36] <Jartza> hmmh
[12:53:47] <Jartza> it's first time I ever try writing to attiny85 flash
[12:53:54] <Jartza> self-programming, that is
[12:55:09] <Jartza> I was looking at all kind of assembler examples, but it seems avr libc has some functions
[12:56:03] <Jartza> boot_page_erase() -> boot_spm_busy_wait() -> boot_page_fill() * 32 -> boot_page_write() -> boot_spm_busy_wait() ?
[12:56:12] <Jartza> does that look like correct way to do it?
[13:03:07] <Casper> Jartza: that's basically it
[13:03:20] <Casper> unless you want to write a partial page
[13:03:44] <Casper> in that case you first have to read the page...
[13:05:06] <Jartza> yeah, only full pages
[13:06:00] <Jartza> and during the erase and write the interrupts should be disabled, it seems?
[13:09:28] <Casper> I'm not sure if it should be
[13:09:39] <Casper> but it sound like a good idea
[13:14:55] <Jartza> yeah, I guess it doesn't hurt at least
[13:22:41] <Jartza> well, it seems to work
[13:22:42] <Jartza> cool
[13:23:07] <Jartza> I first thought that I made a mistake in code, but I forgot to burn the SELFPRGEN -fuse
[16:34:05] <Casper> which of the avr have a pll for the pwm out?
[16:34:26] <Tom_itx> do any?
[16:34:36] <Tom_itx> xmega maybe
[16:35:15] <Casper> one tiny does
[16:35:34] <Casper> I'm at work, and I have work to do, so it's hard to concentrate on finding stuff
[16:35:38] <Casper> beside I have an headache
[16:35:56] <Casper> and less than 2 hours to place the order
[16:37:10] <Tom_itx> i'm not sure, i've never looked for that on a pwm
[16:45:09] <Casper> attiny85 is said to have a pll
[16:51:26] <Casper> look like only the attiny85 and the at90pwm setries
[16:54:12] <The_Coolest> So I'm implementing an AVR based board with 3.3v VCC, with several 3.3v chips on board. I want to make said board compatible with 5v ISP programmers. any ideas?
[16:58:17] <The_Coolest> ah scratch that. my atmega1284p board has 3.3v spi outputs and 3,3v for vcc. it can work as usbasp.
[16:58:50] <hamnstar> anybody here use openocd/jtag with atmega128rfa1?
[17:05:49] <The_Coolest> tho the chips i'll be using are 5v tolerant, that's good
[18:38:13] <brabo> gah sometimes... i have a routine that reads adc values and sends them out. if i run it regularly from the main loop, it works fine. if i however run it from another subroutine, it reboots my mcu :/ all 3, main and two subs are in same c file.
[18:40:20] <brabo> the adc value routine calls an externel function tho to effectively read and output the data
[18:44:46] <Lambda_Aurigae> brabo, what chip?
[18:48:13] <brabo> Lambda_Aurigae: aha, good evening! it's an atmega2560
[18:48:26] <brabo> tho i'm pretty sure my crappy code is to blame hehe
[18:48:27] <Lambda_Aurigae> so not a lack of ram for subroutine calls.
[18:48:34] <brabo> shouldn't be
[18:48:52] <brabo> Program: 8050 bytes (3.1% Full)
[18:48:54] <Lambda_Aurigae> if it was an attiny then I would say it's running out of ram/stack or such.
[18:48:59] <brabo> Data: 1384 bytes (16.9% Full)
[18:49:52] <brabo> yea, i had weirdness before due to ram overuse.. it was more strings getting messed up
[18:50:01] <brabo> that was on an atmega8
[18:53:41] <Lambda_Aurigae> without seeing the code I have no clue what's going on.
[18:58:47] <brabo> uhu, no problem.. lemme pastebin
[19:04:51] <brabo> Lambda_Aurigae: main: https://paste.xinu.at/vw8eNi/ adc.c: https://paste.xinu.at/zLedI/ so if in main the timing loop calls get_sensors(); it works. if in poll_uart at line 155 it gets called, it does fully output the results, but then immediately reboots
[19:05:10] <brabo> i hope you don't cry your eyes out from my code :p
[19:05:27] <Lambda_Aurigae> gotta finish DW episode first then will read it...about 2 minutes to go.
[19:05:56] <Lambda_Aurigae> ok,,,done.
[19:06:21] <brabo> sure, take your time :) i'll be very glad if it gets solved sometime today hehe
[19:12:24] <Lambda_Aurigae> not sure but I'm still leaning toward filling sram.
[19:13:21] <Lambda_Aurigae> creating those char buf[1] every time it loops...
[19:13:42] <Lambda_Aurigae> almost need a jtag interface to watch the memory and see.
[19:14:38] <Lambda_Aurigae> hate to say it, but if you use atmel studio, you can run it in simulator and watch and see what happens.
[19:22:53] <brabo> hm.. do you think that it would go up fron what avr-size reports to 8k?
[19:23:19] <Lambda_Aurigae> the data size will definitely change.
[19:23:38] <brabo> yeah, but more than 6 k just with those buffers?
[19:23:42] <Lambda_Aurigae> it can't take into account everything, specially stuff created at runtime like you are doing in there.
[19:23:55] <brabo> uhu i understand
[19:24:35] <Lambda_Aurigae> if you can run it in simulator you can watch memory usage and see things happening.
[19:24:54] <Lambda_Aurigae> best way to do that is, unfortunately atmel studio, if you don't have jtag
[19:24:57] <brabo> mmm simulavr or simavr would be good?
[19:25:27] <brabo> with one of those i seem to remember could run it and connect in gdb
[19:25:32] <Lambda_Aurigae> simavr is a pain to use but functional...not sure if your chip is supported though.
[19:25:40] <Lambda_Aurigae> or is it simulavr?
[19:25:44] <Lambda_Aurigae> I never bothered.
[19:25:56] <brabo> there's two of em, i forgot which is which :=
[19:25:58] <brabo> :)
[19:25:59] <Lambda_Aurigae> played with it early on but never got into it and never did get the hang of gdb.
[19:26:08] <brabo> but perhaps i have a good excuse here to run it and see
[19:26:25] <brabo> i have some gdb experience luckily :)
[19:26:54] <Lambda_Aurigae> there are plenty of tutorials out for it.
[19:33:35] <brabo> Lambda_Aurigae: thanks anyway :)
[21:00:36] <krysmin> Hello
[21:01:27] <krysmin> I will rewrite library from c to asm
[21:02:00] <krysmin> Why people dont write some library in asm