#avr | Logs for 2013-06-01

Back
[00:00:07] <theBear> ask him what the frequency is sometime, and hear him groan as he remembers the 90s
[00:02:11] <Xark> jadew: The cool part is Spartan6 has TDMS (or whatever) support (not aware of other FPGAs that have that, so you need PHY, which is typically NDA).
[00:02:39] <jadew> alright, all 3 achronims are lost on me hehe
[00:02:43] <jadew> gotta google
[00:02:48] <theBear> acronyms !
[00:03:13] <jadew> thanks
[00:03:22] <theBear> something dual something, field programmable grid array, physical layer thingy, and non disclosure agreement
[00:03:40] <Xark> jadew: Hehe, sorry. It supports the signalling standard used by HDMI/DVI on chip. Other FPGAs need a PHY (physical interface component) for which you need to sign a Non Disclosure Agreement (i.e., not hobbyist friendly).
[00:03:57] <jadew> ah ha
[00:04:34] <jadew> so in a way they had that use in mind
[00:04:48] <Xark> jadew: Which is why "cheap" FPGA HDMI boards like this can't be used for HDMI (without some reverse engineering or NDA leak) -> http://hackaday.com/2013/05/08/hdmi-color-processing-board-used-as-an-fpga-dev-board-to-mine-bitcoins/
[00:05:17] <Xark> jadew: Yeah, I think they even have an app note on HDMI/DVI.
[00:06:40] <jadew> here's a $1000 question
[00:06:49] * Xark holds out his hand...
[00:06:56] <jadew> I'm gonna get a papilio fpga dev board
[00:07:05] <jadew> should I expect to need a better scope than my 50Mhz one
[00:07:09] <jadew> or will this suffice?
[00:08:17] <Xark> jadew: I suspect that is fine. Hopefully you won't have to debug HDMI signal. However, I find this very handy (more so than my scope, honestly) -> http://www.seeedstudio.com/depot/preorder-open-workbench-logic-sniffer-p-612.html
[00:08:35] <jadew> yeah, I have one already
[00:08:47] <Xark> Cool. You are set then AFAIK. :)
[00:08:53] <jadew> I'm the guy who pointed you to his OLS client :P
[00:09:08] <jadew> http://dumb.ro/lafront/
[00:09:11] <Xark> jadew: Ahh. Sorry, I didn't remember the nick. :)
[00:09:19] <jadew> np
[00:10:19] <jadew> I don't think the OLS would do more than the 50Mhz scope
[00:10:35] <jadew> at 200Mhz sampling speed it's still worse than the 50Mhz scope
[00:10:44] <edman007> so I want my application to be totally interrupt driven... what do I do in main? sleep? what happens when it wakes up from an interrupt? does the interrupt have to end by putting it back to sleep?
[00:11:00] <Xark> I mostly use it at 100Mhz with RLE mode and it seems to do nicely (although, not on 250Mhz signals...).
[00:11:49] <Xark> I think it "cheats" for 200Mhz with DDR FPGA inputs (but seems a bit wonky for me @ 200Mhz).
[00:12:06] <jadew> what do you mean wonky?
[00:12:37] <Xark> edman007: I believe so, yes. Like the example here http://www.nongnu.org/avr-libc/user-manual/group__avr__sleep.html
[00:12:59] <Xark> jadew: I just get odd results. Like timebase isn't right.
[00:13:01] <thetruthisoutthe> Xark <= i think using 2 ios with one inverted should work as a hack :)
[00:13:10] <jadew> Xark, latest firmware?
[00:13:16] <thetruthisoutthe> don't know if it requires a series resistor
[00:13:27] <jadew> I remember having similar issues, but I don't think I had that with my client
[00:13:49] <Xark> thetruthisoutthe: You mean for HDMI? Not what I have heard (or seen).
[00:13:53] <jadew> I did find some bugs in the firmware tho, when it gets in some weird mode and starts outputting garbage, but I'm not sure if it's fixed or not
[00:13:55] <thetruthisoutthe> no, DVI
[00:14:06] <Xark> thetruthisoutthe: I think the video part is the same.
[00:14:22] <thetruthisoutthe> i mean the 2 wire diff transmission
[00:15:14] <thetruthisoutthe> one could macro it in any fpga i think
[00:15:17] <Xark> thetruthisoutthe: Well, that is not what I have heard.
[00:15:23] <Xark> (or seen)
[00:15:35] <thetruthisoutthe> yet
[00:15:36] <thetruthisoutthe> :)
[00:15:38] * Xark checks his OLS firmware...
[00:16:05] <thetruthisoutthe> well i see nothing fancy there
[00:16:26] <thetruthisoutthe> http://en.wikipedia.org/wiki/TMDS
[00:16:55] <Xark> jadew: Hmm, "Open Logic Sniffer v1.01" Firmware: 3.07 Protocol 2
[00:17:22] <jadew> yep, same here
[00:17:29] <thetruthisoutthe> The physical layer for TMDS is current mode logic (CML), DC coupled and terminated to 3.3 Volts.
[00:17:38] <Xark> jadew: Maybe it is because I use RLE?
[00:17:39] <thetruthisoutthe> aham i see, so it requires resistors with an io
[00:17:48] <jadew> Xark, highly possible
[00:19:26] <jadew> if you give it a try or notice discrepancies in expected result vs what you really get, it would be interresting to share
[00:19:34] <jadew> I could test in my client too
[00:20:40] <Xark> jadew: Next time I have a chance to pin it down, I will. I just assumed it wasn't supported (and I didn't really need > 100Mhz, it was just a WTH).
[00:21:31] <Xark> jadew: I think there was an older bug where the first capture after switching modes would be bad (and this may have confused my testing).
[00:22:17] <jadew> Xark, it's possible, in the latest firmware there's actually a command to shut off RLE
[00:23:03] <jadew> also, IIRC the 200Mhz mode with RLE, worked differently than the other modes with RLE
[00:24:22] <jadew> you might actually get more data sampling 1 channel at 200Mhz with RLE than you would sampling 1 channel at 100Mhz
[00:25:26] <jadew> again, I'm speaking from memory, but I think when you're not using the 200Mhz mode, it uses duble the size for sampling, so 1 channel = 2 bytes, 1 for the sample 1 for the count
[00:25:46] <jadew> while with 200Mhz you get 1 byte for the sample and 2 or 3 (can't recall) for the count, no matter what
[00:25:52] <Xark> Interesting. I was able to pretty much capture a full frame of 640x480 VGA or composite (with a not too complex image). Very cool for debugging the timing. :)
[00:25:58] <jadew> if you use 2 channels at 100Mhz you also get 2 bytes for the count
[00:26:37] <jadew> well, when using RLE you can get at most 12k changes
[00:26:53] <Xark> Right. Pretty much regardless of sample rate.
[00:26:58] <jadew> yep
[00:27:22] <Xark> My pixel clock was 25Mhz (for VGA) so 100Mhz was sufficient to debug timing.
[00:27:57] <Xark> (with a little help from scope perhaps - or at least 2nd opinion).
[00:28:31] <jadew> yeah, deffinitely enough
[00:30:02] <jadew> the crappy part about RLE is that the trigger position doesn't work anymore
[00:30:16] <jadew> because you can set the trigger at position x
[00:30:42] <jadew> but the time before the trigger would varry depending on the counts until x
[00:30:55] <Xark> Heh, I still have a link from when I was debugging it -> http://imgur.com/a/r2p94#0
[00:32:51] <Xark> jadew: Yeah, that makes sense. I think I have noticed that, but it didn't cause me too much trouble (but I do think I altered the "percentage ahead of trigger" due to that).
[00:33:34] <jadew> Xark, the problem that causes is that you can't get a new set of samples and expect to get your packet in the same spot
[00:33:43] <jadew> which would allow you to set cursors so you can measure things
[00:33:47] <jadew> and then see the difference
[00:34:23] <Xark> jadew: Also, if you have no signals ahead of trigger it causes issues IIRC.
[00:34:23] <jadew> that 10Mhz signal "has a ring to it" :P
[00:34:41] <jadew> Xark, what issues?
[00:34:45] <Xark> jadew: Yeah, that was STC 8051 project. STC is dirt cheap, but has crap GPIO drive. :)
[00:35:08] <jadew> Xark, it might cause issues decoding data
[00:35:20] <jadew> since a protocol parser might expect a line to go high before it goes low
[00:35:33] <Xark> jadew: If you had trigger percentage (say) 10% ahead of trigger and no other signal ahead of trigger it wouldn't capture right. I believe I had to set trigger to 0% ahead or something.
[00:35:34] <jadew> so if you trigger on low and your first sample is low, yeah, that could cause a problem
[00:35:46] <jadew> oh, that's strange
[00:36:17] <jadew> I didn't have this issue so far
[00:37:00] <jadew> probably a firmware issue as well
[00:37:10] <Xark> I may not be recalling the details correctly, but there was some limit to setting the "percentage ahead" when I was doing serial captures (and wanted to see the very first byte).
[00:38:01] <Xark> Never had the issue with VGA/NTSC captures (probably because there was always "signal transitions").
[00:38:54] <jadew> I haven't had many issues regarding that
[00:39:15] <jadew> maybe I have a different usage pattern, or maybe it was the client
[00:39:34] <Xark> It was also different in that it was active low for serial (not sure if that would matter).
[00:39:55] <jadew> shouldn't matter
[00:42:06] <thetruthisoutthe> hey guys, remember this code ?: http://pastebin.com/BzwPzZnx
[00:42:18] <thetruthisoutthe> found the source https://www.elance.com/s/copertronic/
[00:42:42] <jadew> total=0,total1=0,finish=0,interruption=0,recordm=0,records=0,recordh=0,recordme=0,recordse=0,recordhour=0,timemax=0,timelimit,odometerh,odohelp,timesave,odohelpm;
[00:42:46] <jadew> are you low on disk space?
[00:43:00] <thetruthisoutthe> ;>>
[00:43:10] <jadew> :)
[00:43:35] <Xark> Hey, you know whitespace slows the compiler down too. :)
[00:43:58] <jadew> heh, that too :P
[00:44:42] <jadew> thetruthisoutthe, there's absolutely no reason why not to have each variable on its own line
[00:44:59] <jadew> it will make it easier to find and change its type, if you have to
[00:45:09] <thetruthisoutthe> definitely
[00:45:09] <jadew> but mainly, easier to find / read
[00:45:17] <thetruthisoutthe> but i think it was not the intent
[00:45:34] <thetruthisoutthe> it is probably a test code that was not being payed
[00:45:46] <jadew> ah, it's not your code
[00:45:47] <thetruthisoutthe> posted here by raden
[00:45:50] <thetruthisoutthe> no
[00:46:05] <thetruthisoutthe> so he wanted somebody to fix it for him
[00:46:16] <jadew> meh, test code or not, wtf is this: PORTB|=((1<<PB0)|(1<<PB1)|(1<<PB2)|(1<<PB3)|(1<<PB4)|(1<<PB5)|(1<<PB6)|(1<<PB7));
[00:46:24] <thetruthisoutthe> :)
[00:46:39] <thetruthisoutthe> seems like some script parsing
[00:47:09] <theBear> hehehe
[00:47:11] <jadew> you can actually see the code he copy pasted
[00:47:12] <thetruthisoutthe> can also be idiot programmer
[00:47:16] <jadew> because it's properly formatted
[00:47:22] <Xark> jadew: Yuck, but probably the compiler bakes most of that out...
[00:47:34] <jadew> Xark, oh, deffinitely
[00:47:43] <jadew> that would get converted to PORTB = 0xFF
[00:47:50] <thetruthisoutthe> yeah
[00:47:50] <jadew> but my point was about the spacing
[00:47:51] <theBear> i know which one i woulda typed
[00:48:16] <jadew> or lack of spacing...
[00:48:36] <thetruthisoutthe> also using while loops and unroll everything
[00:48:41] <thetruthisoutthe> instead of functions
[00:50:41] <Xark> Well, I guess that kind of code is what you get for $22 an hour from Copertronic (but he has 4.9 and 5.0 star rating). :)
[00:51:53] <jadew> this is hillareous, I'm sure you missed it, but there's a global variable "i"
[00:52:32] <jadew> Xark, I'm paid less than that, but I'd like to think my code looks a bit better
[00:52:41] <thetruthisoutthe> :)
[00:53:17] <jadew> ah, speaking of the global i variable, in case people are getting ideas, don't
[00:53:46] <jadew> most of the time it's faster to use a local one than to use the global one "cuz it's already initialized and allocated"
[00:53:57] <jadew> because using the global one means loading and storing it
[00:54:28] <jadew> while a local one can be... a random register picked by the compiler and promptly discarded
[00:54:31] <thetruthisoutthe> that is one of the smallest problems i think
[00:54:37] <jadew> eventually with no pushing or popping involved
[00:54:37] <Xark> jadew: That reminds me of a SDK that had a global "x". That caused a bit of head scratching until -save-temps. :)
[00:55:07] <thetruthisoutthe> jadew <= check a few hundred lines below
[00:55:32] <thetruthisoutthe> like from line 707?
[00:55:51] <thetruthisoutthe> if(selection == 1) ......
[00:56:11] <jadew> Xark, I guess that's an advantage of the languages that don't inherit higher scopes, altho they suck overall
[00:56:50] <jadew> lol thetruthisoutthe
[00:57:20] <jadew> I guess he skipped the class on "switch (selection)" :P
[00:57:22] <Xark> jadew: Yeah, the preprocessor let me "band-aid" the sin (literally, as it was some optimized sin() routine causing the clash). :)
[00:58:31] <Xark> Wow, that code is like a glossary of stupid coding techniques....the more you look the more WTF. ;)
[00:58:37] * Xark closes the tab
[00:59:05] <thetruthisoutthe> :(
[00:59:08] <thetruthisoutthe> line 1471
[00:59:23] <jadew> how many lines are there lol?
[00:59:26] <thetruthisoutthe> if(selection<0)
[00:59:27] <thetruthisoutthe> {
[00:59:27] <thetruthisoutthe> selection =8;
[00:59:27] <thetruthisoutthe> }
[00:59:37] <thetruthisoutthe> line 58: uint8_t selection=1;
[00:59:40] <thetruthisoutthe> :):)
[01:00:14] <jadew> it looks like a noob's project
[01:00:20] * Xark guesses this coder is "so good" he doesn't even need any "stupid" warnings enabled...
[01:00:27] <thetruthisoutthe> expect uint8_t to be less than 0 !
[01:00:40] <jadew> we shouldn't really bash him, he's probably learning and just discovered ctrl + c
[01:01:10] <Xark> jadew: Hey, more power to him if he can earn $750 and 5 stars from that. :)
[01:01:25] <jadew> wait, someone earned money for that?
[01:01:28] <Xark> He may have a bright future. :)
[01:01:43] <Xark> jadew: You missed the other link -> https://www.elance.com/s/copertronic/
[01:02:35] * Xark notes the company is the same, but not the same name on that page vs the comments.
[01:02:37] <jadew> did he make the program in the background too?
[01:03:04] <thetruthisoutthe> no, that is called "illustration"
[01:03:04] <jadew> (the one in his portofolio picture"
[01:03:10] <jadew> ah
[01:05:12] <jadew> This is the project: https://www.elance.com/j/avr-micro-controller-programming-c-language/30707626/
[01:05:55] <thetruthisoutthe> lol
[01:05:55] <jadew> looks like a few hours project if the requirements were clear
[01:06:06] <jadew> maybe a day?
[01:06:09] <thetruthisoutthe> is that "chairman raden" ?
[01:06:10] <thetruthisoutthe> :)
[01:06:26] <thetruthisoutthe> ahaha
[01:06:57] <thetruthisoutthe> mystery solved
[01:10:08] <jadew> Xark, for that project the pay sounds more like 50-70$/hr than $20
[01:10:54] <edman007> this is odd... I tried adding some interrupts, it didn't seem to be working, so I checked the assembly GCC compiled... why does the interrupt table in GCC have 15 entries (counting reset)? The datasheet for this chip (tiny24a) says it has 16 interrupts plus reset (and the one I need is #17)
[01:11:28] <edman007> the interrupt got compiled as __vector16, but nothing seems to ever call it...
[01:11:57] <jadew> reset wouldn't be in the table I think
[01:12:15] <jadew> and your interrupt isn't called probably because it's not enabled or the global interrupts are not enabled
[01:13:26] <Xark> edman007: Are you sure gcc knows the exact chip you are using?
[01:16:36] <edman007> Xark, I'm pretty sure.... though I'm telling it two things...one for arch and one more specific (seems it needs both)
[01:16:46] * edman007 double checks the less specific one...
[01:17:36] <Xark> edman007: I think the linker needs it too (just mentioning in case you link directly vs gcc).
[01:22:25] <Badaboom> jadew: purring like a kitten:)
[01:23:35] <Badaboom> oh and i looped it for now until i can work on the timers, int. and buttons
[01:25:06] <Badaboom> But its from scratch using that:)
[01:29:56] <edman007> Xark, looks like it's getting it
[01:33:41] <Badaboom> Oh note to self: dont PWM on the same port as SPI/USI on the 2313,, it doesnt like it for some reason
[01:35:15] <Xark> edman007: Hmm. The AVR interrupt vector stuff is a bit confusing. I assume you have consulted http://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html ?
[01:35:58] <edman007> Xark, yea, those docs are pretty lousy, I read it, and most of the headers too...
[01:36:11] <edman007> verified that io.h specifies 17 vectors too
[01:36:17] <thetruthisoutthe> do you like this XMEGA magic operator thingy? http://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=90004
[01:36:29] <thetruthisoutthe> PORTA.OUTSET = (1<<PA0);
[01:36:30] <thetruthisoutthe> PORTA.OUTCLR = (1<<PA0);
[01:36:59] <thetruthisoutthe> |= &= is not that hard to write either
[01:37:02] <edman007> Xark, it's just odd because if I change the code to just use a different interrupt (like #10) then it shows right up
[01:37:15] <edman007> but that's of no use for my stuff
[01:37:30] <Xark> thetruthisoutthe: Costs cycles (which can matter). It has toggle too, IIRC (with a single write, and no read).
[01:37:44] <thetruthisoutthe> hmm
[01:37:46] <Badaboom> Outset Outclr,, hmm
[01:38:09] <Xark> edman007: Can you "manually" specify the vector (and avoid the layers of macros etc.)?
[01:39:11] <Badaboom> so thats the out""?
[01:39:26] <Xark> edman007: Kind of hacky, but it might be a useful "sanity check".
[01:39:34] <edman007> lets see...
[01:39:59] <thetruthisoutthe> Xark <= PORTA |= 1; is just compiled as a bitset 1; no ?
[01:40:09] <thetruthisoutthe> haven't looked at asm output yet
[01:40:18] <thetruthisoutthe> currently everything works fine
[01:41:19] <Xark> thetruthisoutthe: I believe recent avr-gcc has that optimization for a single bit. However, IIRC the xmega has a way to set/clear/toggle bits in a port with only a write and not disturb other bits (which would normally need read, op, write)
[01:41:27] <Badaboom> Bah,, i bm it for another day
[01:42:00] <Xark> thetruthisoutthe: It is possible I am mixing it up with AVR32...
[01:42:06] <Badaboom> Xark: like amask?
[01:42:27] <thetruthisoutthe> i think i will not use avr32 :(
[01:42:34] <thetruthisoutthe> rather arm cortex
[01:43:02] <Xark> thetruthisoutthe: You are not alone. :) ARM has "bit-band" which does the exact same thing I just described (set, clear, toggle).
[01:43:19] <Xark> (some ARMs, perhaps not all)
[01:43:52] * Xark links http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0179b/CHDJHIDF.html
[01:44:17] <Badaboom> sounds like masking to mwe
[01:44:20] <Badaboom> me
[01:45:08] <Xark> Badaboom: It is just extra ports where a 1 written will set/clear/toggle the PORT bit, and a 0 will leave the bit undisturbed. This makes RMW into just W.
[01:45:26] <Badaboom> ahh i see
[01:46:54] <edman007> Xark, same thing...
[01:47:05] <edman007> defined it as 'void __vector_16 (void) __attribute__ ((signal, used, externally_visible)); '
[01:47:07] * Xark notes even 328p has the "secret toggle" trick (where you write to PIN).
[02:51:12] <andrew_> is there a c preprocessor variable I can check to see what part the compiler was called for?
[02:51:50] <andrew_> for instace to decide whether to declare an interrupt for USART_RX_vect vs USART0_RX_vect
[03:03:42] <andrew_> nm, figured it out by looking at io.h
[03:09:22] <Fleck> :)
[03:31:14] <andrew_> well, sortof
[03:31:28] <andrew_> except all the macros that are defined in there don't seem to work in my code
[03:42:12] <OndraSter_> check io<whatever is your chip>.j
[03:42:13] <OndraSter_> .h
[03:52:29] <andrew_> I think it doesn't work because both the #if and the actual ISR declaration use the preprocessor?
[03:53:15] <andrew_> I'm trying to do this:
[03:53:20] <andrew_> #if defined (__AVR_ATmega328P__) || defined (__AVR_ATmega328__)
[03:53:21] <andrew_> ISR(USART_TX_vect)
[03:53:23] <andrew_> #elif defined (__AVR_ATmega1284P__)
[03:53:24] <andrew_> ISR(USART0_TX_vect)
[03:53:26] <andrew_> #endif
[03:53:40] <OndraSter_> that should work
[03:53:53] <andrew_> running avr-gcc with -E, I get nothing at the top of the function
[03:54:03] <andrew_> so then it complains there should be something before {
[03:54:06] <OndraSter_> and are those defined?
[03:55:13] <andrew_> I'm not sure? do those get defined when I specify -mmcu=atmega328p on the gcc command line?
[03:55:36] <andrew_> it would appear not
[03:55:39] <OndraSter_> check out iom328p.inc
[03:57:36] <andrew_> looks like it defines _AVR_IOM328P_H_ not __AVR_ATmega328P__
[03:58:00] <andrew_> I don't see anything else that contains "328" that looks relevant
[03:58:14] <OndraSter_> not sure if gcc itself defines something
[03:58:35] <OndraSter_> I remember people using _AVR_ATmega defines
[03:58:39] <andrew_> then how does it know which headers to include for register definitions?
[03:58:48] <OndraSter_> from the -mmcu
[03:59:01] <OndraSter_> plus you write it there
[03:59:12] <OndraSter_> atmel studio automatically includes it I think
[03:59:21] <andrew_> oh
[03:59:27] <OndraSter_> not sure
[03:59:47] <andrew_> I don't see how io.h works then?
[04:00:18] <OndraSter_> I am not in the position to check the file right now, maybe later
[04:00:35] <andrew_> it depends on those same macros being defined to include iom328p.h
[04:02:32] <andrew_> I figure if gcc knows which headers to include, there must be something I can use for conditional compilation as well
[04:16:21] <andrew_> if I define it myself, I just get a already defined error
[04:17:04] <andrew_> I think it doesn't work because the preprocessor won't check the conditional and do the substitution of the ISR header in the same pass
[04:17:09] <andrew_> so it ends up being blank
[04:20:44] <andrew_> this works:
[04:20:48] <andrew_> #if defined (__AVR_ATmega328P__) || defined (__AVR_ATmega328__)
[04:20:50] <andrew_> #define USART0_RX_vect USART_RX_vect
[04:20:51] <andrew_> #endif
[04:20:53] <andrew_> ISR(USART0_RX_vect)
[04:21:00] <andrew_> so I was right :)
[04:23:34] <andrew_> that was a good use of an hour and a half!
[04:48:35] <tomatto> how to send uint16_t via usart to have that uint16_t on the other side (pc)?
[04:51:09] <OndraSter_> sent two uint8_t
[04:51:26] <OndraSter_> send
[04:52:59] <tomatto> yeah, but how to put them together in terminal? and in right order, when i want to send it repeatedly
[04:53:19] <thetruthisoutthe> use superglue
[04:54:02] <OndraSter_> hehe
[04:54:11] <OndraSter_> tomatto, the same way you decode them when rxed
[04:54:45] <thetruthisoutthe> ( 1 || 2 || x ) ?
[04:55:06] <OndraSter_> that's logical or
[04:55:22] <OndraSter_> you want something like
[04:55:34] <OndraSter_> send(number & 0xFF); send(number >> 8);
[04:55:54] <OndraSter_> and on computer number = receive() | (receive() << 8)
[04:56:13] <thetruthisoutthe> OndraSter_ <= will you do my homework too?
[04:56:17] <OndraSter_> no
[04:56:23] <OndraSter_> will you finish mine?
[04:56:43] <OndraSter_> http://clip2net.com/page/m12051/47140579
[04:56:47] <tomatto> that is looking good
[04:56:50] <OndraSter_> here is screenshot from one of the latest builds
[04:57:01] <OndraSter_> well, 2 days old
[04:57:14] <thetruthisoutthe> i don't feel like game coding ;/
[04:57:31] <tomatto> do you have some receive stuff for linux ?
[04:57:40] <OndraSter_> you read from tty
[04:57:42] <OndraSter_> S0
[04:57:44] <OndraSter_> or w/e
[04:58:19] <bitd> Eww OndraSter_ that does not look embedded.
[04:58:24] <OndraSter_> haha
[04:58:26] <bitd> So why are you bothering with it <.<
[04:58:27] <OndraSter_> homework from school
[04:58:31] <bitd> Ah.
[04:58:32] <OndraSter_> from programming class
[04:58:39] <OndraSter_> embedded system class was easy
[04:58:44] <OndraSter_> (got B :D)
[04:59:02] <bitd> Hahaha, I can see that.
[04:59:24] <bitd> What are you programming this in?
[05:00:15] <OndraSter_> C++
[05:00:16] <OndraSter_> of course
[05:00:30] <bitd> Ah, well lucky you.
[05:00:37] <OndraSter_> lucky?
[05:00:42] <OndraSter_> I wish I could do it in C# :D
[05:00:45] <bitd> We had to do a object oriented assignment in C.
[05:00:46] * RikusW got C++ for the C++ test :-D
[05:00:49] <thetruthisoutthe> why not java or flash?
[05:00:55] <tomatto> OndraSter_: what about ttyS0 settings? btw. what is w/e?
[05:00:55] <OndraSter_> OMG flash
[05:01:07] <OndraSter_> tomatto, no idea, I don't use linux. W/e = whatever
[05:01:08] <bitd> tomatto, what ever
[05:01:08] <thetruthisoutthe> they used to teach thath shit
[05:01:12] <thetruthisoutthe> *teach
[05:01:19] <OndraSter_> *tgat
[05:01:20] <OndraSter_> *that
[05:01:27] <bitd> Java is just evil thetruthisoutthe
[05:01:34] <OndraSter_> yea
[05:01:38] <thetruthisoutthe> okey my time's up bb
[05:01:39] <OndraSter_> that is why I use it only for Minecraft :D
[05:02:15] <bitd> C/C++ now those are languages that are going to stick around for a while.
[05:03:31] <bitd> And for me, understanding C++ will immediately make me understand Java aswell. Understanding Java will still make you look like a tool when doing C++.
[05:03:41] <OndraSter_> heh
[05:04:05] <OndraSter_> tbh I hate C++... manual pointers and references and what not..
[05:04:15] <bitd> But seriously, you should try that C++ assignment in C <.<
[05:04:24] <OndraSter_> I have to use C++
[05:04:34] <OndraSter_> and why should I? :P
[05:04:37] <bitd> C++ is just a superset of C :P
[05:04:47] <bitd> Hahaha, its fun.
[05:05:04] <twnqx> pfff
[05:05:11] <twnqx> just use one of the ultra-early c++ compilers
[05:05:13] <twnqx> well
[05:05:15] <twnqx> "compilers"
[05:05:23] <twnqx> those were just transpilers to C :P
[05:05:24] <OndraSter_> they said we cannot use C++0x
[05:05:28] <OndraSter_> but it runs on gcc 4.4
[05:05:33] <OndraSter_> so I hope it knows nullptr at least
[05:05:38] <OndraSter_> that is the only C++11 thing I use
[05:05:51] <OndraSter_> the code looks nicer than with NULL
[05:05:57] <OndraSter_> (with syntax highlight in VS)
[05:06:04] <twnqx> a guy i know just cries about undebuggable memory leaks with c++ smart pointers \o/
[05:06:24] <OndraSter_> hehe smart pointers
[05:06:28] <OndraSter_> = counted references?
[05:06:32] <OndraSter_> and copy-on-modify?
[05:06:36] <twnqx> he loses about 1GB/minute
[05:06:40] <OndraSter_> holy crap
[05:07:34] <twnqx> video encoding has quite large scale data processing :P
[05:27:23] <theBear> nothing looks nice in vs
[05:35:54] <specing> twnqx: git bisect ;D
[05:37:40] <twnqx> specing: no, an eternal bug
[05:37:44] <twnqx> no regression
[05:37:55] <specing> heh
[05:38:17] <specing> I don't even do C++ all that much
[05:38:30] <twnqx> i only do c++ if i am forced
[05:38:43] <specing> mostly Bash and Python
[05:39:04] <twnqx> bash (awk), perl, make, C :P
[05:39:10] <twnqx> and occasionally verilog
[09:59:10] <Badaboom> morning
[09:59:45] <megal0maniac> Afternoon
[10:43:55] <jobgg> does anyone know whether there is a recent gcc-avr / avrdude distro for ubuntu?
[10:53:35] <specing> nope
[10:57:15] <robotustra> hi
[11:06:22] <Badaboom> robotustra
[11:09:12] <beaky> hello
[11:09:37] <beaky> is it a good idea to read and write TCNT1 directly instead of using TCNT1H and TCNT1L?
[11:09:47] <Tom_itx> yup
[11:09:56] <beaky> ah
[11:10:08] <beaky> my book never uses the TCNT1 macro :(
[11:10:30] <beaky> because it uses a different compiler and library; codevision
[11:10:45] <Tom_itx> so sad
[11:10:59] <beaky> what book should I read to learn avr?
[11:11:11] <Tom_itx> devicex.pdf
[11:11:53] <Badaboom> Tom: btw, i havent had a chance to order that,, the boss<-- said i have to wait till next week:(
[11:12:02] <beaky> yeah the atmel docs are not bad
[11:12:15] <Tom_itx> Badaboom i thought you just didn't like me
[11:12:35] <Badaboom> lol,, I think its her that doesnt like avr's:)
[11:12:46] <Tom_itx> i deal with that too
[11:12:47] <beaky> I like avrs
[11:12:55] <Badaboom> and all my other expensive Hobbies
[11:13:06] <Tom_itx> try cnc
[11:13:11] <Badaboom> But shoes,, now those are important
[11:13:12] <Tom_itx> that gets expensive
[11:13:20] <Tom_itx> purses
[11:13:27] <Badaboom> lol,, i was looking at cnc this morning
[11:13:41] <Tom_itx> did you know you can spend way more than $500 on just a purse?
[11:13:50] <Badaboom> Yup
[11:14:01] <Tom_itx> hasn't happend around here
[11:14:05] <Tom_itx> the day it does...
[11:14:13] <Badaboom> <--- Wallet from Walmart,, still lasting
[11:14:15] <beaky> purses can cost over $3000
[11:14:24] <beaky> the "designer" ones
[11:14:52] <Badaboom> Imagine the order from digikey for 3k
[11:15:34] <Badaboom> wonder if u get a free gift with purchase?
[11:15:42] <Badaboom> Oh no thats Macys
[11:16:12] <beaky> you guys get free gifts from digikey with your orders? :D
[11:16:22] <Badaboom> Nope
[11:17:02] <beaky> awww
[11:17:11] <beaky> I thought digikey sent biscuits or gummy bears with large orders
[11:21:15] <Badaboom> Tom: ive been looking into a hackspace here locally that has a cnc
[11:22:42] <Tom_itx> what do you need to cnc?
[11:22:51] <Badaboom> Boards
[11:23:59] <Badaboom> The videos i was watching earlier look like a plotter type tho
[11:24:25] <Badaboom> Its a router yes?
[11:24:53] <Tom_itx> probably
[11:25:24] <Badaboom> then theres the ones that do the drilling that they showed,, and cutting
[11:27:32] <ambro718> I'm looking for a fast 32bit sqrt. I've tried http://www.mikrocontroller.net/articles/AVR_Arithmetik#Wurzel but I still need it to be faster.
[11:29:32] <edman007> ambro718, what type of equation? you can often optimize it with other math and combine them...
[11:29:44] <edman007> http://en.wikipedia.org/wiki/Fast_inverse_square_root being one of the famous one for 32-bit floats
[11:30:02] <ambro718> edman007: I need to solve quadratic equations
[11:31:10] <ambro718> I tried newton's method written in C but it is much faster than the formula. I'm doing it all with integers (fixed-point and c++ templates for exponent tracking).
[11:31:18] <ambro718> * much slower
[11:36:24] <edman007> ambro718, so you got an exponent variable? the wiki makes a nice note that a base2 exponent works as a log function and you can use that to skip most of the math http://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Approximations_that_depend_on_IEEE_representation
[11:37:18] <edman007> you'd probably have to change the constants, if youre storing the numbers with exponents separately, then you can do that
[11:37:19] <ambro718> the exponent is compile-time-only, I really just need a 32bit integer sqrt
[11:39:05] <ambro718> hm the sqrt_approx you linked looks interesting thanks.
[11:42:57] <beaky> you can use successive approximation to quickly solve quadratic
[11:43:02] <beaky> quadratic equations
[11:43:25] <ambro718> beaky: what kind of approximations?
[11:43:34] <beaky> like newton's method :D
[11:43:46] <beaky> oh wait it's slow :(
[11:44:03] <ambro718> lots of multiplications and divisions
[11:44:10] <beaky> right
[11:44:10] <twnqx> there's no way i'd know to calculate an sqrt at compile time
[11:44:56] <twnqx> (unless you unroll one of those iterative approaches far enough and put it into a macro)
[11:45:34] <ambro718> c++ templates are turing-complete you know
[11:46:11] <ambro718> first hit on google, http://jkhvatov.blogspot.com/2009/11/c-compile-time-square-root-sqrt-using.html
[11:46:29] <twnqx> maybe
[11:46:33] <twnqx> but normal people don't use c++ on micros
[11:47:15] <ambro718> c++ is good for uC, just don't use 90% of the language (templates are ok)
[12:04:40] <plasmasolutions> twnqx: Hi! My crystal arrived! I see now a new usb device when plugged in my linux box :) Yeah! Thanks for your help last time!
[12:04:57] <plasmasolutions> twnqx: Now only some udev rules and there you go
[12:05:14] <twnqx> :)
[12:05:31] <plasmasolutions> :)
[12:10:47] <edman007> ok, I asked this last night and couldn't figure it out... when GCC compiles my application, the final vector table (as shown in an assembly dump) seems to be two entries short, it should have 17 entries, io.h agrees with this, the compiled table only has 15 entries, if I use a vector it gets put in the right spot on the table, unless it's vector 15 or 16, then it's simply omitted from the vector table (and the compiled code has no way of e
[12:10:47] <edman007> ver accessing the vector)...I ran it and it seems that the vector isn't executed...anyways, I need to use these two vectors...
[12:11:15] <edman007> is there a way to force GCC to get it right or something?
[12:11:40] <twnqx> maybe you gave it the wrong cpu tpe?
[12:13:53] <Tom_itx> edman007 was it you with the ardweenie code?
[12:14:06] <Tom_itx> or was that someone else...
[12:15:36] <edman007> that wasn't me
[12:16:01] <edman007> twnqx, -mmcu=avr25 -mmcu=attiny24a
[12:16:05] <Tom_itx> someone else then. 1st year uni student
[12:16:10] <edman007> that's right for the attiny24a right?
[12:16:31] <twnqx> i would never give more than one -mmcu
[12:17:00] <twnqx> so only the attiny24a
[12:17:39] <edman007> it's can't find crttn24a.o when I do that (it's in the avr25/ directory...
[12:17:55] <twnqx> what's your OS?
[12:18:10] <edman007> I'm on linux
[12:18:15] <twnqx> which distro?
[12:18:20] <edman007> slackware64
[12:18:25] <twnqx> hm
[12:18:48] <twnqx> avr-libc as distro package or compiled on your own?
[12:19:11] <edman007> built from this script http://slackbuilds.org/repository/14.0/libraries/avr-libc/
[12:20:02] <edman007> the script doesn't seem to do anything funny...
[12:20:08] <twnqx> well
[12:20:14] <twnqx> i can't really talk about slackware
[12:20:20] <twnqx> but gentoo has the same prob
[12:20:41] * twnqx just tries to remember what he did as solution
[12:21:12] <twnqx> do you know where the acr libs are installed? /usr/avr/lib ?
[12:21:57] <edman007> yea
[12:23:09] <twnqx> i *think* i needed a symlink from /usr/lib/binutils/avr/2.23.1/ldscripts to /usr/avr/lib/ldscripts
[12:23:18] <edman007> twnqx, ohh... it is CPU... I get the full table with the attiny24
[12:23:29] <twnqx> >_>
[12:23:42] * edman007 wonders what the difference is between attiny24 and 24a
[12:24:24] <twnqx> i had the same prob with the subdir with my 13a
[12:24:27] <edman007> amtel says power consumption is the only differance... I suppose I'll just leave it as it...
[12:25:20] <twnqx> ah
[12:25:35] <twnqx> -L/usr/avr/lib/avr25/ helped me :P
[12:25:49] <twnqx> i just manually added the library search path
[12:25:59] <edman007> ohh... that's a good idea
[12:26:46] <edman007> meh, that isn't working
[12:26:52] * edman007 leaves it at the 24
[12:27:28] <twnqx> "worked for me" is all i can say :)
[12:27:34] <twnqx> good luck with your project
[12:34:51] <tzanger> morning
[12:46:13] <[z_z]> Using the asf usb modules... Is it necessary for the user application to allocate memory for the usb control transfer buffer? In the .map output file from gcc I see udd_ctrl_buffer allocated by asf/avr32/drivers/usbc/usbc_device.c. Can i somehow make use of that and save a few bytes?
[13:05:10] <vectory> the asf files come with examples, i think. see if a buffer is allocated there?
[14:39:00] <tzanger> 'wow
[14:39:14] <tzanger> the atmel software foundation git repo is part of the distributable
[14:39:23] <tzanger> this means I should be able to pull it all in and use it on Linux
[15:13:07] * edman007 finally got SPI communication working between his raspberry pi and attiny24
[15:18:41] <Badaboom> edman007: congrats
[17:22:48] <megal0maniac> It's time for a 12V UPS
[17:24:04] <megal0maniac> Power is getting unreliable :/ Out completely for 2 seconds, back for a second then brown-out for a another second then back. Suprised nothing got hurt
[17:25:18] <IanCormac> What are you working on? Or do you mean 120V?
[17:30:33] <ambro718> or he has a laptop
[17:30:39] <megal0maniac> 230V
[17:30:54] <megal0maniac> As in the grid for our entire suburb and beyond
[17:31:29] <IanCormac> Where do you live?
[17:32:18] <megal0maniac> South Africa. We do have issues with power around this time of year. The demand is higher than what the grid can take. 1st world equipment but 3rd world power :/
[17:33:02] <megal0maniac> (i.e. it's winter here)
[17:33:26] <IanCormac> Bummer
[17:33:31] <IanCormac> New York has the opposite problem
[17:33:35] <IanCormac> but at the same time
[17:33:43] <IanCormac> their AC demands more power than the grid can supply
[17:34:08] <megal0maniac> We have too many volts :D
[18:10:44] <Casper> megal0maniac: here, in canada, we always are in excess of power :D
[18:11:07] <Tom_itx> how do you copy sub directories in linux?
[18:11:12] <Casper> cp -r ?
[18:11:34] <Casper> yup
[18:11:48] <Casper> or, be lazy and use mc
[18:12:05] <Tom_itx> to external media like a thumbdrive
[18:12:19] <Tom_itx> how do you address the media in terminal?
[18:15:47] <seldon> You mount it somewhere, then cp to it like you would to any other directory. It's possible your system automounts it upon insertion; if so, probably under /media somewhere.
[18:16:35] <Tom_itx> it does but i don't know what it's called
[18:17:29] <Tom_itx> also how do you remove a directory and all it's subs?
[18:18:45] <seldon> ls /media should give you a hint. Usually it ends up in /media/filesystem-label, where filesystem-label is the label you gave the filesystem or some unique number if you didn't do that.
[18:18:59] <seldon> rm -R directory. Be careful with that.
[18:19:08] <Tom_itx> yeap
[18:20:27] <megal0maniac> cp -a for me
[18:20:45] <megal0maniac> I like it because it does symlinks and preserves permissions and stuff
[18:20:51] <Tom_itx> now to find the thumbdrive..
[18:21:00] <seldon> For big directories I tend to use rsync.
[18:21:20] <seldon> If something happens halfway through, it saves a *lot* of time.
[18:22:30] <Casper> Tom_itx: dmesg
[18:22:47] <Tom_itx> i think i got it
[18:22:53] <Casper> you will see in the last few lines something about it
[18:24:00] <Tom_itx> operation not permitted
[18:24:06] <Tom_itx> as root
[18:24:06] <Tom_itx> ?
[18:24:13] <Casper> ntfs?
[18:24:35] <Tom_itx> the target is
[18:24:44] <Tom_itx> but i've put other files on it just fine
[18:25:22] <Casper> mount -t ntfs-3g /dev/sdx# /mnt/whatever ?
[18:26:41] <Tom_itx> ok i'll work on this later. too farking many distractions here
[18:26:45] <megal0maniac> I have Parted Magic on a pendrive. Everyone has permission to do anything, so you don't get stuff like this
[18:27:02] <megal0maniac> Debian on the other hand is being a pita.
[18:27:13] <Tom_itx> how would i format it in linux?
[18:27:24] <Tom_itx> i don't really care how i get them transferred
[18:27:36] <megal0maniac> mke2fs /dev/sdxx
[18:27:47] <megal0maniac> or mkfs.ext2 /dev/sdxx
[18:28:02] <megal0maniac> Or something like that. Tab completion is your friend
[18:28:17] <seldon> Do you want to transfer the files from a linux machine to a linux machine or to a windows machine?
[18:28:34] <megal0maniac> Good point
[18:28:36] <Tom_itx> linux to linux
[18:28:39] <Casper> mkfs.vfat -F32 /dev/sdx#
[18:28:51] <Tom_itx> i may just use the network
[18:28:56] <Tom_itx> i'll figure it out later
[18:29:03] <Casper> or mkfs.ext[2|3|4] /dev/sdx#
[18:29:11] <Tom_itx> gotta go for now
[18:29:13] <megal0maniac> But... but we want to hear the happy ending
[18:29:24] <seldon> mkfs.ext4 is what I'd use.
[18:29:43] <seldon> Well, I'd try to make it work with ntfs because it would annoy me that it isn't working.
[18:29:46] <megal0maniac> On a pendrive?
[18:30:13] <seldon> I don't see why not.
[18:30:19] <megal0maniac> And on the topic of media inappropriate filesystems, why is ntfs on a pendrive?
[18:30:39] <megal0maniac> seldon: Because journaling is expensive and not really necessary on a pendrive
[18:30:58] <megal0maniac> Or I've just been working with Linux on ~400mhz ARM processors too much
[18:31:43] <Casper> megal0maniac: to fix the 4G/file limitation
[18:32:09] <megal0maniac> Fair enough
[18:32:45] <megal0maniac> Although I found out that you can split/join files with windows' copy utility. Pretty neat :)
[18:33:02] <twnqx> welcome to the 1990s
[18:33:20] <megal0maniac> To be fair, I did find this out 7 years ago
[18:33:43] <megal0maniac> But it's still cool. Used to have a split/join file utility on my pendrive until I found out
[18:33:50] * Xark suggests using PIP :)
[18:33:56] <megal0maniac> Or harddrive then
[18:34:18] <RikusW> megal0maniac: so are Capetown doing load shedding again ?...
[18:34:53] <twnqx> how is za, living wise
[18:35:02] <twnqx> i know some areas of johannisburg are pretty bad
[18:35:04] <twnqx> but otherwise?
[18:35:21] <megal0maniac> twnqx: Cape Town is pretty awesome
[18:35:42] <RikusW> the whole of Gauteng is a big traffic jam ;)
[18:35:54] <RikusW> (maybe not quite that bad...)
[18:36:14] <megal0maniac> RikusW: Only for two seconds, although I just found a plug which has sort of melted into it's socket. I found it because it started smelling like burn, so that might have been what caused the "load shedding" :X
[18:36:37] <RikusW> heh
[18:37:09] <RikusW> on farms rain or thunderstorms often causes power failures
[18:37:30] <twnqx> that can be solved with a proper ups
[18:37:36] <RikusW> two years ago the snow snapped the lines and we were without power for a week...
[18:37:51] <twnqx> friend of mine can run his house ~3days on an APC
[18:37:52] <megal0maniac> We don't get snow in the suburbs
[18:37:57] <twnqx> before switching to generator
[18:38:05] <megal0maniac> That's excessive :0
[18:38:18] <twnqx> he got a standard apc backups 3000
[18:38:20] <RikusW> twnqx: when there is lightning nearby I unplug everything....
[18:38:24] <twnqx> but as many batteries as it will take
[18:38:31] <twnqx> bah
[18:38:41] <twnqx> there are line filters for that
[18:38:44] <megal0maniac> UPS should give you max 1hr on lights and essential plugs, just to give you enough time for the generator to kick in
[18:38:53] <RikusW> I'd rather unplug...
[18:39:17] <megal0maniac> I went to Zimbabwe in December. I know all about running off the grid :P
[18:39:19] <RikusW> I've seen surge damage.. split transistors etc
[18:39:53] <megal0maniac> When the grid is live, it's putting out anything from 175VAC (should be 220)
[18:39:56] <twnqx> yeah, so you obviously don't have a decent line filter
[18:40:20] <twnqx> modern power supplies take anything from 85VAC, no prob
[18:40:48] <RikusW> and 8kV ?
[18:41:02] <megal0maniac> twnqx: To answer your question more, it's a lot like Australia. Except we have more problems with poverty and crime. In the suburbs, you can't tell the difference. I like it here
[18:41:03] <RikusW> surge.. ?
[18:41:03] <twnqx> ... that's why you have line filters with surge protection
[18:41:19] <megal0maniac> And fridges don't like 175VAC :)
[18:41:37] <RikusW> well I repaired a lot of PC smps, and seen some stuff...
[18:41:48] <twnqx> let's say i don't care about stuff that can be solved with a bit of technic
[18:41:54] <RikusW> a few burst 200V caps even
[18:42:10] <megal0maniac> I want to make a 12V UPS at some stage. Just to keep the internet alive
[18:42:12] <RikusW> megal0maniac: no motor like too low volts
[18:42:12] <twnqx> 200V sounds very low
[18:42:23] <RikusW> it will actually start drawing more current
[18:42:29] <twnqx> 400V caps is where PSUs reside
[18:42:36] <RikusW> and burn
[18:43:00] <megal0maniac> Yeah.. That's Zimbabwe :P
[18:43:23] <twnqx> do you need afrikaans, or does english suffice?
[18:43:39] <megal0maniac> Predominantly English in the Western Cape
[18:43:49] <RikusW> internet messing around again :(
[18:44:12] <megal0maniac> You can get by without Afrikaans no problem here. And the Xhosa people know English too
[18:44:41] <RikusW> twnqx: there is usually 2 x 200V caps
[18:45:19] <RikusW> usually measures 350Vdc
[18:46:06] <twnqx> man i think i had enough beer to go to bed :S
[18:46:57] <megal0maniac> I can't fault that plan
[18:48:14] <twnqx> http://cheezburger.com/7518546944 and i need this
[18:49:35] <megal0maniac> Make it with an AVR butterfly :)
[18:49:49] <megal0maniac> I don't drink enough to warrant that
[18:50:22] <megal0maniac> Goodnight all :)
[18:57:51] <twnqx> https://i.chzbgr.com/maxW500/7510750720/hAD5E54C3/ nice idea
[18:58:23] <[z_z]> I want to initialize a global variable with the contents of a certain flash location.... uint8_t serial_number[USB_DEVICE_GET_SERIAL_NAME_LENGTH] __attribute__ ((section (".noinit"))); void my_init_serial(void) __attribute__ ((naked)) __attribute__ ((section (".init3"))); my_init serial currently just does serial_number[0] = 'Q'; but serial is always NULL...
[18:59:09] <megal0maniac> twnqx: http://www.adafruit.com/products/5
[18:59:34] <[z_z]> err. serial_number is always filled 0x00...
[18:59:52] <megal0maniac> twnqx: Uses an attiny2313
[19:00:04] <twnqx> megal0maniac: boo for being proprietary
[19:00:09] <twnqx> soecial dongle etc
[19:01:04] <Xark> twnqx: Umm, that is a standard ISP programmer I believe.
[19:01:37] <megal0maniac> It's just a USBTiny ISP programmer :P
[19:02:09] <twnqx> also, must be rgb, not one color only.
[19:02:20] * megal0maniac sigh
[19:03:01] <Xark> twnqx: Well, if you want deluxe as opposed to a kit, http://www.hokeyspokes.com/
[19:03:04] <megal0maniac> Goodnight :)
[19:03:54] <twnqx> i don't care about kit or not, but those kits are all single color :P
[19:13:57] <ambro718> is it possible to optimize multiplication if one of the factors is known in advance?
[19:14:10] <ambro718> (16bitx16bit->32bit)
[19:15:02] <edman007> ambro718, optimize in what way? if the factor is log2 you can replace it with a bitshift (if the compiler can figure it out during the build it will do that for you)
[19:15:33] <ambro718> edman007: optimize it so it takes less instructions - but in a generic fashion, so that I can do this optimization as JIT code generation
[19:15:53] <ambro718> I'll be multiplying lots of different numbers with one particular number
[19:16:45] <ambro718> btw, can AVR do JIT in the first place? or is all code read-only?
[19:17:45] <Xark> ambro718: Not totally read only (because it can flash itself), but no, JIT probably doesn't make any sense on AVR.
[19:17:53] <edman007> ambro718, you can do it... it's just a PITA because code can't be in the ram (I'm pretty sure you have to write to the eeprom to do it), and the EEPROM is slow
[19:18:09] <ambro718> that's not good :(
[19:19:19] <Xark> ambro718: Since AVR is Harvard architecture (separate code/data), you can't run from RAM (or EEPROM AFAIK - just flash aka PROGMEM).
[19:20:19] <Xark> ambro718: The other issue is fitting a JIT compiler in flash. :) You may want to use ARM (or perhaps PIC32, AVR32) for an application like that.
[19:24:15] <beaky> hello
[19:24:22] <beaky> how do I do ADC?
[19:25:11] <Xark> beaky: Using AVR studio or Arduino stuff?
[19:25:20] <Xark> (or plain gcc)?
[19:25:25] <beaky> gcc
[19:25:45] <Xark> beaky: Try this tutorial (ignore the IDE parts, but it is using GCC) -> http://maxembedded.com/2011/06/20/the-adc-of-the-avr/
[19:26:21] <beaky> ah thanks
[19:27:22] <beaky> so once I get an adc reading from 0 to 255 (or 512, or 1024), how do I relate it to the original analog range (e.g. a heat sensor from 0 to 100C)
[19:28:36] <Xark> beaky: I think it is a (nearly) linear range from 0.0v to AREF voltage.
[19:28:41] <beaky> ah
[19:28:56] <Xark> AREF defaults typically to VCC.
[19:29:27] <Horologium> ambro718, closest you will come to JIT on an AVR would be an interpreter really. JIT could be done but rewriting the flash constantly will wear it out. Granted, 10000 writes is a lot but if you are constantly rewriting flash the thing won't last too long.
[19:29:53] <beaky> hmm
[19:29:59] <beaky> the code in the tutorial looks very familiar
[19:30:05] <ambro718> Horologium: right, but an interpreter probably won't make my multiplications faster
[19:30:06] <Horologium> beaky, look at the datasheet on your sensor..it will tell you the connection between voltage and temperature.
[19:30:17] <Horologium> ambro718, probably not...slow things down most likely.
[19:30:49] <Horologium> you need a processor that can run program from ram for JIT.
[19:31:16] <Horologium> it COULD be done on an 8052 chip with external sram mapped to program space, but that slows things down dramatically too.
[19:31:35] <beaky> avrs can flash themselves?
[19:31:42] <Horologium> beaky, that's what bootloaders do.
[19:31:57] <Horologium> bootloader lives in the upper section of flash and it can write to the memory in the lower section.
[19:32:02] <beaky> ah
[19:32:31] <Horologium> you could write a program that reprogrammed parts of flash on the fly..just have to have the rewriting code live in the bootloader section of flash.
[19:33:02] <Xark> Horologium: I think there is a tiny API of sorts to make that easier (IIRC).
[19:33:14] <Horologium> Xark, probably.
[19:33:43] * Xark links http://www.nongnu.org/avr-libc/user-manual/group__avr__boot.html
[19:33:46] <Horologium> I considered doing that briefly when I was working on self-modifying code.
[19:34:10] <Horologium> then I switched that project over to 8052 chips with nvsram mapped to program space.
[19:34:35] <Xark> Horologium: Cool. AVR is less than ideal for SMC. :)
[19:34:41] <Horologium> yes.
[19:34:56] <Horologium> each chip series has its advantages and disadvantages.
[19:35:29] <Horologium> if I could get an AVR that could execute code from external sram,,,even if it slowed down to 1/4 speed like the 8052 does,,,then I would drop the 8052 chips completely.
[19:36:10] <Horologium> and if I could get an AVR in dip package that has built in hardware USB then I would likely drop 90% of the PIC chips I use too.
[19:36:23] <Xark> Horologium: Only Atmel AVR32 can do that (for some chips), I belive.
[19:36:38] <Horologium> yes...and AVR32 is not through hole....no way, no how.
[19:36:46] <Horologium> which makes it difficult for me to use.
[19:36:56] <Xark> Horologium: I think you can get NXP ARM in DIP with USB.
[19:37:09] <Horologium> really?
[19:37:12] <Horologium> might have to look into those.
[19:37:18] <Xark> Horologium: Pretty sure...
[19:37:41] <beaky> I love avr
[19:37:49] <beaky> avr is so easy
[19:38:45] <Horologium> beaky, agreed...avr is the second microcontroller I ever touched and overall my favorite.
[19:38:56] <thetruthisoutthe> h
[19:39:01] <thetruthisoutthe> !
[19:39:03] <Horologium> l
[19:39:05] <beaky> so my uC is taking a bunch of temperature readings every hour. how do I save them somewhere and eventually upload them to a PC?
[19:39:17] <Horologium> beaky, do you have your SPI pins free?
[19:39:23] <beaky> what's spi?
[19:39:28] <Horologium> nevermind.
[19:39:33] <beaky> like mosi and miso?
[19:39:43] <beaky> usart?
[19:39:44] <Horologium> I was going to suggest using an SD card.
[19:39:44] <thetruthisoutthe> beaky <= still not earning $$$?
[19:39:51] <Horologium> mosi and miso are used for spi, yes.
[19:39:53] <beaky> $$$?
[19:40:03] <thetruthisoutthe> money with 3 digits ?
[19:40:13] <Horologium> how many readings?
[19:40:18] <Horologium> and what chip are you using?
[19:40:25] <beaky> I am using an atmega16a
[19:41:18] <beaky> I am getting readings from adc and putting them in an array, which ultimately overflows as I don't know how to properly gather readings :P
[19:41:55] <Horologium> how much data per reading?
[19:42:11] <beaky> like a uint8_t per data
[19:42:15] <beaky> per reading*
[19:42:29] <beaky> and every hours it wakes up and does a reading
[19:42:42] <Horologium> do you need to record time too? or just the temp?
[19:42:56] <Xark> Horologium: Hmm, looks like that is not the case. NXP has some nice 28 pin (or 8 pin) DIP ARM parts, but apparently none with USB are DIP. http://hackaday.com/2012/09/09/the-easiest-way-to-dive-in-to-arm-programming/ and http://www.adafruit.com/products/1336
[19:42:57] <beaky> time would be nice :D
[19:43:01] <Horologium> you can store 512 bytes of data in the eeprom.
[19:43:11] <Horologium> then connect via serial port and download it.
[19:43:14] <beaky> wow thats tiny I thought eeprom was bigger
[19:43:27] <Horologium> Xark, saw those..
[19:43:45] <Horologium> beaky, didn't bother to,,umm,,,read the datasheet?
[19:44:00] <beaky> who reads datasheets? :D
[19:44:03] <Horologium> me
[19:44:03] * beaky is not an engineer
[19:44:07] <Horologium> neither am I
[19:44:19] <Xark> Horologium: They have some nice USB parts, but not DIP. You probably saw this too -> http://dangerousprototypes.com/2013/04/23/dipcortex-arm-cortex-in-a-dip-package-with-usb/
[19:44:26] <beaky> ah I thought the atmega16a had like 16kB
[19:44:27] <Horologium> I've never had an electronics class in my life.
[19:44:38] <Horologium> last programming class I took was in 1985 in high school.
[19:45:08] <Horologium> beaky, it has 16K of flash....
[19:45:10] <beaky> why do they call it the atmega16 if it only has 512 eeprom bytes?
[19:45:13] <beaky> ah
[19:45:18] <Horologium> and 16K of flash is 8K instructions.
[19:45:19] <beaky> I confused them :(
[19:45:29] <Horologium> flash is for program...10k write cycles..
[19:45:41] <Horologium> eeprom is for storing data during power out....100k write cycles.
[19:46:10] <Horologium> the atmega32 has 1K eeprom.
[19:46:13] <Xark> EEPROM can also be written a byte at a time (vs flash needs full page erased first).
[19:46:52] <Horologium> my current favorite avr is the atmega1284p....128K flash, 16K sram, 4K eeprom..
[19:47:09] <beaky> wow that is huge
[19:47:14] <beaky> (thats what she said)
[19:47:18] <Horologium> and in a 40pin dip package.
[19:47:22] <Xark> Horologium: Yeah, that is a nice part. Only bummer is it won't overclock to 28Mhz (like 644 will in Uzebox). :)
[19:47:32] <Horologium> yeah.
[19:47:52] <beaky> wow the atmega1284p is a beast
[19:47:58] <Horologium> the huge sram in the 1284p is probably its best feature.
[19:48:18] <thetruthisoutthe> what do you include for uint8_t style datatypes on avr ?
[19:48:25] <Horologium> beaky, it also runs at 20MHz....where your 16 only runs at 16MHz.
[19:48:31] <Xark> thetruthisoutthe: Same as standard C. <stdint.h>
[19:48:49] <thetruthisoutthe> okey, that won't have much overhead data?
[19:48:51] <Horologium> Xark, isn't that included in <avr/io.h> ??
[19:48:54] <thetruthisoutthe> nooo
[19:48:56] <thetruthisoutthe> ;/
[19:49:02] <beaky> yeah it is automagically included by io.h :D
[19:49:07] <thetruthisoutthe> hah
[19:49:15] <Xark> Horologium: Perhaps. It seems to always be present in my AVR code, so seem slikely.
[19:49:16] <thetruthisoutthe> i think not for my atmega
[19:49:31] <Horologium> thetruthisoutthe, I've never had to include anything extra for it.
[19:49:43] <Horologium> what chip you using?
[19:49:44] <thetruthisoutthe> my gcc is old?
[19:49:49] <thetruthisoutthe> mega168pa
[19:50:04] <thetruthisoutthe> i had to include the stdint
[19:50:24] <Xark> thetruthisoutthe: What OS? If Windows, you could install http://www.atmel.com/tools/ATMELAVRTOOLCHAINFORWINDOWS.aspx to update it.
[19:50:31] <thetruthisoutthe> avr-gcc (Fedora 4.5.0-2.el6) 4.5.0
[19:50:33] <thetruthisoutthe> linux
[19:50:52] <Xark> thetruthisoutthe: Ahh, distro avr-gcc. Those are almost always fubar.
[19:51:01] <thetruthisoutthe> oh i see ;<
[19:51:04] <beaky> Atmel AVR is the world's most successful microcontroller family
[19:51:06] <Xark> thetruthisoutthe: Interesting it is 4.5.0 (bleeding edge, I think).
[19:51:23] <thetruthisoutthe> no, it is EL-6 that is enhanced security
[19:51:26] <Xark> beaky: According to Atmel, perhaps. :)
[19:51:48] * beaky has been reading too much Atmel marketing
[19:52:48] <Horologium> thetruthisoutthe, just did a test compile here and didn't have to include anything but <avr/io.h>
[19:52:50] <Horologium> for your chip.
[19:52:51] <thetruthisoutthe> but ofc, everything redhat gives is outdated
[19:52:59] <Horologium> redhat...bah.
[19:53:05] <Horologium> go DEBIAN!
[19:53:08] <thetruthisoutthe> ;<
[19:53:15] <seldon> 4.5 is pretty far from bleeding edge. I have 4.7 here.
[19:53:31] <Horologium> gcc version 4.7.2 (GCC)
[19:53:33] <thetruthisoutthe> actually i have an SL 6
[19:53:38] <thetruthisoutthe> will upgrade soon
[19:53:40] <Horologium> that's stock on my latest debian install.
[19:53:42] <thetruthisoutthe> pretty old
[19:54:12] <thetruthisoutthe> http://www.scientificlinux.org/distributions/6x/6.4/
[19:54:16] <thetruthisoutthe> 6.4 is avail ;/
[19:54:42] <vectory> i saw 4.8.1 release news today
[19:54:44] <seldon> What I really want is an avr-clang, though.
[19:54:51] <Horologium> clang?
[19:55:07] <vectory> llvm c back (front?) end
[19:55:12] <vectory> apple c compiler
[19:55:13] <seldon> http://clang.llvm.org/
[19:55:30] <seldon> Well, not *just* apple.
[19:56:05] <Horologium> just reading up on it...they didn't port the avr section of gcc to it I guess, eh?
[19:56:09] <vectory> true, maybe. dont know much about it
[19:56:13] <thetruthisoutthe> Horologium <= i'm not sure i want debian...
[19:56:22] <thetruthisoutthe> not for me
[19:56:23] <Horologium> thetruthisoutthe, why not? It works great.
[19:56:38] <thetruthisoutthe> well last time i tried it it failed to setup correctly
[19:56:48] <vectory> is avr in the gcc trunk and just needs to be configured when building or is it a fork?
[19:56:51] <thetruthisoutthe> had some issues
[19:56:51] <Horologium> I haven't had that problem with debian in,,,,5 or 6 years.
[19:57:02] <Horologium> vectory, it's built into the gcc trunk..
[19:57:10] <vectory> oh
[19:57:10] <Horologium> vectory, just like arm and mips32
[19:57:10] <thetruthisoutthe> possible i got the wrong version wrong time, but still
[19:57:24] <thetruthisoutthe> i am not average user
[19:57:28] <Horologium> thetruthisoutthe, try the latest stable.
[19:57:35] <thetruthisoutthe> did that like 3 times
[19:57:53] <Horologium> there are some hoops to go through for good video drivers but if you aren't gaming with it the stock drivers are fine.
[19:58:02] <thetruthisoutthe> SL 6 worked fine out of the box, and is stable
[19:58:04] <thetruthisoutthe> i like it
[19:58:16] <Horologium> and I have it running on everything from old p-4 xeon box here to a brand new out of the box this morning hp laptop.
[19:58:33] <seldon> I like debian, but debian stable can be a hassle on new hardware (because it's usually old). I go with testing, usually.
[19:58:45] <thetruthisoutthe> i was considering lunar linux, linux from scratch, gentoo, slackware too
[19:59:44] <thetruthisoutthe> (all with xfce only)
[20:00:51] <Horologium> seldon, latest debian just came out recently, like, in the last month.
[20:01:00] <Horologium> have had no problems with it on new hardware here.
[20:01:01] <seldon> Yes, but it sports a 3.2 kernel.
[20:01:18] <thetruthisoutthe> i roll my own always
[20:01:34] <Horologium> this machine is running one version old debian with a 2.6 kernel.
[20:01:47] <thetruthisoutthe> Linux * 3.8.4-rt2 #2 SMP PREEMPT RT Mon Apr 29 10:03:42 CEST 2013 x86_64 GNU/Linux
[20:02:18] <seldon> If you have a new network card that needs a driver from 3.8 (for example), installing debian stable can be trying.
[20:02:19] <Horologium> in fact, my mother in law and wife's cousin(older female) are both running the latest debian right now...just put it on one machine today.
[20:02:40] <seldon> Because netinst.
[20:02:49] <Horologium> although, they just do email and facebook for the most part.
[20:03:09] <Horologium> so they would probably be ok with a chromebook but they wanted bigger screens.
[20:03:31] <Horologium> I just threw chrome on top of debian and all their bookmarks and history and everything gets backed up to their gmail accounts.
[20:04:13] <seldon> chrome saves your browsing history with google?
[20:04:19] <thetruthisoutthe> awesome :) now google knows everything about you
[20:04:42] <thetruthisoutthe> it can sell your data for $0.1 now
[20:04:55] <Horologium> http://avr-llvm.sourceforge.net/ hmmmm....
[20:05:03] <seldon> I don't mean to whip out the tinfoil, but that's kind of creepy.
[20:05:20] <Horologium> well, not sure about history, but their bookmarks and passwords and cookies are stored.
[20:05:39] <Horologium> it's an option you can turn on,,,to backup your browser info to a gmail account.
[20:06:12] <Horologium> firefox has a similar option for saving your browser info to a cloud account.
[20:06:15] <thetruthisoutthe> no matter, google learns from ip addresses, search keywords and timestamps too
[20:06:23] <thetruthisoutthe> best with cookies enabled
[20:06:40] <beaky> I have 12 leds, but my uC only has 6 PWMs. How do I generate frequencies on my GPIO ports and emulate PWM in software?
[20:07:08] <beaky> (I am using the ATmega328p for this one)
[20:07:50] <beaky> and each led will have a different wave attached
[20:07:52] <vectory> beaky: dont naively try to run a for loop as timer. i did and it fucked up the accuracy pretty bad. OTOH for leds it might work, but with sound you'll notice
[20:08:12] <beaky> ah how does loop-as-timer work?
[20:08:34] <thetruthisoutthe> emulate a timer in an interrupt ?
[20:08:47] <vectory> beakt i.e.: while (1) for (i = 15; i; i--){}
[20:08:53] <beaky> ah
[20:09:01] <beaky> the infamous speedup loop :D
[20:09:08] <Horologium> 12 variables to store the pwm duty cycle....copy them over to countdown variables....turn them all on....start loop, count down each variable till it reaches 0..when one reaches 0 you turn off the corresponding output.
[20:09:24] <Horologium> repeat copy and countdown loop.
[20:10:19] <Horologium> I do that with servos.
[20:10:22] <beaky> ah
[20:10:40] <beaky> thats awesome I can stick everything in a vector and control the leds uniformly
[20:10:43] <Horologium> have run 16 servos on an atmega32 at 8MHz doing that with no problem.
[20:11:09] <beaky> 16 servos is insane :D
[20:11:16] <Horologium> not really.
[20:11:19] <Horologium> standard hobby servos.
[20:11:25] <beaky> ah :D
[20:11:32] <Horologium> they don't need a lot of refresh really.
[20:11:44] <beaky> I love servo motors
[20:12:13] <beaky> but they are kinda pricey :(
[20:12:25] <Horologium> 50Hz is what you should run hobby servos at I think.
[20:12:35] <Horologium> I often run them down around 20Hz
[20:13:02] <Horologium> they chatter a bit and don't have the holding strength at that refresh frequency but for what I often use them for it's fine.
[20:14:04] <Horologium> and when modding them for continuous rotation it gets kinda fun.
[20:16:15] <beaky> ah how do you do that mod?
[20:16:37] * edman007 is writing a servo controller...
[20:16:52] <Horologium> http://www.instructables.com/id/How-to-modify-a-servo-motor-for-continuous-rotatio/
[20:17:42] <edman007> IIRC it's "50HZ-ish", they just measure the pulse width, with 1.5ms being zero... most will run just find as long as the period is significantly longer than 1.5ms
[20:17:51] <Horologium> bah..that's not a good link.
[20:17:56] <Horologium> they just took out the electronics.
[20:18:39] <beaky> ah
[20:18:45] <beaky> yeah that just leaves you with a DC motor :/
[20:18:59] <Horologium> http://www.ranchbots.com/club/papers/Modifying%20Hobby%20Servo%20Motors%20for%20Continuous%20Rotation.pdf
[20:19:00] <Horologium> there
[20:19:47] <Horologium> the farther off you are from your 1.5ms pulse, above or below, the faster it turns.
[20:20:05] <Horologium> you can also get servos prebuilt like that.
[20:20:18] <Horologium> expensive but usable are the ones from vexlabs.com
[20:20:43] <beaky> why are watchdog timers useful?
[20:20:48] <Horologium> make that vexrobotics.com
[20:21:09] <edman007> beaky, used in all sorts of systems to detect a program crash
[20:21:12] <Horologium> beaky, if your code goes into a terminal loop, aka locks up, the watchdog timer will reset the chip and let it start over.
[20:21:32] <Horologium> it's like, if your PC gets a BSOD, the watchdog timer would hit the reset button for you.
[20:21:41] <edman007> even my desktop has one, I can configure the BIOS to reboot the computer if it locks up
[20:21:55] <thetruthisoutthe> i haterc servos
[20:22:05] <thetruthisoutthe> that 1-2ms signal is lame
[20:22:43] <thetruthisoutthe> bldc controllers with pwm input are much better
[20:23:03] <edman007> thetruthisoutthe, I got my 4 servos for $10...I'll deal with it
[20:23:33] <Horologium> aaww man...I haven't looked at vex in a while...they got rid of the continuous rotation servo and just went with 2 wire motors instead.
[20:23:52] <thetruthisoutthe> :)
[20:24:07] <Horologium> but they've added lots of stuff.
[20:24:54] <thetruthisoutthe> well, evolution
[20:26:12] <Horologium> but still expensive as hell.
[20:26:52] <thetruthisoutthe> i like huge stepper motors too
[20:27:02] <thetruthisoutthe> those are "continuous rotation" ;>
[20:28:18] <beaky> besides dc motors, steppers, and servos, what other motors are there?
[20:28:32] <thetruthisoutthe> Horologium <= fly a photocopier BLDC in a plane :)
[20:29:09] <Horologium> why?
[20:29:10] <thetruthisoutthe> linear motors, induction motors, at least 2 types of ultrasonic motors, steam engines
[20:29:32] <Horologium> I have some mongo steppers out of older copiers.
[20:29:49] <Horologium> more like brushless DC motors that require an external controller, but,,
[20:30:21] <Horologium> beaky, a servo is just a motor/sensor/controller combination.
[20:30:39] <Horologium> which can use any of a number of different motors.
[20:30:44] <robotustra> it's easier to take DC motor with gear box I think
[20:31:22] <robotustra> I did a smal planetary gear box recently
[20:31:23] <Horologium> hobby servos are nice in that they handle everything for you,,you just send a 1ms to 2ms pulse to tell them where to turn to.
[20:31:40] <robotustra> may be
[20:33:34] <thetruthisoutthe> Horologium <= i mean this kind http://dangerousprototypes.com/wp-content/media/2010/09/inside-of-a-brushless-dc-motor-1-1024x539-W490.jpg
[20:34:08] <Horologium> just a typical brushless dc motor.
[20:34:16] <thetruthisoutthe> this oculd fly a plane
[20:34:35] <thetruthisoutthe> best if it has bearings
[20:34:36] <Horologium> possibly.
[20:35:14] <thetruthisoutthe> cd motors are used at 50-150W power levels...
[20:35:20] <thetruthisoutthe> compare the sizes
[20:35:45] <thetruthisoutthe> (i mean hacked)
[20:35:56] <thetruthisoutthe> oroginally they are 10W max
[20:35:58] <thetruthisoutthe> ori
[20:38:18] * robotustra my gear box http://maholet.livejournal.com/29943.html
[20:39:15] <robotustra> all power of servos just in reduction
[20:40:37] <robotustra> and it's compact
[20:42:07] <robotustra> I don't like servos - they are noisy and I hate it especially in modern robots
[20:44:54] <Tom_itx> hackvana who did that board house review showing board quality of various vendors?
[20:47:38] <thetruthisoutthe> robotustra <= bldc motors are super silent
[20:48:13] <thetruthisoutthe> been spinning some above 32k rpm, it only did a whisper
[20:49:11] <flop> as a survey question, which avr device people use the most on this channel?
[20:49:35] <jadew> the programmer
[20:49:53] <thetruthisoutthe> atmega168 eqv, and atxmega ?
[20:50:27] <robotustra> thetruthisoutthe: for robotics high RPM is not needed, it's usialy big torque required
[20:50:28] <[z_z]> lol. the usb cable.
[20:50:41] <thetruthisoutthe> robotustra <= gearing
[20:51:20] <robotustra> thetruthisoutthe: :) are you kidding me? gears create most of the noise
[20:51:31] <thetruthisoutthe> i didn't say gears, only gering
[20:51:55] <robotustra> what is this?
[20:52:45] <thetruthisoutthe> http://www.investopedia.com/terms/g/gearingratio.asp
[20:52:48] <thetruthisoutthe> first hit
[20:54:51] <thetruthisoutthe> ever heard of belt drive ? http://www.koga-signature.com/en/News/Gates-Carbon-Drive
[20:55:15] <thetruthisoutthe> supersilent, and long lasting
[20:55:54] <Badaboom> yawn
[20:56:03] <thetruthisoutthe> blurp
[20:56:10] <Badaboom> :)
[20:57:06] <Badaboom> Think im gonna watch a movie
[20:57:22] <jadew> hey Badaboom, I left yesterday so I saw your message only when I came back, did you fix your device?
[20:57:44] <Badaboom> Yeah man,, all good,, i used PB4 instead of 0
[20:57:50] <Badaboom> for cs
[20:58:37] <jadew> cool, PB0 works too
[20:58:53] <jadew> it's what I used in my tests, so I'm 100% sure it's fine
[20:58:53] <Badaboom> yup,, just already had it wired that way was all
[20:59:02] <jadew> ah
[20:59:06] <Badaboom> :)
[20:59:13] <Badaboom> kinda didnt have a choice
[20:59:46] <Badaboom> But yeah,, thanks again
[20:59:48] <jadew> did you find out what was the issue?
[20:59:53] <Badaboom> yes
[20:59:55] <Badaboom> and...
[21:00:01] <Badaboom> PWM i was using
[21:00:19] <Badaboom> I had 1 Indication LED that was conflicting
[21:00:27] <Badaboom> using PWM
[21:00:35] <Badaboom> Very strange
[21:01:02] <jadew> well, glad it works :)
[21:01:08] <Badaboom> yep:)
[21:01:40] <Badaboom> And for some odd reason the battery pack im using is way more efficient,, does PWM draw that much?
[21:01:57] <Badaboom> I didnt think it did
[21:02:27] <jadew> depends on what it's driving I guess
[21:02:59] <Badaboom> hmm,, oh well,, its fine now:)
[21:04:08] <jadew> now I'm currious, I might take every peripheral and test it out, see how much current each takes
[21:04:37] <Badaboom> this is that display i mentioned,, theres 7 indication leds built in
[21:04:51] <Badaboom> Older so it might draw more
[21:05:17] <jadew> what resistors are you using?
[21:05:20] <Badaboom> Im trying to do a datasheet on it for kicks but its a tough one
[21:05:24] <Badaboom> 330
[21:05:32] <thetruthisoutthe> :)
[21:05:38] <thetruthisoutthe> leds eat current
[21:05:42] <jadew> you might try higher resitors
[21:05:44] <Badaboom> yes they do:)
[21:05:53] <thetruthisoutthe> 10-20mA average every segment
[21:05:54] <jadew> I had a display that worked fine with 2k resistors
[21:05:55] <Badaboom> 470?
[21:06:01] <Badaboom> oh
[21:06:12] <jadew> depends how bright you want them to be
[21:06:20] <Badaboom> I don't think itll come on with that much
[21:06:29] <thetruthisoutthe> it may have a photosensor, and adjust pwm...
[21:06:51] <thetruthisoutthe> in darkness it only needs a few mA-s for total display
[21:06:53] <Badaboom> The brightness i have set 0X05,, 0X0A being brighter
[21:07:19] <Badaboom> or as they call it Intensity
[21:07:38] <thetruthisoutthe> gamma
[21:08:01] <Badaboom> wonder if Kate will mind me saying hun,, look at my intensity,, oh wait,, ok bad joke
[21:08:05] <thetruthisoutthe> light flux
[21:08:18] <Badaboom> photonic level?
[21:09:22] <Badaboom> jadew: have u seen it?
[21:09:26] <Badaboom> \the display?
[21:09:35] <jadew> no
[21:09:48] <Badaboom> one sec,, heres an older pic if i can find it...
[21:10:39] <thetruthisoutthe> jadew <= a led can emit visible light with only a few hundred microampers
[21:10:50] <thetruthisoutthe> depends on the efficiency
[21:10:51] <Badaboom> http://tinypic.com/view.php?pic=30aaujc&s=5
[21:11:20] <jadew> Badaboom, that looks pretty brigth
[21:11:32] <Badaboom> yes,, ive since toned it down
[21:11:38] <Badaboom> see the resistor?
[21:11:49] <jadew> yeah
[21:11:57] <jadew> I take back my suggestion to increase the resistors
[21:12:04] <jadew> if you use PWM, you shouldn't have to
[21:12:04] <Badaboom> thats the ref resistor,, its been changed from the recommended and i also coded the intensity
[21:12:04] <thetruthisoutthe> ah that ugly max ic
[21:12:24] <Badaboom> lol..truth,, i couldnt abandon it
[21:12:59] <Badaboom> That display has seperate indication LEDs at the top
[21:13:09] <Badaboom> looks like 4 but theres actually 7
[21:13:09] <thetruthisoutthe> separate
[21:13:20] <Badaboom> ty
[21:18:15] <Badaboom> Is there a place like tinyhost that alloows videos?
[21:18:20] <Badaboom> allows
[21:18:35] <Tom_itx> youtube
[21:18:35] <Horologium> youtube
[21:18:38] <Horologium> haha
[21:18:50] <Badaboom> yeah,, sigh,, i guess ill u/l it there:)
[21:19:23] <Badaboom> You havent seen my lemon etching vids yet either;0
[21:21:25] <Badaboom> thetruthisoutthe: you really hate that chip or any other from max ehh?
[21:52:42] <jobgg> dang, i just deadbug soldered a soic and when it put it into the breadboard, one of the leads broke...
[21:52:56] <Tom_shop> woops
[21:53:40] <thetruthisoutthe> leads may be bent up to 1 times
[21:53:52] <Horologium> up to but not including 1 times
[21:53:56] <thetruthisoutthe> :)
[21:54:31] <thetruthisoutthe> try a bga
[21:54:42] <Horologium> buddy of mine was gonna try a tqfn package deadbug...
[21:54:48] <Horologium> thetruthisoutthe, been done...
[21:54:56] <thetruthisoutthe> tqfp is not that cool
[21:54:57] <thetruthisoutthe> ;/
[21:55:03] <thetruthisoutthe> leads are too close
[21:55:34] <Horologium> http://dangerousprototypes.com/wp-content/media/2012/11/tmp006_deadbug_01-W600.jpg
[21:55:47] <Horologium> not tqfp...tqfn...thin quad flat nolead.
[21:55:56] <thetruthisoutthe> oh this thing ok
[21:55:57] <thetruthisoutthe> :)
[21:56:13] <Horologium> tqfn has pads on the bottom but no leads sticking out.
[21:56:17] <thetruthisoutthe> but well, for this i make a board, and reflow it
[21:57:33] <Horologium> http://dangerousprototypes.com/wp-content/media/2012/10/pyxis2010-testpcb1.jpg
[21:57:43] <Horologium> there's a nifty bga deadbug.
[21:57:50] <thetruthisoutthe> things will get ugly only when you need multilayer and vias under for bga
[22:03:04] <thetruthisoutthe> jobgg <= btw i have recently livebug mounted a soic-14 because i didn't had pdif replacement
[22:03:16] <thetruthisoutthe> p-dip
[22:04:12] <thetruthisoutthe> put it on board, and connect the 14 bond-wires
[22:14:48] <hackvana> Tom_itx: I can't remember at the moment.
[22:19:30] <Tom_shop> do you recall seeing it?
[22:25:03] <hackvana> Yes. Have you Googled.
[22:28:27] <Tom_shop> no not yet
[22:41:04] <jobgg> Horologium, I've seen that thing a couple of months ago, and I was pretty blown away
[22:42:30] <jobgg> to have the courage and the hands to do that to a ... 200 $ i think it was or so chip...
[22:43:28] <theBear> deadbug is way easier to not screw up than just mounting something like a bga, imo
[22:43:52] <jobgg> i'm not goint anywhere near a bga with my current setup xD
[22:49:06] <jobgg> now deadbug mounting an bga...the ATtiny1634 I'm using actually seems to have a bga version, so if I ever have the time and money to just junk 10 of them by misssoldering them, I'll give that a shot.
[22:51:06] <theBear> that's the thing with soldering, if you do wrong, you can fix it
[22:51:12] <theBear> so long as you can SEE the soldering
[22:54:38] <thetruthisoutthe> apply some hazardous highly toxic flux, and there you go
[22:56:55] <jobgg> i've got a fadenzähler around, so I can tell if I screwed up too bad
[22:57:54] <jobgg> ohh, they're called linen testers in english
[22:58:03] <jobgg> learned another thing today
[23:03:14] <thetruthisoutthe> flux capacitors ?
[23:08:10] <theBear> wtf is a linen tester ?
[23:09:21] <Tom_shop> theBear, you don't know?
[23:11:03] <jobgg> http://en.wikipedia.org/wiki/Linen_tester
[23:11:31] <theBear> Tom_shop, along with my 'i don't have a trolling bone in me' policy, i'm gonna have to say i don't
[23:12:02] <theBear> wow, that's kinda cool.. fadenzahler eh ? that dutch ?
[23:12:26] <jobgg> german, but it comes close
[23:12:59] <theBear> just trying to get the pronunciation right :)
[23:13:16] <theBear> few friends have been working on my german a lot in recent years :)
[23:13:40] <theBear> i can say schranz right now, so they don't think i'm saying trance, which is imho a polar opposite :)
[23:15:20] <jobgg> i actually had to look schranz up. it was not schränzermusik
[23:16:16] <theBear> err, it probably is
[23:16:31] * theBear looks
[23:17:04] <jobgg> it's either techno or carnival music
[23:17:14] <theBear> very specific branch of techno
[23:17:24] <theBear> the awesome branch :)
[23:17:27] <jobgg> then it's actually schranz
[23:18:44] <theBear> so schränzermusik is carnival music ? cos i like that very much too
[23:18:53] <jobgg> schränzer are marching bands that play very loud music during Fasnacht, which is a holiday during spring over here. You dress up, put up a tree, climb it, get very drunk...it's actually pretty swell
[23:18:57] <theBear> all the definitions i found are too german for me :)
[23:19:08] <theBear> put up a tree ?
[23:21:00] <jobgg> well, it's a fir with the bottom branches cut and sanded off. Then you hang a ring on it and pull it up on a rope. There's stuff on the ring, and you try to climb the tree.
[23:21:33] <theBear> awesome !
[23:21:48] <theBear> you crazy foreigners sure got some cool ideas :)
[23:21:49] <jobgg> http://upload.wikimedia.org/wikipedia/commons/4/4c/Narrenbaum_mit_Kind.jpg kinda like that
[23:23:44] <jobgg> i'm quite sure half of those rituals were thought up by drunk people, but I haven't found conclusive proof yet.
[23:25:42] <thetruthisoutthe> o yea! fat kids won't get their cookies :)
[23:26:35] <jobgg> yes...i don't think that would catch on in the US
[23:27:39] <thetruthisoutthe> so, you are fat and dumb, you won't get a cookie. - this is correct i believe
[23:27:46] <theBear> yeah, that'd show 'em
[23:27:55] <Tabaliah> I don't think there is anything up that pole worth getting slivers in my privates for.
[23:29:37] <Casper> robotustra: how was that last storm?
[23:31:06] <thetruthisoutthe> try the same in africa?
[23:31:20] <thetruthisoutthe> they will climb the trees instantly
[23:32:07] <theBear> try the same here i'll climb it instantly, if there's any chance of food up there
[23:34:34] <edman007> man, this thing is pissing me off... SPI bus seems really picky...even at low frequencies...
[23:34:46] <Tom_itx> noise
[23:34:49] <Tom_itx> ?
[23:36:28] <edman007> maybe... I dunno, I'm trying to get some data transfers working, i can kinda get the first few bytes to transfer, and then it just stops and I get jibberish
[23:37:42] <tzanger> SPI's actually pretty hard to fuck up. Are you sure you have CPOL and CPHA correct?
[23:37:43] <edman007> hrm...no, I'm spending too much time in the interrupt...I got to move the code out of the interrupt, that's the problem
[23:37:48] <tzanger> there are only four combinations, may as well try them all
[23:38:09] <edman007> yea...I just cut the processing out of the interrupt and it worked...
[23:38:38] <tzanger> never process in an interrupt
[23:38:44] <tzanger> set a flag and let the main loop take care of the processing
[23:39:19] <edman007> I guess that's what I'll do...
[23:39:32] <Tom_itx> thar's yer problem
[23:40:02] <tzanger> interrupts are meant to get the peripheral back into the state of waiting for data as quickly as possible
[23:40:11] <tzanger> get in, get the peripheral back to waiting state and get out
[23:41:05] <tzanger> that usually means just grabbing all data you can in a tight loop until the peripheral says "there ain't no more"
[23:44:04] <thetruthisoutthe> dma, events :(
[23:47:05] <tzanger> thetruthisoutthe: if your CPU has 'em, sure
[23:47:18] <tzanger> actually I'm fighting that right now on a SAM4L
[23:47:34] <thetruthisoutthe> why ? is that not simple?
[23:47:37] <tzanger> I have the PEVC working fine, I'm trying to figure out how to gate the ADC and LCD clocks correctly
[23:47:49] <thetruthisoutthe> ;/