#avr | Logs for 2013-06-02

Back
[00:08:24] <edman007> ok... so moving the code works...though I guess my struct came in backwards...
[00:23:18] <vectory> apparantly converting pcm data from 48khz to 12khz involves more than averaging each 4 samples. got a nice noise
[00:23:47] <vectory> heavy aliasing, so to say!?
[00:28:00] <thetruthisoutthe> average is a lowpass filter
[00:28:56] <thetruthisoutthe> it can also be done wrong
[00:29:21] <thetruthisoutthe> you need a moving window
[00:29:42] <theBear> lower samplerate is a lowpass filter too
[00:31:32] <thetruthisoutthe> i think i'd try a weighted average function
[00:32:25] <theBear> i'd consider it when my head wasn't so cloudy
[00:32:41] <thetruthisoutthe> with a moving window ( circular ring buffer input, compute avg after each increment )
[00:32:46] <theBear> moving window sounds good tho
[00:34:46] <thetruthisoutthe> this gets more interesting when the sample rate ratio is not uint
[00:36:27] <theBear> oh i know, sample and bit depth conversion is a huge and awesome subject
[00:43:22] <thetruthisoutthe> http://pastebin.com/m1PBPgpS
[00:44:39] <thetruthisoutthe> did this for some things last year
[00:45:03] <vectory> the bear, you dont mean sounds good as in the sound it will produce, is it?
[00:46:38] <vectory> atm im reading something that involves a qunatization matrix, and i dont understand it _at_all_ xD
[00:47:58] <thetruthisoutthe> http://en.wikipedia.org/wiki/Quantization_(signal_processing)
[00:48:45] <vectory> i bet thatss like the wiki on FFT, full of vexing formulas
[00:49:12] <vectory> yep
[00:49:24] <vectory> and not short at all
[00:49:34] <thetruthisoutthe> http://en.wikipedia.org/wiki/Sampling_(signal_processing)
[00:50:04] <vectory> i'll go to bed rather and see if can get spmething out of audacity tomorrow
[00:50:05] <thetruthisoutthe> for downsamling, you simply choose a value on the curve that fits best
[00:50:37] <thetruthisoutthe> special case when you divide by 2,3,4 ...
[00:50:51] <thetruthisoutthe> otherwise it needs more magic
[00:51:40] <vectory> getting an idea
[00:55:34] <thetruthisoutthe> do this while bored http://en.wikipedia.org/wiki/Lanczos_resampling
[00:55:36] <thetruthisoutthe> :)
[00:59:49] <vectory> i think im getting sidetrack. the goal was to get a format thatll get a second or two of audio stored in eeprom
[01:00:34] <thetruthisoutthe> not sure it is possible
[01:00:47] <thetruthisoutthe> try a flash chip
[01:01:00] <vectory> i really should
[01:01:11] <thetruthisoutthe> microsd card ?
[01:01:47] <vectory> that would be a sideproject, too
[01:01:54] <thetruthisoutthe> or store the function to generate wave and create it on-the-fly
[01:02:03] <vectory> i just wanna feed pwm to a pc speaker
[01:02:11] <vectory> thetruthisoutthe: yeah, like that
[01:02:26] <thetruthisoutthe> kk, read on xm, s3m formats
[01:02:51] <thetruthisoutthe> or just generate frequency, and apply pwm value
[01:03:43] <thetruthisoutthe> http://www.youtube.com/watch?v=GGMl9bQ5szg
[01:03:44] <thetruthisoutthe> :)
[01:03:53] <thetruthisoutthe> ATMEGA328 XM Player
[01:04:17] <thetruthisoutthe> theBear <= you'll like this too
[01:08:20] <thetruthisoutthe> http://www.youtube.com/watch?v=MCGJ5a1HoNc
[01:08:28] <thetruthisoutthe> AVR ATMEGA32A MOD Player
[01:10:51] <thetruthisoutthe> insane hardware haha http://www.youtube.com/watch?v=j6ijbexoq-M AVR ATmega644 MOD player - finally plays S3M!
[01:15:24] <vectory> thetruthisoutthe: what puts me of of that idea is i need to learn how to use a tracker first
[01:15:46] <vectory> i mean, i would want to play my own tunes on it :)
[01:16:15] <vectory> gn8
[01:32:03] <vectory> thetruthisoutthe: wait, whats the weight there?
[01:33:42] <thetruthisoutthe> vectory <= it is meant to be applied to a raw dataflow
[01:34:14] <thetruthisoutthe> weight is the weight of the current sample
[01:36:06] <thetruthisoutthe> so it generates an average without a lookup table, or extra looping
[01:36:34] <vectory> and the average converges with each datapoint
[01:36:46] <vectory> and weight simply counts up, yea?
[01:36:53] <thetruthisoutthe> it has a little phase lag though
[01:37:43] <thetruthisoutthe> you add whatever weight you want
[01:37:49] <thetruthisoutthe> like 4
[01:38:15] <thetruthisoutthe> or 1.23456 lol
[01:39:04] <vectory> isnt the new avg less affected by the current sample, the heigher weight is?
[01:39:12] <vectory> would be counter intuitive
[01:39:16] <thetruthisoutthe> yes, inversely proportional
[02:20:27] <tzanger> thetruthisoutthe: haha is that your s3m player?
[02:21:07] <tzanger> I wrote my own s3m player in x86 asm about 20 years ago now
[02:21:33] <tzanger> haha unreal 2
[02:23:45] <edman007> bah... and now I got stack corruption on my ARM code...
[02:23:49] * edman007 needs sleep
[02:27:37] <tzanger> heh I had the SAM4L diving off into the weeds until I discovered the ASF lib did not enable AST periodic interrupts
[02:27:45] <tzanger> uncomment a define and it worked
[02:30:14] <edman007> heh
[02:30:20] <thetruthisoutthe> tzanger <= hey :) no, not mine, i have not done that yet, was not bored enough
[02:30:49] <thetruthisoutthe> i only do SMT btw, so obviously not mine
[02:31:39] <thetruthisoutthe> tzanger <= remove the #if and #ifdefs then ;)
[02:31:59] <thetruthisoutthe> you call for the devil with those using gcc
[03:27:38] <Badaboom> I hate being sick
[03:30:09] <Badaboom> aquaphobia 1993,,lmao
[04:36:04] <megal0maniac> BLOODY COMPUTER!
[04:36:30] <megal0maniac> I hate intermittent problems
[04:36:47] <megal0maniac> *Sometimes* the 3rd SATA port won't pick anything up
[04:37:18] <megal0maniac> At the moment, it seems as though it does this if the solid state is connected at all
[04:37:26] <skroon> hi
[04:37:52] <skroon> can I use atmels capacitive touch libraries (Qtouch) without using avr studio? I would like to just use gcc-avr (i'm on osx)
[04:46:48] <thetruthisoutthe> skroon <= you can even write your own "capacitive touch library"
[04:47:53] <thetruthisoutthe> good thing it will run on atmel mcu not on any os
[04:49:48] <skroon> thetruthisoutthe: so how do you hook it up? is it just adc ?
[04:50:51] <thetruthisoutthe> no.
[04:51:00] <thetruthisoutthe> a capacitive button don't even need an adc
[04:51:09] <thetruthisoutthe> just s simple io pin
[04:57:19] <skroon> I mean the Qtouch buttons, sliders and wheels
[04:57:25] <skroon> not a real touchscreen
[04:57:53] <thetruthisoutthe> never used that
[04:58:03] <thetruthisoutthe> i usually have my own way doing things
[04:59:09] <megal0maniac> I had a stupid moment. I got my aery32 (UC3 dev board) and wondered why there were so many pins on a port :)
[04:59:16] <megal0maniac> I'm so used to 8
[04:59:54] <megal0maniac> skroon: Have you tried making a project in studio and hacking away at the .c and .h files?
[05:00:04] <thetruthisoutthe> 32 bit means it has 32 bit wide bus
[05:00:09] <megal0maniac> I'm sure that would at least give you a starting point
[05:00:22] <megal0maniac> thetruthisoutthe: Hence me saying "stupid moment". I know this :)
[05:00:41] <megal0maniac> But I've been taking 8 for granted because it's all I've been working with
[05:43:55] <Badaboom> megal0maniac: i just found the main reason this morning for my display problem
[05:44:04] <megal0maniac> Mmm?
[05:44:36] <Badaboom> The display driver datasheet isnt very accurate in that...
[05:44:55] <thetruthisoutthe> "User error, Replace user and Press any key to continue..."
[05:45:10] <Badaboom> very cute
[05:45:41] <megal0maniac> :P
[05:45:48] <Badaboom> If you dont send a command to display test on then off it may get stuck in a powerup phase of scan only 1 digit
[05:46:46] <Badaboom> This comes after thinking ive had it several times to positive
[05:47:28] <plasmasolutions> Hi guys! I'm now in the programmer stage :) How can I tell my linker to NOT overwrite the bootloader at 0x80... but instead begin at the flash location 0x80..20..
[05:47:31] <Badaboom> and im strictly speaking from a powerup ie: removing the source
[05:47:43] <plasmasolutions> twnqx: My master, any hints ? ;)
[05:47:49] <megal0maniac> plasmasolutions: Use the bootloader to program the chip?
[05:47:57] <thetruthisoutthe> ;>
[05:48:00] <plasmasolutions> I'm using the dfu_programmer
[05:48:09] <thetruthisoutthe> whatever that is
[05:48:19] <kobsu> plasmasolutions: you have to change linker script
[05:48:27] <Badaboom> lmao,, i thought of a name for dfu
[05:48:48] <kobsu> plasmasolutions: do you know where your linker script is located?
[05:49:22] <plasmasolutions> kobsu: atm there is none ;) I only did a "avr32-gcc -Wall -O2 -I /opt/avr32-tools/include -mpart=uc3a0128 main.cpp -o main.elf"
[05:49:34] <plasmasolutions> followed by avr32-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature main.elf main.hex
[05:50:17] * megal0maniac clearly has no idea :)
[05:56:33] <kobsu> plasmasolutions: there's always one :)
[05:56:43] <kobsu> plasmasolutions: you are using the default from avr32 toolchain now
[05:56:56] <kobsu> let me find the path for you
[05:57:01] <kobsu> one moment
[05:57:08] <plasmasolutions> kobsu: Very kind thanks!
[05:58:10] <plasmasolutions> kobsu: I found many under avr32/lib/ldscripts... maybe there...
[05:58:30] <kobsu> yes that's the right place
[05:59:03] <Badaboom> oompa loompa doopadee doo
[05:59:11] <plasmasolutions> so, when I'm not giving a particulary one via the -T command then it searches for an appropriate one ton this dir?
[05:59:20] <kobsu> yes
[05:59:20] <plasmasolutions> Where is this magic happening?
[05:59:27] <kobsu> plasmasolutions: in gcc
[05:59:46] <kobsu> plasmasolutions: similarly as it links libc for you
[06:00:11] <kobsu> so the file is avr32elf_uc3a0128.x
[06:00:13] <kobsu> open that
[06:00:15] <plasmasolutions> But gcc does not know this location (installed the avr32 under /opt/ by me)
[06:00:39] <plasmasolutions> And I only set up the PATH to the avr32/bin
[06:02:08] <plasmasolutions> kobsu: Opened! But I have a uc3b0128
[06:09:13] <kobsu> plasmasolutions: ahh, but why -mpart=uc3a0128 then?:)
[06:09:49] <plasmasolutions> kobsu: so this is a valid question and a typeo by me ;)
[06:09:50] <kobsu> plasmasolutions: whatever change FLASH origin to 0x80002000
[06:09:52] <plasmasolutions> typo
[06:10:33] <kobsu> you can also reduce 0x2000 from LENGTH... so it would be LENGTH=128K-0x2000
[06:11:23] <kobsu> ... and avr32-gcc finds these files because it knows the relative path to the these files
[06:11:37] <plasmasolutions> ah ok...that clears it up to me
[06:12:03] <kobsu> you could also copy that default .x linker script and give it -T command when you link your program
[06:12:21] <plasmasolutions> kobsu: Will take this way to not corrupt the original file
[06:13:04] <kobsu> also be aware that default linker scripts from avr32 toolchain doesn't set default stack size... so also define __stack_size__ in your linker script
[06:13:27] <plasmasolutions> Ok, I will! Just found a doc for the linker scripts too
[06:13:28] <plasmasolutions> http://www.atmel.com/Images/doc32158.pdf
[06:14:04] <kobsu> plasmasolutions: under SECTIONS you can say __stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 4K;
[06:15:48] <kobsu> Yep, you can also take a cue from https://github.com/aery32/aery32/blob/master/aery32/ldscripts/avr32elf_uc3a1128.x
[06:16:33] <kobsu> that appnote you linked is good reading
[06:16:37] <plasmasolutions> kobsu: Ah yes, ok, will look at this script and report back! Thanks for your help so far!
[06:33:04] <plasmasolutions> kobsu: All working! Programm is up and running :)
[06:33:15] <kobsu> nice :)
[06:33:48] <plasmasolutions> kobsu: You were the midwife :D
[06:34:11] <kobsu> ehh ;)
[06:34:42] <plasmasolutions> So next thing is to enable jtag programming and debugging with the dragon
[06:35:12] <kobsu> next somebody should make opensource gdbproxy for avr32 ;D
[06:36:03] <plasmasolutions> yes, that would be great!
[06:36:24] <thetruthisoutthe> who uses gdb?
[06:36:24] <plasmasolutions> and a plugin for qtcreator to enable a avr toolchain
[06:36:58] <kobsu> thetruthisoutthe: I would
[06:36:59] <twnqx> thetruthisoutthe: everyone not using winblows?
[06:37:23] <thetruthisoutthe> i never used gdb ;/
[06:37:28] <kobsu> plasmasolutions: I have set up avr toolchain for sublimetext 2
[06:37:45] <plasmasolutions> thetruthisoutthe: Everyone that has passed the dark (or blue) ages ?
[06:37:51] <thetruthisoutthe> what is it good for?
[06:38:47] <plasmasolutions> kobsu: Never heard of it... but just downloading it :)
[06:39:14] <kobsu> :)
[06:40:03] <plasmasolutions> kobsu: So is there a way to debug under linux with jtag?
[06:41:06] <kobsu> plasmasolutions: via avrstudio only as far as I know
[06:41:51] <plasmasolutions> kobsu: so only on win.. that's bad... we're programmer, what are we waiting for ;)
[06:44:44] <BusError> my latest AVR board, ordered now: https://plus.google.com/u/0/111387094029238541867/posts/2nJUnXpVVZf
[06:44:59] <twnqx> plasmasolutions: on avr 8bit?
[06:45:10] <twnqx> avarice + gdb
[06:45:50] <thetruthisoutthe> so guys, you use gdb to read code and see what it does?
[06:46:17] <twnqx> more like breakpoints / single stepping/variable display
[06:48:09] <twnqx> from the live chip
[06:48:16] <thetruthisoutthe> i see
[06:48:35] <plasmasolutions> twnqx: No, on avr32
[06:48:37] <thetruthisoutthe> i rarely feel like checking response to external events
[06:50:53] <twnqx> yeah
[06:51:02] <twnqx> just *sometimes* you can't explain weird behavior
[06:51:27] <Badaboom> ^^
[06:51:47] <thetruthisoutthe> oh there is always a solution
[06:51:48] <thetruthisoutthe> :)
[06:51:52] <twnqx> it took my half a year to accidentally find a bug
[06:51:59] <twnqx> me*
[06:52:14] <twnqx> i always knew something was wrong, i just couldn't find it
[06:52:28] <thetruthisoutthe> typos, memory overflows
[06:52:29] <Badaboom> thats what she said
[06:52:38] <plasmasolutions> twnqx: Is there a gui you are aware of that allows me to set fuses with checkboxes? On linux?
[06:52:54] <twnqx> no, the best i know is a cli tool
[06:52:56] <twnqx> hang on
[06:53:23] <plasmasolutions> sad...
[06:53:34] <twnqx> works only with jtag adapters. javr, from the xc3sprog package
[06:53:36] <thetruthisoutthe> plasmasolutions <= http://www.engbedded.com/fusecalc ?
[06:53:46] <twnqx> fusecalc can't set fuses
[06:53:52] <thetruthisoutthe> avrdude can
[06:54:04] <twnqx> with an extremely obfuscated commandline, yes
[06:54:12] <plasmasolutions> thetruthisoutthe: Not for avr32...
[06:54:12] <Horologium> use the online fuse calc.
[06:54:13] <thetruthisoutthe> avrdude -U lfuse:w:0x62:m -U hfuse:w:0xdf:m
[06:54:35] <twnqx> yes
[06:54:38] <twnqx> i call that obfuscated
[06:54:44] <Badaboom> theres even an app for fuses
[06:54:47] <thetruthisoutthe> twnqx <= what is wrong with make && make install ?
[06:55:02] <twnqx> ?
[06:55:07] <Horologium> is avr32 even used for anything commercial?
[06:55:16] <thetruthisoutthe> i don't think
[06:55:34] <plasmasolutions> Horologium: Someone has to be the first one...me! :)
[06:55:40] <twnqx> i suppose it is, guess atmel would have stopped the tapeout if they only shipped to hobbyists
[06:55:45] <thetruthisoutthe> isn't it 8 bit atmel, or arm ?
[06:55:51] <Horologium> I just don't see the advantage of avr32 over arm.
[06:55:56] <twnqx> it's some random 32bit cpu
[06:56:11] <Horologium> avr32 is a 32 bit avr, kindasorta....it's avr extended to what an arm can do, almost.
[06:56:26] <twnqx> just more vendor lock-in
[06:56:45] <Horologium> it was apparently designed to run linux and be programmed in C.
[06:56:59] <Horologium> or so the advertising sheets say.
[06:58:29] <thetruthisoutthe> i like this thing http://en.wikipedia.org/wiki/AMULET_microprocessor
[06:59:13] <thetruthisoutthe> asynchronous system
[06:59:16] <thetruthisoutthe> The APT group estimates AMULET2 to have a similar power dissipation/performance ratio as ARM8. One very notable feature due to the asynchronous design is the drop of power dissipation to 3 μW when not in use
[07:18:47] <plasmasolutions> twnqx: https://plus.google.com/u/0/100648505516372675531/posts/ToGoqkedcJY
[07:19:13] <twnqx> cute
[07:19:19] <plasmasolutions> ;)
[07:20:21] <megal0maniac> Why no Atmel / AVR logo?
[07:20:56] <plasmasolutions> megal0maniac: My company logo is on the front, that is enough ;D
[07:21:27] <plasmasolutions> megal0maniac: Once atmel sponsors me and I don't have to buy something from them I will gladly add up their logo on top
[07:21:29] <plasmasolutions> ;)
[07:29:27] <megal0maniac> I assume that's the thing that the dragon is trying to kill? :P
[07:36:01] <plasmasolutions> :D The baby dragon is practising with it's big brother to someday spit the same amount of flames like him ;D
[07:37:31] <megal0maniac> Ah. Cute :)
[07:37:58] <plasmasolutions> ;)
[08:18:28] <plasmasolutions> kobsu: Bought sublime :) It's very handy and small so I will carry it on a usbstick to have it available everywhere... but I cannot find any autocompletion stuff that includes "include"...do you have some experience with that topic?
[08:25:02] <Horologium> 70 dollars for a text editor?
[08:25:32] <theBear> heh, cheaper than word :)
[08:26:20] <plasmasolutions> Horologium: Yes, if it helps me and does not hinders me it's worth it..
[08:26:25] <Horologium> I wouldn't pay for word either.
[08:26:41] <theBear> nbah, me neither :)
[08:33:10] <GuShh_> theBear: I got a starter office with this laptop so that's even cheaper!
[08:33:55] <theBear> meh, use abiword on a real os and you'll save in cpu cycles :)
[08:35:47] <Horologium> I use libre office myself.
[08:37:16] <GuShh_> theBear: save them for what? clueless "developers"
[08:37:19] <theBear> i haven't needed an 'office' for many years, but i tend to use kspread these days, so i'd probably try the matching koffice text editor if i needed one, first got abiword years ago to open msword docs
[08:37:22] <GuShh_> who code in Java, for example.
[08:37:25] <theBear> GuShh_, for electricity costs
[08:37:53] <kobsu> plasmasolutions: yes I have used sublimeclang
[08:37:59] <kobsu> plasmasolutions: for autocomplete in st2
[08:38:19] <theBear> anyone know what you call the wire-end sockets for single-pin-header connecting ?
[08:38:25] <plasmasolutions> kobsu: And it also autocompletes symbols and methods... in the avr32 includes?
[08:38:53] <kobsu> plasmasolutions: I'm glad to hear that you even bought a license :) jsp has made a good job to create that editor
[08:38:57] <kobsu> plasmasolutions: yes
[08:39:15] <plasmasolutions> Cause I've looked at the plugin page andd it says: Discontinued -> go to https://github.com/quarnster/completion
[08:39:26] <plasmasolutions> So I installed that under sublime text 3
[08:39:30] <kobsu> yeah but you can still use it and it works
[08:40:09] <plasmasolutions> kobsu: I think if a dev is doing some great work editor wise it's my duty to support it
[08:40:16] <plasmasolutions> so I bought it
[08:40:42] <plasmasolutions> Apart from donating to open source projects ..
[08:44:55] <GuShh_> theBear: no, like I said whatever cycles you save will be wasted by clueless retards programming in java, javascript, flash, etc.
[08:45:06] <GuShh_> all of which you can get rid of at the cost of not being able to do much these days
[08:45:16] <theBear> and i maintain you can avoid them as well in a real os as a silly one :)
[08:45:32] <GuShh_> that's similar to ignoring most of the people on an irc channel though
[08:45:36] <GuShh_> might as well quit the channel
[08:46:09] <theBear> meh, seems to work for me, not ignoring, i think i've ignored 3 times since 1990
[08:47:26] <Tom_itx> c-grid
[08:47:32] <Tom_itx> that's what they're called
[08:47:47] <GuShh_> theBear: you can remember as far back? :p
[08:48:14] <GuShh_> for electricity costs I moved to a single laptop and got rid of the desktops, although I still use multiple screens
[08:48:16] <theBear> heh, i might drink, but i'm cursed with near-photographic memory, regardless of mental/physical state
[08:48:43] <GuShh_> so you can remember random price tags and recall when the prices increased or decreased for example?
[08:49:19] <GuShh_> I seem to remember all that, plus locations of objects that aren't even mine, but maybe I won't remember what colour shirt someone was wearing or such, don't care for those details.
[08:49:34] <GuShh_> oh and I think we covered security cameras at least a couple times already
[08:50:11] <theBear> well, for example, there's roughly 4 hours i can't clearly remember in all my many many many 1000's of hours of drunkenness and psychadelic abuse
[08:50:13] <GuShh_> I've since added emergency exits to my safety related OCD.
[08:51:09] <theBear> i seem to have trouble noticing MOST people i 'see every day' gaining/losing things like moustaches/beards
[08:51:19] <theBear> but that's because i never really noted it, not forgot :)
[08:51:28] <Horologium> heck, I have trouble noticing most people period.
[08:51:43] <GuShh_> Hmm I haven't had any contact since yesterday wrt my brother
[08:52:10] <theBear> and as the years go on some of my number memory fades, i can't remember the specs for most common opamps backwards anymore, but then again, i don't regularly look them up anymore... i seem to do okay referring to avr datasheets i haven't checked in 10 years tho :)
[08:52:12] <GuShh_> Horologium: that's what you'll say in court after you've run over several people, right?
[08:52:21] <theBear> hehe
[08:52:41] <Horologium> naaa...I avoid moving speed bumps.
[08:52:46] <GuShh_> silly details are often erased for more relevant data
[08:52:56] <Horologium> it's just that people are mostly the same to me.
[08:53:10] <GuShh_> deep inside you are a massive racist I bet
[08:53:13] <Horologium> there is me, my wife, and everybody else.
[08:53:19] * GuShh_ facepalms
[08:53:19] <Horologium> it ain't that deep.
[08:53:25] <Horologium> I hate everybody equally.
[08:53:34] <theBear> mmmm, seems frightening how much just plain, details i have room for tho... if i had the time i could recount with haunting accuracy everything from about the time i was 2
[08:53:57] <theBear> and i can still sketch plans or facades of houses i saw 20+ years ago near perfectly
[08:54:01] <GuShh_> However I recall they've estimated a fairly small size in GB equivalent to a human brain
[08:54:17] <GuShh_> What matters is how you store the data of course.
[08:54:31] <GuShh_> theBear: pfft that remains to be seen
[08:54:44] <GuShh_> we can all draw random sticks and say we've seen it before!
[08:55:20] <theBear> yeah, i've proven it tho
[08:55:49] <GuShh_> what's a leko?
[08:55:52] <theBear> would help for oceans ?? style crimes, or the bank job kinda deals :)
[08:55:55] <theBear> i dunno
[08:56:03] <GuShh_> seems lighting related
[08:56:15] <GuShh_> possibly a throw light
[08:56:21] <GuShh_> oh ellipsodial""
[08:56:41] <GuShh_> "Leko Light also known as an ellipsoidal, features a shaped reflector in combination with one or more lenses which creates a hard edged beam of light with even light intensity. The fixture uses shutters that can shape the beam of light. Leko's make a great light to project gobos."
[08:57:05] <theBear> hmmm, that does sound distantly familiar, like someone pasted that same paragraph a few years ago in irc land :)
[08:57:05] <GuShh_> that explains the "1k leko" on here http://techno-fandom.org/~hobbit/lighting/dimmer.html reading the url further agrees with this notion >_<
[08:57:40] <theBear> might be a theatre thing, i don't know much theatre stuff.... kinda sounds like a focus feature if it isn't a brand, or a generic term like "hoover" vs vacuum
[08:57:48] <GuShh_> so now, what's a gobo?
[08:58:06] <GuShh_> oh ok, goes-between or goes-before-optics
[08:58:11] <GuShh_> whatever, weird lighting people...
[08:58:19] <theBear> gobo is a cutout template, usually a small metal disc or maybe glass
[08:58:23] <GuShh_> they're the type you never see 'cos they either wear black or are black.
[08:58:38] <GuShh_> and you only notice them when they throw something on stage.
[08:58:42] <theBear> you use them to make a spotlight into a star, or a mottled effect, or whatever
[08:58:44] <GuShh_> hopefully themselves.
[08:58:52] <theBear> funny word, like spigot :)
[08:59:06] <GuShh_> http://upload.wikimedia.org/wikipedia/commons/8/84/Gobo_holder.JPG
[08:59:08] <theBear> there are a few standard sizes
[08:59:14] <GuShh_> are the patterns laser etched or is it even fancier?
[08:59:34] <GuShh_> it has to handle a lot of temperature...
[08:59:38] <theBear> yeah, they slip into those, then you slide that into the side of a spotlight, that looks like a midsized 'profile' light one
[08:59:51] * GuShh_ shrugs
[09:00:06] <theBear> depends on the light involved, you can get low-temp ones madeup cheap with custom logos for one-off shows, but bigger lights and non-uv-filtered melt them QUICK
[09:00:10] <GuShh_> so why are lekos called lekos?
[09:00:26] <theBear> laser etched for proper metal ones, also you get 'wavy glass' kinda ones for soft and mottle effects
[09:00:35] <theBear> i dunno what a leko is yet apart from what you said
[09:01:10] <theBear> ahh, haven't read that dimmer link for years, it's a good theory/new players guide
[09:04:37] <GuShh_> heh
[09:04:55] <GuShh_> I was actually researching VFDs and for some reason that popped up
[09:05:10] <theBear> what, fluro vfd or motor vfd ?
[09:05:13] <GuShh_> motor
[09:05:29] <GuShh_> google fail...
[09:05:30] <theBear> mmm, fairynuff, phase control and hv switching and stuff i spose
[09:05:46] <theBear> yeah, it thinks it's smarter than us these days, gets common related terms and messes everything :)
[09:09:23] <GuShh_> theBear: well the dimmer as-is works for universal motors.... dremel, angle grinders, some drills...
[09:09:37] <GuShh_> not so much for induction heh such as most lathes and bench drills!
[09:09:52] <GuShh_> and that's why I need a VFD in the first place for a half hp induction motor
[09:09:53] <theBear> yeah, not the kindest to them, but people like us are good at breaking the rules and getting away with it
[09:10:15] <GuShh_> hmm they do use regular dimmers on all those tools with variable speed control that plug onto mains, since they're brushed universal motors
[09:10:16] <GuShh_> brb
[09:10:25] <theBear> it's not really practical for a small/one-off thing, but you might consider igbts, either linear or pwm style
[09:10:52] <theBear> if you do be careful tho, when designed for resistive loads inductive loads kill them REAL quick
[09:26:40] <Tom_itx> <theBear> anyone know what you call the wire-end sockets for single-pin-header connecting ?
[09:26:43] <Tom_itx> c grid
[09:27:01] <theBear> ahh, thanks, was for someone else, wasn't paying attention :)
[09:31:40] <twnqx> theBear: that reminds me
[09:32:02] <twnqx> i wanted to build an electronic load, but i want to be able to do more than resistive - how would build a capacitive load? :P
[09:32:51] <theBear> damn, umm, hmmm
[09:39:47] <vectory> switch mode?
[09:40:15] <vectory> besides, how do you do resistive?
[09:40:39] <twnqx> with fat mosfets or igbts
[09:40:40] <theBear> resistive is easy, basically a powerdevice
[09:40:52] <twnqx> and lots of cooling.
[09:41:11] <theBear> pretty sure you can do transistor with a resistors/pot across it, like a 'variable zener' setup
[09:41:34] <twnqx> yeah, but if you want to burn away a few hiundred watts...
[09:42:17] <theBear> if there are a 1000 different several-thousand watt transistor amps out there, why not ?
[09:42:26] <theBear> it's all about putting heat into a heatsink
[09:42:41] <theBear> big transistors are happy to dissipate up to around 250w
[09:42:43] <theBear> in to3
[09:44:37] <twnqx> big igbts can do a few kW :P
[09:44:56] <twnqx> but yeah, bipolars n linear region should do as well
[09:45:04] <theBear> yeah, but i don't have a bunch of them in my parts box :)
[09:45:10] <theBear> and they usually expensive
[10:02:38] <Horologium> hmm...how about,,,,transistors made with LED technology?
[10:02:46] <Horologium> so each junction glows a different color.
[10:03:00] <Horologium> and put them in clear casing.
[10:03:05] <Horologium> or just even one junction.
[10:03:21] <Horologium> so you have a combination transistor and LED in one package.
[10:03:33] <Horologium> makin fer da blinkin lights prettys.
[10:04:10] <vectory> did you think this through?
[10:04:21] <Tom_itx> sounds like he did
[10:04:37] <Tom_itx> in a visual effects sort of way
[10:04:48] <Horologium> ummm...
[10:04:51] <Horologium> someone already made one.
[10:04:54] <Horologium> an OLET
[10:05:14] <Tom_itx> i'd rather have an OmLET
[10:05:21] <Horologium> http://en.wikipedia.org/wiki/Organic_light-emitting_transistor
[10:05:35] <Horologium> Tom_itx, had that for breakfast.
[10:05:47] <Tom_itx> yesterday :)
[10:06:00] <Horologium> taco flavored.
[10:06:01] <Tom_itx> serial today
[10:06:16] <Horologium> brkfst.dll not loaded. cereal port not found.
[11:37:56] <theBear> GuShh_, for reference just looked harder, the cooked disc in that link earlier is the gobo itself, little starry one, and thoroughly cooked, probably due to a poorly 'focused'/adjusted lamp
[11:38:15] <theBear> especially judging from the off-centerness as well as unusual amount of heat
[12:23:20] <skroon> hi
[12:23:27] <skroon> is there a hardware tcp/ip solution at atmel?
[12:36:50] <skroon> anyone here ever used contiki-os ?
[12:48:27] <tyrosine> >>> DECIMAL TO HEX? I know this is an odd situation (I'm communicating with commercial device over serial port), but I need to turn a decimal value into the "visual hex" of the same value. In other words, my char x=90. I want the simplest code to turn 90 into 0x90. Not the actual hex value (0x5A). Any suggestions?
[12:52:00] <tyrosine> I think I figured it out... hex=dec%10+(dec%100)/10*16;
[12:53:52] <twnqx> :S
[12:54:51] <twnqx> though yeah, that will.. probably... work
[12:59:00] <tyrosine> is there a more elegant way?
[12:59:12] <tyrosine> consider the nubmer 90. In that equation, 90 gives me "144", which is hex 0x90
[13:04:42] <seldon> I'd write dev % 10 + (dec / 10) % 10 * 16, so the compiler can save one division (and to avoid silliness for dec > 99).
[13:05:07] <seldon> Here's hoping I'm not missing key parts of the conversation :P
[13:08:41] <tyrosine> thanks!
[13:08:43] <tyrosine> that does help.
[13:14:35] <tyrosine> ooo... better
[13:14:35] <tyrosine> (dec / 10) << 4 | dec % 10
[13:15:41] <seldon> I suspect there will be no difference in asm between << 4 and * 16.
[13:17:33] <seldon> This seems like an odd operation to want, though. What are you trying to do there?
[13:17:54] <twnqx> display decimal values on a device that can display hex, i guess
[13:18:14] <seldon> I see.
[13:18:20] <twnqx> "BCD encoding"
[13:18:23] <seldon> Carry on, then.
[13:21:10] <seldon> Without the second % 10, you will get funny results for dec >= 100, mind you.
[13:23:01] <tyrosine> yes, but that should never happen in this application.
[13:23:11] <tyrosine> I ended up with...
[13:23:13] <tyrosine> hex=dec/10*16+dec%10;
[13:23:16] <tyrosine> dec=hex/16*10+hex%16;
[13:23:25] <tyrosine> and it seems to work
[13:26:06] <seldon> Looks sane.
[13:30:49] <edman007> is there something to swap the polarity of the SPI bus with a tiny24a? for some reason I basically got things working... but the bits are inverted when I receive them on the tiny
[13:31:23] <edman007> wait... maybe not...
[13:35:02] <Tom_itx> cpol
[13:40:16] <seldon> That's for sck, not miso/mosi, though. If that were the error, the bits would arrive shifted to one side.
[13:56:00] <yunta> OndraSter: r u t?
[14:03:53] <megal0maniac_afk> h
[14:04:55] * robotustra relaxing... http://www.youtube.com/watch?v=F3Cv_GqkR-M
[14:07:50] <OndraSter_> yunta, am I what?
[14:08:14] <yunta> "are you there" :)
[14:09:01] * robotustra some music... http://www.youtube.com/watch?v=t21C09JiRc4
[14:09:18] <yunta> OndraSter_: I've got error setting up PDI mode, from dragon. I've found some logs where you also had it, what's your final fix for that?
[14:10:51] <OndraSter_> 40pF to ground from... the clock pin I think
[14:12:19] <yunta> thx
[14:13:12] <yunta> you should get paid by atmel for being customer support
[14:14:40] <OndraSter_> :D
[14:20:47] <yunta> damn, no change
[14:21:28] <yunta> it reads supply voltage a bit low (3.2v), but I doubt that could be a problem.....
[14:26:30] * robotustra _|-|_|-|_|-|_ Jeri calls it clock
[14:57:01] <yunta> fck it, I'm gonna buy avrispmk2
[15:02:33] <vectory> RikusW: bl32u2_avrdude_conf_patch.txt in AVR_U2S_20111022.tbz is outdated
[15:02:46] <RikusW> why ?
[15:03:12] <RikusW> not working with avrdude 5.11 ?
[15:04:47] <vectory> i dont know, but diff says it differs from the standalone file
[15:05:05] <vectory> i.e. mode= 0x41;
[15:05:11] <vectory> is new
[15:06:15] <RikusW> basically I set the eeprom length to one to avoid eeprom page writing
[15:06:50] <RikusW> you could copy the current m32u2 and change eeprom length to 1
[15:06:52] <vectory> which ds do i need anyway? the m32u2 ds doesnt mention bl32u2
[15:07:20] <RikusW> I changed it that way to be compatible with my bootloader
[15:07:31] <RikusW> afaik flashing works fine
[15:07:47] <RikusW> its only eeprom in terminal mode thats buggy
[15:08:17] <vectory> oh, it is a m32, i get it x)
[15:08:24] <vectory> m32u2, even
[15:08:25] <RikusW> say writing byte 0 also erases 1,2 & 3
[15:08:31] <RikusW> yes
[15:08:50] <vectory> thought bl means blacklist and thats why i cant find it :P
[15:08:58] <RikusW> bl32u2 is the bl - bootloader patch
[15:09:05] <RikusW> BootLoader ;)
[15:10:31] <vectory> one quick question: how to include a asm file with .data section only in *.c?
[15:10:41] <vectory> easy enough to find it in google?
[15:10:58] <RikusW> what are you trying to do ?
[15:11:03] <RikusW> why won't plain C work ?
[15:11:23] <RikusW> avrlibc docs should have something on that
[15:14:29] <vectory> RikusW: hmm, i wanna save 30k or so of pcm data in flash. basically abusing the chip as a ram substitute
[15:14:48] <RikusW> use char[] ?
[15:15:09] <RikusW> char data[] = {
[15:15:09] <vectory> hmmm, wont that be put on the stack?
[15:15:11] <RikusW> 0x12,0x34........};
[15:15:17] <RikusW> err
[15:15:32] <RikusW> there is a way to let it stay in flash only
[15:15:41] <RikusW> PROGMEM iirc
[15:16:23] <vectory> ok, thank you, will google when i come back from work
[15:16:38] <RikusW> read the avrlibc docs, its all in there
[15:17:12] <vectory> abcmini wrote a tut on avrfreaks, as well :D
[15:17:26] <RikusW> good for you :)
[17:05:58] <beaky> hello
[17:06:26] <Horologium> if you say so.
[17:06:56] <beaky> how do i use the avr dragon?
[17:07:29] <Horologium> plug it in, hook it up, and use it.
[17:07:38] <Horologium> it is a programmer and debugger.
[17:07:48] <beaky> ah i didnt solder the pins on it yet :(
[17:07:55] <Horologium> have you read the avrdragon documentation?
[17:08:00] <beaky> ah not yet
[17:08:46] <Horologium> is it me or is it now illegal to read documentation before asking questions?
[17:09:03] <beaky> :D
[17:09:43] <beaky> alright i will rtfm ^^
[17:11:44] <RikusW> beaky: those pins are for HVPP only
[17:11:57] <RikusW> the ISP and JTAG ones are already soldered on
[17:12:08] <RikusW> (2x3 and 2x5)
[17:14:11] <beaky> ah xlent
[17:14:23] <beaky> I'll just hook the ISP bits
[17:21:07] <Xark> Hmm, I recently installed AVR Studio 6.1 (and uninstalled 6.0). Now creating a new project, it appears it only supports ARM, XMEGA, AVR32 and Mega1284. Am I missing something, or do you need older version for (e.g.) 328p?
[17:21:36] * Xark notes it only lists "boards" not "processors" (I am using a breadboard...)
[17:27:53] * Xark figures out he needs to double click to get MCU list for custom board (nvm). :) Runs so slow on my 3GB system (swapping), that I didn't realize it was doing something...
[17:28:27] * Horologium shrugs.
[17:28:41] <Horologium> it won't run on linux, even under wine, for crap.
[17:29:13] <Xark> Horologium: Not surprised since based on Microsoft "tech". :)
[17:30:23] <Xark> Horologium: I only use it when I need Dragon debugging...
[17:55:37] <RikusW> run it in a virtualbox
[17:57:47] <Horologium> RikusW, that would require installing windows.
[17:59:47] <R0b0t1> s/installing/pirating/
[18:00:35] <Horologium> that too.
[18:01:48] <R0b0t1> No reason to use AVR Studio though, use Eclipse if you really do need an IDE. Pretty much every self-released IDE has worse code completion than it.
[18:02:14] <jadew> R0b0t1, you clearly haven't used avr studio :)
[18:02:29] <R0b0t1> HMMM.
[18:02:54] <jadew> it's not self-released ;)
[18:03:05] <jadew> it's based on microsoft's visual studio
[18:03:13] <Horologium> I used avr studio years back but found it mostly useless.
[18:03:22] <Horologium> before it became atmel studio
[18:03:35] * edman007 hugs emacs
[18:03:44] <seldon> <3 emacs.
[18:04:02] <Horologium> I prefer vi
[18:04:04] <jadew> I'm not using it either, but I know it has great code completion and it moves faster than eclipse, since everything does
[18:04:07] <seldon> Heretic!
[18:04:42] <seldon> That was directed at Horologium. I'll be building a stake.
[18:04:49] <Horologium> what, for vi?
[18:04:52] <Horologium> it works.
[18:04:56] <Horologium> even without a gui.
[18:05:14] <seldon> It's clearly evil. And I am entirely serious(tm).
[18:05:49] <Horologium> so, I never claimed not to be possessed by evil.
[18:06:02] <jadew> well, if you got used to it, it's fine, but it's the 80's technology
[18:06:28] <Horologium> umm
[18:06:32] <Horologium> 70s tech dude.
[18:06:59] <Horologium> The original code for vi was written by Bill Joy in 1976, as the visual mode for a line editor called ex that Joy had written with Chuck Haley.[2] Bill Joy's ex 1.1 was released as part of the first BSD Unix release in March, 1978. It was not until version 2.0 of ex, released as part of Second Berkeley Software Distribution in May, 1979 that the editor was installed under the name vi (which took users straight into ex's visual mode), and the name by wh
[18:06:59] <Horologium> ich it is known today.
[18:08:02] <edman007> vi is very evil
[18:08:12] <seldon> Emacs hails from the 70s, as well. That's not the problem.
[18:08:27] <R0b0t1> vim
[18:08:29] <Horologium> we could always go back to coding with ed
[18:08:37] <R0b0t1> I like the version of vim with all the fluffery.
[18:08:39] <seldon> TECO.
[18:09:17] <seldon> Or dd and /dev/mem.
[18:10:12] <Horologium> or cat
[18:12:39] <seldon> Hmmm...that would be a real challenge.
[18:13:05] <seldon> Since invoking cat will change /dev/mem.
[18:14:04] <Horologium> use cat...read from stdin, write to a file.
[18:14:41] <Horologium> used to do similar on minimal dos installs.
[18:15:03] <seldon> Oh, that. I thought you meant to cat from/to /dev/mem.
[18:15:03] <R0b0t1> There was some hacking I did a while back that was basically writing to /dev/mem. Huge clusterfluffle.
[18:15:23] <Horologium> R0b0t1, it can be fun.
[18:15:47] <seldon> Fun, yes. But you should not usually want to do it.
[18:16:21] <R0b0t1> Horologium, it tried to detect writes not by itself and I didn't know this for a while...
[18:17:55] <Horologium> heck, back in the commodore days you could write programs directly to memory with poke.
[18:18:26] <R0b0t1> But the programs didn't poke back :3
[18:18:33] <Horologium> no, you had to peek them
[18:19:08] <Horologium> aahh the wonderful days of writing assembly on paper and hand compiling.
[18:19:29] <seldon> Gnah.
[18:20:05] <Horologium> then put it all in data statements and have a little program that would read the data and poke it into ram then call it.
[18:21:03] <seldon> It's amazing how sheer nostalgia can turn that sort of thing into the "good old days." :P
[18:23:30] <seldon> I'm willing to bet you were cursing at every typo.
[18:24:34] <Horologium> no...I had a ball with it.
[18:24:38] <Horologium> it was a challenge.
[18:24:49] <Horologium> it's how I learned to program.
[18:24:58] <Xark> seldon: I did it, and it was fun. However, not sure I would want to write modern software that way. :)
[18:29:28] <seldon> Well, to be honest, I have been poking around in ELF binaries myself a few times. But I generally try to avoid it.
[18:30:40] <seldon> And I would have gone nuts without objdump.
[18:32:18] <R0b0t1> I used to be able to disassemble x86 in my head.
[18:32:25] <R0b0t1> Surprisingly, it was not a skill that was readily retained.
[18:32:55] <R0b0t1> Although the output of modern compilers is basically RISC-like.
[18:38:38] <Xark> R0b0t1: Similar to how I remember a bunch of 6502 opcodes, but only know (typically) breakpoint and NOP for modern architectures.
[18:39:13] <R0b0t1> 0x90
[18:39:42] <Xark> Yep. :)
[18:39:44] <R0b0t1> 0x33 break, 0xC3 ret, 0xC9 ret n32
[18:40:03] <R0b0t1> Mmm maybe not 0x33. But it had a 3 in it.
[18:40:13] <RikusW> x86 0xCC
[18:40:26] <RikusW> 90 is nop
[18:40:28] <Xark> You beat me (the other one I know). :)
[18:42:02] <Horologium> I don't remember the opcodes for 6502 anymore...it's been nearly 30 years since I did that.
[18:42:18] <RikusW> avr break is 0x9598
[18:42:54] <RikusW> nop is 0x0000
[18:42:58] <Horologium> at least avr opcodes are word size.
[18:43:15] <R0b0t1> Heh.
[18:44:20] <Xark> RikusW: Can't say I have had to use AVR break. :) Unless Dragon use it indirectly (but I think it has like 4 break addresses or something).
[18:44:43] <RikusW> the dragon does use that too
[18:45:33] <RikusW> you can actually put a break instruction anywhere and it will work with the dragon
[18:45:36] <Xark> RikusW: Yeah, I guess you want something for "assert" (etc.)
[18:46:06] <RikusW> dW got one sw breakpoint, use "run to cursor" to use it
[18:46:51] <Xark> dW = debugwire?
[19:07:24] <Tom_itx> ja
[19:48:00] <RikusW> http://www.mentor.com/embedded-software/blog/post/one-way-ticket-to-mars-bd20c415-273d-4f24-8e23-5da4947ccfbb
[19:48:09] <RikusW> One-way Ticket to Mars anyone ?
[19:54:01] <cmtptr> oh man I love mars
[20:03:40] <jadew> that's gonna happen
[20:05:38] <jadew> I'd go for it, if the other 27-39 passengers will be hot chicks
[20:05:50] <jadew> that would be a fun surprise
[20:06:12] <Horologium> problem is, they are all man hating lesbians.
[20:06:13] <jadew> maybe I can get on the cometee and at the launch "you won't be able to see the other winners until you get there"
[20:06:14] <seldon> I'll wait until there's air there.
[20:06:30] <jadew> and there... ta ram! me and the hottest chicks that applied
[20:06:30] <Horologium> there is air there!
[20:06:35] <Horologium> it's just not real thick.
[20:06:53] <seldon> Nor breathable.
[20:06:58] <Horologium> beside the point.
[20:07:02] <Horologium> there is still air there.
[20:07:39] <jadew> I think they put some algees in there, a few years back in "Mission to Mars" the movie
[20:07:39] <seldon> Don't make me check the dictionary!
[20:09:05] <ambro718> what's a fast way to detect the position of the highest bit in an integer?
[20:09:21] <Horologium> math?
[20:09:34] <ambro718> are there any special instructions that could help, or do I have to do repeated right shifting?
[20:09:35] <jadew> on the other hand, they found evidence of previous life for years, I remember reading a document from the nasa site documenting some dirt samples that had bacteria fossiles in them
[20:10:20] <seldon> ambro718, http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogObvious (and the ones below that)
[20:10:35] <Tom_itx> probably left over from the last failed marsone mission
[20:11:07] <Tom_itx> monitors sure have come down since the last time i got one
[20:11:48] <Tom_itx> went to the local place to find a used one to put in the shop on my cnc and walked out with a new one for $80
[20:12:30] <jadew> hah, nice
[20:13:06] <Tom_itx> the last used one i got was 60
[20:13:08] <Tom_itx> go figure
[20:14:24] <Xark> ambro718: Hmm, isn't that: rightmost_bit = v & (v-1); (which seems like it would be in seldon's link, but I didn't spot it)
[20:15:02] * Xark realizes that is leftmost bit...d'oh. :)
[20:15:06] <seldon> That checks if something is a power of 2.
[20:15:46] <Xark> seldon: Yeah, typically used for that (leftmost bit only of a value). Sorry.
[20:15:48] <jadew> http://web.archive.org/web/20030609061951/http://cass.jsc.nasa.gov/lpi/meteorites/life.html
[20:15:59] <jadew> for some reason the link isn't live anymore
[20:16:42] <jadew> probably generating too much excitation, apparently the evidence was refuted recently
[20:17:13] <ambro718> seldon: ok thanks, I'll try compiling some of those
[20:17:14] <seldon> Hmm... v ^ (v & (v - 1)) could do that, I think.
[20:17:52] <seldon> Get the least significant bit of a value, I mean.
[20:20:30] <Xark> seldon: Hmm...wouldn't that just clear the leftmost bit?
[20:21:09] <seldon> v & (v - 1) is v with the lowest bit unset.
[20:22:00] <seldon> Anyway, ambro718, about the highest bit stuff: Keep in mind that AVRs don't have shift-by-n-bits instructions. I think that makes some of the stuff on that site perform badly there.
[20:22:30] <ambro718> seldon: good observation...
[20:22:54] <jadew> while (!(value & 0xFFFF)) { ++pos; value <<= 1; }
[20:22:57] <Xark> ...Yes, and AVR tends to make loops (but might unroll with higher optimization values).
[20:23:02] <jadew> where 0xFFFF is your max value
[20:23:04] <Xark> avr-gcc*
[20:23:10] <jadew> don't know how faster you can do that
[20:23:32] <jadew> wait
[20:23:35] <jadew> not FFFF
[20:23:40] <jadew> 0x8000
[20:24:11] <jadew> you basically want to AND it against 10000000000etc
[20:24:28] <seldon> Well, if it's a 16 bit int, it'll make sense to check the individual bytes.
[20:24:44] <jadew> that too
[20:25:24] <jadew> oh and the position will be in reverse
[20:25:30] <ambro718> It's a 32bit int. Doing the shifts on 32bits directly isn't very fast in AVR. I think I'll try examining the bits from the MSB down, so I won't have to do big shifts of multiple bytes.
[20:26:18] <seldon> Moreover, you only have to check one byte for its bits.
[20:26:46] <seldon> Just skip the zero bytes at the most significant end.
[20:26:56] <ambro718> exactly
[20:27:40] <jadew> I think you can do it super fast in asm
[20:27:50] <jadew> I mean... the fastest you can do
[20:27:53] <ambro718> I'll try C first. What's the byte order
[20:28:16] <seldon> LSB first.
[20:28:49] <seldon> union { uint32_t val; uint8_t bytes[4]; } whee;
[20:53:18] <ambro718> http://ideone.com/QkQssj
[20:53:34] <ambro718> should I try doing it in asm?
[20:54:00] <Tom_itx> of course
[20:55:30] <ambro718> I'm not sure whether I should be keeping two counters, one for bits and one for bytes
[20:55:59] <ambro718> if I keep just one I need to do shift by 3 to get the other
[20:57:15] <ambro718> hm actually I should just unroll the loop
[20:59:26] <tzanger> I'll unroll your loop, boy!
[21:08:36] <ambro718> so in inline asm a 32-bit is split in A,B,C,D, which is lsb/msb?
[21:09:44] <thetruthisoutthe> h
[21:11:16] <Horologium> whichever you want.
[21:11:26] <Horologium> unless you are reading an existing variable.
[21:11:33] <Xark> ambro718: The default on avr-gcc is "little endian".
[21:11:46] <ambro718> Xark: that doesn't tell me whether A is msb or B is msb
[21:11:48] <ambro718> * or D
[21:12:13] <thetruthisoutthe> seldon <= typedef struct { uint8_t a1, a2, a3, a4; } dwordhack; ? :)
[21:12:16] <Xark> ambro718: I think it does. a would be lsb, d would be msb
[21:12:27] <ambro718> Xark: thanks
[21:12:31] <Horologium> little endian means the low byte is at the beginning.
[21:12:37] <Horologium> big endian means the other way around.
[21:13:03] <ambro718> I know, but you need to be sure that someone didn't reverse the letters ;)
[21:13:03] <seldon> thetruthisoutthe, That would probably work, but I prefer the array in the union because I have a guarantee there'll be no padding.
[21:14:53] <thetruthisoutthe> yeah i have that union stuff for colorspace conversion
[21:15:40] <seldon> Mind you, strictly speaking neither is actually defined behaviour in the C standard, so we're arguing about a matter of taste in dirty-ish hacks :P
[21:16:20] <thetruthisoutthe> it is defined, you only can be shot if somebody wants to run it on some system with other endianness (who ever uses that )
[21:16:44] <thetruthisoutthe> mac ?
[21:17:07] <Horologium> older mac..
[21:17:13] <Horologium> powerpc and earlier.
[21:18:17] <seldon> thetruthisoutthe, surprisingly it isn't (although everybody does it). There's just a lot about inspecting the initial part of union members of struct types that share an initial sequence.
[21:18:18] <thetruthisoutthe> c has endianness testing and defines, but i don't care about that
[21:29:45] <dgriffi> if I'm interfacing a matrix keypad to an AVR, can I just connect the cols and rows pins directly to the IO pins, or do I need to mess with pullup resistors?
[21:30:48] <dgriffi> and.. can I connect these to the PD lines?
[21:31:49] <thetruthisoutthe> io pins have internal pullup resistors if you want
[21:32:20] <dgriffi> okay, so there's the first question solved. thanks
[21:32:54] <dgriffi> now, about where I'm allowed to connect the matrix. Will PD be acceptable?
[21:38:14] <dgriffi> anyone?
[21:43:57] <vectory> why wouldnt it?
[22:10:59] <dgriffi> vectory: just wondering. I'm a novice with the AVR and was thinking that some pins might be such that they MUST or MUST NOT be used for certain things
[22:11:24] <ambro718> can someone see why my assembly is not compiling, http://ideone.com/5xjpH2
[22:11:26] <dgriffi> (delay in response was caused by network burps and farts)
[22:11:59] <thetruthisoutthe> no wondering allowed
[22:13:56] <dgriffi> another question about button matricies.. can someone point me to some code for detecting two buttons down at once?
[22:19:49] <theBear> erm, without looking 'normal' 2d button matrix code should detect multiple buttons happily
[22:46:52] <ambro718> okay my 32bit log2 is working correctly :D http://ideone.com/oF9DiW
[22:47:08] <ambro718> can someone see any way to make it faster?
[22:53:18] <ambro718> needs 30 instructions in worst case
[22:54:14] <jadew> bst r17, 7
[22:54:21] <jadew> brst add7andreturn
[22:54:26] <jadew> bst r17, 6
[22:54:32] <jadew> brst add6andreturn
[22:54:41] <jadew> etc
[22:55:34] <jadew> so you get away with 1 instruction less in there, but a bit more code
[22:56:07] <jadew> because you'll need to have code for adding 7, 6, 5, 4, 3, 2 and 1 and then jumping to end
[22:57:37] <ambro718> so instead of 3 instructions per bit I only have 2 instructions per bit in the checking code, right?
[22:57:49] <jadew> yeah
[22:57:51] <ambro718> I'll try that, thanks
[22:57:55] <jadew> np
[23:22:29] <ambro718> is there any difference between ori and sbr instructions?
[23:26:22] <Xark> ambro718: No, same encoding (i.e., synonym)
[23:28:10] <ambro718> ah, ok, lol
[23:29:05] <ambro718> so there really is no way to set a register to a constant in a single instruction?
[23:29:24] <ambro718> e.g. I need cli+ori
[23:29:25] <Xark> ambro718: LDI?
[23:29:31] <jadew> yeah, ldi
[23:29:56] <ambro718> great, thanks! I skipped ldi because I assumed "load" means memory
[23:29:58] <Xark> ambro718: However, it has to be r16-r31 (which can be a PITA)
[23:30:17] <jadew> it's enough for most stuff
[23:31:38] <Xark> jadew: Yeah, just saying (because it will error if the wrong reg).