#avr | Logs for 2014-07-13

Back
[00:12:54] <ktims> can i trouble someone to send me iotn841def.inc?
[00:14:39] <randrews> Okay, well, I figured out one stupid thing I was doing. I was mixing up PORTB and DDRB
[00:14:48] <randrews> Which in hindsight I should have known because the CS wave on the scope didn't look right.
[06:13:20] <ivanshmakov> Tom_itx, randrews: What about http://www.roland-riegel.de/sd-reader/benchmarks/?
[06:13:35] <ivanshmakov> s|benchmarks/||, of course.
[07:27:41] <Tom_itx> ivanshmakov, i've got that one bookmarked as well
[07:32:37] <Lambda_Aurigae> http://danieldebruin.tumblr.com/tnt finally, a 3d printer without an ardweeny!
[07:32:45] <Lambda_Aurigae> and check out some of his other stuff as well.
[07:34:27] <ivanshmakov> Tom_itx: ACK. Actually, I’ve recently found that I /do/ have some DIP-case MCUs with more than 8 KiB flash (ATmega168V in this case; bought years ago), so I hope to finally get back at writing the tutorial (of a kind) on interfacing an SD card.
[07:35:01] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/logger/logger_breadboard.jpg
[07:35:08] <Tom_itx> that was my original test platform for it
[07:36:06] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/logger/SD_breadboard2.jpg
[07:36:17] <Tom_itx> that was a decent size card in 08 :D
[07:38:52] <Lambda_Aurigae> those links don't show anything here Tom_itx
[07:41:21] <ivanshmakov> Lambda_Aurigae: Try: https://web.archive.org/web/*/http://tom-itx.no-ip.biz:81/~webpage/logger/, etc.
[07:41:41] <Lambda_Aurigae> the rest of his page works, just not those particular links.
[07:41:42] <Tom_itx> http://tom-itx.ddns01.com:81/~webpage/logger/logger_breadboard.jpg
[07:41:45] <Tom_itx> does that?
[07:41:53] <Lambda_Aurigae> yup..that one works.
[07:42:36] <Tom_itx> http://tom-itx.ddns01.com:81/~webpage/logger/logger_thumb_index.php
[07:42:43] <Tom_itx> thumnails for that project
[07:42:49] <Lambda_Aurigae> yup.
[07:43:28] <ivanshmakov> Tom_itx: BTW, is it really necessary to use a non-standard TCP port number for HTTP here?
[07:43:35] <Tom_itx> in comparison, i just picked up a 64GB card the other day :)
[07:43:42] <Tom_itx> yes
[07:43:50] <Tom_itx> my isp blocks 80
[07:46:02] <Tom_itx> i know it's a PITA for some here...
[07:55:33] <ivanshmakov> Tom_itx: If you don’t mind releasing the contents under a free license (CC BY-SA 3.0, to be specific), I’d rather suggest you to move as much stuff as possible to Wikiversity.
[07:57:08] <ivanshmakov> (And to the Wikimedia Commons, obviously.)
[11:23:43] <Duality> what are structs?
[11:24:28] <Duality> are they arrays in disguise ?
[11:36:51] <ivanshmakov> Duality: More or less. One notable difference is that the members of a C struct may be of different types, while the members of a C array cannot.
[11:38:24] <kastein> Duality: they allow you to access named elements instead of numbered indexes, too, good if storing a set of data that isnt all the same type but needs to be kept together
[11:38:35] <kastein> you can make arrays of structs, too
[11:40:20] <kastein> also, check out unions. they allow you to do things like tell the compiler that this array of bytes and that struct with a float and a u32 are the same, stuff data in in one format and take it out in the other. very useful for handling network data in a structured way, etc
[11:41:00] <kastein> (some compilers may not support that, the standard doesnt require handling putting data in in one way and taking it out in another but almost all compilers handle it properly, verify before using)
[11:43:08] <Duality> yea unions i know what they are. but i don't see the use of them for me yet atleast
[11:50:07] <ivanshmakov> Duality: One another use for a C struct is that of a bitfield. Thus, it becomes possible to use foo.bar = 13; instead of something obscure, like foo = (foo & (~ (0x0f << 3))) | (13 << 3);.
[11:54:09] <Duality> ivanshmakov: i don't understand that.
[11:54:39] <Lambda_Aurigae> a struct is a container
[11:55:39] <Duality> Lambda_Aurigae: i know. but i don't understand the bit field part
[11:55:45] <Lambda_Aurigae> like, you can have a struct with an int x and int y and a string for description all inside.
[11:55:57] <ivanshmakov> Duality: Embedded programming implies memory constraints. For that reason, it’s typical for embedded programmers to use, say, one 8-bit integer while they need, say, 3 two-bit ones.
[11:56:16] <Lambda_Aurigae> bit field is not necessarily a struct thingie.
[11:56:28] <Lambda_Aurigae> I suggest reading the K&R Teach Yourself C book.
[11:56:48] <kastein> a better example would be mem mapped i/o. many i/o registers have a bunch of weird sized bitfields in them
[11:56:50] <Duality> i read that book
[11:57:02] <Lambda_Aurigae> it explains structs and all in it.
[11:57:18] <Duality> i know how structs work in c
[11:57:26] <kastein> you can define them in a struct, then just make a pointer to that kind of struct, set the pointer value to the i/o register address
[11:57:34] <Duality> but i was more thinking how c would interpret a struct like arrays and such
[11:57:44] <ivanshmakov> Lambda_Aurigae: I’m pretty sure that I’ll avoid reading any book by K&R by all means possible.
[11:57:46] <kastein> and now you can do stuff with the bitfields as if they were struct members instead of masking and shifting
[11:57:57] <Lambda_Aurigae> an array of a struct is just an array of a bunch of variables packed together.
[11:58:11] <Lambda_Aurigae> ivanshmakov, why? they wrote the book for the programming language they wrote.
[11:58:34] <Duality> that book is what got me into C :)
[11:58:50] <ivanshmakov> Lambda_Aurigae: The current version of C (that’s C11) was ratified, like, years after that book was written.
[11:59:15] <Lambda_Aurigae> but C is still C..they have added stuff to it, yes, but that book is awesome for beginners.
[11:59:57] <Lambda_Aurigae> http://en.wikipedia.org/wiki/Bit_field there is a struct for bit field in this wiki entry...
[12:00:38] <Duality> except the grammer isn't the same for small parts. i couldn't compile their examples
[12:00:47] <Duality> but i figured it out with some compiler flags :)
[12:04:54] <Lambda_Aurigae> I remember using structs to build primitive classes in C...you would have a struct containing variables and pointers to functions, which is basically what a class is.
[12:10:30] <ivanshmakov> Lambda_Aurigae: Did you ever looked at libXt and the libraries built upon it? They do it exactly that way. And they even do inheritance by stacking structs!
[12:12:13] <Lambda_Aurigae> never looked at that.
[12:12:57] <Lambda_Aurigae> had a guy from Sandia National Labs give me that K&R Teach yourself C book back in the mid 80s then he showed me how to do the "class" thing in C before I ever heard of C++
[12:14:58] <ivanshmakov> Lambda_Aurigae: That book probably was a good reading back then. Nowadays, I wouldn’t really recommend it to anyone.
[12:15:24] <Lambda_Aurigae> I don't know of any better beginner C book myself.
[12:17:09] <ivanshmakov> Lambda_Aurigae: I didn’t say that I know a decent beginner C book myself, either.
[12:18:15] <ivanshmakov> Besides, a “beginner” may mean at least two things: an advanced programmer which doesn’t know C, or an entirely novice programmer which for some reason wishes to learn C (as in: as his or her first language.)
[12:18:35] <Lambda_Aurigae> to my knowledge, everything in that book is still relevant and in the current C implementation...just things have been added.
[12:19:31] <Lambda_Aurigae> although I could be completely off my rocker(which is likely true anyhow)
[12:20:49] <ivanshmakov> Lambda_Aurigae: The thing that’s likely to bother a beginner nowadays would be how to render HTML, or how to build GUI interfaces, or at the least how to handle /text./ These topics were largely non-existent at the time it was written.
[12:46:44] <Lambda_Aurigae> ivanshmakov, but that's not C...it might use C but it's not C.
[12:47:54] <Lambda_Aurigae> classics are still the best.
[12:48:02] <Lambda_Aurigae> I'm watching Police Academy right now.
[12:48:12] <Lambda_Aurigae> Just past the podium scene.
[12:51:41] <Duality> Lambda_Aurigae: actually i thought about it a while back. (the c class struct thing)
[12:52:17] <Lambda_Aurigae> you don't quite have the isolation that C++ classes give you but it's basically the same thing.
[13:05:45] <ivanshmakov> Lambda_Aurigae: Well, to me, “classics” would mean a book on CP/M, not on C.
[13:06:25] <Lambda_Aurigae> go back farther than CP/M
[13:08:49] <ivanshmakov> Lambda_Aurigae: Besides, /not being part of the standard/ is by no means the same as /not being part of the stuff you need to know for your C programming./ Though by “text handling” above I’ve meant something like wprintf (), which /is/ part of ISO C11.
[13:48:03] <Jartza> hola
[13:52:27] <Duality> hi
[14:25:35] <Jartza> d'oh
[19:18:52] <DrLuke> hi
[19:19:16] <Lambda_Aurigae> lo
[19:26:07] <nullset> hi
[19:26:58] <N1njaneer> Sup!
[19:30:30] <Tom_itx> ey
[19:30:32] <Tom_itx> h
[19:33:10] <Lambda_Aurigae> fgdfrte
[19:33:45] <Tom_itx> saleae analizer software ver 1.1.15 runs fine on my linux box but nothing newer will run
[19:34:11] <Tom_itx> can't quite figure that out
[20:59:37] <hackvana> rue_house: Where is tobbor?
[20:59:44] <DrLuke> We demand more tobbor!
[20:59:55] <Tom_itx> been gone for some time now
[21:00:12] <DrLuke> Did it go to robot heaven?
[21:01:53] <hackvana> Who am I going to play the cannuck/yankee dance with now?
[21:02:17] <DrLuke> cannuck!
[21:03:43] <DrLuke> Plot twist: I'm not a yankee, so you can't reply :(
[21:08:37] <hackvana> nullset: I see what you did there
[21:09:03] <nullset> :)