#avr | Logs for 2014-07-26

Back
[04:02:03] <TheLemonMan> harro, i was playing with some avr elfs and noticed that ida and objdump decode them differently
[04:02:32] <TheLemonMan> a quick search revealed that objdump doubles the absolute/relative arguments while ida seems to halve the symbol addresses
[04:02:48] <TheLemonMan> now, does anyone know why this happens ?
[04:03:17] <TheLemonMan> i've (quickly) read the atmel sheets but couldn't find an explanation
[04:15:37] <ivanshmakov> TheLemonMan: The AVR program (flash) memory is organized in 16-bit words, not octets. May it be that one software shows “word offsets,” while the other these for octets?
[04:18:07] <TheLemonMan> gah, this makes sense
[04:18:24] <TheLemonMan> it's slightly retarded but meh
[04:38:03] <twnqx> TheLemonMan: that's how the 128kB flash devices work with 16bit program counter
[04:38:31] <TheLemonMan> twnqx: is there a 8-bit pc mode ?
[04:38:57] <twnqx> not that i would know. have you ever seen 512 byte flash devices?
[04:39:13] <twnqx> i think i only ever flashed one program that short into an avr
[04:39:45] <TheLemonMan> 512 bytes are enough for a demo :)
[04:40:36] <twnqx> on windows, with all the libs behind it
[04:40:54] <twnqx> though ok, i probably could put a fire or plasma into 512byte DOS
[04:41:07] <ivanshmakov> twnqx: As in, say, ATtiny13A?
[04:41:09] <WormFood> you can do a lot in 512 bytes, if it is cleverly programmed (think recursion)
[04:41:28] <twnqx> attiny13a is what i used as a 50hz generator.
[04:41:45] <twnqx> less components than a ne555...
[04:42:37] <ivanshmakov> twnqx: I’ve coded a polyphonic music fragment into one, back some years ago.
[04:42:49] <twnqx> cool
[04:43:10] <twnqx> i think i have a spare 13a. mind sharing the image (and external circuitry)?
[04:44:03] <twnqx> well, i have at home, so i could check it out in a week when i'm back :)
[04:44:53] <ivanshmakov> twnqx: The source seem to be at http://am-1.org/~ivan/lhc/users/ivan_shmakov/tasks/μbox_3/, and it uses http://am-1.org/~ivan/lhc/users/ivan_shmakov/tasks/tiny-misc.S/.
[04:45:00] <ivanshmakov> Not exactly a readable source, though.
[04:45:31] <twnqx> i just want to listen :)
[04:45:50] * twnqx likes chiptunes
[04:47:11] <ivanshmakov> As for the external circuitry, – I’ve used a simple RC-filter and a transistor (and, of course, a battery, a reset circuit, and a couple of resistor + LED circuits.) I don’t remember the exact details, alas.
[04:49:14] <ivanshmakov> These days, I’d spare a transistor and just program the PWM outputs to be exact opposites of one another, so to get full 3 V amplitude at 3 V power supply.
[04:55:29] <ivanshmakov> (… But what I’d really want to implement is some kind of .mod player on an ATmega168PA or something like this.)
[05:03:18] <twnqx> uh
[05:03:21] <twnqx> mods are... large
[05:03:33] <twnqx> given they have sample banks
[05:03:40] <twnqx> make a .sid player first :)
[05:03:55] <twnqx> mh
[05:07:56] <ivanshmakov> twnqx: Sure, but one can fit an SD reader in 16 KiB flash.
[05:08:18] <ivanshmakov> twnqx: As for the samples, I didn’t say that the player I have in mind would play just /any/ .mod.
[05:08:29] <twnqx> bah. all or nothing.
[05:09:15] <twnqx> hm. i wonder what actually happened to my mod collection...
[05:10:36] <ivanshmakov> twnqx: Mine is mostly a selection of http://modarchive.com/, so I’m not all that afraid of losing it.
[05:11:41] <twnqx> there are a few options
[05:12:02] <twnqx> it might be in a backup of my bbs from those days, if i kept the filebase
[05:12:13] <twnqx> most of them went probably with my local scene.org mirror
[05:12:41] <ivanshmakov> (I even use a separate filesystem, or rather several of them, for anything I’m downloading from the ’net. So that in the case of emergency I could copy only the things that are more or less irreplaceable.)
[05:13:02] * twnqx just has one large fs with backup
[05:13:11] <twnqx> aka 2 servers, 350km apart
[05:14:22] <twnqx> hm. the bbs backup only contains the system...
[05:15:18] <twnqx> some day in 1997, when the internet replaced fidonet for me...
[05:15:22] <ivanshmakov> twnqx: My BBS had little content. For one thing, it had a 14.4k modem; for the other, – Internet access has become, well, actually accessible shortly after I’ve started one.
[05:15:44] * twnqx has 2x dual 28k8 + ISDN
[05:15:49] <twnqx> had*
[05:16:08] <twnqx> and one of the biggest demoscene collections in the region
[05:16:30] <twnqx> hell, i apparently still have some stuff that's not on scene.org :S
[05:19:19] <ivanshmakov> FWIW, the thing I’m /still/ feeling bad about losing is a few Heretic PWADs with the maps I’ve made. I guess I’ve uploaded it to a few other local BBSes, but have no idea on how to trace their respective sysops after all these years.
[05:21:23] <twnqx> try an old FIDO nodelist?
[05:26:06] <ivanshmakov> twnqx: What for? The phone numbers are very likely to have changed, now that a decade has passed.
[05:26:21] <twnqx> true, but the names should be in there
[05:26:33] <ivanshmakov> twnqx: So?
[05:26:44] <twnqx> so use linkedin or facebook or whatever?
[05:26:53] <twnqx> once you have the names
[05:28:11] <twnqx> anyway, dinnertime
[05:28:13] <ivanshmakov> twnqx: Well, seems like a solution. Though I have no accounts at social networking sites, and isn’t exactly looking forward for getting any.
[05:28:32] <twnqx> same here, but you can delete them afterwards :P
[05:28:46] <twnqx> chances that data survived for almost 20 years are pretty slim anyway :/
[05:32:19] <ivanshmakov> twnqx: It’s more like less than 15 years for me, actually.
[05:33:38] <ivanshmakov> The Internet access became an option for “mere mortals” c. 1999 in this locality. Until then, and shortly thereafter, BBSes have more or less flourished here.
[06:08:25] <Tachyon`> hi
[06:08:39] <Tachyon`> what is the voltage for a perceived 1 on a 5v avr digital input?
[06:08:54] <Tachyon`> minimum voltage
[06:08:55] <twnqx> typcially 0.7*Vcc
[06:08:59] <Tachyon`> ah, thanks
[06:09:04] <twnqx> per data sheet
[06:09:15] <twnqx> experience says 3.3V works, too :P
[06:14:09] <Lambda_Aurigae> datasheet is your friend.
[06:14:52] <Lambda_Aurigae> http://www.interfacebus.com/voltage_threshold.html
[06:14:59] <Lambda_Aurigae> I love this graphic too.
[06:20:03] <Tachyon`> oh, that's a useful graphic and is going on my board
[06:20:31] <twnqx> but what about 1.2V cmos!
[06:21:07] * twnqx prefers the 0.7Vcc
[06:21:32] <Lambda_Aurigae> http://www.interfacebus.com/voltage_interface.html
[06:21:36] <Lambda_Aurigae> also useful.
[06:22:19] <Lambda_Aurigae> http://www.interfacebus.com/Logic_Design_Descriptions.html
[06:22:27] <Lambda_Aurigae> homepage there....lots of stuff.
[06:23:29] <Lambda_Aurigae> http://www.interfacebus.com/ real homepage..first time I looked that deep.
[07:12:59] <Jartza_> hmmh
[07:13:28] <Jartza_> did I misread the attiny datasheet, as it states the "logical 1" is around 50% of VCC
[07:14:45] <Jartza> are other avrs that different? or is this just feature of tiny
[07:14:46] <Jartza> https://www.dropbox.com/s/76eyu2syj5eg8mk/Screenshot%202014-07-26%2014.54.27.png
[07:15:42] <Jartza> from that it looks like the logical 1 is more or less around 2.5V when VCC is 5v
[07:15:50] <Lambda_Aurigae> more or less.
[07:16:09] <Lambda_Aurigae> kind of a guaranteed level.
[07:17:45] <Jartza> yeah, just referring to:
[07:17:47] <Jartza> 13:50 < twnqx> typcially 0.7*Vcc
[07:18:01] <Lambda_Aurigae> so, test it and see.
[07:18:02] <Jartza> I guess that stands for 74xx and cmos-logic
[07:18:16] <twnqx> nah, 74xx is bette than that (hi there, TTL)
[07:19:44] <twnqx> normally you see vil at 0V - 0.3Vcc, and vih at 0.7Vcc - Vcc guaranteed
[07:20:13] <twnqx> the area in between will do something, mostly the right thing, but often at higher current consumption
[07:20:19] <twnqx> (that is for cmos)
[07:20:33] <Jartza> quick test with attiny85 and a led, vcc 3.3volts, the logic changes at around 1.68-1.7 volts :)
[07:21:04] <Jartza> my multimeter isn't that accurate that I can tell for sure
[07:21:22] <twnqx> now use it for current mesaurement at tripping point
[07:22:02] <twnqx> you might find the point where you short circuit the internal input inverter :P
[07:22:13] <Jartza> :)
[07:22:16] <Jartza> I don't want to
[07:22:33] <Jartza> just babbling here as it's too hot to think and I'm bored
[07:22:37] <Jartza> because I'm on vacation
[07:23:20] <Lambda_Aurigae> time to acquire 128 peltier units and build a cold chair.
[07:23:30] <Jartza> it's 31°C outside (on shadow) and 33°C inside :P
[07:23:33] <Jartza> no air-conditioning
[07:25:26] <twnqx> 35 out
[07:25:28] <twnqx> 22 in
[07:25:31] <twnqx> yey AC
[07:26:03] <Lambda_Aurigae> 19C here.
[07:26:10] <Jartza> yeah, I visited at the office, it was around 20C :)
[07:26:15] <Lambda_Aurigae> maybe a couple lower inside.
[07:26:17] <Jartza> sort of wanted to stay there longer
[07:26:34] <Jartza> oh well. shouldn't complain, this isn't that typical to finland
[07:26:58] <Jartza> the warm weather started when I started my vacation and it looks like it's going to hold until I go back to work
[07:27:27] <Jartza> within 20 weeks we'll be plowing snow and freezing our asses off anyway ;)
[07:27:34] <Lambda_Aurigae> same here.
[07:27:53] <Lambda_Aurigae> should have snow by mid november.
[07:27:58] <Jartza> the "typical" finnish summer is around 16-22C
[07:28:10] <Lambda_Aurigae> global warming!
[07:28:17] <Jartza> so it's been exceptional, actually I heard it's the warmest month within 50 years
[07:28:27] <Lambda_Aurigae> we have had a few hot days but our summer has been generally mild here so far.
[07:29:02] <Jartza> even during the nights it has been over 20C
[07:29:12] <Jartza> they call that "tropical" weather in finland
[07:29:29] <Lambda_Aurigae> supposed to hit 30C here today.
[07:29:48] <Lambda_Aurigae> hit 37C last week.
[07:31:44] <Jartza> I think we get 37C like once in 100 years :)
[07:31:59] <Lambda_Aurigae> had several days last summer that hit that and higher.
[07:32:42] <Jartza> ok, the record high in finland is 37.2
[07:32:47] <Jartza> that happened on 2010
[07:33:13] <Jartza> and record low -51.5 :P
[07:34:45] <Lambda_Aurigae> record high here is 43.3C
[07:35:26] <Lambda_Aurigae> record low -34.4C
[07:39:23] <Jartza> so it's a bit more on a warmer side ;)
[07:39:58] <Lambda_Aurigae> yeah.
[07:40:08] <Lambda_Aurigae> our wind chills get horrid though.
[07:40:42] <Lambda_Aurigae> -65C record windchill.
[07:40:45] <Jartza> so you live somewhere around canada or so? :)
[07:40:53] <Lambda_Aurigae> midwest.
[07:41:00] <Jartza> ok
[07:41:15] <twnqx> so we conclude that the world's average temp is 35°C atm, from samples in this very channel.
[07:41:25] <Lambda_Aurigae> https://www.google.com/maps/place/Bangor,+IA+50258/@42.1733191,-93.0935357,17z/data=!3m1!4b1!4m2!3m1!1s0x87efb535c46a1413:0x440d2a0a7a00c3
[07:41:26] <Jartza> :D
[07:41:27] <Lambda_Aurigae> there
[07:41:51] <twnqx> bangot sounds indian
[07:41:56] <twnqx> bangor*
[07:41:57] <Lambda_Aurigae> bangor
[07:42:06] <twnqx> still does :P
[07:42:21] <Jartza> oh, not that close to canada yet then
[07:42:29] <Lambda_Aurigae> nope.
[07:42:36] <Jartza> bangor might sound indian because they have bangalore there? :)
[07:42:40] <Lambda_Aurigae> get up toward minot north dakota and it's lots colder.
[07:43:06] <twnqx> hm, 21kCNY hotel cost so far
[07:43:50] <Jartza> that's the part of US I have never visited
[07:44:03] <Jartza> I've only visited south, east coast and west coast
[07:44:39] <twnqx> the only parts of the americas i have visited so far are sao paulo and rio de janeiro...
[07:45:10] <Jartza> I've visited los angeles, san francisco, boston, new york, dallas and houston
[07:45:30] <Lambda_Aurigae> most of those places I've never been.
[07:45:34] <Lambda_Aurigae> hate big cities.
[07:45:43] <Lambda_Aurigae> been to LAX but never left the airport.
[07:45:51] <Lambda_Aurigae> drove through new york and boston.
[07:46:05] <Jartza> I don't like big cities that much myself either
[07:46:15] <Jartza> but mostly those have ween work-related trips
[07:46:21] <Jartza> I live in countryside myself
[07:46:22] <Lambda_Aurigae> des moines is almost too big for me.
[07:46:38] <Lambda_Aurigae> I have cornfields surrounding me.
[07:46:50] <twnqx> neither do i, but i have to work in places like shanghai, shenzhen, sao paulo, dubai, ...
[07:46:52] <twnqx> :(
[07:48:58] <Jartza> https://www.google.fi/maps/@60.489724,24.117645,3a,90y,243.42h,91.42t/data=!3m4!1e1!3m2!1sYoToSLHih0TAXDLAbaAT7w!2e0
[07:49:10] <Jartza> that's the closest the google car got to my house
[07:49:22] <Jartza> if you zoom to the forest, you might see a hint of yellow
[07:49:24] <Jartza> that's my house :D
[07:49:32] <Lambda_Aurigae> kewl.
[07:49:43] <Lambda_Aurigae> I miss the north carolina mountains and the forests out there.
[07:49:45] <Lambda_Aurigae> real forest.
[07:49:56] <Lambda_Aurigae> not little clumps of trees here and there like they have here in iowa.
[07:50:37] <Lambda_Aurigae> https://www.google.com/maps/place/Bangor,+IA+50258/@42.173295,-93.093796,3a,75y,42.81h,90t/data=!3m4!1e1!3m2!1sbFpa1WwPeZOPt69Wg8qBaA!2e0!4m2!3m1!1s0x87efb535c46a1413:0x440d2a0a7a00c3
[07:50:45] <Lambda_Aurigae> little veggie stand is in front of my house.
[07:50:53] <Lambda_Aurigae> and the big white building across the street is my workshop.
[07:51:47] <Jartza> looks like countryside too :)
[07:51:56] <Jartza> except your house is closer to the road
[07:52:02] <Lambda_Aurigae> yup.
[07:52:11] <Lambda_Aurigae> close enough that our chickens run across the road all the time.
[07:52:19] <Lambda_Aurigae> duckies have a habit of stopping traffic.
[07:53:36] <Thrashbarg> You ducks are really trying my patience!
[07:54:29] <Thrashbarg> (simpsons...)
[07:54:40] <Lambda_Aurigae> never got into the simpsons.
[07:54:52] * Thrashbarg points and screams
[07:56:30] <Lambda_Aurigae> I prefer Farscape and Stargate:SG1
[07:56:34] <Thrashbarg> ah
[07:57:13] <Lambda_Aurigae> I recently acquired the entire stargate serieseseses....
[07:57:28] <Thrashbarg> ah right :P
[07:57:39] <Lambda_Aurigae> and all the movies.
[07:58:25] <Thrashbarg> a friend got a Stargate pinball to restore as payment for restoring another machine. He restored it, then the police seized it because it was stolen
[07:58:34] <Lambda_Aurigae> haha.
[07:58:44] <Thrashbarg> yeah he was pissed... put a lot of money in it
[12:58:05] <rue_shop2> ok I translated the pinout for the arduino knockoff boards I been buying and removing the arduinoness from
[12:59:13] <Jartza> hmmh
[12:59:46] <ivanshmakov> rue_shop2: Is that the pinout given in pins_arduino.h?
[13:00:07] <rue_shop2> its an open source board, dotn' take much work to draw it all out
[13:00:40] <rue_shop2> $2.50 for a M328p board with isp header, crystal, and votlage regulator, cant be much of a sceptic
[13:01:30] <rue_shop2> not right for all my projects, but it makes for a quick and dirty 'insert microcontroller'
[13:02:52] <rue_shop2> oh I paid about $3 for these, whatever
[13:13:52] <Lambda_Aurigae> yeah.
[13:14:00] <Lambda_Aurigae> you can get some insanely cheap ardweeny boards.
[13:14:08] <Lambda_Aurigae> and it's not hard to wipe the ardweeny code from them.
[13:17:31] <ivanshmakov> Lambda_Aurigae: The only “Arduino” code that should be there is Optiboot, and it’s actually something that I’d flash on /any/ MCU I use, – irrespective of the board (if any.)
[13:19:19] <ivanshmakov> For one thing, it makes it possible to (re)program AVRs with only a 4-wire USB to Serial adapter, – instead of a fully-featured ISP programmer.
[13:19:46] <Lambda_Aurigae> but you can't update fuses with the serial interface.
[13:20:39] <ivanshmakov> Lambda_Aurigae: Yes. But depending on what the AVRs are used for, – it may be unnecessary in the first place.
[13:21:21] <ivanshmakov> (Or, rather, in the first place, one would update them so that Optiboot gets started.)
[13:24:28] <Bushman> hmm... any ideas how to implement exponential rolling average in code?
[13:25:16] <Lambda_Aurigae> do it on paper and convert that to code.
[13:25:32] <Lambda_Aurigae> not even sure what that is,,,but,,,if you can write formulas it can be turned into code.
[13:26:37] <Bushman> i was hoping maybe someone wrote a lib for that already?
[13:27:00] <Lambda_Aurigae> if it's something real I'm sure someone has.
[13:27:40] <Lambda_Aurigae> is exponential moving average the same thing?
[13:28:44] <Lambda_Aurigae> http://www.dreamincode.net/forums/topic/91270-exponential-moving-average/
[13:29:14] <Lambda_Aurigae> it's java but it looks like C
[13:31:59] <Bushman> it seems to be the same thing according to naming in wiki article
[13:41:56] <Lambda_Aurigae> time for some mindless pseudo-scifi.
[13:42:00] <Lambda_Aurigae> Mars Attacks!
[14:18:09] <Bushman> i think the "pseudo" part is redundant... there's the "fiction" part already there
[14:18:11] <Bushman> :D
[14:23:58] <Lambda_Aurigae> well, it's more comedy than scifi.
[16:21:13] <rue_mohr2> I would like to point out that earth is a nice place because to date it has not gone to other inhabited worlds and tried to conquer them
[16:21:46] <rue_mohr2> :/ my juice smells like freezer burn
[17:08:02] <wald0> how i can run a function in async mode ?
[17:08:21] <wald0> so i dont want that the main code waits for it to be finished before to continue
[17:08:49] <ivanshmakov> wald0: There’s no way to do that.
[17:09:03] <ivanshmakov> AVR supports only a single thread of control.
[17:09:06] <Tom_itx> nope, avr's aren't FPGA's
[17:10:38] <ivanshmakov> wald0: The only possibility is that the thing you want to do can be done by a on-die peripheral. Then, you can write a function in such a way that it sends a command to such a peripheral, and /does not/ wait for the command to complete.
[17:12:53] <wald0> mmmh
[17:13:24] <wald0> my problem is: im programming a keyboard (ergodox), and im making a led to blink when the key is pressed
[17:13:45] <wald0> problem is that human eye needs a bit of delay to see the light, like 100 ms at least looks good
[17:14:00] <wald0> but on such way, you cannot press the next key at the same speed, there's some kind of a lag
[17:14:13] <wald0> i cannot do that ? :/
[17:14:56] <Tom_itx> one led per key or one led for all?
[17:17:25] <ivanshmakov> wald0: If you have a spare Timer/Counter unit at your AVR, then you can configure it to fire an interrupt after certain time. So, you toggle a LED, and enable the timer. The interrupt toggles LED again, and disables the timer.
[18:21:18] <wald0> ivanshmakov: makes sense, thx :) ill make a look to that
[18:50:07] <jadew> hey, any idea if the atmega32u2 does high speed USB?
[18:50:13] <jadew> the datasheet says USB 2.0
[18:50:22] <learath> uh
[18:50:29] <learath> I doubt atmega32 can do 10mbps
[18:50:32] <learath> you want it to do 480?
[18:50:45] <jadew> which would imply 24 MB/s, but it also says... 12 Mbit/s
[18:50:48] <jadew> so... wth?
[18:51:02] <jadew> learath, I need it to do at least 20 MB/s
[18:51:16] <learath> it *might* be able to bitbucket at 20mbits/second
[18:51:19] <learath> but I wouldn't bet on it
[18:51:33] <jadew> the issue is if the USB hardware supports that
[18:51:38] <learath> no no it's not :P
[18:51:48] <Casper> even if the hardware support it
[18:52:00] <Casper> the avr can not move the data that fast
[18:52:08] <learath> It could support usb4 and it still won't do 20mbits/second :P
[18:52:09] <jadew> it can do 20 MIPS
[18:52:26] <Casper> 20MIPS do not mean it can do 20Mbit
[18:52:30] <jadew> that's enough to reach close to 20 MB/s
[18:52:34] <learath> no.
[18:52:39] <Casper> far from it
[18:52:40] <learath> well. maybe? with DMA
[18:52:41] <learath> maybe
[18:52:50] <Casper> it do not support dma
[18:52:52] <learath> but then it's really not doing anything
[18:52:55] <learath> casper: I know that :P
[18:52:59] <jadew> yeah, that one doesn't have DMA
[18:53:03] <Casper> at best you will do a read then a write
[18:53:09] <learath> I don't think any AVR does DMA
[18:53:11] <jadew> Casper, that's what I want to do
[18:53:18] <learath> That's very nice.
[18:53:19] <jadew> lerath, the xmegas do
[18:53:26] <learath> do they?
[18:53:29] <jadew> yep
[18:54:00] <jadew> so... any suggestions on the cheappest chip that can do 20 MB/s over USB?
[18:54:23] <learath> so they do
[18:54:33] <learath> 20 megabytes per second?
[18:54:37] <jadew> yeah
[18:54:56] <learath> what kind of data to where/what
[18:54:59] <jadew> I already know about the cypress one, but I want cheaper
[18:55:12] <learath> 20 megabytes/second isn't really "microcontroller" realm
[18:55:16] <jadew> serial
[18:55:21] <learath> guh
[18:55:30] <learath> How about no?
[18:56:10] <jadew> learath, it is possible
[18:56:16] <jadew> and I already know several chips that can do it
[18:56:19] <jadew> I just want to do it cheap
[18:56:37] <jadew> like... $3-$5
[18:57:04] <learath> Well, good luck with that.