#avr | Logs for 2015-12-07

Back
[00:46:01] <rue_house> http://ruemohr.org/~ircjunk/projects/wallclock/p1070558.jpg
[00:46:02] <rue_house> go big
[00:47:43] <rue_house> http://ruemohr.org/~ircjunk/projects/wallclock/p1070500.jpg
[01:03:18] <Mr_Sheesh> rue_house - I'm interested in how they made those digits, if they didn't buy them
[01:08:08] <rue_bed> cnc
[01:08:11] <rue_bed> foam
[01:08:19] <rue_bed> painted with stain
[01:09:51] <rue_bed> everyone seems to want some ,I should get my cnc busy
[01:21:33] <Mr_Sheesh> Are you using LED tape to backlight the foam or whatever that's the segment diffusers?
[01:24:05] <Mr_Sheesh> (also what is the segment diffuser made of? Curious, thinking some sort of acrylic square rod or ?)
[01:44:11] <Haohmaru> what did i miss? ;P~
[01:45:46] <Casper> everything!!
[02:30:06] <Haohmaru> :~(
[06:33:56] <Jartza> good day
[07:18:05] <Lambda_Aurigae> prove it.
[07:34:50] <Jartza> hehe
[07:35:17] <Jartza> well, got my accelerometer-driver working, for me it's good :)
[07:43:38] <drymek> Hi, do you know where I can find any info about TDD for AVRs?
[08:02:15] <nuxil> tdd ? as in test driven development ?
[08:06:25] <nuxil> Jartza, what are you making now?
[08:07:17] <Jartza> nuxil: ahh, this accelerometer-driver is work-related
[08:07:49] <Jartza> making a sport watch :)
[08:07:49] <nuxil> ok.
[08:08:06] <Jartza> http://www.suunto.com/
[08:08:07] <Jartza> :)
[08:09:25] <nuxil> so youre a watch/clock maker?
[08:10:06] <Jartza> not really, I'm one of the coders
[08:10:19] <Jartza> in embedded-dept
[08:10:36] <Jartza> making a new platform for future products
[08:10:53] <nuxil> thats cool.
[08:11:36] <nuxil> tel me.. that vga thingy you made.,, did you do most of the code in assembly?
[08:12:34] <Jartza> it's all assembly
[08:12:41] <Jartza> https://github.com/Jartza/octapentaveega/blob/master/vga.asm
[08:12:44] <Jartza> there's the source
[08:13:27] <nuxil> thats impressive
[08:13:59] <drymek> nuxil: Yes, Test Driven Development
[08:15:27] <nuxil> well drymek cant help you.. im a noob, just started messing with avr. maybe Jartza , Lambda_Aurigae knows :p
[08:16:35] <drymek> nuxil: I’m in the middle of my very first book about AVR, but this is not excuse ;-)
[08:18:08] <Jartza> so what about TDD and AVR? :)
[08:18:24] <Jartza> I've done TDD on AVR, but TDD is more about practices and process, not platform
[08:18:37] <Jartza> yes, I've done automated tests for stuff, running AVR code in simulator
[08:19:07] <drymek> Jartza: sure it’s not about platform, but you need platform specific tools to do it.
[08:19:43] <drymek> I’m a beginner so I’m looking for a resource about that. How to install simulator (and which).
[08:19:44] <Jartza> depends.
[08:19:55] <Jartza> but simulator is nice if you want to automate tests
[08:20:05] <Jartza> automating tests in hardware is much harder
[08:20:13] <Jartza> I would suggest simavr or simulavr
[08:20:25] <Jartza> but it depends on the platform you're using (win/linux/mac?)
[08:20:33] <drymek> mac
[08:21:00] <drymek> I already have CrossPack
[08:21:39] <drymek> it contains simulavr
[08:22:16] <drymek> I’ve tried to run my very simple app on it, but without success. Thats why I’m looking for resources.
[08:23:08] <Jartza> ahh
[08:23:35] <Jartza> what kind of problems you're having?
[08:23:48] <drymek> it is very likely that I produce bad elf file: https://github.com/drymek/CMake-for-AVR/blob/master/gcc-avr.cmake#L64
[08:23:49] <Jartza> I don't remember if crosspack includes avr-gdb
[08:24:38] <drymek> Includes. GNU gdb (GDB) 7.6.1
[08:25:44] <drymek> I’m running it with simulavr file.elf but it’s printing help file.
[08:26:16] <Jartza> simulavr -d attiny85 -f file.elf
[08:26:25] <Jartza> and replace attiny85 with your chip and file.elf with elf
[08:26:31] <drymek> I have also do that.
[08:26:31] <RikusW> Hi Jartza, seems the tracking number is active now :)
[08:26:38] <Jartza> RikusW: nice! :)
[08:26:45] <Jartza> drymek: and the output is?
[08:27:15] <drymek> I have atmega328. I will do that in few minutes and will let you paste exactly output, ok?
[08:27:27] <drymek> *without let ;-)
[08:27:33] <Jartza> hmm
[08:27:46] <Jartza> run "simulavr -L"
[08:27:59] <drymek> atmega32
[08:28:06] <Jartza> my build for example doesn't have atmega328p as supported chip
[08:28:14] <drymek> shall I compile for atmega32 or atmega328p ?
[08:28:39] <Jartza> atmega32 is different chio
[08:28:41] <Jartza> chip
[08:29:34] <Flutterbat> isnt the atmega328p a bigger atmega88?
[08:29:44] <Jartza> drymek: try simavr?
[08:29:45] <Flutterbat> bigger as in more flash
[08:29:53] <drymek> phisical size is the same.
[08:29:58] <Flutterbat> yeah
[08:30:06] <drymek> yes, different mem size only.
[08:32:04] <Jartza> it seems my simavr (on osx) supports atmega328 & atmega328p
[08:32:15] <drymek> hm…
[08:32:59] <drymek> simulavr -d atmega -f app.elf -> prints help message as well
[08:33:19] <Jartza> there's also no such device as "atmega"
[08:33:26] <Jartza> simulavr -L lists the devices
[08:33:33] <drymek> sorry, my fault.
[08:33:36] <Jartza> and you can only use those devices
[08:34:03] <drymek> -d atmega32 same output :/
[08:34:18] <Jartza> try simavr
[08:34:24] <drymek> I guess simavr will be good choice :-)
[08:35:43] <drymek> https://github.com/buserror/simavr that one, right?
[08:36:14] <Jartza> yes
[08:40:30] <drymek> it’s not ready for avr tools form cross pack, will take me a while
[08:46:22] * BusError agrees ;-)
[08:50:23] <Jartza> though, simavr had some problems with timers on attiny85
[08:50:30] <Jartza> so I couldn't really test my vga code on it :)
[08:53:07] <drymek> so I’ll not use attiny ;-)
[08:55:00] <Jartza> drymek: I guess my vga-code is a bit extreme example anyway :P
[08:55:11] <Jartza> as it's running some cycle-accurate thingies
[09:01:58] <drymek> btw: is there any „testing framework” or should I forgot my expirience in web development? :-)
[09:09:45] <nuxil> so. whos up for some noob helping :p im verry confused on how to set ports as output and how to set them low/high
[09:09:56] <nuxil> http://pastebin.com/fVUUsByy
[09:10:14] <nuxil> pls give me an example :p
[09:10:51] <drymek> http://dostmuhammad.com/easyavr-h-header-file-for-pinport-operations/
[09:11:06] <drymek> Thats look pretty nice,
[09:11:35] <drymek> the „raw” version: https://github.com/drymek/CMake-for-AVR/blob/master/main.c
[09:12:34] <drymek> This main.c says: „Set port B as output” and than: switch on, wait, switch off, wait, repeat.
[09:12:52] <drymek> Whole port (8 pins).
[09:13:05] <nuxil> thats just a blink example the last one. and it sucks as it uses all ports.. besides it could have been written like PORTB ^= 0xFF in the while loop :p
[09:13:07] <Jartza> nuxil: use PB with DDR :)
[09:13:29] <Jartza> nuxil: and if you want to just set unique bits, you should use |= instead of =
[09:13:46] <Jartza> so DDRB |= (1 << PB3) | (1 << PB4);
[09:14:06] <nuxil> ok.. but what about setting individual ports high/low.
[09:14:12] <drymek> nuxil: Than you will not see instruction for on/off options :P
[09:14:22] <Jartza> setting pins low you should use PORTB &= ~(1 << PB3) for example
[09:14:36] <Jartza> & is bitwise AND
[09:14:58] <nuxil> ~ is ? i know << is left shift
[09:15:06] <Flutterbat> bitwise negation
[09:15:18] <Flutterbat> 1001 > 0110
[09:15:26] <nuxil> ah
[09:15:35] <Jartza> "ones complement" in other name
[09:15:56] <Jartza> nuxil: http://www.tutorialspoint.com/cprogramming/c_operators.htm
[09:16:15] <Jartza> nuxil: are you familiar with bitwise operations and logic as such?
[09:16:25] <nuxil> yea
[09:16:32] <Jartza> those PB1, PB2 are basically just bit numbers
[09:16:34] <nuxil> but not so much in C
[09:16:50] <Jartza> PB7 for example in many MCUs is defined as "7"
[09:16:50] <rue_house> Mr_Sheesh, 1W bead leds, air light pipes, paper diffuser
[09:17:34] <Jartza> that's why you need the bit shift
[09:18:04] <Jartza> PORTB &= ... is same as PORTB = PORTB & ...
[09:18:17] <Jartza> also DDRB |= ... is same as DDRB = DDRB | ...
[09:19:13] <nuxil> thanks
[09:19:40] <Flutterbat> nuxil: you could write a macro to make it more readable
[09:20:05] <drymek> there are macros in easyavr.h ;-)
[09:20:15] <nuxil> no. i like it raw and hardcore :p i need to learn it anyway before i start to dive into macros
[09:20:24] <Flutterbat> drymek: is that a standard lib?
[09:20:24] <drymek> :D
[09:20:40] <drymek> Flutterbat: not a standard but pretty common.
[09:21:02] <Flutterbat> i see. never heard of it
[09:21:06] <drymek> already done and popular. And it’s about 30 lines of code, so you can read and chack.
[09:24:20] <drymek> Jartza: simavr stops on „Load HEX flash 00000000, 184” I guess it’s working, and now it’s time to connect with gdb, right?
[09:37:22] <rue_house> #define OUTPUT 1
[09:37:22] <rue_house> #define INPUT 0
[09:37:28] <rue_house> DDRA = (INPUT << PA0 | INPUT << PA1 |INPUT << PA2 |INPUT << PA3 |INPUT << PA4 |INPUT << PA5 |INPUT << PA6 |INPUT << PA7);
[09:38:41] <rue_house> #define IsHigh(BIT, PORT) (PORT & (1<<BIT)) != 0
[09:38:41] <rue_house> #define IsLow(BIT, PORT) (PORT & (1<<BIT)) == 0
[09:39:08] <rue_house> /if (IsHigh(3, PINB)) { explode(); }
[09:53:08] <drymek> simavr looks like rocket science for beginners….
[09:54:22] <drymek> shall I change my code to include simavr file or I’m missing something?
[10:47:09] <RikusW> How many of you know about "trinary hybrid multilevel inverters" ?
[10:48:39] <LeoNerd> That's a lot of fancy words
[10:49:29] <RikusW> it uses multiple h-bridges with voltages increasing 1 3 9 27 81
[10:50:04] <LeoNerd> That sounds decidedly odd... how are you going to add those voltages?
[10:50:26] <RikusW> its used for DC/AC
[10:50:56] <RikusW> 1 2(3-1) 3 4(3+1) 5(9-3-1) etc
[10:51:33] <LeoNerd> Yesyes; I'm aware of trinary logic generally
[10:51:50] <LeoNerd> But surely to use this to output a variable voltage, you need to add them together
[10:52:02] <RikusW> using h-bridges
[10:52:05] <LeoNerd> I could imagine a variable current source that added current sources at 1mA 3mA 9mA etc..
[10:52:38] <LeoNerd> But I don't see how you're going to add voltages at power, unless they're all isolated floating wrt. each other
[10:53:00] <RikusW> they need to be isolated yes
[10:53:34] <RikusW> using bidirectional dc/dc converters to absorb reactive power
[10:54:28] <RikusW> super-lift inverters is another elegant idea
[10:57:08] * RikusW is reading Advanced DC/AC Inverters by Fang Lin Luo and Hong Ye
[10:58:58] <LeoNerd> I got my copy of AoE yesterday :)
[11:00:57] <RikusW> Age of Empires ? a new version ?
[11:01:36] <LeoNerd> 3rd Ed.
[11:01:56] <LeoNerd> Art of Electronics... Horowitz & Hill
[11:03:10] <RikusW> ah
[11:11:42] <RikusW> there is -> The Art of Linear Electronics as well
[13:36:25] <malinus> Do you guys think it could be worth it to make a small run of my sound-localization sensor? It seems there are no "arduino compatible" (hehe) "sound-localization-sensors" available out there.
[13:36:59] <malinus> I should make a kickstarer, right Jartza :3?
[13:38:17] <Tom_itx> absolutely
[13:38:37] <Tom_itx> that way you don't actually have to make it
[13:38:41] <Tom_itx> just collect the money
[13:38:50] <malinus> lol
[13:39:16] <malinus> Just a fancy video of a prototype and a couple of actors?
[13:39:42] <Tom_itx> uh huh
[13:46:11] <Jartza> malinus: sure, why not!
[13:46:37] <Jartza> maybe I should also kickstart arduino vga shield :D
[13:50:56] <malinus> oh you made that? I've seen a few people try, the timing gotta be tight :)
[13:53:16] <Jartza> malinus: https://github.com/Jartza/octapentaveega
[13:53:33] <Jartza> in the README there's a link to arduino shield board pic :)
[14:02:50] <malinus> Haha, cute!
[14:04:21] <Jartza> did you check the videos? :)
[14:04:30] <Jartza> yeah, it's attiny85 :P
[14:05:11] <malinus> Yep. Impressive, I didn't think you could pull it off at 20Mhz
[14:06:52] <Jartza> I didn't want to overclock :)
[14:08:33] <Jartza> you can run attiny85 @32MHz with overclocking, but yea... didn't want to
[14:11:03] <cehteh> liquid nitrogen cooled tiny :D
[14:12:02] <cehteh> mmh you cant increase the voltage .. the claming diodes will trip
[15:03:15] <maaarghk> hey, would you guys be able to recommend a forum or somewhere i can post asking for advice? i'm a total newbie to the world of AVRs with only a high-level understanding of the concepts; but I have a project idea in mind and could be doing with advice and guidance even with regards to where to look for information.
[15:03:35] <maaarghk> i'd ask here but i figure the questions are too specific
[15:04:16] <maaarghk> although something you might be able to help with is recommending a good, free diagramming / schematic design tool which works on os x? :)
[15:13:30] <Jartza> malinus: for pcb schematics? eagle works with osx
[15:13:59] <lald> there is an avr forum in /topic (avrfreaks.net)
[15:14:31] <Jartza> that too
[15:14:53] <lald> as for "too specific", what people do is use a pasting site for the verbose parts.
[15:14:56] <lald> like pastebin.com
[15:15:06] <Jartza> yeah
[15:15:32] <Jartza> and nothing wrong in specific questions
[15:16:26] <Jartza> oops, maaarghk, not malinus
[15:19:28] <lald> Anyone else planning on participating in StockFighter? It's an embedded security CTF, and the fake processors with be AVR8.
[15:19:48] <Yxven> I'm looking into it lald
[15:20:09] <lald> starfighters.io
[15:20:33] <lald> I'm pretty pumped about it, should be a lot of fun.
[15:20:38] <Yxven> I'm not sure what to think of it
[15:22:17] <maaarghk> laid: Jartza: thanks. I checked avrfreaks when I saw the /topic but it seems the entry level is a little bit above me. I might be mistaken though, but I couldn't see a "noobs" forum.
[15:22:19] <lald> How so?
[15:22:23] <Yxven> It seems like a lot of work for a game, and it's far from guaronteed to help your job prospects
[15:22:27] <maaarghk> I'll grab eagle. I was thinking along the lines of block diagrams for now
[15:23:32] <lald> Yxven: I guess I hadn't thought of it that way, I'll genuinely have fun.
[15:26:12] <Yxven> lald, Hopefully, it'll be fun
[15:27:16] <Yxven> lald, although, puzzle based games tend to be difficult to balance. I wouldn't be surprised if most people get stuck and give up early
[15:28:04] <lald> Mmhmm, maybe that is why they're having two tech trees.
[15:28:30] <lald> so you can play different kinds of puzzles if you get frustrated.
[15:29:14] <lald> I've spent just enough time reversing to learn to love the masochism of it and not enough to be good at it, so the timing is perfect for me.
[15:29:35] <Yxven> hmm, where are the two tech trees explained?
[15:29:42] <Yxven> I only got the email for the avr one
[15:30:03] <lald> I'll get you a link
[15:30:19] <lald> tl;dr second tech tree is finance based
[15:30:21] <Yxven> I don't know anything about low level programming, so I'm hoping to figure out the basics by friday
[15:31:15] <lald> http://www.kalzumeus.com/2015/08/20/designing-and-building-stockfighter-our-programming-game/
[15:31:53] <lald> I can send you some reccomended reading if you'd like.
[15:31:56] <lald> It is all very dry.
[15:32:28] <Yxven> That would be great thank you lald
[15:42:02] <lald> http://pastebin.com/vMR2ViJj
[15:42:08] <lald> you might also look at microcorruption.com
[15:42:34] <lald> it's tqbf's previous "game", and it's targetted at entry-level people
[15:42:59] <lald> which doesn't mean it isn't hard but does mean it is possible :)
[15:45:09] <Yxven> interesting, I thought this game was over
[15:46:07] <lald> I don't think they're planning on publishing more levels, and it's way too late to get first place on the leaderboard, but they're not taking it down that I know of.
[15:46:16] <lald> It's a recruitment tool for them, for one.
[15:53:32] <Yxven> Did you play microcorruption lald?
[15:55:05] <lald> Mmhmm, I haven't beaten it.
[15:55:13] <lald> It's fun and is how I learned asm.
[15:55:33] <Yxven> Any idea how many levels it has?
[15:57:15] <lald> 19 including the tutorial. Keep in mind though that MSP430 is a von Neumann architecture, you can do 90s things like redirect execution into the buffer you just used to smash the stack. AVR is Harvard, you have to be more creative.
[15:57:38] <lald> since data and code are con seperate busses.
[15:58:02] <maaarghk> i think i'm gunna play microcorruption actually
[15:58:13] <maaarghk> seems like an interesting wya to make that transition from software to hardware know-how
[15:58:23] <lald> Do it, it's a lot of fun, and it'll help you not write vulnerable code.
[16:08:12] <malinus> Jartza: cmon I thought you liked free stuff :)
[16:10:42] <Jartza> malinus: I do :)
[16:10:52] <malinus> Jartza: why eagle then :)
[16:11:02] <Jartza> I also like stuff that works :P
[16:11:08] <Jartza> kicad on osx is just plain horrid
[16:35:54] <Yxven> I'm off to a good start
[16:36:02] <Yxven> I finished the tutorial and I have no idea how to do the first level
[16:37:06] <Jartza> heh
[16:37:20] <Jartza> what you're trying to do?
[16:37:25] <lald> microcorruption.com
[16:37:30] <lald> ignore all the libc cruft
[16:37:39] <lald> got to the main function, take it one instruction at a time
[17:43:32] <Mr_Sheesh> rue_house - aah :) Someone suggested "Spin" as a diffuser, http://www.bhphotovideo.com/c/product/44001-REG/Rosco_RS300611_3006_Filter_Tough.html for example. Paper would do - TYVM :)
[17:45:19] <Casper> :D decoding of this remote goes well :D
[17:45:33] <Casper> next step: power on and off :D
[18:05:09] <Yxven> lald, do you have any advice on getting unstuck on this microcorruption?
[18:05:51] <Yxven> I figured out the first one. I feel like I understand the second one, but my understanding isn't leading to the correct password
[18:08:13] <Yxven> join #uctf
[18:08:17] <Yxven> erm
[18:23:26] <lald> Yxven: why don't you pm me since it's OT
[18:23:50] <lald> oh, i didn't know there was a channel for it
[18:23:51] <lald> neat
[18:31:27] <Jartza> darned microcorruption :D
[18:40:14] * Lambda_Aurigae prefers macrocorruption.
[18:41:50] <lald> Not enough room on a tiny BLE lock for macrocorruption
[18:45:46] <Lambda_Aurigae> with a big enough hammer we can increase the surface area 1000 fold!
[18:46:17] <lald> I like the way you think
[19:10:37] <Jartza> agh Reykjavik
[23:56:54] <rue_house> #define NOP() asm volatile ("nop"::)
[23:57:05] <rue_house> #define ABS(a) ((a) < 0 ? -(a) : (a))