#avr | Logs for 2013-11-06

Back
[03:26:48] <OndraSter_> g'dammit
[03:26:55] <OndraSter_> I could have been designing a card reader
[03:27:11] <OndraSter_> then I learned that I would need a certification for whatnot
[03:27:16] <OndraSter_> which I cannot do ofc
[03:27:40] <megal0maniac_afk> a certi what now?
[03:30:46] <OndraSter_> something about if fire would start then something about firemen
[03:30:51] <OndraSter_> no idea
[03:36:41] <specing> wat
[03:36:48] <specing> just make one
[03:36:54] <specing> fuck the governemnt
[03:36:59] <specing> fuck the system
[03:38:41] <OndraSter_> lol
[03:39:19] <OndraSter_> we might hack it later just to intercept the authroization data
[03:39:23] <OndraSter_> and connect it to our system
[04:23:34] <theBear> huh ? make one system, fuck the system ? but, but, then i'll have no systems :(
[04:25:05] <theBear> heh, been a week for it.... SERIOUSLY waterdamaged recentish airbook couple days ago, still in the 'backburner' pile for (more) mobo diagnosing, my 'new' machine it seems was being given away 'cos it had lived with a mouse infestation AND never been dusted, so spent most of today washing the stink off taht (shiny now, just gotta re-goop the heatsinks and cross the fingers :) and still gotta do the annoying
[04:25:06] <theBear> dodgy shuffle on this case/hds
[04:55:00] <megal0maniac_afk> OndraSter: Heh. Don't even have to do anything to the source for the scope. He's written it so that it switches to internal clock if crystal fails to start :)
[04:55:40] <megal0maniac_afk> And given that I already have USB with polyfuse, 3v3 vreg, that leaves only some caps and resistors and 3 ICs
[04:56:07] <megal0maniac_afk> And that's only for the analogue section. I can implement logic analyzer with no hardware or software change
[04:56:56] <megal0maniac_afk> Oh yeah, and do you have .hex for DFU bootloader?
[05:30:38] <megal0maniac_afk> Gah! No enumeration
[06:39:22] <Tom_itx> megal0maniac_afk there is source for bootloaders in one of the app notes
[06:43:57] <Tom_itx> 109 iirc
[07:29:31] <megal0maniac_afk> OndraSter_: ping
[07:31:47] <megal0maniac_afk> Or anyone who understands xmega clock system
[07:32:32] <megal0maniac_afk> Tom_itx: Thanks, I'll try that one again. Couldn't get it right last time, but maybe this time will be different ;)
[07:32:33] <Tom_itx> sry no but it's a pll system
[07:32:37] <Tom_itx> you can overclock
[07:33:44] <Tom_itx> megal0maniac_afk, you can get the bootloaders from atmel as well for U chips
[07:37:03] <megal0maniac_afk> Tom_itx: I'll look around
[07:37:15] <megal0maniac_afk> I'm trying to get this to use internal clock: http://pastebin.com/S6GhtYXM
[07:37:33] <megal0maniac_afk> Theoretically, it should be falling back to it, but I need to make sure
[07:42:07] <megal0maniac_afk> Whoo! It works
[07:55:40] <megal0maniac_afk> Except it doesn't :/
[09:37:11] <Gerritjan> hi all
[09:48:16] <Gerritjan> question im just starting with sam3x8e (DUE) is it better to program in ASF or somthing else
[10:00:05] <megal0maniac_afk> Gerritjan: Well if you're starting, then probably Arduino ;)
[10:01:08] <megal0maniac_afk> In all seriousness, you'd probably be better off doing stuff without ASF to begin with. ASF makes some stuff easier, but it also hides details. If you want to learn, then start by doing basic stuff in pure C and work your way up
[10:01:13] <megal0maniac_afk> NEVERMIND then
[10:02:19] * megal0maniac_afk is desperately trying to turn an xmega into an oscilloscope. But I think the host software is the real issue and I'm not about to spend $8 to test it on Android ;)
[10:03:24] <specing> why $8?
[10:05:43] <megal0maniac_afk> specing: Because the supported android app is $8
[10:06:23] <megal0maniac_afk> specing: I'm putting this onto an xmega256a3u http://www.gabotronics.com/oscilloscopes/xprotolab-plain.htm
[10:07:27] <megal0maniac_afk> The source is there, it's compiled for the chip, and I've modified it to use the internal clock. If it's working, I should be able to at least get logic analzyer working without external components
[10:18:02] <jadew> megal0maniac_afk, just write your own software
[10:19:39] <megal0maniac_afk> jadew: I have you seen this guy's stuff?
[10:20:04] <megal0maniac_afk> It'll be another couple of years before I even come close
[10:28:09] <kdehl> Aren't there any simple ICs that just consists of a resistor ladder, like a simple DAC?
[10:28:33] <jadew> megal0maniac_afk, doesn't look that complex
[10:30:30] <jadew> megal0maniac_afk, also, 2MSPS is complete garbage
[10:31:08] <jadew> you'll be able to see like... 200 Khz signals with 10 points resolution
[10:31:46] <kdehl> Oh, I found some. Nvm.
[10:31:53] <jadew> that's very low performance by the 80's standards
[10:32:19] <megal0maniac_afk> jadew: I suppose. But I already have all the stuff, and it's more useful than having nothing at all
[10:32:35] <jadew> indeed
[10:33:11] <jadew> you should save some money and get a real scope tho
[10:33:26] <megal0maniac_afk> I plan to
[10:33:39] <jadew> you might be able to get one for free that's better than what you get with that xmega :)
[10:34:49] <megal0maniac_afk> Oh yeah? How so?..
[10:35:18] <jadew> there's no use for sub mhz oscilloscopes anymore
[10:36:11] <jadew> some electronists do throw away stuff (most don't, but still)
[10:36:55] <megal0maniac_afk> Oh, yeah. Well I have a 15mhz analogue scope. But it's hardly portable :) Plan is for it to be an extension of my laptop. Practicals in the cafeteria kind of thing
[10:40:59] <shorted_neuron> then you can ask the ladies "want to see my arbitrary waveform generator?"
[10:41:44] <megal0maniac> shorted_neuron: I do that anyway. They don't know I'm talking about so they can't call my bluff ;)
[10:42:57] <megal0maniac> jadew: Something like the Rigol DS1052E is only $330. Makes it seem silly to buy any of the decent USB scopes, unless you really need that portability
[10:58:04] <jadew> megal0maniac, if I was getting my first scope now, I'd get either the 1000Z or the 2000 series
[11:04:33] <beaky> hello
[11:04:43] <beaky> what will be the output of my gpio if i power my avr with 3.3v
[11:04:46] <beaky> output voltage*
[11:05:02] <jadew> 3.3v
[11:05:48] <beaky> ah
[11:05:48] <megal0maniac> jadew: That 1000Z is very nice. Pity it all costs a gazillion dollars here :)
[11:06:12] <jadew> it costs a gazillion in here too :)
[11:38:21] <Gerritjan> whats the best way to program the Sam3x8e (DUE) with asf of the other code?
[11:41:10] <Gerritjan> nobody?
[11:43:08] <ambro718> huh? "asf of the other code"?
[11:43:32] <ambro718> if you want it quick and easy use atmel studio which has built in asf
[11:43:36] <Gerritjan> i mean or use the arduino software so its compiled and easy to use
[11:44:16] <ambro718> arduino is for kids
[11:44:24] <bitd> lal
[11:44:26] <Gerritjan> because there is a little information about the Arduino DUE but more about the sam3x8e
[11:44:33] <bitd> You tell em ambro718
[11:44:40] <Gerritjan> hahaha
[11:45:24] <Gerritjan> and i did install atmel studio and there is a project for the Sam3x8e chip and thats why im asking
[11:45:26] <specing> its funny because its true
[11:45:42] <bitd> Its funny because hes fat <.<
[11:45:52] <Gerritjan> :'(
[11:46:23] <bitd> http://www.youtube.com/watch?v=fee9zb-YCTA
[11:46:30] <Gerritjan> oke so the best way to code it is asf?
[11:48:30] <Gerritjan> or stop and play with other kids? :)
[11:49:16] <jadew> asf is such a misfortunate name...
[11:49:29] <jadew> it's only missing a d to make it look like complete garbage
[11:49:53] <jadew> like you're hitting keys test something that doesn't really matter
[11:50:07] <specing> hahah
[11:51:23] <Gerritjan> thats not wat i want to do if i want to do it right lets do it right :)
[11:51:54] <ambro718> is there any comprehensive guide how to use asf with arduino due without avr studio (on Linux, starting just with an arm compiler)?
[11:52:18] <ambro718> i.e. how to compile and link it, the includes and linker scripts
[11:52:27] <ambro718> and how to upload via serial
[11:53:27] <bitd> Just write the damn code yourself.
[11:53:32] <bitd> You might actually learn something
[11:53:42] <ambro718> huh? what code?
[11:54:09] <bitd> I was refering to the ASF libraries.
[11:56:16] <User> sorry disconnection :S
[11:56:49] <bitd> Vervelend he? :P
[11:56:54] <Gerritjan> ja
[11:57:03] <Gerritjan> ./cry
[12:23:51] <megal0maniac> BusError: ping
[12:24:31] <BusError> megal0maniac, ?
[12:26:37] <megal0maniac> http://i.imgur.com/KJhQPjkl.jpg
[12:27:22] <megal0maniac> Minus the level shifting, alas :)
[12:28:17] <BusError> hehe and thru hole. very 1985 ! :-)
[12:28:30] * BusError doesn't do anything bigger than 0402 if he can ;-)
[12:28:56] <BusError> but very neat, must be a royal pain to bend the pins etc?
[12:29:31] <megal0maniac> The I2C pullups are on the other side, and they're actually 0805. Other than that, all through-hole. I've gotten good at bending the pins in the right places :P
[12:30:25] <megal0maniac> It's funny because when I started with this stuff, a 1/4w resistor was tiny. Now they're HUGE and I just want to surface mount everything. Perspective changes somewhat
[12:30:31] <megal0maniac> And thanks :)
[12:31:35] <BusError> yeah for a while I tought 0805's were tiny. Now I'm looking at 0201s thinking they migth be doable :-)
[12:31:59] <BusError> but, nahh. too much trouble; I think I'll stick with 0402's :-)
[12:32:26] <megal0maniac> I think I'll stick with 0805 and SOT23. They fit nicely onto veroboard XD
[12:33:16] <BusError> true I use that quite a bit too, for a quicky
[12:35:09] <megal0maniac> Apparently they do pcb fab at university. I'm pretty sure it's old school, but I'm keen to check it out. Keep forgetting
[12:35:20] <megal0maniac> Here's the ugly bit http://i.imgur.com/yg0o6Co.jpg
[12:35:28] <bss36504> Oh my god.
[12:35:35] <BusError> I do my own pcbs too, but really, with the like of oshpark, why bother?
[12:35:42] <bss36504> I just lost my lunch.
[12:35:50] <bss36504> + 1 for OSHpark
[12:36:01] <BusError> ergh. STRIPBOARD? darn didn't knew they still existed :-)
[12:36:06] <megal0maniac> bss36504: :D
[12:36:13] <bss36504> granted, megal0maniac isn't in the US, so maybe not OSHpark
[12:36:14] <megal0maniac> Let's not be dramatic
[12:36:21] <BusError> I use perfboard+kynar wire for my ugliest bits :-)
[12:36:22] <bss36504> Its pretty bad.
[12:36:30] <bss36504> :P
[12:36:52] <megal0maniac> bss36504: hackvana if anything, but it's usually a case of "i wonder if..." and then I have to make it immediately
[12:37:28] <megal0maniac> Plus it's more of a challenge and I haven't actually figured out the intricacies of pcb layout
[12:37:30] <BusError> my version of hacks: https://plus.google.com/111387094029238541867/posts/D4Gdbbq2MFw
[12:37:46] <bss36504> Ah I see. My school does some simple PCB fab too, but no soldermask, no plating so I'd rather just pay somewhere to do it for me.
[12:39:49] <megal0maniac> BusError: I raise you http://i.imgur.com/Z1DEV.jpg
[12:40:08] <megal0maniac> bss36504: Don't click that one
[12:40:41] <BusError> I don't do "final" projects on perfboard, only prototypes; with place for probes etc
[12:40:47] <bss36504> yuck.
[12:40:48] <BusError> I do sometime full projects on a full size one tho
[12:41:10] <bss36504> I just skip to PCBs for protoypes or perfboard for one offs. Usually though, I try and keep it neat
[12:41:11] <megal0maniac> BusError: I'm a student. So everything is a prototype :D
[12:41:26] <megal0maniac> I'm getting better at the neatness thing
[12:42:01] <BusError> try perfboard, a lot neater
[12:42:14] <megal0maniac> I've ordered some
[12:42:22] <bss36504> also, I generally use through hole for perfboards.
[12:42:58] <BusError> actually 0805's and SOT23's are prettu much perfect to fit between 'pads', very quick
[12:43:35] <BusError> eurocard perfboard fit into quit ea few enclosures too, if you want to neat the project
[12:43:44] <megal0maniac> Then there was this which I found on the ground, in the casing for a cheap selectable voltage PSU. It had LED indicators for each voltage so I took the liberty of adding resistors to use for uCs. Pity it only has 7 LEDs http://i.imgur.com/4S4IOJsl.jpg?1
[12:44:17] <bss36504> http://i.imgur.com/SJFuuIB.jpg
[12:44:28] <megal0maniac> BusError: Like this http://i.imgur.com/4MTgAl.jpg
[12:44:54] <BusError> bss36504, oshpark++ :-)
[12:44:55] <megal0maniac> OSHPARK!!
[12:45:01] <megal0maniac> Heh :)
[12:45:07] <bss36504> good stuff. This is Rev 4 and it worked like a charm.
[12:45:16] <megal0maniac> Good grief what is that black thing??
[12:45:20] <bss36504> That board is for a demo at work, came out pretty nice.
[12:45:25] <bss36504> Oh the silo looking thing on the right?
[12:45:31] <bss36504> Its a socket for an 18LCC chip
[12:45:42] <megal0maniac> Why is it so damn high?
[12:45:54] <BusError> https://plus.google.com/111387094029238541867/posts/EoocMTBXjzG <- replace a m644 (DIP) with a STM32 board :-)
[12:46:05] <bss36504> Our memory is in an 18LCC at this stage, since it's still under development. Final package will likely be a TSSOP8
[12:46:32] <megal0maniac> For lulz. Programming an attiny (instead of doing maths) http://i.imgur.com/XADPM1X.jpg
[12:46:38] <bss36504> Its tall because thats the way they made it :) doesnt matter though, it is a really good socket. works perfectly
[12:46:42] <megal0maniac> I like tssop
[12:46:53] <megal0maniac> BusError: Ooh, that is a cool idea
[12:46:56] <BusError> and my biggest oshpark board up to now: https://plus.google.com/111387094029238541867/posts/ZvYuDe2RUaG
[12:47:53] <megal0maniac> Sweet :)
[12:48:30] <bss36504> Thats nice, I need to make one of those. I use my trusty hot air station and a syringe of solder paste to hand place and reflow everybody
[12:49:15] <bss36504> Oh and BusError, fun fact: If you put your text in the soldermask restrict layer, your lettering comes out gold and it looks awesome.
[12:51:04] <BusError> bss36504, ohh cool, I'll have to try that :-)
[12:51:13] <BusError> blingy
[12:51:56] <bss36504> Yeah, when I have space, I like to test out board art as much as i can. What program do you use for your layout?
[12:52:33] <BusError> Eagle
[12:52:41] <bss36504> Ah, me as well.
[12:52:47] <BusError> tried Kicad, but it's just too brain damaging
[12:52:56] <bss36504> It gets the job done, since work isn't going to shell out for anything Cadence.
[12:52:58] <BusError> Eagle is not terrific, but Kicad is total bonkers
[12:53:04] <bss36504> Kicad makes me want to cut myself
[12:53:06] <bss36504> it's horrible.
[12:53:12] <BusError> same
[12:53:35] <megal0maniac> Maybe that's why I haven't managed to figure it out
[12:53:53] <BusError> I'm goign to do BGAs next... I'm telling myself it can't be that hard really
[12:53:55] <bss36504> In my opinion, eagle gets the job done with no fancyness and an intuitive UI. However, I wish they had some of the fancy features like trace and via bumping, etc
[12:54:17] <bss36504> It sucks having to manually expand a group of traces just to fit in a single via
[12:54:19] <BusError> I use freerouting, in conjunction with eagle now
[12:54:43] <BusError> export the ULP, fifddle with the "push" of freerouting, re-export back to eagle. works
[12:54:49] <bss36504> Freerouting is pretty cool too, I just like doing manual layout. As I do the layout I get a better feel for where things should go
[12:55:16] <BusError> oh I also manual route, but freerouting has a manual mode that does push/pull
[12:55:24] <bss36504> Oh does it?
[12:55:26] <bss36504> cool
[12:55:32] <bss36504> I'll have to check it out
[12:56:14] <BusError> yep, worth exploring a bit. it's not /fantastic/ but you can definitly route boards with it, with a bit of learning. too bad the guy no longer works on it, it's a fantastic tool
[12:56:26] <BusError> ie potential;
[12:57:18] <BusError> (afk, bbl)
[13:12:25] <N1njaneer> Altium has about a half-dozen different routing modes, which make it really nice to do board layout.
[13:12:54] <bitd> Gahh Altium.
[13:12:57] <N1njaneer> Though honestly I tend to just use "Ignore", "Push and Shove", and "Hug" modes most often.
[13:13:00] <bitd> Makes me want to curl up and cry :P
[13:13:10] <N1njaneer> bitd: Why? :D
[13:13:22] <bitd> Its good I know, I just really like the easy simple eagle.
[13:13:33] <bitd> Cause first of, I have to boot to windows.
[13:13:35] <N1njaneer> If all you need to do is simple, then use the simplest solution. :)
[13:14:00] <N1njaneer> But when I need to do multi-layer boards which are pushing the boundaries of what the board house can even fab, I need more tweaky ability.
[13:14:11] <bitd> :-)
[13:14:24] <N1njaneer> Also, Spaaaaaaaaaaaace Mouse!
[13:14:55] <N1njaneer> Doing board layouts without SpaceMouse for nav is like trying to do CAD work without a hand.
[13:15:34] <bitd> I have used spacemouse in Inventor, never in altium though.
[13:15:36] <N1njaneer> Because you can move around and zoom without having to click away from laying traces.
[13:16:04] <N1njaneer> It's amazing in Altium. Only 3DOF, but the speed buttons are super-handy for initiating routing, plopping vias, flipping boards, moving between layers, etc.
[13:16:27] <N1njaneer> And the slightly older models on eBay are really inexpesive
[13:17:14] * megal0maniac downloads Eagle
[13:17:45] <bitd> Haha :P
[13:46:49] <bss36504> N1njaneer: What does a license of Altium go for?
[13:57:51] <megal0maniac> I keep turning all my structs into typedef structs. Is this bad?
[13:58:36] <megal0maniac> In the definition. So I use box_t instead of struct box
[13:58:44] <bss36504> not bad. typedef struct just saves you from having to type struct <structType> <instanceName>
[13:59:13] <megal0maniac> Okay good. I'm trying to make sure that none of the innocent stuff I do now is going to hurt me later :)
[14:00:02] <megal0maniac> And it's quickly turning into a habit
[14:00:12] <bss36504> thats a good idea
[14:00:32] <megal0maniac> I mean the typedef thing, not the checking :P
[14:00:49] <bss36504> ah, well either way, good job
[14:01:15] <megal0maniac> n00b programmer doesn't want to make people lose their lunch
[14:01:32] <bss36504> keep the n00b soldering out then :P
[14:01:37] <bss36504> ^kidding
[14:01:57] <megal0maniac> :D
[14:02:36] <megal0maniac> I love C
[14:03:04] <bss36504> Oh no, beaky syndrome has spread to megal0maniac!
[14:03:19] <megal0maniac> :O
[14:03:30] <megal0maniac> bss36504: I can do a little better http://i.imgur.com/T5qYIOh.jpg
[14:03:41] <bss36504> not too shabby
[14:04:47] <learath> yeah that's not too bad
[14:04:55] <learath> looks like it needs cleaning
[14:04:56] <learath> a lot
[14:05:16] <megal0maniac> I did do that
[14:05:30] <megal0maniac> Also needs more focus :)
[14:05:32] <bss36504> Isopropyl and a hearty brush
[14:14:34] <megal0maniac> I love floats
[14:16:24] <megal0maniac> They make up numbers for the decimal points you don't specify. 155.753 becomes 155.753006
[14:16:58] <megal0maniac> Pity the SAM D20 doesn't have an FPU
[14:17:24] <bss36504> Do you really love them>
[14:17:25] <bss36504> ?*
[14:18:10] <megal0maniac> The way they work is pretty cool
[14:18:31] <bss36504> I suppose
[14:18:32] <megal0maniac> And the random values don't bug me, they'll be truncated in the output
[14:19:10] <megal0maniac> Programming exam in... 11 hours :)
[14:19:48] <megal0maniac> Thought I'd be brain picking a lot more than I did tonight. Things are going well
[14:20:03] <bss36504> good luck. C programming?
[14:21:42] <megal0maniac> Thanks. And yip. Think I'm pretty ready
[14:22:17] <megal0maniac> It basically doesn't resemble AVR programming whatsoever, after the includes, defines and main()
[14:22:42] <bss36504> What will you be tested on?
[14:23:51] <megal0maniac> It's programming 1, so all the basic stuff. Functions, structs, pointers, passing by value/reference, header files, and general good programming style
[14:25:04] <megal0maniac> I know I'll pass, but I'd like a distinction, because I'm not getting one for maths :P
[14:25:46] <bss36504> haha I know the feeling.
[14:26:00] <bss36504> Well good luck
[14:28:39] <megal0maniac> Thanks :)
[14:29:57] <N1njaneer> Good luck, mega!
[14:30:16] <N1njaneer> You seen quite competent on the programming side from chatting here. I'm sure you'll do fine! :D
[14:35:14] <N1njaneer> Helpful hint for today - make sure chips are soldered in the right way round
[14:35:26] <bss36504> That is important
[14:38:44] <megal0maniac> N1njaneer: Thanks!
[14:39:04] <megal0maniac> Luckily, no chips and no soldering. Sorting arrays and making structures and nonsense like that :)
[14:39:18] <megal0maniac> I love Spawner
[14:39:27] <bss36504> you gotta do a bubble sort
[14:39:35] <megal0maniac> Yip
[14:39:54] <megal0maniac> Spawner generates random data sets for me to practise my l33t skillz
[14:40:51] <bss36504> oh wow, spawner would have helped me about a month ago...
[14:42:45] <megal0maniac> It's pretty great. Even populates mysql dbs
[14:43:53] <megal0maniac> Okay, goodnight! :)
[14:43:59] <bss36504> goodnight
[14:44:10] <N1njaneer> Nigh!
[14:44:14] <N1njaneer> +t
[14:57:29] <antto> for some reason, i always read that as "inkjetuino"
[14:58:05] <inkjetunito> :)
[15:06:23] <N1njaneer> Do you print things, Injectunito?
[15:06:32] <N1njaneer> Can I send things to your spooler?
[15:06:47] <N1njaneer> Er inkjetunito
[15:06:50] <inkjetunito> yes, send me things
[15:07:23] <N1njaneer> antto: Could be injectuino -- the digital hobbiest syringe that runs on AVR
[15:08:08] <inkjetunito> iirc there was some *uino for controlling fuel injection aswell
[15:08:57] <N1njaneer> GetGirlsuino
[15:10:02] <inkjetunito> uno, due, agire
[15:10:07] <antto> ;]
[16:32:41] <OndraSter_> http://d24w6bsrhbeh9d.cloudfront.net/photo/aWZxYBn_700b.jpg
[16:32:43] <OndraSter_> I need that cat
[16:33:42] <malinus> OndraSter_, you can borrow my cat, especially if your hands have problems with some emacs-commands: http://i.imgur.com/WlZihHa.jpg
[16:34:15] <OndraSter_> :D
[17:24:09] <hetii> Hi :)
[17:26:13] <hetii> I have such simple code: http://pastebin.com/hxPFii05, When i press SW1 on display i got 1234 when SW2 4321, those states should stay until i press sw1 or sw2 but when i enable TCCR1B interrupt those number are displayed till i keep pressing sw1 or sw2. Why ?
[17:27:39] <hetii> In another word if i release button my number are not displayed anymore.
[17:32:47] <hetii> I discover when i change isr(TIMER1_COMPA_vect) to ISR(TIMER1_COMPA_vect) then it works like expected.
[17:41:09] <timemage> hetii, depending on what you supplied for options to the compiler, it may be interpreting the former as int isr(int TIMER1_COMPA_vect) {
[17:41:23] <timemage> hetii, vs invoking the macro to add whatever attributes.
[17:42:37] <hetii> hmm
[17:43:20] <timemage> hetii, C is case sensitive, but then you probably knew that.
[17:45:46] <hetii> yep i know it, but need to see whats the different between this macro and function
[17:47:01] <timemage> hetii, cpp, gcc with -E or --save-temps. inspect the output/resulting file.
[17:49:55] <timemage> hetii, in short, it's going to evaluate to some stuff with a keyword like __atribute__ in it, which in tern is going to result in generating numbers place at the interrupt vectors.
[17:50:23] <timemage> heh, "tern".
[17:53:50] <hetii> ok, so this is something that i will investigate in some other time.
[17:53:59] <hetii> Other code: http://pastebin.com/1amLaVwa
[17:54:41] <hetii> When i press SW1 i just got 0 in display and then whatever what i press its blank.
[17:56:00] <N1njaneer> Where is SW1/SW2 read/debounced?
[17:57:39] <hetii> They are declared in atboard.h: http://pastebin.com/6k636hsF
[17:58:33] <hetii> btw i tested them in other code and they works.
[17:58:51] <N1njaneer> hetii: You realize that you aren't debouncing them and you will continue the same operation over and over until they are let up, correct?
[17:59:10] <N1njaneer> You are also not limiting the range.
[17:59:57] <N1njaneer> Check to make sure timer_seconds doesn't go below zero or above some maximum value before changing it.
[18:00:49] <N1njaneer> And you will need to either do state-change detection (from not-pressed to pressed) if you want them to only increment once, or else you will need to gate the condition so that it only fires so many times per second if you are holding the button down, so it will increment/decrement at some usable rate.
[18:01:46] <N1njaneer> As written, it will just roll super-fast up or down and be virtually unsettable.
[18:02:12] <N1njaneer> You are also not allocating space for msg
[18:02:24] <N1njaneer> You need to do "char msg[6]" or so
[18:02:28] <N1njaneer> At the top
[18:02:35] <N1njaneer> Not *msg
[18:02:51] <N1njaneer> That's uninitialized and will write in to RAM at some random location and corrupt anything in its path
[18:03:34] <N1njaneer> To be safe, it needs to be a minimum of "char msg[6];" in length to be able to store "65535[NULL]"
[18:04:14] <hetii> :q
[18:04:43] <hetii> ok, i will apply your tips and will check what happens:)
[18:07:23] <N1njaneer> Do you follow the reasonings?
[18:07:40] <hetii> N1njaneer: http://pastebin.com/ttX1B4dA
[18:08:33] <N1njaneer> Put the range checks in your ISR
[18:08:36] <hetii> Its just some test code so i don`t care about value in timer_seconds, now its just from 1000 till 9999
[18:08:48] <N1njaneer> Also, you still have lines active in your while loop.
[18:09:14] <hetii> you mean in global loop ?
[18:09:22] <hetii> is it wrong?
[18:09:49] <N1njaneer> You have duplication with what is in the ISR
[18:10:27] <N1njaneer> Also, your active_display variable default: case in the switch statement is a bit odd.
[18:10:30] <hetii> I don`t see that .. In ISR i just handle displaying.
[18:11:38] <hetii> Btw when i run latest code all my segments in display are on
[18:12:29] <hetii> ok wait a second i see bug
[18:13:20] <N1njaneer> Hold on, trying to fix your code
[18:14:16] <N1njaneer> http://pastebin.com/TDARz00q
[18:15:03] <N1njaneer> Also, the %04d will format your numbers as "0001" rather than "1<NULL>"
[18:16:13] <hetii> ok i didi like that http://pastebin.com/9Wh7u8Wg, and it works like expected(of course the button debouncing need to be implemented)
[18:16:16] <N1njaneer> Else you will need to specifically zero out msg[0] through msg[3] manually before you do the sprintf() to ensure they are zero
[18:16:56] <N1njaneer> Because sprintf() will only add a null terminator and then stop writing. If it writes "1<NULL>" then msg[2] and msg[3] are left untouched and may be nonzero, but non-contribuing
[18:16:58] <N1njaneer> contributing
[18:18:58] <hetii> hmm good to know that, thx
[18:18:59] <hetii> ;>
[18:19:22] <N1njaneer> If you want digits to be off, I would suggest using %4d to fill with spaces, and to right-justify your number output
[18:20:05] <N1njaneer> Then modify your display code to look for the space character (32) and treat that as an "off" display
[18:20:46] <N1njaneer> So hence 10 would be written as " 10" with msg[0] and msg[1] set to 32
[18:24:01] <hetii> Ok i test also your code, and with small modification where i use marco ISR it works perfectly. I also change formatter for sprintf like you said with and rid off unnecessary 0 from the front.
[18:24:30] <N1njaneer> Cool, hopefully all is working now :)
[18:25:46] <hetii> General what is a good practice when we have such situation where i use some interrupt and main loop, What kind of part of the code can be in main loop, and when is better to put it into interrupt callback ?
[18:27:22] <N1njaneer> Highly dependent on the situations.
[18:27:55] <N1njaneer> The biggest thing you need to be aware of is simultaneous access of variables, which may necessitate atomic sections or semaphores.
[18:27:59] <Casper> interrupt should be as short as possible to avoid missing interrupts, but time critical stuff "must" be in the interrupt
[18:28:09] <Casper> and convenience play a big factor
[18:28:17] <N1njaneer> http://www.nongnu.org/avr-libc/user-manual/group__util__atomic.html is a good primer for some of that.
[18:28:18] <Casper> you can have about everything in interrupt
[18:28:28] <Casper> and still be considered good practice
[18:29:06] <N1njaneer> Casper: Except for the case if you have a ton of interrupts and they are all firing at a high rate. Then it's actually far more efficient to use polling, but again, dependent on the situation. :)
[18:30:59] <hetii> OK i see that this subject is complex, and depend on final implementation. Ok thank you for yours time and help :)
[18:31:19] <N1njaneer> Sure thing! Glad you got it working.
[18:34:14] <hetii> yep, :) now its time to implement something useful :)
[20:25:29] <xrosnight> hello, any suggestions about controlling wireless submarine under water using RF module ? what RF module then ? :) Thank you!
[20:25:46] <Tom_itx> rf doesn't do well underwater
[20:28:15] <xrosnight> yeah i heard it
[20:29:36] <Tom_itx> http://www.huv.com/uSeeker/
[20:29:42] <Tom_itx> have a look
[20:29:57] <Valen> I often do everything in interrupts
[20:30:06] <Valen> even floating point maths
[20:30:09] <Valen> but then i am evil
[20:30:35] <Valen> radio + water != good, radio + salt water = radio + conductive shielding = nothing
[20:34:15] <xrosnight> Valen: then conclusion is that radio + salt water == not a solution ...
[20:34:45] <Valen> yup
[20:35:23] <Valen> Has anybody done anything with ultrasonic transducers in the OS world?
[20:37:44] <xrosnight> Valen: some of my friends want to comfort his/her dog on air by ultrasonics
[20:37:58] <Valen> comfort?
[20:38:24] <xrosnight> is that possible. dog can hear that. not quite sure whether that can be called "comfort" or "torture " .. LOL
[22:22:38] <jenia> hello everyone
[22:23:20] <jenia> why are there two compare registers in every timer module
[22:23:25] <Casper> bonsoir voisin
[22:23:47] <jenia> tes de montreal?
[22:24:12] <Casper> simple, each timer can be used to output 2 PWM signal, and in some case trigger 2 sets of interrupts
[22:24:16] <Casper> rive sud
[22:24:25] <jenia> haha cool
[22:24:48] <jenia> okay but the registers are useless in the ctc mode
[22:24:53] <jenia> i mean two of them
[22:25:09] <Casper> it's mainly for PWM output
[22:25:18] <jenia> yea. thanks very much
[22:30:50] <Casper> now, to contact rigol again...
[22:31:00] <Casper> there is a small issue I get with the sig gen I got
[22:31:11] <Casper> a weird one and illogical