#avr | Logs for 2013-10-01

Back
[00:08:42] <braincracker> vsync_ yea, but it would be much cooler to use a bldc ;/ those starter motors may have 30-40% efficiency?
[00:09:33] <braincracker> brushes make noise, wear, and heat up, running it full throttle for a few minutes would make it meltdown
[00:09:57] <braincracker> bored? 300kmh-1 in traffic with a superbike ;>> http://www.youtube.com/watch?v=BmIr33pekM0
[01:28:21] <WormFood> from the ATmega128 datasheet: "UBRR Contents of the UBRRH and UBRRL Registers, (0 - 4095)" <-- do the newer AVRs go above 4095?
[01:32:31] <OndraSter_> define newer AVRs - like xmega or still only 1284 etc?
[01:34:24] <WormFood> ATmega1284RFR2 appears to go to 65535
[01:34:58] <WormFood> newer AVRs = newer than the ATmega128
[01:35:18] <Casper> man that build was a real pita...
[01:35:31] <Casper> don't use 1/2" plywood when you have to screw in it's thickness...
[01:35:47] <Casper> have to use pilot holes... and even then it's not great...
[01:35:57] <WormFood> that was what I was just about to say
[01:36:49] <WormFood> http://i.imgur.com/qee12YZ.gif make it fit
[01:39:32] <Casper> but the end result is ok
[01:41:18] <Casper> https://www.dropbox.com/s/3yu1aq18y3txhw6/2013-10-01%2002.03.05.jpg
[01:54:28] <homeflux> hi everyone!
[02:27:15] <Joel_re> ping Tom_itx
[02:27:37] <Joel_re> I missed your reply
[04:22:29] <Tom_itx> Joel_re, [12:02:10] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/pdf/mmc/ProductManualSDCardv2.2final.pdf
[04:22:29] <Tom_itx> [12:02:27] <Tom_itx> table 1.1
[05:06:35] <Joel_re> Tom_itx: cool, thanks will look at it
[05:06:46] <Joel_re> Tom_itx: also, its been a while since you were on ##electronics :p
[05:06:55] <Joel_re> <- smooth_penguin btw
[05:44:52] <megal0maniac_afk> WormFood: They mostly seem to be 12bits, even on the xmegas
[06:00:29] <WormFood> I noticed the same thing too megal0maniac_afk...but there are some that are bigger....I'm trying to think about how to handle that in my baud rate calculator
[06:07:01] <megal0maniac_afk> WormFood: Where do you see that? The upper 4 bits of UBRR1H are reserved, even on the 1284rfr2
[06:08:18] <WormFood> ATmega1284RFR2 appears to go to 65535
[06:08:32] <megal0maniac_afk> Where do you see that?
[06:08:38] <WormFood> my observation is based on their xml file
[06:08:56] <WormFood> UBRR mask is 0xFFFF where everything else is 0x0FFF
[06:10:41] <megal0maniac_afk> I'm looking at the register summary in the datasheet
[06:10:55] <WormFood> I haven't download the datasheet yet
[06:11:04] <WormFood> so I could be totally wrong ;)
[06:11:33] <megal0maniac_afk> I've checked xmega256a3u, atmega1284p and atmega1284rfr2. I hope for your sake that you're wrong ;)
[06:11:54] <megal0maniac_afk> But it seems like 12bit is the standard, even on the xmega which can go up to 4Mbit
[06:12:26] <WormFood> ATmega64RFR2.xml: <register caption="USART0 Baud Rate Register Bytes" name="UBRR0" offset="0xC4" size="2" mask="0xFFFF"/>
[06:13:06] * megal0maniac_afk shrugs
[06:14:31] <megal0maniac_afk> You have a point, but I'm inclined to trust the datasheet over xml files made for internal use. I could be reading the datasheet incorrectly too, but I don't think so
[06:14:45] <WormFood> you're probably right
[06:14:51] <WormFood> a 16 bit UBRR does not make sense
[06:15:37] <WormFood> I'm downloading the datasheet now, to double check
[06:21:55] <WormFood> you're right megal0maniac_afk, it's only 4096 values....I wonder why the xml file has a 16 bit mask, instead of a 12 bit mask
[06:41:46] <WormFood> http://www.wormfood.net/avrbaudcalc-1.1.1.php <-- what do you guys think? I now display the ubrr in hex, and I don't show values between 256 and 4095 as being invalid anymore ;)
[07:03:06] <WormFood> ok, I think I figured out how to change my baud calc to make it better...take into account double speed mode U2Xx=1, and make the tables more useful ;)
[09:01:34] <megal0maniac_afk> WormDude: Your version has gone down :)
[09:01:52] <megal0maniac_afk> WormFood: ^
[09:02:04] <WormFood> yeah, 2.0 I decided to rename to 1.1.0
[09:02:06] <megal0maniac_afk> Didn't even notice the nick change
[09:02:14] <WormFood> however, no version is the default now
[09:02:28] <megal0maniac> Did you solve the UBRR mystery?
[09:02:44] <WormFood> so avrbaudcalc-2.0.0 and avrbaudcalc-1.1.0 are both avrbaudcalc.php
[09:02:57] <WormFood> I'm currently working on 1.1.1 (which I'll quite likely name 1.2)
[09:03:10] <WormFood> or maybe give it 2.0, since it will make a lot of changes
[09:03:18] <WormFood> fuck. now I can't connect to my server
[09:03:34] <WormFood> it's working for you right now, right megal0maniac?
[09:04:13] <megal0maniac> 1.1.1 which you linked earlier is giving 500 error
[09:04:21] <megal0maniac> but 1.1.0 loads and works
[09:04:54] <WormFood> yeah, I'm actively working on 1.1.1
[09:05:07] <WormFood> I go to test my changes, and I can't connect
[09:06:05] <megal0maniac> Strange
[09:06:46] <megal0maniac> Whoo! 1.1.1 loads
[09:08:36] <megal0maniac> And the out of range conditional formatting looks right for 12bit
[09:09:01] <megal0maniac> (Referring to the note in the footer)
[09:18:05] <WormFood> megal0maniac, look again
[09:18:16] <WormFood> there is a checkbox, for 8-bit UBRR values
[09:18:47] <WormFood> by default it is set for 12-bit values as being valid, but check that box, and it will show values that exceed 8-bits as being invalid :D
[09:19:28] <WormFood> also, the double speed mode works....look at the values, then check the double speed box, and make the tables, and notice the ubrr values change :D
[09:21:49] <WormFood> megal0maniac, check it quick, is you want to see it before I break it again adding the next feature :D
[09:23:28] <vsync_> i have seriously lost all my solder
[09:23:35] <WormFood> What I'm going to do, is make the tables even bigger, and more colorful....but I'll make it optional, so if you want a small tight table, you can get it....
[09:23:37] <vsync_> i had two rolls of this good lead solder :<
[09:24:02] <WormFood> also, what do you think about including the hex values too?
[09:24:56] <WormFood> also, I suppose I should have an option, to show UBRRH and UBRRL...what do you think?
[09:28:05] <sjokkis> guys, when i write via spi to my can bus controller, and then read the same register back, it doesn't read the correct value every time. is that probably because i've written a shit spi driver, or because you can't expect the can controller to get it right every time?
[09:28:24] <megal0maniac> Maybe a radio button for hex/dev
[09:28:28] <megal0maniac> *dec
[09:28:55] <megal0maniac> Well, two radio buttons. People generally use 1 or the other. A choice is useful, both seems unnecessary
[09:32:01] <megal0maniac> WormFood: Also, I was wrong about my thinkpad's linux drivers. The only gripe is that I like the options that the synaptics windows software gives you
[09:32:25] <megal0maniac> Linux support is pretty generic/basic and I'm not sure that multitouch works. But I'm spoilt
[09:36:27] <WormFood> I used to be spoilt, so now I guess I'm an exspoilt
[09:39:34] <megal0maniac> What distro do you use?
[09:39:35] <WormFood> once again, I'm probably wrong, because I'm looking at the xml files
[09:39:38] <WormFood> Debian
[09:39:51] <megal0maniac> Ah, okay
[09:42:38] <megal0maniac> Wrong about?
[09:56:29] <WormFood> everything
[10:25:15] * megal0maniac drinks his cheap American beer
[10:43:58] <megal0maniac> Why use for(;;) instead of while(1)?
[10:44:04] <megal0maniac> Or while(true)
[10:45:22] <antto> when i need a loop, i always use "while"
[10:46:50] <antto> 99.9% of the time
[10:49:45] <sjokkis> antto: you mean you just don't use for loops?
[10:49:50] <sjokkis> antto: that's silly
[10:53:19] <megal0maniac> for(;;) seems silly to me
[10:53:29] <megal0maniac> Is it more efficient or something?
[10:54:00] <megal0maniac> I mean, I get why it works, but while(true) seems far more logical. And I've seen so much code using for(;;)
[10:54:14] <twnqx> it's more timing
[10:55:18] <antto> sjokkis yes, i've used "for" loops probably once or twice..
[10:56:58] <twnqx> hm
[10:57:03] <twnqx> you, sir, are weird.
[10:58:43] <antto> before C/C++ i was "coding" mirc scripts, and there it was just "while" loops
[10:59:54] <antto> and sure.. i'm weird ;P~
[11:05:33] <jadew> megal0maniac, people usre for(;;) for the same reason they write lots of shit code, it looks cool/leet
[11:05:40] <jadew> *use
[11:05:47] <vsync_> leet
[11:07:44] <twnqx> 1337
[11:07:49] <jadew> yeah :P
[11:07:53] <twnqx> i use it because it's shorter
[11:08:01] <jadew> it's 1 char shorter
[11:08:42] <twnqx> sometimes i do #define forever while(1) / for(;;) though :P
[11:08:52] <jadew> heh
[11:08:55] <jadew> that's a nice one
[11:11:14] <megal0maniac> jadew: I think that's the answer I was looking for :P
[11:11:26] <megal0maniac> How cool is this? http://i.imgur.com/vjrbNil.png
[11:11:44] <megal0maniac> No explanation necessary
[11:11:46] <jadew> is that in putty?
[11:11:49] <megal0maniac> Yeah
[11:12:01] <jadew> yeah, it's nice :)
[11:12:45] <jadew> I once watched a footbal game in putty, live
[11:12:56] <megal0maniac> And when you push S3, it prints to the right of the picture and not below it. Guess it just moves the cursor, but I like it.
[11:13:55] <megal0maniac> I watched a movie in VLC like that. There used to be an ascii plugin
[11:14:55] <antto> and i'm weird, huh? ;]
[11:15:06] <jadew> too bad the effect is not the other way around and things look clearer as you go further away, otherwise you could use this to watch porn
[11:40:54] <WormFood> http://www.wormfood.net/avrbaudcalc-1.1.1.php?u2xmode=1 <-- I'm still working on on it, but tell me what you guys think about my changes.
[11:52:43] <WormFood> ok, I think I'm done for the moment. I really like the changes I made...it's been something I've been meaning to do for quite a while.
[11:52:50] <WormFood> any feedback?
[11:52:56] <MannImMond> are you working on it at the moment?
[11:53:47] <MannImMond> It's not possible for me anymore to hide double speed info (it was 5 min ago...)
[11:54:09] <WormFood> correct, I turned that on, because I don't have the code able to handle the switch
[11:54:16] <WormFood> I just need to clean up the html is all
[11:54:54] <WormFood> yeah, I forced the double speed mode on all the time now. (just for the moment)
[11:56:19] <WormFood> I'm trying to think of ways to allow users to define their own clock speed tables. I tried to give what I thought would be the most common, or most interesting (obviously nobody is going to use a 32 Khz clock, but thought it might be interesting, in case anyone thought about it)
[11:57:25] <MannImMond> Maybe a switch to hide your precalculated tables would be nice
[11:59:20] <sjokkis> Ok, I'm having doubts about this code. I'm making it too general and it's silly.
[12:00:08] <sjokkis> Advice pls? I've got a driver for a chip i'm talking to via SPI, and I want to write a module on top of this driver. I'd like to do this in a way that makes the µC driver replaceable if I'm gonna use a different one at a later time
[12:00:17] <MannImMond> On the "Given System Clock to Baudrate" table it would be nice if the regular baudrates(the ones that you have in your predefined tables) or the closest matches are highlighted with bold text or something
[12:00:19] <sjokkis> Mostly as a fun exercise, but partially because it's a good idea
[12:00:30] <N1njaneer> sj: Abstract it out? :)
[12:00:40] <sjokkis> N1njaneer: Right. Never done that before. Teach me pls
[12:01:55] <jadew> WormFood, it's blank
[12:02:05] <WormFood> yeah, I just broke it
[12:02:20] <sjokkis> I started doing it the way it's done in u8glib, which is an library for embedded graphics. Essentially, you write a module that implements the device, and a module that implements the communications layer (spi, parallel whatever) and then you register those and it uses pointers to call the right functions
[12:02:31] <WormFood> try it now jadew
[12:02:32] <N1njaneer> Basically wrap every method of contact with the lower-down levels in something that can easily be swapped in/replaced. For instance, make all contact with it flow through a minimum set of function calls that you could conceivably change out easily by simply rewriting each of them to perform the same functions at the end of the day, but with different internal code.
[12:02:41] <sjokkis> It's a neat system and it's ot that hard, but it seems overkill for CAN
[12:02:48] <jadew> WormFood, working now
[12:03:18] <WormFood> I'm trying to get the user defined clock speed as the first table, instead of the last....can't get unshift_array to work
[12:03:23] <N1njaneer> You really don't need to go to the point of function pointers and such because you'll never be doing run-time swaps of things on an AVR device - it's kind of overkill even from that basis :)
[12:03:29] <WormFood> er, I mean array_unshift
[12:04:08] <sjokkis> N1njaneer: Right. The way it's done in u8glib kinda seems inspired by how you'd want to do it if it was object oriented, with a template class and so on
[12:04:12] <WormFood> [00:42:16] <MannImMond> Maybe a switch to hide your precalculated tables would be nice <-- good idea...and easy to implement....just erase the array when checked ;)
[12:04:23] <N1njaneer> The function-pointers are really most useful if you have dynamic run-time linking, or need to do things on an ABI (application binary interface) level for special circumstances. :)
[12:05:02] <jadew> !php $arr = array(1, 2, 3); array_unshift($arr, 4); print_r($arr);
[12:05:02] <jadew> Array ( [0] => 4 [1] => 1 [2] => 2 [3] => 3 )
[12:05:03] <sjokkis> N1njaneer: I think u8glib does it that way because it comes packaged with a bunch of c-files that implement different communication devices and display devices. so you just specify the one you want and boom
[12:05:12] <jadew> WormFood, seems to be working fine
[12:05:22] <sjokkis> N1njaneer: And that's what I was thinking would be neat, but then it struct me that the set of relevant CAN controllers is like three
[12:05:37] <WormFood> I promise it will break again, while I figure out how to do this one thing ;)
[12:06:24] <N1njaneer> sj: Could be. There's certainly different approached given the architecture ideas of the author, and intended uses. A lot of those techniques are certainly overkill (or downright implausible) when talking about Harvard-architecture, flash-based microcontroller implementations :)
[12:06:39] <jadew> !php $arr = array(1, 2, 3); array_splice($arr, 0, 0, array(4)); print_r($arr);
[12:06:39] <jadew> Array ( [0] => 4 [1] => 1 [2] => 2 [3] => 3 )
[12:06:51] <jadew> WormFood, that's another way of doing it
[12:07:56] <N1njaneer> sj: I would just use a common set of functions that address the CAN controller in a common way. That way you could simply change out CanControllerDriver.c / CanControllerDriver.h (or whatever you want to call them) with a different model if you wanted to just by swapping out the file.
[12:08:16] <sjokkis> N1njaneer: I agree. For this level of complexity, that's better.
[12:08:18] <sjokkis> N1njaneer: Thanks
[12:08:22] <N1njaneer> It's a compile-time thing, but that's the only thing really applicable for embedded :)
[12:09:12] <sjokkis> N1njaneer: Would you make tiny inlined functions that just call the lower-level functions, or can I use #define for this?
[12:09:38] <N1njaneer> sj: The thing that takes a bit of experience is designing the interfaces (as in functions / th "API-lite") in such a way that they are robust and expandable without being cumbersome. That and not falling in to the trap of being forced by the least-common denominator of ALL implementations to do something a specific way.
[12:10:19] <sjokkis> N1njaneer: I've written a lot of API code, but I've never been that involved in designing the API spec. Wish me luck!
[12:10:27] <sjokkis> Not really sure what I'm doing here
[12:13:16] <N1njaneer> sj: It kind of depends - kind of a broad question. I would just use a common set of function names. Things like: controllerInitialize(), controllerStart(), controllerStop(), controllerQueryInfo(), controllerWrite(), controllerRead(), etc. Stuff like that. Boil down the concepts of what you need it do to ("I need to initialize the hardware it needs, identify some of its parameters, start it running,
[12:13:16] <N1njaneer> write data to it, read data from it, etc") and try to fit that into a pretty concise set of functions. Leave everything INSIDE the functions specific to the hardware, so in theory you have the hooks and procedures necessary to swap something else in later.
[12:13:27] <rlc> Can the avrdragon be used for AVR32?
[12:14:01] <bss36504> rlc: http://www.atmel.com/tools/AVRDRAGON.aspx?tab=devices
[12:15:59] <rlc> Great. Thanks
[12:16:44] <N1njaneer> sj: Think of it abstracted out. Think of a hot-water tank. The hot water tank has water in, water out, power connection, and temperature settings controls. If you can identify and abstract out each of those important items, you could make it so you could install and work with any hot water heater in your house, no matter how the tank works internally.
[12:19:46] <N1njaneer> You want to use the same analogy to designing APIs/ABIs. The problem is that it's a pretty broad-scope problem, so there is no hard and fast rule for specifically how to do it best. Most of that comes with experience, but you can certainly take a hint from looking at how others have done it. It's also important to be realistic with how much you want to abstract out. I've seen some APIs that become
[12:19:46] <N1njaneer> so incredibly bloated so quickly that they kind of undo the purpose of having them in the first place, since USING them has become analagously complicated to just writing a new port of the code from scratch. :)
[12:21:16] <N1njaneer> (same with C++ and OOP classes - just because you are writing classes does not mean you are writing them *well*. Some people bloat and intertangle them so significantly that you quickly lose almost all the benefits of OOP design )
[12:21:36] <N1njaneer> Anyhow, </SOAPBOX> :D
[12:27:56] <sjokkis> Thanks, N1njaneer !
[12:27:59] <MannImMond> Wormfood: Btw. the pagetitle is still version 1.1.0
[12:28:53] <WormFood> oh yeah, I didn't change that part yet ;)
[12:29:10] <WormFood> BUT, I'm also still working on it...it's a work in progress ;)
[12:29:30] <WormFood> I may give this ver 1.2, or perhaps 2.0 after all these changes.
[12:29:40] <WormFood> most likely it will not be 1.1.1
[12:29:45] <bss36504> hate to be that guy, but what are we talking about?
[12:30:01] <WormFood> http://www.wormfood.net/avrbaudcalc-1.1.1.php
[12:30:38] <WormFood> it's being worked on, so if it breaks, check back in a few minutes...of course, older versions are all still up.
[12:30:53] <bss36504> ah, neat.
[12:33:05] <megal0maniac> WormFood: Last suggestion, maybe instead of UBRR | UBRR (hex), make it UBRR___ dec|hex
[12:33:32] <MannImMond> Eh would be nice btw to have a link(additional) without the version in it to make it usable for bookmarks/distributing the link
[12:34:03] <WormFood> the version is just for my working copy, once I'm done, and make it the main one, it won't have the version number on it.
[12:34:04] <megal0maniac> MannImMond: http://www.wormfood.net/avrbaudcalc.php
[12:34:28] <WormFood> that is actually just a symlink to the current version, with version number
[12:34:45] <WormFood> so, right now avrbaudcalc.php links to avrbaudcalc-1.1.0.php ;)
[12:34:46] <MannImMond> ah nvm then
[12:38:43] <WormFood> ok, got the user supplied clock rate, to come up as the 1st table now (instead of the last)
[12:43:37] <MannImMond> So, the switch is there it's just not doing anything right? :D
[12:43:42] <MannImMond> for hiding the tables
[12:44:55] <MannImMond> nvm :)
[12:45:43] <WormFood> hehehe
[12:46:03] <WormFood> it works, but throws some errors...gotta track down (it seems php does not like doing math on arrays with 1 element.
[12:56:45] <WormFood> ok, got that all fixed.....looking good ;)
[12:58:30] <WormFood> ok, now to fix the double speed display....without a doubt, it will probably be broken for the next 30 minutes or so.
[13:24:26] <sjokkis> hooray, my can controller works great
[13:34:24] <N1njaneer> Sweet!
[13:36:26] <abcminiuser> Right, when I buy my own house in Aus, I'm totally making a rave den
[13:36:32] <abcminiuser> Put that electronics to use
[13:37:26] <N1njaneer> LUFA-powered Rave Den?
[13:39:24] <bss36504> I think that would be an audio class device....
[13:41:33] <abcminiuser> Hell yes
[13:41:51] <abcminiuser> Some decent speakers, black lights, a FFT linked to some strobes, LEDs
[13:42:04] <abcminiuser> Hate dancing with a passion, love techno and lights
[13:42:38] <bss36504> so do you just go to clubs and awkwardly stand around?
[13:42:50] <abcminiuser> Never been
[13:43:00] <abcminiuser> I'm not a...popular....person
[13:43:06] <abcminiuser> So I just rock out at home
[13:44:17] <bss36504> not popular eh? Surprising. I dont go clubbing either.
[13:45:19] <abcminiuser> Some days I wish I was born with a personality
[13:45:32] <abcminiuser> Other days, I forget to care and pump up the headphones
[13:50:13] * Tom_itx cranks it up to 11
[13:51:04] * abcminiuser is going to build his own club, with blackjack and hookers
[13:53:23] <bss36504> ^lol
[13:54:15] <Tom_itx> money for nuthin and the chicks for free
[13:54:29] <bss36504> abcminiuser is being rather self depreciating: "no personality"
[13:54:35] <WormFood> that ain't workin'
[13:54:51] <WormFood> did you know that song was banned in australia?
[13:54:57] <Tom_itx> really?
[13:54:58] <WormFood> I think that is where it was banned
[13:55:25] <WormFood> I'm sorry, it was banned from Canadian radio
[13:55:40] <bss36504> canada and austraila are basically the same, so no worries :P
[13:56:04] <WormFood> http://www.dailymail.co.uk/news/article-2033245/Dire-Straits-song-ban-lifted-Canada.html <-- oh, looks like they removed the ban
[13:56:15] <bss36504> As far as I know there are only 2 countries in the world: USA and not USA
[13:56:19] <bss36504> ^Kidding
[13:56:29] <WormFood> Alan Cross, a broadcaster, said the ruling made Canada ‘look silly’ to the rest of the world. <-- this is so true
[13:56:43] <megal0maniac> I bought a Dire Straits record on the weekend. That, and Monty Python and Bill Cosby :)
[13:56:48] <bss36504> Well I'm sure they're sorry now.
[13:56:50] <abcminiuser> bss36504, and only one of those two has a functioning government...
[13:56:52] <WormFood> Dire Straits’ singer Mark Knopfler reacted at the time by offering to replace ‘faggot’ with ‘fudger’ but it was not enough for the authorities. <-- hahaha
[13:57:05] <abcminiuser> Mark Knopfler does some great songs
[13:57:11] <bss36504> abcminiuser: touché
[13:57:17] <WormFood> agreed
[13:58:34] <abcminiuser> https://www.youtube.com/watch?v=HPwFgPkcmeg
[14:00:09] <abcminiuser> Listen to that and appreicate good music, you young'ns
[14:00:10] <WormFood> I remember hearing the DJ on the radio station I listen to, have some bimbo call up, and say she is a HUGE Dire Straits, and asked him to play "Sultans of Sweat", and he is saying "huge fan eh? And you don't even know the title of the song you're requesting"
[14:02:31] <abcminiuser> Jesus, I can derail anything
[14:02:32] <abcminiuser> My bad
[14:02:36] <abcminiuser> Carry on gents
[14:02:38] <WormFood> ok, I think I'm done with the baud rate calculator....I just gotta clean it up, and make it the default...but take a look at it, and tell me if I missed anything. http://www.wormfood.net/avrbaudcalc-1.1.1.php
[14:04:49] <abcminiuser> Teo baud registers?
[14:06:30] <WormFood> huh?
[14:06:36] <WormFood> abcminiuser, what do you mean?
[14:06:52] <abcminiuser> You said some newer parts have two baud registers
[14:07:35] <bss36504> UBRRH, UBRRL. Not sure if it's limited to new parts, but that's what he's talking about I believe
[14:08:10] <GuShH> why another calculator?
[14:10:22] <Tom_itx> just to confuse you
[14:10:39] <GuShH> the correct answer was: why not
[14:13:41] <WormFood> well, I believe internally it's a single UBRR register, but it is 12-bits, so it is accessed through 2 memory locations...so 2 parts
[14:14:06] <WormFood> I was actually documenting that aspect of the calculator
[14:16:37] <bss36504> I dont think, by definition, that it is two registers. All the register addresses are 8 bits, and the documentation is pretty clear that UBRRH and UBRRL are different registers.
[14:16:55] <sjokkis> abcminiuser: you think you're being old timey by recommending NEW mark knopfler?
[14:17:22] <bss36504> abcminiuser: Aren't you like <25 too?
[14:18:44] <sjokkis> at least the woman who didn't know the name of "sultans of swing" kept it real
[14:18:48] <sjokkis> that was on their very first demo tape
[14:19:36] <abcminiuser> 24 :P
[14:19:48] * abcminiuser *wheeze* BACK IN MY DAY *wheeze*
[14:20:18] <bss36504> haha I did that to my boss today cause he's really excited about his first smartphone (He's 35, I'm 19)
[14:22:40] <sjokkis> so i'm abstracting this library for the MCP2515 without having access to any other CAN controllers. what's important? what's not?
[14:22:46] <sjokkis> i don't even know. at this point i just do things
[14:28:03] <sjokkis> http://www.youtube.com/watch?v=pfmkRi_tr9c&t=51s
[14:32:12] <WormFood> ok, my old 1.1.1 ver link no longer works...it's now version 1.2.0, and that is the default version....so check it out www.wormfood.net/avrbaudcalc.php and tell me what you guys think about the changes.
[14:35:33] <MannImMond> looks good
[14:39:51] <WormFood> ok...unless someone can find anything wrong with my page, I probably won't touch it for another year or three
[14:40:40] <WormFood> it is now twice as big as it was when I first started.
[14:41:15] <WormFood> 25% more lines...100% more code (and comments)
[14:41:36] <bss36504> thats usually how it ends up for me
[14:42:28] <WormFood> I guess most people would do a switch, and make totally different tables, but I do the switch, and change the colspan/rowspan, depending on if the user wants double mode speed info
[14:42:37] <ColdKeyboard> When I store variables in MCU, they are stored in RAM, right? Software goes into SW flash, variables in RAM and constants in EEPROM?
[14:42:41] <WormFood> also notice, most browsers should display a tooltip when you hover over the input boxes
[14:42:52] <WormFood> no ColdKeyboard
[14:42:56] <bss36504> nope
[14:42:58] <WormFood> constants are in flash
[14:43:11] <bss36504> variables are initialized in ram at startup
[14:43:16] <WormFood> I'm not aware of any compiler that uses eeprom for storage of variables
[14:43:42] <bss36504> you could hack it into doing that, but it wouldnt be very efficient, and you'd have to write a DMA of sorts...nevermind.
[14:44:11] <ColdKeyboard> Ok, but the variables are held in ram?
[14:44:57] <bss36504> after startup yes
[14:45:18] <bss36504> when the MCU powers up, the variables are loaded from flash (non-volatile) into RAM (volatile)
[14:45:40] <bss36504> but the flash also contains the application section where the program runs from.
[14:46:14] <ColdKeyboard> I see
[14:46:35] <bss36504> When you say, initialize an int, it has to store that as part of the program in flash, but when the program begins, a ram location is created that holds that value.
[14:47:05] <ColdKeyboard> So if I want to create a array that will occupy almost whole RAM i will be limited by the RAM size - Code size = max space for array
[14:47:12] <ColdKeyboard> *an array
[14:47:23] <GuShH> WormFood: what do you mean by "old version link doesn't work anymore"
[14:47:25] <bss36504> not minus code size, minus whatever the variables are.
[14:47:25] <GuShH> you should redirect
[14:47:37] <ColdKeyboard> OK, thanks :)
[14:47:41] <WormFood> ok, time for me to go to bed (3:30 am here), now that I've spent all my time working on my calculator, instead of doing "real" work
[14:47:45] <bss36504> You could just try to use dynamic allocation until it fails.
[14:47:53] <GuShH> how dare you break the internetz
[14:48:04] <WormFood> GuShH, don't worry about it...I said that in case anyone tried the old links.
[14:48:05] <bss36504> while(mempointer!=null) realloc(mempointer)
[14:48:15] <bss36504> ColdKeyboard: But why?
[14:48:26] <WormFood> redirect?
[14:48:28] <WormFood> unlikely
[14:48:34] <GuShH> broken links are bad.
[14:48:50] <WormFood> if someone is foolish enough to give a link to my internal test version, then that is their fault
[14:48:50] <GuShH> go to sleep already, or you'll end up drooling the keyboard
[14:49:20] <WormFood> the real link works
[14:49:20] <GuShH> oh I thought it was public
[14:49:20] <ColdKeyboard> bss36504: I want to create small LogicAnalyzer and I'm thinking of storing values in ram and after the maximum amount has been sampled, dump them over USART to some software for processing
[14:49:20] <GuShH> I REJECT YOUR REALITY AND SUBSTITUTE MY OWN
[14:49:21] <bss36504> WormFood: make an html page that just has a link to the latest version <meta http-equiv="refresh" content="0; url=http://example.com/">
[14:49:24] <ColdKeyboard> or If the speed is not that critical, I could sample -> send -> repeat
[14:50:02] <ColdKeyboard> Hey, I know HTML and PHP, what needs to be done? :)
[14:50:04] <WormFood> http://www.wormfood.net/avrbaudcalc-1.1.0.php works, but http://www.wormfood.net/avrbaudcalc-1.1.1.php no longer works
[14:50:19] <GuShH> ColdKeyboard: you basically know nothing then :p
[14:50:21] <WormFood> it does not matter, because nobody should be using those
[14:50:22] <GuShH> or rather, nothing worth knowing
[14:50:26] * GuShH grins
[14:50:44] <WormFood> http://www.wormfood.net/avrbaudcalc.php <-- this is the one *everyone* should be linking to
[14:50:47] <bss36504> ColdKeyboard: I wouldnt do that. That would be a really kloogey way to do it. Store it externally on a flash chip, store it in EEPROM, store it in on-board flash. Dont attempt to use ALL of your ram.
[14:50:50] <GuShH> Also if your keyboard is cold, chances are you haven't been writing enough code to keep it warm
[14:51:01] <WormFood> 晚安
[14:51:23] * GuShH nudges ColdKeyboard
[14:51:27] <ColdKeyboard> GuShH: Someone mentioned redirect and problem, I wanted to help... that's all... :)
[14:51:40] <GuShH> And I'm just being silly that's all
[14:51:58] <ColdKeyboard> I know :)
[14:51:58] <GuShH> We can still be imaginary friends
[14:53:25] <bss36504> Anyway ColdKeyboard, I think you'd be better off setting up a real time interrupt, sampling and storing what you need to in that time. If you need more samples or more time, get a faster processor or tweak your interrupt period. thats pretty much the standard way to do sampling at a constant rate, whether it;s digital or analog.
[14:53:30] <ColdKeyboard> bss36504: I will do something like that, but if my MCU works on 48MHz and I need sample rate of few ms, I could send char over uart and then sample again without losing data. But then I need to find software that works with raw hex/binary data. OLS is nice but I have to log data, edit file to make it proper OLS format and then open it in software. It would be really nice if I could just click
[14:53:31] <ColdKeyboard> "read" and that's it. :)
[14:53:52] <bss36504> what MCU are you using?
[14:54:28] <bss36504> ColdKeyboard: Write custom pc software?
[14:54:42] <ColdKeyboard> bss36504: I have ATmega8 and few Tiny's but I might go for some dsPIC or PIC18F or something like that...
[14:55:04] <bss36504> ew PIC. I cant help with specifics there.
[14:55:27] <bss36504> an atmega8 wont go to 48Mhz though. use an Xmega maybe
[14:55:29] <ColdKeyboard> Well, I need more help with PC software than with hardware :)
[14:57:25] <bss36504> Well if you can do embedded coding you should be ok with some simple C programming on a PC to collect and/or process data over a serial connection.
[14:57:42] <bss36504> or write Java using JSSC for your serial stuff.
[15:01:49] <ColdKeyboard> I wanted to make it work with some of the existing software, like OLS or Sigrok... I can work with OLS but then I have to record data from serial, write it to file and then open it in OLS. It would be nice if I could just connect to the device with OLS and read the data directly. Also I haven't found the protocol specs, like what commands it sends to the device and what does it except as answer
[15:01:51] <ColdKeyboard> :\
[15:02:39] <bss36504> can you link me to what OLS is?
[15:03:38] <ColdKeyboard> http://www.lxtreme.nl/ols/
[15:03:39] <bss36504> Openbench Logic Sniffer?
[15:03:47] <ColdKeyboard> Yes
[15:04:18] <bss36504> I have to go to class, but I might be on later.
[15:04:34] <ColdKeyboard> Ok, see ya :)
[17:22:32] <Kre10s> I've written a simple led blinking program in C. I used avr-dump -d to disassemble it. I then build the executable again, but from asm source. I use avr-gcc test.s -o test. Looking at the disassembly output of test i see the interrupt jump table appears twice... how can i get avr-gcc not to do that?
[17:24:25] <Kre10s> gcc always links in /usr/lib/gcc/avr/4.7.2/../../../avr/lib/avr5/crtm32m1.o
[17:25:14] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/avr/tiny10/t10blink.asm
[17:25:19] <Tom_itx> there is a very simple blink
[17:26:35] <specing> I think he wants to complicate things, not write a simple blinker
[17:26:57] <Kre10s> Ah. was looking for -nostartfiles
[17:27:44] <Tom_itx> we humans try to do things the most difficult ways sometimes
[17:28:33] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/avr/blinkled/asm/interrupt/led_blink_int.asm
[17:28:39] <Tom_itx> there's one using interrupts
[17:29:14] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/avr/blinkled/asm/delay/led_blink_delay.asm
[17:29:17] <Tom_itx> and another that doesn't
[17:30:46] <Kre10s> :P silly humans.
[17:31:14] <Tom_itx> ^^ in case you're just interested in learning asm
[17:37:21] <Kre10s> hmm. so I read somewhere that "main should never return". but if i read this disassembly right... ctors_end does a call main; jmp exit ... which is jmp .-2
[17:37:43] <Kre10s> so. theres no reason for main not to be allowed to return.
[17:38:34] <Tom_itx> the } is the return or end
[17:38:45] <Tom_itx> en c
[18:53:56] <codyps> Kre10s: jmp .-2 is an infinite loop, IIRC
[18:54:07] <Kre10s> yup.
[18:59:46] <N1njaneer> Yes, . is the current location counter that points to the address of the next instruction, so -2 rewinds it by 2 bytes (1 word) and makes it jump to itself. I still think "." should me "me, right here!" so the -2 isn't necessary, but.... :)
[19:10:00] <sjokkis> Hey N1njaneer, when I write to this CAN bus controller, does it seem reasonable to you that I could expect it to write every registry value I tell it do, or is it more likely that I have to check and retry until it sticks?
[19:22:32] <braincracker> N1njaneer<= wrong, jump is a relative jump after the current IP, in this case, after executing the jmp instruction.
[19:37:30] <N1njaneer> brain: Ahh, that makes sense. I guess it's a different way of thinking of the notation because of the way the jmp instruction works :)
[19:39:20] <N1njaneer> sj: Not sure, I don't have any experience with the CAN controller
[19:40:50] <braincracker> N1njaneer<= #asm :)
[19:42:12] <N1njaneer> hmm?
[19:42:33] <N1njaneer> Oh, #asm channel on here?
[19:43:25] <braincracker> yea
[19:45:06] <N1njaneer> My strength is admittedly far more with C/C++ side, but I know enough to be dangerous with AVR assembler.
[19:48:27] <braincracker> http://www.teslamotors.com/roadster/technology/battery
[19:48:28] <braincracker> :)
[19:48:40] <braincracker> Sixty-nine cells are wired in parallel to create bricks. Ninety-nine bricks are connected in series to create sheets, and 11 sheets are inserted into the pack casing. In total, this creates a pack made up of 6,831 cells.
[19:57:35] <vsync_> yeah? well li-ion is still crap :x
[19:58:56] <sjokkis> N1njaneer: but with spi in general, can you fire and forget or would you do better to check?
[19:59:46] <braincracker> vsync_<= agreed, i support nanophosphate
[20:00:19] <braincracker> LiFePO4
[20:00:46] <braincracker> and A123 type is best from: http://www.a123systems.com/
[20:00:57] <vsync_> i'm familiar with a lot of battery types
[20:01:34] <vsync_> however as said so many times in the past, before a battery is made that charges as fast as a cap, electric cars are pretty bad
[20:01:54] <braincracker> you are wrong again
[20:02:14] <vsync_> and this is how?
[20:02:24] <vsync_> anyway, could probably pm or something instead, this is offtopic
[20:02:52] <braincracker> not that offtopic i think...
[20:03:01] <braincracker> a rechargeable battery
[20:03:52] <braincracker> vsync_<= http://assets.buya123batteries.com/images/a123/26650_data_sheet.pdf :)
[20:04:05] <braincracker> so this thing can be charged in 15 minutes if you want to.
[20:04:10] <Valen> didnt A123 go bankrupt?
[20:04:30] <braincracker> it was always bankrupt, it is supported by us military
[20:04:58] <braincracker> it would only require insane amount of power for you to charge your EV in 0.5 hour :)
[20:05:12] <Valen> Also, there are batteries you can charge at 5C
[20:05:15] <Valen> or more
[20:05:20] <vsync_> and this is practican, how?
[20:05:28] <Valen> so its 10 minutes to "fill"
[20:05:31] <vsync_> load up an electric car battery pack with 5C, good luck with that
[20:05:34] <vsync_> yeah Valen sure...
[20:05:39] <braincracker> 85kWh pack is charged in about 4.5 hours @ 40kW power from dual 3 phase 400V AC sockets
[20:05:40] <vsync_> let's stick with reality for a change
[20:05:43] <braincracker> ...
[20:06:02] <Valen> that's just an engineering problem
[20:06:20] <vsync_> yeah, system's crap by definition, but wasting power on it will resolve it
[20:06:25] <Valen> that said, why would you want to
[20:06:26] <N1njaneer> Plus we all know that ammonia is the future of energy storage :)
[20:06:27] <braincracker> from where you get 400kW of electric power for charging your vehicle ?
[20:06:45] <Valen> braincracker: vanadium redox battery
[20:06:50] <vsync_> sure rofl
[20:07:04] <braincracker> :)
[20:07:06] <Valen> the "service station" would act as a load leveler, charge their battery banks up off prak
[20:07:11] <Valen> peak
[20:07:24] <Valen> then they can dump the power into your car on demand
[20:07:26] <vsync_> i'm not only talking about fast charging it out of mains, i'm talking about storing the braking energy which is the niche of electric cars
[20:07:40] <Valen> or sell it back to the grid for peak shaving
[20:07:53] <braincracker> it is certainly possible to charge your EV at home in 20 minutes.
[20:08:10] <vsync_> probably is, but the range of said 'ev' is crap
[20:08:20] <braincracker> let's see, it'd need a little puffer battery at home for, another $50k
[20:08:43] <braincracker> and a 300kW charger
[20:08:50] <Valen> thing is, you are trying to make the EV into a petrol car, just don't do that and its not a problem anymore
[20:09:08] <Valen> charge your EV over night, and hook up a range extender if you are doing a long trip
[20:09:24] <braincracker> charge your pack @ 1000A current :)
[20:09:29] <vsync_> yeah or build a small nuclear reactor in a trailer
[20:09:42] <vsync_> because "our battery tech is so good"
[20:09:47] <vsync_> A123 POWER!
[20:09:50] <braincracker> hahaha yes
[20:10:07] <sjokkis> hm. the register values i read out from this, reading the same three registers in a loop, vary. but they're control registers and not supposed to change unless i change them. it's very strange
[20:10:18] <sjokkis> i wonder if it's the controller or my spi implementation
[20:10:29] <braincracker> mmm it'd be fun to plug in 2-3 100mm^2 cables into my EV for fast charging
[20:10:31] <braincracker> :)
[20:10:43] <vsync_> offtopic... shush
[20:10:51] <N1njaneer> sj: Sounds like a potential framing problem.
[20:11:04] <Valen> braincracker: the balancing could be "interesting" at 1000A
[20:11:06] <sjokkis> N1njaneer: what do you mean?
[20:11:16] <sjokkis> N1njaneer: this is my spi implementation, if you'd like to take a look http://pastebin.com/DRxyDBfK
[20:11:25] <Valen> I reckon EV's are going to go for much higher voltages
[20:11:32] <braincracker> Valen<= built in balance charger? :(
[20:11:43] <N1njaneer> sj: I'd double-check your chip-select lines are set up correctly and functioning properly. Also, as a note, you need to ensure the SS' pin is being set up as an OUTPUT if using SPI bus as a master.
[20:11:45] <braincracker> only 99 cell packs in series
[20:11:53] <Valen> regardless, you are going to need to shunt quite a bit of power
[20:12:06] <braincracker> charge each stage separately
[20:12:12] <braincracker> 99 chargers built in
[20:12:13] <Valen> I reckon they will run around 600V or so
[20:12:23] <N1njaneer> sj: Even if SS' isn't used, it needs to be an output, else if it's an input it will cause the SPI to abort transfers if the pin transitions.
[20:12:43] <sjokkis> N1njaneer: yeah, that makes sense. as you can see i set it as an output though
[20:13:14] <braincracker> Valen<= makes sense, now it only needs 99 welding power supplies rated @ 3kW each to fast charge your pack :)
[20:13:32] <tzanger> jadew: https://plus.google.com/107280738832484622687/posts/66m8p3A93WR
[20:13:43] <N1njaneer> I would double-check your timing and chip-select outputs, etc to make sure you aren't getting some kind of odd jitter that is causing a byte to occasionally get lost, etc.
[20:13:44] <Valen> hey, I'm not advocating fast charge of EV's
[20:14:01] <Valen> thats people trying to make them look the same as a petrol car
[20:14:02] <braincracker> okey then vsync_
[20:14:06] <Valen> I'm just saying its possible
[20:14:10] <jadew> tzanger, what's that?
[20:14:11] <sjokkis> N1njaneer: how do you suggest i double-check the CS output?
[20:14:26] <N1njaneer> sj: First with code, second with scope or logic analyzer.
[20:14:46] <braincracker> battery swap stations are planned, i don't like the idea
[20:14:47] <tzanger> that's the pump controller and the test/programming fixture (16 spring loaded contacts, the 4 holes align the UUT on top of hte fixture you press down, it programs, tests and pass/fail
[20:14:58] <Valen> I'm 50/50 on battery swaps
[20:15:08] <jadew> oh, that's nice!
[20:15:29] <sjokkis> N1njaneer: if you wouldn't mind having a look, here is the code for spi http://pastebin.com/DRxyDBfK and this is for the actual transfer http://pastebin.com/z8wMGYK0
[20:15:35] <braincracker> i'd throw another 85kWh pack on the backseat to get 1000km range
[20:15:35] <sjokkis> N1njaneer: does it seem reasonable?
[20:15:53] <Valen> I mean renting a pack does seem like a nice idea
[20:16:01] <Valen> gets you around the up front cost
[20:16:10] <tzanger> the little board has a high-side 5V regulator and runs off 24VAC (capacitive reactance based power supply) but I want to protect the programmer when programming so there are 4 dual form-A reed relays on the fixture; when you go to program it it switches the contacts over and disconnects the 24VAC
[20:16:15] <N1njaneer> With a logic analyzer
[20:16:16] <Valen> and you don't need to worry about them crapping themselves etc
[20:16:26] <N1njaneer> oops wrong window :)
[20:16:33] <Valen> but you never know what you get in some respects
[20:16:56] <braincracker> it is indeed funny and lame to advertise how cool is an EV is with a video showing you need to sleep at the charging station for 3-8 hours when you have like 20kms remaining from your trip
[20:17:04] <braincracker> there are youtube videos of this lol
[20:17:13] <Valen> I wonder about a hybrid, where you have a built in pack with say 100km range, then use exchange packs for range extension
[20:17:42] <braincracker> you can throw a gas tank and an electric generator on the backseat...
[20:17:49] <braincracker> now you have a Hybrid
[20:18:04] <Valen> yeah, that is probably the easiest way
[20:18:07] <braincracker> yey OndraSter
[20:18:18] <Valen> you only need ~10Kw worth of generation power
[20:18:19] <sjokkis> N1njaneer: does the fact that the values i'm getting back switch back and forth between the right value and wrong values indicate the errors you suggested?
[20:18:53] <N1njaneer> That's kind of what I'm thinking, yes. Clearly it's *working*, but something is causing it to be inconsistent.
[20:19:10] <sjokkis> right. i'm definitely sending something and receiving something
[20:19:28] <sjokkis> there's nothing in my implementation that could cause me to just read my own writes
[20:19:31] <N1njaneer> Logic analyzer is worth its weight in gold for testing this stuff.
[20:19:32] <braincracker> Valen<= no... only a few hundred watts. to run your car. tesla's roadster requires about 85 kW·h 300 mi (480 km) (Tesla Motors) 5.65 km/kWh ;/
[20:19:45] <sjokkis> N1njaneer: we probably have those at the uni, but i don't know how they work
[20:20:15] <sjokkis> N1njaneer: i'll look into it
[20:20:15] <Valen> braincracker: you might find power requirements are rather higher at 110km/h
[20:20:19] <braincracker> Acceleration can eat 320kW
[20:20:22] <braincracker> :)
[20:20:23] <braincracker> yes
[20:20:24] <braincracker> ...
[20:20:46] <Valen> that is their max range figure. My understanding for most cars is ~10Kw is enough to push them down the highway
[20:20:54] <Valen> which is when you would be using a range extender
[20:21:04] <N1njaneer> sj: You can also try adding generous delays in your code to slow things down to see if the results change, which may help isolate any problems related to race-conditions or timing, etc.
[20:21:14] <braincracker> no idea really...
[20:21:35] <braincracker> tesla's cars are not that efficient
[20:21:57] <N1njaneer> sj: Like, check to make sure you are asserting and releasing the CS for your SPI chip with adequate timing margins, etc. between operations.
[20:21:58] <braincracker> std electric bicycle efficiency: 47.6km/kWh
[20:22:14] <braincracker> they roll a little easier... and tesla cars are 2200kg
[20:22:20] <sjokkis> N1njaneer: i should add delay after setting or unsetting CS?
[20:22:20] <braincracker> lold
[20:22:30] <braincracker> battery pack can be about 350kg
[20:22:49] <sjokkis> i'll try it
[20:22:52] <N1njaneer> sj: It's a start. At least see if it changes the results at all.
[20:23:19] <braincracker> Valen<= range is given at 80kmh-1 i remember
[20:23:37] <Valen> sounds about right
[20:23:38] <braincracker> 88kmh-1/55mph-1
[20:23:48] <N1njaneer> sj: The nicer logic analyzers you can just clamp on to the wires of relevant interest, and they will capture and decode the timing and full data flowing across the SPI so you can instantly confirm if the proper signals are traversing the wires.
[20:25:47] <sjokkis> N1njaneer: yeah, come to think of it, i believe i was told we have a logic analyzer in the $100k range at one of the electronics labs
[20:26:10] <sjokkis> N1njaneer: probably have to fill out a bit of paperwork to use it, though
[20:26:33] <jadew> wth does a 100k LA do?
[20:26:52] <sjokkis> jadew: thoroughly test your IC design, i think
[20:29:29] <sjokkis> jadew: maybe what i'm thinking of isn't called a logic analyzer. from what i understood, they program it to test an IC in every conceivable way
[20:29:40] <jadew> ah
[20:29:55] <jadew> so it's more like a unit testing for ICs :)
[20:30:08] <sjokkis> i guess so, yes
[20:30:13] <jadew> neat
[20:30:25] <sjokkis> i haven't used it, so i don't really know
[20:30:27] <vsync_> braincracker: i wasn't talking about fast charging them either
[20:30:33] <vsync_> moreso storing the braking energy
[20:30:50] <vsync_> which, with the current battery tech, goes more or less wasted
[20:31:12] <vsync_> that's why, i said, you'd need something to charge as fast as a cap
[20:31:24] <braincracker> regenerative braking is possible and is done in modern EV
[20:31:47] <vsync_> it is, but the battery only receive a fraction of it
[20:31:51] <vsync_> +s
[20:32:07] <braincracker> the motor power display if from +320kW/-50kW in the tesla model S
[20:32:11] <vsync_> it's merely a joke with the "modern EW"
[20:32:13] <vsync_> EV*
[20:32:54] <braincracker> with a BLDC motor i think 90% is possible, haven't measured it yet
[20:33:13] <braincracker> i'm on it
[20:33:34] <braincracker> (i mean firmware)
[20:34:58] <vsync_> huh?
[20:36:46] <braincracker> vsync_<= regen braking is also possible with a brushed motor, obviously that will have <40% efficiency at braking
[20:36:57] <braincracker> brushless is much better
[20:37:42] <braincracker> 98% efficient hub motors are being built for 1kW poer and electric bikes
[20:38:13] <vsync_> I know that
[20:38:21] <braincracker> a brushed motor can be about 60% efficient
[20:38:28] <vsync_> I wasn't talking about that either, was I now?
[20:38:35] <sjokkis> so uh, N1njaneer
[20:38:43] <braincracker> <vsync_> it is, but the battery only receive a fraction of it
[20:39:02] <braincracker> 0.9 is a large fraction
[20:39:09] <vsync_> It will, definately not
[20:39:14] <sjokkis> N1njaneer: this is embarassing. i used a 2-pin cable for chip select, with only one of them being connected
[20:39:19] <sjokkis> N1njaneer: try to guess if CS was connected
[20:39:22] <vsync_> it's not related to the motor, it's related to the battery
[20:39:24] <braincracker> haven't measured it, i just guess...
[20:39:40] <braincracker> what does this have to do with the battery?
[20:39:54] <vsync_> you cannot absorb all the energy into it, in such a small period of time
[20:40:16] <braincracker> you can, unless you are going downhill indefinitely
[20:40:18] <vsync_> e.g. an efficient option would be to have a cap bank instead, however that's not practical
[20:40:25] <vsync_> you can't :)
[20:40:42] <vsync_> you cannot store all the energy with the current battery tech in a few seconds of a brake
[20:40:49] <braincracker> i could, if i get a few thousand a123 cells, and make a pack from that
[20:41:06] <braincracker> hm, few seconds ?
[20:41:06] <vsync_> couldn't make it 90% efficient either :)
[20:41:51] <vsync_> you could build a cap bank in it, that'd be pretty cool to be honest. If one could make it lightweight, haha
[20:41:56] <braincracker> i see you want all your emergency braking power stored in your battery
[20:42:27] <braincracker> that'd require about 4-8x larger power rated motor controller/motor
[20:42:52] <braincracker> >320kW motor on each wheel maybe
[20:43:09] <braincracker> and a pimped battery pack
[20:43:17] <vsync_> a non-existant one
[20:43:32] <vsync_> the most efficient regen brakes store about 30% I think
[20:43:39] <braincracker> go to a123systems, get one for $100k
[20:43:59] <braincracker> money makes things possible
[20:44:30] <Valen> you don't need 320Kw per wheel
[20:44:33] <vsync_> no need for a123's, there are other high current charge packs out there
[20:44:39] <braincracker> the std 85kwH pack is only $12k btw.
[20:44:56] <vsync_> are you an a123 puff?
[20:44:58] <braincracker> vsync_<= good luck with that
[20:45:04] <braincracker> puff?
[20:45:04] <Valen> you can only put as much energy into the pack as you can take out of the wheel > road interface
[20:45:22] <vsync_> beautiful way to put it
[20:45:24] <braincracker> vsync_<= show me better, and i'll like that more :)
[20:45:26] <Valen> IE once the wheels are sliding you don't need more breaking
[20:46:02] <vsync_> braincracker: what's the max charge on those
[20:46:03] <Valen> that and *most* brake applications aren't emergency stops
[20:46:11] <vsync_> charging current
[20:46:18] <braincracker> vsync_<= 10C charge, 60C discharge
[20:46:23] <vsync_> alright
[20:46:52] <braincracker> the chinese replica for EV can do about 0.5C
[20:47:03] <braincracker> LiFePO4
[20:47:56] <vsync_> charge?
[20:48:21] <vsync_> you can get cheap chinese replicas 5C at least
[20:48:25] <braincracker> and like 2-4C discharge
[20:48:28] <vsync_> but that's small packs
[20:48:29] <Fornaxian> anybody know of a complete DMM chip that's relatively cheap? I'm finding them around 10 to 12 dollars so far, even in large quantity. Looking for something that has a serial or even parallel interface rather than a display interface.
[20:48:44] <vsync_> and like, a lot more discharge
[20:49:46] <braincracker> vsync_<= http://www.made-in-china.com/showroom/aiicsu/product-detailJoeQajrvOAWu/China-Rechargeable-Batteries-LiFePO4-for-Ev-E-Bike.html
[20:51:03] <vsync_> wonder what oC is
[20:51:10] <braincracker> they don't even advertise specs :)
[20:51:17] <braincracker> degree celsius...
[20:51:58] <braincracker> http://www.batteryspace.com/lifepo4-prismatic-module-3.2v-100ah-10c-rate-320wh-un-approved.aspx
[20:52:02] <braincracker> here is one with some specs
[20:52:14] <braincracker> capacity: 100Ah (320 Wh) at 1C rate
[20:52:27] <braincracker> Standard charging current 0.3 - 0.8C rate (30A - 80A)
[20:52:58] <braincracker> Constant discharge current: 300A (3C rate)
[20:53:10] <braincracker> this sounds ...useful
[20:54:31] <vsync_> it's meant for solar panels most likely
[20:55:31] <braincracker> and EV
[20:55:49] <braincracker> you connect 10-100 of these in series.
[21:17:27] <bss36504> ColdKeyboard: Whats the word?
[21:23:33] <braincracker> you'd use an atmel microcontroller for very low power drain cell balancing in a large lithium pack?
[21:24:07] <bss36504> braincracker: I think they make ICs for that.
[21:24:16] <braincracker> they make ics for everything :)
[21:24:23] <braincracker> i will not buy them
[21:24:45] <bss36504> yeah, well my theory is that if someone has made and tested an ASIC to do something that I wouldnt do as well in code, I'll buy from them
[21:25:00] <braincracker> ok this would limit voltage to 3.6V for example
[21:25:11] <braincracker> how would this need an asic?
[21:25:20] <bss36504> You said cell balancing.
[21:25:20] <braincracker> i was just thinking about low power drain
[21:25:28] <bss36504> whats the end goal?
[21:25:36] <bss36504> just to run the micro from a battery?
[21:25:37] <braincracker> low power drain
[21:25:44] <braincracker> cell pack balancing
[21:26:02] <bss36504> So buy a cell balancing asic so that you dont blow up your batteries.
[21:26:04] <braincracker> and if a micro measures voltage then reporting also
[21:26:19] <braincracker> and so i can integrate it with my bldc controller
[21:26:22] <braincracker> and charger
[21:26:43] <bss36504> Ok, I still dont think doing a custom mcu solution to handle cell balancing is the right approach.
[21:26:57] <bss36504> http://www.ti.com/ww/en/analog/bq77910_integrated_battery_protection_solution/index.shtml
[21:27:00] <braincracker> what is the solution in your opinion?
[21:27:01] <bss36504> ^For example.
[21:27:40] <bss36504> Granted, I dont have a very big picture of this design. If you just want to make a charging controller or a load leveler (across cells), they make chips.
[21:27:51] <bss36504> if you need simple voltage regulation, still chips.
[21:28:11] <bss36504> "they" as in the generic chip manufacturer.
[21:29:56] <braincracker> well if this is more expensive than 10x attiny chips then i'll use 10x attiny chips :)
[21:30:35] <braincracker> and i can use an SPI bus to forward cell voltages too in system
[21:34:10] <braincracker> the cells are connected in series though, they do not sare a common ground, and each mcu must have its own voltage reference ;/
[21:34:54] <bss36504> My understanding of LiPo batteries is you dont mess around. If it's 10x the cost, but it does it *right* then use that. Again, I have very limited context as to what you're end goal is here. Lets assume the premise that some chip out there will do the job better than you can with a mcu: Low power drain: certainly any chip designed for battery power management is probably going to have significantly lower active current draw than the mcu+ass
[21:34:54] <bss36504> Second, voltage reporting, this would be easy to implement with a mcu, and it's possible there is a controller with built in monitoring and communication. Third: Regulation, a battery management chip will likely have some sort of regulation unit, and if not, it would be trivial to get a high efficiency regulator of some kind. I love micros, but in my experience, if you can do something with a purpose built chip-especially related to power s
[21:34:54] <bss36504> luck
[21:35:40] <bss36504> Oh, I forgot to elaborate on that first sentence: I mean they tend to get hot and/or catch fire and/or explode if used improperly.
[21:40:00] <bss36504> Read the cover page of the datasheet for that TI chip, it's basically everything you wanted and I described. It also only costs ~$7 from mouser
[22:10:56] <sjokkis> just successfully sent my first can packet
[22:10:59] <sjokkis> nice
[22:11:03] <sjokkis> only took all day
[22:11:14] <bss36504> congrats!
[22:11:22] <N1njaneer> Woohoo!
[22:12:13] <sjokkis> now for writing a higher level application on top of it, with message queues and fun stuff
[22:13:40] <bss36504> I've never done anything with CAN, but i'd be interested in seeing the final product
[22:14:11] <sjokkis> sure
[22:14:24] <sjokkis> i haven't put this branch up on github yet, but i will
[22:16:40] <sjokkis> it's not gonna do anything super interesting. just transmit the input from a joystick to another node
[22:16:56] <sjokkis> where we'll be controlling an automatic ping-pong table
[22:17:24] <bss36504> what device are you targeting?
[22:17:57] <sjokkis> the user side, which i'm working on now, is running on at90usb1287
[22:18:03] <sjokkis> the other side will run atmega128
[22:18:14] <bss36504> wait, you bitbanged this CAN?
[22:18:44] <braincracker> bitbang this :) microwave oven spotwelder http://www.youtube.com/watch?v=al45MXMp7e0
[22:18:59] <sjokkis> bss36504: what no
[22:19:27] <sjokkis> bss36504: sorry. the at90usb is connected to an mcp2515
[22:19:40] <bss36504> sjokkis: ohhhhhh. ok I should have rememered.
[22:19:49] <bss36504> but that was like 11 hrs ago.
[22:20:02] <sjokkis> bit-banging CAN would be...interesting
[22:20:12] <bss36504> probably doable
[22:20:32] <WormFood> http://www.wormfood.net/avrbaudcalc-1.3.0.php <-- I'm still working on it, but tell me what you guys think so far about my newest changes. (mouseover the baud rate tables)
[22:20:40] <sjokkis> this is the end product, sort of: http://www.youtube.com/watch?v=0z43PO2iaqk&t=1m45s
[22:20:43] <sjokkis> from a previous year
[22:21:34] <sjokkis> the robot arm dropping the ball and detecting when the ball goes out of bounds are extras they've done
[22:21:47] <sjokkis> you only get 80% in this class for following the spec to the letter
[22:24:00] <sjokkis> it's "supposed" to be run on the breadboard with a half dozen different ICs. we part of our extra work we're moving it over to this http://www.nimron.no/P1000/ dev board we have at the uni
[22:24:08] <sjokkis> i run freertos on the at90usb that's on there
[22:24:23] <sjokkis> the breadboard has an atmega162 but fuck that
[22:25:44] <bss36504> That's pretty badass. What is this for?
[22:26:00] <sjokkis> a class at the university
[22:26:34] <sjokkis> embedded systems design
[22:26:46] <bss36504> what university?
[22:26:52] <bss36504> Seems pretty neat.
[22:26:52] <sjokkis> NTNU
[22:27:16] <sjokkis> the university that spawned AVR, incidentally
[22:27:49] <bss36504> Thats pretty sweet. I'm a little bit envious.
[22:27:53] <sjokkis> in a way, at least. the guys who run atmel norway went here
[22:28:26] <sjokkis> there aren't classes like this at your university?
[22:30:05] <bss36504> No unfortunately, we have microcontrollers, but nothing as in depth as that. I have learned most of my stuff on my own. I work as an application engineer for a memory company, and I'm literally the only app engineer. I kind of wish I had someone above me to teach me more stuff, but I do alright.
[22:30:19] <bss36504> I dont plan on working there forever. I'd like to work for atmel someday.
[22:30:37] <sjokkis> Where do you live?
[22:30:44] <bss36504> But I graduate with my BS EET in the spring. I'm in VT USA
[22:30:55] <bss36504> I go to Vermont Technical College
[22:31:02] <sjokkis> I'm honestly not sure what Atmel does in the US
[22:31:07] <sjokkis> All the AVR stuff is here
[22:31:20] <bss36504> Yeah, I wouldnt mind going to Norway
[22:31:35] <bss36504> They have a design center in Colorado
[22:31:47] <sjokkis> What do they design there?
[22:31:48] * WormFood leaves
[22:37:30] <bss36504> possibly not a design center, not that I check wikipedia. It is however where they manufacture Xsense products. Im sure abcminuser could tell us more when he's online.
[22:39:21] <sjokkis> that's ok
[23:16:09] <TechIsCool> I have a question about progmem. If I have a static variable like a pwm location stored in progmem why can't I target it like normal?
[23:16:26] <TechIsCool> I get told the lvalue required as left operand of assignment