#avr | Logs for 2013-08-28

Back
[01:10:56] <braincracker> Casper <= i could be, but no way i am standing on that crane like that ;/ wind...
[02:26:43] <haneefmubarak> Does anyone know if single byte modulus is faster than single byte division on AVRs?
[02:28:07] <haneefmubarak> >
[02:32:16] <Xark> haneefmubarak: I haven't benchmarked, but probably similar. There is no divide or modulo instruction, so probably the very similar "divide with remainder" software routine used.
[02:58:19] <dunz0r> Oh... speaking of equations. Which would be the fastest the value = somevalue * 2 or value = somevalue + somevalue? Or won't it make any difference
[02:58:33] <dunz0r> On an Atmega328p, with avr-gcc as the compiler.
[03:00:43] <Xark> dunz0r: What type is somevalue?
[03:00:59] <dunz0r> Xark: Int.
[03:01:15] <Xark> dunz0r: However, I am thinking + wins (since AVR can only shift by one, so has to shift twice and deal with carry to 2nd byte).
[03:01:38] <dunz0r> That's what I'm thinking too.
[03:01:52] <Xark> dunz0r: With << 1 it is probably much closer...
[03:02:37] <Xark> (also doesn't need a register for the "1")
[04:51:47] <bjonnh> I'm trying to use simavr, and I get things like "GDB: read memory error 00800267, 00000019 (ramend 0260)"
[04:52:09] <bjonnh> (the program works on my attiny85 and that's the mcu I use for simavr)
[04:53:19] <bjonnh> what happens on an avr when trying to access a non existing memory area ?
[04:56:04] <Xark> bjonnh: Reads "crap", I believe.
[05:00:14] <bjonnh> ok, it seems that softuart is not well managed by simavr…
[05:18:03] <megal0maniac_afk> Lt_Lemming: You are not the target market
[05:18:36] <Lt_Lemming> wow megal0maniac_afk, way to be behind the ball
[05:18:55] <megal0maniac_afk> I was at the top of the scrollback, just realised :)
[05:19:00] <megal0maniac_afk> Still, relevant
[05:19:26] <Lt_Lemming> I may not be the target market, sure. but it's still quite the missed opportunity
[05:20:15] <megal0maniac_afk> I agree. Especially since they do actually offer an ethernet shield
[05:20:20] <Lt_Lemming> also, just for lol's, that's about 1/5th to 1/4 my scrollback :-P
[05:21:09] <megal0maniac_afk> It's irssi. I think the default scrollback is pretty short, haven't bothered changing it because there's always zlog
[05:21:18] <Lt_Lemming> heh
[05:21:24] <Lt_Lemming> I've got 5k lines set
[05:21:27] <Lt_Lemming> it's handy
[05:22:10] <megal0maniac_afk> I guess it would be.. Maybe when I don't have a maths test looming :D
[05:22:24] <megal0maniac_afk> That being said, I'm procrastinating.
[05:22:35] * Lt_Lemming hands megal0maniac_afk some coffee
[05:23:02] * Lt_Lemming hands megal0maniac_afk a petmax memory doubler
[05:23:15] <Lt_Lemming> 5 points to whoever gets that movie reference ::-P
[05:23:15] <w|zzy> oooo
[05:23:17] <w|zzy> coffee!!
[05:24:27] <megal0maniac_afk> Google doesn't even know
[05:24:34] <Lt_Lemming> heh
[05:24:39] <Lt_Lemming> Johnny Mnemonic
[05:24:41] <megal0maniac_afk> I think I might get some coffee. I'm here until 7pm anyway
[05:24:50] <megal0maniac_afk> Goodbye :)
[05:25:28] <megal0maniac_afk> Ooh! I remember that movie!
[05:25:33] <Lt_Lemming> heh
[05:25:35] <megal0maniac_afk> I was only 3 when it came out, but I've seen it
[05:25:46] <Lt_Lemming> I was 13 iirc
[05:25:49] <Lt_Lemming> 12 or 13
[05:25:53] <megal0maniac_afk> Okay really going now
[05:26:11] * Lt_Lemming slips some meth into megal0maniac_afk's coffee
[05:26:37] <spawn_> lo, any of you guys an electrician?
[05:26:47] <Lt_Lemming> electrician... no
[05:26:54] <Lt_Lemming> methinks you came to the wrong channel
[05:27:15] <spawn_> looking for some help with some 3 phase stuff
[05:27:33] <Lt_Lemming> oooh yeah, very much the wrong channel :-P
[05:27:40] <Lt_Lemming> what'd you want to do?
[05:28:32] <spawn_> i need to select a contactor/start/stop system for this bigass mill: http://thirdforces.internationalconspiracy.org/13/mill/mill_moving/mill_in_shed.JPG
[05:28:50] <Lt_Lemming> yeah.... methinks you need to speak to a real electrician
[05:29:13] <Tom_itx> spawn_, ask in #linuxcnc
[05:29:22] <spawn_> Tom_itx: thanks
[05:29:37] <Lt_Lemming> that looks to be missing a few pieces... just a few
[05:29:56] <spawn_> i took the table off so i could move it
[05:29:58] <spawn_> :)
[05:30:14] <Lt_Lemming> err, that's generally actually a bad idea unless you know what you are doing
[05:30:16] <Tom_itx> looks rather old
[05:30:24] <Lt_Lemming> because re-aligning them is quite the skill
[05:30:47] <spawn_> nah, just re-insert the jib-strip, and off u go, not much to it ;>
[05:31:07] <spawn_> clock it up, get the right tension on the jibs and np
[05:31:10] <Tom_itx> yeah i bet he can do it... i see a hammer and a tape measure lying on it
[05:31:29] <spawn_> i had to dis-assemble it to replace the key on the knee anyway
[05:32:02] <spawn_> http://thirdforces.internationalconspiracy.org/13/mill/knee_problem/key_after_much_filling.JPG
[05:32:20] <spawn_> the left one is teh origional key, the one on the right is one i made with a file :)
[05:33:00] <spawn_> http://thirdforces.internationalconspiracy.org/13/mill/knee_problem/knee_screw_key_installed.JPG
[05:33:06] <spawn_> http://thirdforces.internationalconspiracy.org/13/mill/knee_problem/knee_screw_shaft_relocated.JPG
[05:33:29] <Lt_Lemming> how much does it weigh spawn_?
[05:33:35] <spawn_> aproximatly 2 ton
[05:33:39] <Lt_Lemming> noice
[05:33:46] <Lt_Lemming> yeah we got a 2 ton lathe recently
[05:33:49] <spawn_> its a super rigid machine ;>
[05:33:54] <Lt_Lemming> and a 2.5 ton cnc table
[05:34:11] <spawn_> i got a small boxford cnc machine to the left
[05:34:13] <spawn_> in my shed
[05:34:42] <Lt_Lemming> this one has 4 6Kw servo motors
[05:34:49] <spawn_> http://thirdforces.internationalconspiracy.org/13/lathe/boxford_alc/boxford_alc.jpg
[05:34:54] <Lt_Lemming> 1 x, 1 y, 2 z
[05:35:23] <spawn_> this one i might need to retrofit, not sure the computer is working, but i'll find out soon as i got a 3 phase inverter now
[05:35:29] <spawn_> hope the inverter will run that machine
[05:35:30] <bitd> spawn_, nice mill, real nice.
[05:35:41] <bitd> However, how can you work in a chaos like that O.O
[05:36:44] <spawn_> bitd: organised chaos, i played alot of sokoban when i was a kid lol
[05:37:22] <bitd> lol, that would explain it <.<
[05:37:30] <spawn_> bitd: it was ok when i didnt have the mill, but i got the mill, put it in the shed, and basicly i have to get rid of stuff i thought i needed, and basicly its a nightmare :)
[05:37:58] * bitd really wants a mill as well.
[05:38:36] <bitd> I want the same kind of build you have.
[05:38:44] <bitd> All the new age chinese stuff is crappy.
[05:39:05] <bitd> Flimsy aluminum chassis that wont ever let you make the precision needed.
[05:39:12] <spawn_> i spoke with this german guy and he recomended i get the biggest most rigid machine i can get, and the rest wont matter too much
[05:39:15] <bitd> What you have right there is a great basis.
[05:39:22] <bitd> Exactly.
[05:40:33] <spawn_> though, i wish i did a bit more research, spares are imposible to get for this machine, though i doubt it will break anytime soon, its lasted for 50-60 years so far
[05:41:25] <bitd> Hah, yeah that is a bit of an issue.
[05:41:47] <bitd> However, if you have some cad skills, you can practically make any part yourself.
[05:41:52] <spawn_> yep
[05:41:54] <bitd> They are -not- that complex.
[05:41:58] <spawn_> i got cad skillz
[05:42:11] <bitd> :-D
[05:42:47] <spawn_> the parts are all large and bulky in this machine, toootaly overkill
[05:42:56] <bitd> More and more people are starting to gather mechanical + electronic skills. They are on to me <.<
[05:43:05] <spawn_> ;)
[05:43:28] <bitd> Yep, but thats why it lasted so long already.
[05:43:39] <bitd> Squeeze of oil and some cleaning and she's good to go.
[05:43:45] <spawn_> imposible to do anything without electronic controll these days so it seems :/
[05:44:06] <bitd> Meh, sometimes I really fancy the mechanical alternative.
[05:44:27] <bitd> Like carburetters, nothing beats that.
[05:44:45] <spawn_> bleah
[05:44:46] <spawn_> :)
[05:45:27] <spawn_> http://thirdforces.internationalconspiracy.org/13/CAD/carbon_manifold.jpg
[05:45:37] <spawn_> this is going to be the first job for that mill
[05:46:34] <spawn_> its induction manifold for a direct injection system for a cosworth touring car engine
[05:49:50] <bitd> Very nice..
[05:50:13] <bitd> I might be a little biased since I work in a classic racing bike factory.
[05:50:28] <spawn_> oooo
[05:50:42] <bitd> www.absaf.nl
[05:51:06] <spawn_> that must be pretty neat :-)
[05:51:11] <spawn_> i like them oldschool bikes too
[05:51:21] <bitd> So simple, you can always fix them yourself.
[05:52:26] <spawn_> i got a GXS 750 im thinking about turning it into a cafe racer
[05:52:53] <spawn_> 1987 bike
[05:53:29] <spawn_> was thinking about selling it, and getting something older :)
[05:53:42] <spawn_> something 1940's or so
[05:53:49] <bitd> Oeeh :D
[05:54:02] <bitd> I had a 1988 GS450 which I turned into cafe.
[05:54:14] <spawn_> nice:)
[05:54:17] <bitd> However there is one thing about those old japanese bikes.
[05:54:38] <bitd> The frames are not so rigid.
[05:54:58] <bitd> I had to weld in some extra pipes to get it to corner tight.
[05:55:14] <spawn_> :-)
[05:55:49] <spawn_> i might grind back all the welds and tig them up again too, some of the welds look really dangerous
[05:56:22] <spawn_> like birdshit
[05:56:26] <bitd> Hahaha yes.
[05:56:47] <bitd> Might be the first robotic welds, or the last hand welds.
[05:57:02] <spawn_> i think this frame was made in china
[05:57:03] <spawn_> lol
[05:57:26] <bitd> Umph :P
[05:57:47] <bitd> Thats usually a good indication of pure craftsmanship <.<
[05:58:22] <spawn_> hehe
[05:58:39] <spawn_> made by real crafts people in little grass huts
[08:24:57] <Kre10s> anyone got the DAC on an atmega32m1 to work? I'm doing this: http://pastebin.com/wvumgXpx in main...
[08:30:28] <soul-d> google the avr freak 101 bit manipulation
[08:30:38] <soul-d> learn about | and & ~ whatever
[08:30:46] <soul-d> i made mistakes their to
[08:31:11] <theBear> hehe and ^^^^ there too :)
[08:31:24] <theBear> doh, i also made a mistake there, by pointing at the wrong word :)
[08:31:47] <soul-d> :)
[08:32:06] <theBear> but their mistakes are no excuse for mine :)
[08:32:18] <theBear> get my thinly veiled hints yet ?
[08:38:18] <soul-d> no , brain functions are in power saving mode and the coffee refill timer overflowing in the wake up loop
[08:38:55] <soul-d> so it's in stepping mode
[09:01:41] <Kre10s> soul-d, DAC is controlled by only one reg. I set DAOE and DAEN bits. It should be enough right?
[09:04:34] <soul-d> no its about how to use |= when putting values to bit masks using 0 in the shift easily leads to problems especialy when you try to or them since a bit set to "1 or 0" is still 1
[09:04:43] <megal0maniac_afk> bitd: I have an old Japanese bike. Do you want it? :D
[09:04:50] <soul-d> thats why you will see people using &= ~ wich reads as and is not
[09:07:13] <bitd> What kind of old Japanese bike megal0maniac_afk ? <.<
[09:22:56] <Kre10s> soul-d, why would (1<<2)|(0<<3) != 0x4 ?
[09:28:05] <Kre10s> (0<<DAATE)|(0<<DATS2)|(0<<DATS1)|(0<<DATS0)|(0<<DALA)|(1<<DAOE)|(1<<DAEN) evaluates to 0x03. i could just write DACON = 0x3; DAC=128; ... but the output still won't move.
[09:44:27] <twnqx> there's nothing wrong with the |
[09:45:26] <twnqx> no idea about DACs in general, one of the few things i haven't used yet
[09:46:03] <theBear> what does the example code in the datasheet look like compared to yours ?
[09:47:13] <Kre10s> example? what example? Figgured it out just now though. Reference was wrong.
[09:47:29] <Kre10s> 0v reference will give a nice DAC range :P
[09:49:45] <theBear> err, every avr (full version) datasheet i ever seen has short examples in c and asm
[10:05:53] <bjonnh> Is there a way to have the output of Timer0 on another pin than OC0B and OC0A on an attiny85 ?
[10:07:16] <bjonnh> By using an interrupt ?
[10:14:02] <bjonnh> and if using PWM with no prescaler wouldn't it cause too much interrupts ?
[10:23:34] <Casper> bjonnh: you could do it in software
[10:23:47] <Casper> it will make the output less precise, but can work
[10:24:19] <Casper> make the timer trigger an interrupt, and change the pin you want in software
[10:36:44] <OndraSter_> Casper, actually if you do it in asm you can precisely count the cycles and make it as precise as it would be in hardware only
[10:37:17] <OndraSter_> it will have a slight delay though
[11:03:47] <bjonnh> Casper: in fact I used TIMSK |=1<<TOIE0 to activate the TIMER0_OVF_vect
[11:03:56] <bjonnh> Casper: I have to try with the compare vector
[11:04:03] <bjonnh> Casper: should work
[12:12:58] <braincracker> dunz0r <= maybe shl 1 for "*2" :P but if the multiplication is 1 clock ticks then not sure it would be faster
[12:27:55] <N1njaneer> brain: AVR is a 2-cycle on-chip multiply
[12:29:01] <braincracker> okey
[12:29:14] <braincracker> then shl 1 will be faster i assume
[12:29:50] <braincracker> adding number to itself requires the number be copied first, so it will be even slower.
[12:31:17] <N1njaneer> Yes, especially if it's not in a register.
[12:31:29] <specing> adding a number to itself?
[12:31:34] <specing> multiply with 2?
[12:31:46] <specing> or left shift one bit (1 cycle)
[12:32:04] <N1njaneer> Unfortunatly AVR doesn't have a barrel-shifter, so left and right shifts and rotates are one place per clock cycle, so beyond 2 places the multiply is probably faster :)
[12:32:08] <braincracker> sure that is what i was suggesting 5 lines above
[12:33:00] <braincracker> against boredness :) wtf moments, crazy russians, daredevils http://pastebin.com/kAMG0mbF
[12:35:44] <tzanger> smells like early optimization
[12:36:23] <N1njaneer> Just leave it to the compiler's -O3 to see if it will work satisfactorally before going in and hand-tweaking :)
[12:36:59] <braincracker> but o3 runs out of flash space fast ;)
[12:37:13] <braincracker> O2 is moderate
[12:37:27] <N1njaneer> Always the speed/size tradeoff. :)
[12:37:35] <tzanger> I almost always use -Os
[12:37:43] <N1njaneer> But if the app is small and it fits, who cares.
[13:37:13] -rajaniemi.freenode.net:#avr- [freenode-info] channel flooding and no channel staff around to help? Please check with freenode support: http://freenode.net/faq.shtml#gettinghelp
[13:44:32] <inkjetunito> :o YEIS
[13:46:54] <N1njaneer> Hooray New Zealand! http://www.zdnet.com/new-zealand-bans-software-patents-7000019955/
[13:48:23] <abcminiuser> I AM A GOD
[13:48:33] <abcminiuser> I've made the big red button of justice at work
[13:48:55] <N1njaneer> Is it the Official Atmel E-Stop?
[13:49:08] <abcminiuser> Hah, my boss made a new coffee timer out fo that
[13:49:35] <N1njaneer> Does it erase Arduino from the reality timeline?
[13:49:46] <abcminiuser> https://twitter.com/ivarho/status/351782934400864257/photo/1
[13:50:03] <abcminiuser> Nah, it broacasts a SOS call over SMS to a list of phone numbers read from a SD card
[13:50:12] <abcminiuser> Press button. watch everyone's phones go off
[13:50:24] <N1njaneer> Nice!
[13:50:46] <abcminiuser> (Trs: "Guess how we are going to extend the coffee timer :-)")
[13:51:01] <abcminiuser> This is the mark 3, my mark 2 got banned
[13:51:07] <N1njaneer> Then make it go back and remove x86 from the PC standard so something more sensical had a chance to take over before it grabbed hold!
[13:51:08] <abcminiuser> Something about it being a war crime
[13:51:31] <abcminiuser> Bah, I'd rather shoot the guy that said "hrm, big endian sounds like a good idea..."
[13:53:25] <N1njaneer> But I like big endian!
[13:53:56] <N1njaneer> (mostly because it was the Motorola / 68K / etc standard, and PC seemed to have adopted little endian)
[13:54:34] <N1njaneer> But I think that's probably because mentally I think of memory going from left to right in a row, and binary notation following suite when writing out numbers.
[13:54:58] <abcminiuser> Actually to be honest, I don't care which
[13:55:08] <abcminiuser> It's the fact that both are used that annoys the bejeesus out of me
[13:55:23] <abcminiuser> Given two ways of doing something, half the world will pick a random side
[13:55:34] <N1njaneer> If only one had been standardized, that would have been nice. But at least the issue had an approprite name applied.
[13:55:41] <abcminiuser> Seealso: VHDL/Verilog
[13:55:52] <N1njaneer> +10 points to anyone who knows where it comes from without looking it up :)
[13:55:55] <abcminiuser> Can we all agree that Middle Endian is insane?
[13:55:55] * megal0maniac_afk is learning that!
[13:56:05] <megal0maniac_afk> wtf is middle endian?
[13:56:20] <N1njaneer> mega: It's where you swap the nibbles to add additional confusion.
[13:56:36] <abcminiuser> https://en.wikipedia.org/wiki/Endianness#Middle-endian
[13:56:38] <N1njaneer> I prefere VHDL because the notation looks friendlier to me :)
[13:57:02] <abcminiuser> I prefer VHDL because I've learned that, but I've seen some of the Verilog at work
[13:57:11] <N1njaneer> And you have to respect an acronym who's first letter V collapses another three letters in to itself :)
[13:57:14] <abcminiuser> Frankly both are HIDEOUS
[13:57:42] <megal0maniac> N1njaneer: That sounds silly
[13:57:47] <abcminiuser> VHDL is like the Java of hardware design languages - verbose, but does what you say
[13:57:50] <megal0maniac> And I like VHDL, but I haven't seen Verilog
[13:57:57] <abcminiuser> Verilog is closer to C
[13:58:06] <abcminiuser> Both make me want to tear out my eyes
[13:58:16] <abcminiuser> There's a Python HDL project that looks usable
[13:58:22] <megal0maniac> It's not programming, that's the thing
[13:58:52] <megal0maniac> My dad works with process and automation in factories. Need to get me some of those e-stops
[14:00:19] <abcminiuser> Dealextreme
[14:00:23] <abcminiuser> Couple of bucks
[14:00:29] <megal0maniac> Oh wow
[14:00:34] <megal0maniac> IP65? :P
[14:00:37] <abcminiuser> Not exactly rugged, but good enough for prototypes and fun
[14:01:05] <abcminiuser> http://dx.com/p/power-control-emergency-stop-switch-red-yellow-black-150615
[14:01:30] <abcminiuser> Also http://dx.com/p/diy-power-control-emergency-stop-switch-red-black-142755
[14:01:52] <megal0maniac> That's the one I found
[14:01:52] <megal0maniac> And that :)
[14:02:00] <abcminiuser> "DIY Power Control" - why does the thought of people DIYing with safety buttons from Deal Extreme fill me with dread?
[14:02:01] <megal0maniac> These are always fun http://dx.com/p/diy-toggle-switch-flip-safety-covers-guards-dark-red-4-pack-132176
[14:03:35] <N1njaneer> I particularly like the piezo-based switches. You have to actually sharp-impact thump them with your fingers. Just casually leaning or pressing on them won't trigger them, and they are flush-mount
[14:04:26] <abcminiuser> Hell yes, we need those at work
[14:04:26] <megal0maniac> Mmmm... I wouldn't want to use anything from dx for anything vaguely important
[14:04:29] <specing> abcminiuser: 13$ != couple of bucks
[14:04:48] <abcminiuser> "Those...I've no idea what those do, but sometimes they light up so we leave the room for a while."
[14:04:53] <megal0maniac> And USD are even more for me
[14:05:36] <abcminiuser> Jesus, you can get everything on DX
[14:05:44] <abcminiuser> http://dx.com/p/beginner-tattoo-kit-set-54-color-inks-power-2-guns-97079 - lead poisioning and regret included?
[14:06:17] <megal0maniac> That's going under my skin? NO THANK YOU CHINA
[14:06:54] <megal0maniac> 1xSheets practice skin
[14:07:14] <abcminiuser> Tempting to get a USB foot switch, although I've no idea why
[14:07:47] <megal0maniac> I find that with a lot of pointless stuff on DX
[14:08:04] <abcminiuser> Actually, I've never had the urge to acquire random crap
[14:08:33] <theBear> nice distressed finish
[14:08:39] <abcminiuser> People at work show up every day with new stuff from DX and other places (today, 6 telephone style keypad matrix components)
[14:08:52] <abcminiuser> But I've never bought stuff like that just because
[14:08:55] <megal0maniac> Common sense kicks in before I order anything, but still.
[14:09:30] <megal0maniac> I get things like LCDs and accelerometers, more to play with than for actual projects I have planned
[14:09:32] <theBear> none of those pictures show the grips
[14:09:54] <abcminiuser> I spend 99.9% of my time in software, no need for HW
[14:09:58] <abcminiuser> HW annoys me
[14:10:00] <theBear> lol nipple style grommets
[14:10:10] <abcminiuser> Wired up the GPS yesterday, that was irritating enough
[14:10:55] <megal0maniac> This is why I'm studying electrical engineering :P
[14:11:33] <megal0maniac> But after this year, I'll never have to worry about 3 phase or power factor again
[14:11:34] <theBear> megal0maniac, to get your hands on nipple style grommets eh ? :)
[14:11:41] <megal0maniac> Hot damn!
[14:11:54] <theBear> can't blame yer
[14:11:54] <megal0maniac> Why else?
[14:11:58] <theBear> hehe
[14:12:16] <theBear> oh wow, you were serious, wtf is practice skin ?
[14:12:27] <megal0maniac> I really way
[14:12:28] <megal0maniac> was
[14:12:44] <megal0maniac> My main concern is whether its synthetic or not
[14:13:21] <theBear> china really is amazing... either one of those guns with a grip or even that adjustable supply would 'normally' be the price of the whole kit
[14:13:45] <theBear> i wouldn't really care, i thought you needed to rent a pig or go to a butcher for practice
[14:13:58] <abcminiuser> Rent?
[14:14:02] <megal0maniac> And if we're being honest, you probably won't catch anything from using it
[14:14:05] <megal0maniac> abcminiuser: A live one
[14:14:17] <megal0maniac> helps you deal with squirmy clients
[14:14:49] <megal0maniac> Once you get a pig to hold still and tattoo wings above its tail, you're good to go
[14:15:52] <theBear> catch anything from using what ?
[14:15:56] <theBear> lol, wings eh
[14:16:23] <theBear> oh, real skin... most things you can 'catch' are long dead by the time something has caught the slowboat all the way from china
[14:16:58] <theBear> but well, that's what pre-drawing is for, if you can't tattoo within the lines then, you shouldn't be doing it at all
[14:18:59] <tlvb> does random ft232 disconnects while in use and transmitting data sound familiar to anyone else?
[14:19:16] <megal0maniac> DIRTY DIRTY POWER
[14:19:36] <theBear> hehe
[14:19:58] <theBear> they're also intolerant of poorly shielded usb cables that work with 'everything else' often
[14:22:17] <tlvb> I've had trouble with long cables, but then I just get an unable to communicate error. This is different though, as the ft re-enumerates as next in line (basically, fails while being in use as /dev/ttyUSB0, and then re-enumerates as /dev/ttyUSB1, since ...0 was already taken)
[14:23:14] <tlvb> ...although it may be the cable in that case to, but the failure is much more intermittent, several minutes of high baud rate data transfer going fine, just to die when I need it not to
[14:23:44] <theBear> also depends, i'd estimate the majority of 'ft232' chips ANY of us have used over the years aren't REALLY ft232 chips
[14:23:57] <tlvb> bought from mouser
[14:24:02] <tlvb> should be the real deal I hope
[14:24:39] <megal0maniac> Definitely
[14:24:59] <theBear> mmm, if you order specifically it probably is, but random adapter and phone cables and interfaces have all kinds of clones, they work fine generally, just that things like usb noise/quality fringe issues will be different between them
[14:25:10] <braincracker> h
[14:25:18] <braincracker> oh channel is alive
[14:25:36] <theBear> ssshhhh, braincracker is here !
[14:25:48] <tlvb> theBear: it was ordered as a specific part for a design
[14:25:57] <theBear> yeah, i get that now
[14:25:59] <tlvb> so yeah, no random adapter
[14:26:00] <abcminiuser> Quick everyone hide!
[14:26:03] <braincracker> ;>
[14:26:15] * tlvb hides
[14:26:16] <braincracker> yea this is why i always see deserted channels
[14:26:27] <tlvb> /nick tumbleweed
[14:27:27] <megal0maniac_afk> is he gone?
[14:27:31] <tlvb> schematic here http://tlvb.se/?page=dmx512usb ...I should probably put a scope on the power rails, I haven't really had the opportunity yet though
[14:27:37] <theBear> maybe if you were more friendly ?
[14:27:49] <theBear> you know, a smile, a hello, how are you
[14:28:09] <theBear> oooh dmx adapteriser eh .... emtec style or ?
[14:28:33] <theBear> oh, the thing from yesterday
[14:28:42] <tlvb> theBear: from yesterday?
[14:29:01] <theBear> and there's no questions about grounding, the rules are quite definite
[14:29:19] <tlvb> also, I don't know emtec style, I bought and read up on the spec, to get it right for the design
[14:29:38] <theBear> yeah, i remember talking to someone about usb resets and a usb isolater
[14:29:52] <theBear> emtec is a software interface, you know, a standard that most programs are happy to use
[14:30:11] <theBear> a standard usually implemented over a ft232
[14:31:15] <tlvb> but even the spec lists that there are a number of contradictory and nonstandard, but yet implemented ways of grounding the dmx bus
[14:32:10] <theBear> that doesn't make them a good idea
[14:50:55] <braincracker> abcminiuser <= convert the emergency switch to hall + capacitive redundant to be mission-critical :)
[14:52:03] <theBear> call the whole concept crap to be mission-critical :)
[14:52:49] <abcminiuser> Now I just need a mission...
[14:53:28] <theBear> ok, but after i tell you, your computer will self destruct :)
[14:53:28] <braincracker> trigger swarm of killer drones
[14:53:42] <braincracker> or disarm them?
[14:54:18] <theBear> they don't have arms !
[14:54:49] <braincracker> they could have an arm cortex :(
[14:54:56] <braincracker> or atmel arm
[15:09:24] <tlvb> hm, I guess the emtecness would depend on what firmware one wrote, unless it requires higher bandwith
[15:10:01] <tlvb> than dmx itself it should be ok
[15:10:10] <tlvb> *significantly higher
[15:15:20] <theBear> nah, it's nothing fancy, basically raw dmx
[15:21:25] <tlvb> then it should be possible
[15:25:57] <theBear> mmm, chances are there are other equally common protocol/output options in all the common software, that's just the one i heard of and seen most... i usually used big real desks or just did repairs in dmx land, very little pc experience
[15:41:50] <Roklobsta> nice, the 1000013th AVR/DMX project
[15:51:03] <jadew> check out the price on this pcb switch: http://www.tme.eu/en/details/dtsm-21y-v-t_r/microswitches-tact-pcb/diptronics/
[15:52:50] <Roklobsta> heh i rem one company i worked at getting pcbs made and the same style of swicthes were melted onto the PCB
[15:54:39] <jadew> it must be plated with unobtainium and that channels the sound waves more nicely, eliminating jitter and the chance of flyback currents! all for a better sound quality! goes nice with our $1200 usb cables for audiophiles
[15:55:28] <theBear> hey man, the cables are important ! you don't want cheap cables causing wow and flutter on your nice dac !
[15:58:27] <jadew> personally I don't even know what wow and flutter is
[15:58:51] <jadew> I just want a button :/
[15:59:06] <jadew> holly crap, there are even more expensive buttons
[15:59:08] <jadew> wtf...
[15:59:51] <jadew> what kind of application needs a 100 eur pcb push button?
[16:00:37] <jadew> I planning to pay $1 / 10 buttons, nothing more
[16:00:38] <theBear> pcbmount one ? DAMN
[16:01:03] <jadew> theBear, yeah
[16:01:36] <theBear> it's what tapes and records had instead of jitter, been a while, from memory wow is something like an off-center record or capstan, and flutter is just wiggle like vibration on a needle or a head
[16:01:42] <jadew> http://www.tme.eu/en/details/dtsmf-31r-v-t_r/microswitches-tact-pcb/diptronics/#
[16:02:01] <jadew> theBear, got it
[16:02:15] <jadew> check out the price on the last link
[16:02:38] <jadew> 140 euros! lol
[16:03:00] <jadew> 3 buttons and you get a decent oscilloscope
[16:03:53] <jadew> now that's what I was looking for: http://www.tme.eu/en/details/tactb-64k-f/microswitches-tact-pcb/ninigi/#
[16:05:12] <jadew> looks cool too
[16:05:24] <darsie> does the analog comparator output pin/port has to be set as output for the AC interrupt to be executed? Will the interrupt be executed on the result of the AC or on the state of the output (on which a change might be forced from outside)?
[16:05:43] <theBear> err, analog comparator is an input function
[16:07:19] <jadew> holly smokes! http://www.tme.eu/en/details/taef-25s-v-t_r/microswitches-tact-pcb/diptronics/#
[16:07:25] <jadew> 480 euro!
[16:07:48] <jadew> ah, that's a rol
[16:08:22] <jadew> they were all rols.. pff
[16:08:23] * jadew hides
[16:08:39] <theBear> ooh, 8% discount for buying 3
[16:08:47] <theBear> what'
[16:08:52] <theBear> what's a rol, some stupid romanian dollar ?
[16:09:07] <jadew> it's in reel
[16:09:17] <jadew> they come in 2700 pcs reels
[16:09:25] <Roklobsta> lol at rol
[16:09:31] <jadew> heh
[16:09:33] <allgood38> jadew, *roll
[16:09:49] <theBear> oooooohhhh hehehehe
[16:09:50] <jadew> allgood38, thanks
[16:10:20] <jadew> for a moment there I actually tought people pay 100+ euro for a button
[16:10:28] <darsie> theBear: right. thx
[16:10:36] <allgood38> Government contractors?
[16:10:59] <jadew> well, the government would pay anything for anything
[16:11:56] <allgood38> Yep, part sourcing through whatever manufacturer struck a deal
[16:38:08] <endikos> Hey folks… I'm having an issue with a crystal oscillator - not sure what I'm doing wrong or what I've missed. I have the prescaler set to 64, an external 16MHz crystal, my resolution calulated at 0.005 milliseckonds per tick, using the 16 bit overflow timer1 set at 64286 (65536 -1250), but I'm gaining about 6 seconds per minute.
[16:40:16] <endikos> err… that should be 5ms (0.005 seconds) per tick
[16:41:24] <braincracker> yo folk
[16:41:47] <braincracker> no idea what is your goal, but i prefer using a 32768Hz xtal for timing
[16:42:36] <endikos> braincracker: unfortunately, changing the crystal is not an option at this point
[16:43:23] <jadew> endikos, why are you counting down?
[16:43:26] <braincracker> another question is the device :)
[16:43:31] <N1njaneer> endikos: Try setting to 64285 and see if you get closer.
[16:43:33] <jadew> why not set the overflow at 1250?
[16:44:27] <N1njaneer> (Also, as a reference, a decent +/-50ppm clock crystal will give +/-4.32 seconds of error over a 24 hour period)
[16:46:26] <endikos> N1njaneer: I'd considered that - even been kicking around the idea of trying to make a correction every X ticks to make up for the 0.015625 difference between my resolution/prescaler combo and reality ;-)
[16:47:11] <braincracker> that is not that bad
[16:47:48] <braincracker> a good watch crystal is usually +-20ppm
[16:47:57] <braincracker> around zero @ 25C
[16:48:01] <N1njaneer> What is the end application? Generally you should be able to work the math such that either you can divide it down correctly without error, or else calculate what clock crystal value you should select to give you zero error.
[16:49:10] <N1njaneer> brain: I've actually made quarty crystals into inadvertant thermometers by watching the error term of the retrain mechanism vary as you breath on them :)
[16:49:15] <jadew> 6 seconds per minute sounds like way too much
[16:50:07] <endikos> N1njaneer: end-application is in a commercial pellet smoker. While timing isn't critical over a long-run, 3 seconds every thirty seconds is a big deal - we're programmatically controlling fire, afterall ;-)
[16:50:09] <jadew> in 10 minutes you're already off by 1 minute, I tend to believe he's doing something wrong, rather than the crystal sucking that bad
[16:51:13] <jadew> and you still didn't answer why you're counting down and not up?
[16:51:44] <braincracker> hmm well
[16:51:58] <endikos> The wierd thing is that I've been refactoring this codebase, and these settings worked fin previously. I've reduced my memory footprint by around 30%, but the clock is wonky now - didn't used to be - and I can't find for the life of me find what I've broken.
[16:52:05] <braincracker> the internal oscillator of the atmegas can do around +-3% precision ...
[16:52:11] <braincracker> without calibration
[16:55:10] <endikos> jadew: AFAIK, you set TCNT1 to be 65536 - CALCULATED VALUE for your prescale/resolution choice. Then when it overflows, your ISR runs. Setting it at 1250 would make the ISR run ~50 times slower
[16:55:55] <jadew> endikos, not in CTC mode, which is what you should be doing
[16:56:33] <jadew> if you set TCNT1 in the ISR it's ovious you're gonna lose time
[16:56:38] <jadew> because executing those commands takes time
[16:56:52] <jadew> however, in CTC mode it's done for you, in hardware
[16:56:59] <endikos> I'm not losing time
[16:57:02] <endikos> I'm GAINING it.
[16:57:48] <braincracker> actually you don't even need a divisor
[16:58:09] <braincracker> just accumulate all ticks in a variable, and divide using a non-blocking routine
[16:59:51] <endikos> braincracker: isn't the prescaler already basically a non-blocking divisor?
[17:00:07] * endikos is reading the docs on CTC mode
[17:00:53] <braincracker> you can divide by whatever ;)
[17:00:58] <theBear> not 0 :)
[17:01:02] <braincracker> you can not prescale by whatever
[17:01:19] <braincracker> only in CTC mode, if it works
[17:01:20] <endikos> braincracker: ok. I'm picking up what you mean now
[17:01:51] <braincracker> compare match magic ;/
[17:02:13] <endikos> Does CTC preclude the use of PWM?
[17:02:49] <jadew> what does preclude means?
[17:04:13] <jadew> google answered that, well, yeah...
[17:04:19] <N1njaneer> At least one of the channels, yes, depending on the processor.
[17:04:22] <endikos> preclude means essentially that you can't use it - on first glance it looks like the doc is saying you can either use CTC or have a high freqwuency PWM???
[17:04:22] <N1njaneer> Which AVR?
[17:04:32] <endikos> atmega168
[17:05:15] <jadew> you might be able to have another compare accumulator and set it so it toggles the associated output pin
[17:05:37] <theBear> the doc ?
[17:06:05] <endikos> theBear: the atmel datasheet on the 168
[17:06:32] <theBear> ahh, i thought you meant doctor :)
[17:06:40] <N1njaneer> Atmega168 has 3 counters on it, so you can do PWM with another and overflow or compare-matcher interrupts with another :)
[17:08:58] <braincracker> endikos <= i use the 168 too now
[17:09:39] <braincracker> 8MHz internal osc was fine to me, and i have attached a watch xtal, and set up timer2 async mode
[17:09:56] <braincracker> that is for stable timings
[17:11:26] <jadew> you can use a mechanical table clock as a source and you'd still be getting less drift than 6 seconds / minute
[17:12:13] <theBear> i can count better than 6seconds/minute :)
[17:12:19] <braincracker> i have awesome performance from it.
[17:12:42] <braincracker> was running a whole day, and compared it to time.nist.gov
[17:12:50] <braincracker> was within 1s
[17:13:02] <braincracker> my PC's clock was several seconds off though
[17:13:07] <endikos> lol
[17:13:22] <braincracker> haha did you use your PC's clock as timebase?
[17:13:27] <jadew> for one of my previous phones I made myself a little app that was syncing its clock to the GPS, had perfect time :D
[17:13:28] <braincracker> that is never accurate
[17:13:36] <braincracker> only if you do ntp update
[17:13:44] * endikos considers shoe-horning a mechanical table clock into a pellet grill….
[17:14:44] <theBear> only if you run ntpd, ntpsync-ing it can still drift
[17:14:55] <theBear> and still be inaccurate on an absolute level
[17:15:09] <theBear> ntpsync just has so very little time to calculate/account for network delays etc
[17:21:47] <endikos> OK… so what's the benefit of using CTC mode to count down as opposed to leaving it in normal mode and counting up to overflow?
[17:22:07] <theBear> countdowns are more exciting :)
[17:22:11] <jadew> endikos, you don't have to manually set TCNT
[17:22:33] <jadew> which adds a lot of inacuracy to your thing
[17:23:13] <N1njaneer> yep! It just automatically reloads the register and starts counting instead of having to reload it manually each time, which can and will introduce jitter.
[17:23:39] <endikos> How do you initially set the value of the register?
[17:23:56] <jadew> by reading the docs :)
[17:24:44] <endikos> Awesome. I just got RFTM'd.
[17:25:11] <theBear> lol
[17:25:29] <N1njaneer> The datasheets have a much more concise explanation than we're going to be able to casually give you here. Also has exciting pictures, too!
[17:26:52] <endikos> (OCR1A? Mebbe?) Anyway - have to jet for now. See y'all in the morning
[17:32:19] <braincracker> jadew <= a lot, like 0ppm :)
[17:32:45] <braincracker> because the thing is so fast, there is no way the 32768Hz xtal tick will be missed
[17:32:48] <N1njaneer> end: Yes, OCRxA
[17:33:58] <braincracker> however ctc mode ocra compare match thing did not work to me, so i needed to do it manually anyway
[17:34:19] <N1njaneer> brain: Just use a rubidium clock 10 Mhz reference. Then it will only be off by +/-8ms per year
[17:34:33] <braincracker> for what?
[17:34:46] <braincracker> i'm cool even with 40ppm
[17:37:41] <braincracker> N1njaneer <= i even tried 1 count off from 256, noticeable, but not that large error wither.
[17:37:46] <braincracker> e
[17:38:06] <ambro718> huh, it seems that avr-g++ doesn't convert float division by constant into multiplication
[17:38:19] <braincracker> especially if you only need a cooking timer or something like that
[17:38:45] <ambro718> or maybe it isn't allowed to due to loss of precision?
[17:39:23] <N1njaneer> brain: I usually use CTC mode and then just the TIM0_COMPA ISR to trigger. :)
[17:40:12] <braincracker> ok, but then it will not restart timer2 from zero
[17:40:16] <braincracker> you need to manually zero it
[17:41:36] <darsie> To cancel noise on the AVcc pin a 10 uH inductor is recommended. I have 1000 uH and 2.2 uH. Which is better? Could the 1000 uH cause excess transients/ringing?
[17:41:47] <braincracker> this may be another story since i used timer2, did you use timer1 ?
[17:42:54] <braincracker> darsie what noise you want to cancel? :) what is your sampling rate? do you integrate results?
[17:43:30] <braincracker> having no filter can even increase resolution if you do averaging
[17:44:13] <darsie> braincracker: I want to sample solar cell current (via a shunt), voltage and power supply output voltage. I may not need very precise results..
[17:44:46] <darsie> sampling rate is like 10-100 ms.
[17:45:12] <darsie> no integration.
[17:46:08] <darsie> I could get a 10 uH filter, or make one, if it's worth it. Right now it's actually development, so not critical.
[17:47:04] <darsie> I don't have an analog ground plane. Just a breadboard.
[17:47:13] <darsie> atm
[17:47:56] <ambro718> is anyone else seeing that avr-gcc doesn't like passing (large) structs? Using pointers instead of struct has improved code size in every case I tried it, even though the code is completely equivalent (the called function doesn't change the values in the struct).
[17:48:04] <darsie> And the noise to cancel is from the atMega168, and a SMPS.
[17:48:50] <braincracker> r
[17:48:55] <darsie> So, 2.2 uH, 1000 uH or skip them for now?
[17:49:09] <braincracker> LC filter is optional, note, you also need a capacitor to ground, the capacitor and inductor together will form a LOW-PASS LC filter
[17:49:38] <braincracker> the 100nf ceramic capacitors are not optional from vcc pins to gnd
[17:50:03] <darsie> Yeah, I have caps. But I wonder if the series tank filter could resonate.
[17:50:05] <braincracker> 1-10uf ceramic is fine too usually
[17:50:19] <braincracker> it is a low-pass filter
[17:50:52] <braincracker> there is a cut-off frequency you choose when you decide the capacitor and inductor value
[17:50:56] <darsie> The GND pin in the ADC section, should it connect to the analog ground plate?
[17:51:10] <braincracker> noise is an undefined thin
[17:51:13] <braincracker> g
[17:51:38] <braincracker> yes it is nice to have an analog ground plane
[17:52:01] <braincracker> and a digital ground plane too
[17:52:15] <braincracker> but even one ground-plane is better than no-ground plane
[17:53:34] <braincracker> darsie <= well it will work without an LC filter, or even ground-plane
[17:54:15] <N1njaneer> Or worst-case do a ground fill over the top and bottom of the board, and use guard-traces where possible if you can't go to 4-layer
[17:54:25] <braincracker> only a little additional digital switching noise may be present on analog supply
[17:55:48] <N1njaneer> ambro: You always want to pass structs by pointer in something as limited as the AVR stuff, else you incur the overhead of memory copy and/or stack-passing. If you are getting logical errors on large structures, there may be a chance you are overflowing the stack and corrupting the memory pool.
[17:56:04] <braincracker> they say it is best to use an analog and a digital ground-plane and connect them together at one place
[17:56:27] <braincracker> you need this with >=16 bit resolution adcs
[17:56:47] <N1njaneer> brain: Yes, and then route any signals that pass between them through the single "slot" where the planes connect.
[17:56:48] <braincracker> and proper LC filter on avcc
[17:57:18] <N1njaneer> Routing high-speed signals across plane-split is a big no-no :)
[17:57:21] <braincracker> 10-12 bit adc is not that sensitive to noise
[17:58:05] <braincracker> 10 bit with 5V reference gives 5mv step size
[17:59:02] <darsie> I may not have constant Vcc, so I'll use the 1.1 V bandgap reference.
[17:59:24] <braincracker> you'll have to calibrate that too
[17:59:35] <braincracker> and store it in eeprom
[18:00:16] <darsie> braincracker: calibrate the bandgap reference?
[18:00:20] <braincracker> yep
[18:00:29] <braincracker> otherwise it'll be +-10%
[18:00:36] <darsie> Like, measure it against a known voltage?
[18:00:53] <braincracker> i use a 0.1% reference
[18:01:05] <darsie> Or export it and measure it with my multimeter?
[18:01:22] <N1njaneer> Make sure your multimeter is calibrated! :)
[18:01:31] <braincracker> measuring with a (calibrated) multimeter and corecting it works fine too.
[18:01:40] <braincracker> rr
[18:02:40] <darsie> I could measure mains to calibrate my multimeter.
[18:03:21] <theBear> hell no you couldn't !
[18:03:21] <N1njaneer> Mains are AC, and going to be all over the place depending on the phases of the moon.
[18:03:42] <theBear> batteries are more useful than mains, and we all know they change voltage for all kinds of reasons :)
[18:03:58] <theBear> how about a pc supply connected to a running pc while watching the voltages in the bios
[18:03:58] <braincracker> http://www.ti.com/ww/en/analog/power_management/voltage-references.shtml
[18:04:05] <braincracker> pics a precision one
[18:04:10] <braincracker> pick
[18:04:13] <darsie> theBear: good idea.
[18:04:42] <theBear> oooh or build one, little tl43 err, those ref 3pin things, or even a zener and a 1k resistor
[18:05:54] <darsie> I have a LF50CV
[18:06:31] <theBear> err, i believe you
[18:10:54] <darsie> I'll skip noise cancelling and build the main purpose of the circuit. Improvement can come later, if required ...
[18:12:16] <braincracker> i don't think you need it :)
[18:12:18] <N1njaneer> Or just get a calibrated meter :)
[18:12:35] <braincracker> just add an opamp for multiplying up the signal amplitude
[18:13:06] <braincracker> 5V = 5A for example
[18:13:35] <darsie> braincracker: I use an op amp to amplify the low side current shunt voltage.
[18:13:51] <darsie> 8 A = 1 V
[18:14:26] <braincracker> okey
[18:14:45] <braincracker> you are about done then
[18:15:21] <braincracker> you may calibrate your current using a series current meter
[18:15:47] <darsie> Yes, I'm gonna do that.
[18:16:26] <braincracker> Btw there is an atmel appnote that recommends adding even more noise to adc :) for improving adc precision
[18:17:05] <braincracker> signal needs integrating over a few samples
[18:17:42] <darsie> You think I need that to find the maximum power point of the solar module with adequate precision?
[18:17:52] <braincracker> no
[18:17:59] <darsie> k :)
[18:18:16] <braincracker> even the absolute value does not matter for a relative process
[18:18:34] <braincracker> calibration is not needed for it just to work
[18:19:37] <darsie> right. But I might want to log solar power to see how it performs. At some later time.
[18:19:45] <braincracker> i'll be building a thing like that too, but i plan to add a charge counter too
[18:20:06] <braincracker> it is nice to know the charged/discharged energy
[18:20:20] <darsie> We won't have a battery in our first model, I think.
[18:20:29] <theBear> things like accurate shunts and adc's accurate enough for two decimal places are easily bought and/or divided with hand selected 5% resistors chosen with a $10 meter
[18:20:32] <braincracker> at least a small one...
[18:20:58] <braincracker> solar cells are not cool without a battery
[18:21:16] <darsie> Well, flying through the night with a battery would be cool.
[18:21:20] <theBear> they are if you got gridtie
[18:21:24] <theBear> oh, flying eh ?
[18:21:27] <theBear> hehe
[18:21:48] <braincracker> simple
[18:21:51] <braincracker> add helium
[18:21:56] <darsie> gg
[18:22:04] <darsie> Hydrogen.
[18:22:13] <braincracker> okey, but it is flammable
[18:22:20] <darsie> I don't smoke :).
[18:22:34] <theBear> hydrogen is more exciting, like counting down instead of up :)
[18:23:33] <braincracker> it does not matter which way bits flip ;/
[18:23:50] <theBear> yeah, but what about bytes ? <grin>
[18:23:55] <braincracker> hm
[18:24:15] <theBear> and i do like your previous statement btw, it just doesn't really apply here
[18:25:12] <braincracker> also a gray counter is way better than a binary counter
[18:26:36] <braincracker> http://m.eet.com/media/1062045/max-gc-01.gif
[18:32:53] <N1njaneer> I like LFSRs, so simple yet so robust!
[21:21:53] <braincracker> reloaded
[21:21:55] <braincracker> :)
[22:17:39] <MarkX> quick question, is it possible to program regular c/c++ programs using atmel studio 6?
[22:18:52] <Tom_itx> it uses studio framework
[22:20:00] <MarkX> you mean its based off of visual studio 2010, right?
[22:20:11] <Tom_itx> it uses ms studio yes
[22:20:22] <Tom_itx> however the compiler is targeted toward atmel chips
[22:20:34] <Tom_itx> plug in a different compiler...
[22:21:04] <MarkX> ah okay
[22:21:22] <MarkX> that sounds complicated.... i think i'll just install visual c++ 2010...
[22:24:20] <sjokkis> if i have a tiny program doing nothing but polling a single pin, is the response time usually faster or slower than reacting to that same pin using an interrupt?
[22:26:37] <Casper> sjokkis: interrupt take like 16 cycles I think... maybe less
[22:26:49] <sjokkis> thanks, Casper
[22:26:51] <Casper> will your program react in less than that number of cycles? maybe
[22:27:16] <sjokkis> possibly, but only if does positively *nothing* except poll the pin
[22:28:25] <Casper> yeah
[22:28:26] <Casper> also
[22:28:37] <Casper> the responce time will be imprevisible, so timing can be an issue
[22:29:00] <Casper> while interrupt, if no other are happening, are "guaranted" to always execute in the same time
[22:31:41] <sjokkis> right
[22:31:43] <sjokkis> one more question
[22:32:27] <sjokkis> if an event triggers an interrupt, and i set a flag in the interrupt handler so i can deal with it in main, should i clear the flag as soon as i start processing in main, or as soon as i'm done processing?
[22:33:18] <sjokkis> my thinking is to clear as soon as possible, so that i don't miss the flag being set again while i'm working on the first event, but there might be problems with that i'm not seeing
[22:50:15] <Valen> shouldn't matter
[22:50:26] <Valen> you will just run it multiple times
[22:50:31] <Valen> (if you clear asap)
[22:55:14] <sjokkis> won't the interrupt for an event will be effectively disabled until i clear the flag, and can't that be a problem if the processing time is significant?
[22:55:43] <sjokkis> well, i know the first is true. i'm wondering if the second is.
[23:07:51] <Casper> sjokkis: I'ld clear as soon as possible, unless you see it that can cause more problem than missing another interrupt
[23:24:53] <Valen> hang on
[23:25:02] <Valen> there are multiple things here
[23:25:08] <Valen> you have an event
[23:25:20] <Valen> it sets a flag in some interrupt register
[23:25:34] <Valen> execution then jumps to the ISR if you have interrupts enabled
[23:25:51] <Valen> inside your ISR you can set a variable in general ram
[23:26:03] <Valen> you can clear that flag in your main loop
[23:26:16] <Valen> the execution of the ISR will clear the flag in the interrupt register
[23:26:35] <sjokkis> i'm talking about when to clear the flag that is set manually in the ISR
[23:27:07] <Valen> (13:40:24) sjokkis: won't the interrupt for an event will be effectively disabled until i clear the flag, and can't that be a problem if the processing time is significant?
[23:27:24] <sjokkis> right
[23:27:26] <Valen> the ISR will run as often as the interrupt is called
[23:27:33] <sjokkis> sure, but...
[23:27:38] <Valen> assuming you are able to finish it
[23:27:45] <Valen> anything outside that is up to you
[23:28:26] <sjokkis> if we have some procedure in main that reacts to the flag we set manually, and we only clear that flag at the end of the procedure, any invocations of the ISR that happen in the meantime will try to set the flag high when it is high already, and the interrupt won't actually do anything
[23:28:41] <Valen> thats your problem ;->
[23:28:51] <sjokkis> it was the basis for my question
[23:28:58] <Valen> perhaps you should describe what you are actually trying to do
[23:29:18] <Valen> if you have insufficient processing time then nothing will solve that problem
[23:29:23] <sjokkis> i'm asking a theoretical question. when is it best to clear the flag. at the start or at the end of the procedure in main
[23:29:32] <Valen> what difference does it make?
[23:29:41] <sjokkis> it matters because of what i said above
[23:29:45] <Valen> in some cases it could be better either way
[23:29:53] <Valen> what is the best colour?
[23:29:59] <sjokkis> right. i guess the answer is really "depends"
[23:30:01] <sjokkis> but saying it doesn't matter is shortsighted
[23:30:10] <Valen> i didn't say it doesnt matter
[23:30:15] <Valen> i said what difference does it make
[23:30:57] <sjokkis> uh, in some applications i can see missing interrupts having some really spectacular consequences
[23:31:08] <Valen> if you were to describe what you were trying to achieve there may be better options
[23:31:13] <sjokkis> the sky is the limit there, really
[23:31:41] <sjokkis> i don't have a particular application in mind. i'm just asking
[23:32:28] <Valen> i mean if you are doing something where if you get N pulses in and need to do N things as a result then connect N to a counter and if the counter value is > 0 then buffer it and execute N times
[23:33:35] <Valen> your ISR could increment a counter rather than setting a flag
[23:33:42] <sjokkis> yeah, that works
[23:33:48] <sjokkis> thanks
[23:33:53] <Valen> (note use atomic operations around manipulating a shared variable)
[23:34:02] <sjokkis> yeah
[23:44:55] <N1njaneer> Also as a sidenote, you can do some tricks like turning interrupts back on inside of an interrupt, or wrapping the innards of another interrupt-run procedure inside of a seperate function call, so you can selectively check for data if you expect your one interrupt to take a bit longer than expected that might result in another interrupt getting called late.
[23:45:03] <N1njaneer> For instance, receiving high-rate serial data.
[23:46:42] <N1njaneer> If you have a function that processes the receipt of an incoming byte and stuffs it in to a buffer, you can put that in a function called something like checkForByteRx(), and then you call that function inside of the UART RX ISR. This then allows you to call checkForByteRx() periodically any time that interrupts may be turned off for a while, so you can ensure that you don't miss any incoming data
[23:46:42] <N1njaneer> bytes.
[23:47:50] <N1njaneer> You just make sure to do the double-check inside of checkForByteRx() that there actually IS data to be received, so in the case the function is called manually rather from the RX ISR firing that you only act when necessary, and return when not. :)
[23:48:32] <N1njaneer> That trick has helped out in a few instances where I effectively needed nested interrupt priorities because of a LOT of stuff going on at once.
[23:48:48] <Valen> I do suggest keeping the function small and then inlining small functions in the compiler ;->
[23:49:04] <N1njaneer> If you have the code-space to do it, sure.
[23:49:23] <Valen> just avoids the overhead of a function call in the isr
[23:50:30] <N1njaneer> Yep. Or in the case of the example above, check for the condition that would fire the interrupt manually (checking if data is present, in this case) and then doing the function call if required.
[23:54:42] <Valen> so anybody know an off the shelf reflow oven controller?
[23:55:45] <braincracker> yes
[23:55:51] <Valen> link?
[23:55:53] <braincracker> in the $10k reflow oven
[23:55:58] <Valen> lol
[23:56:03] <Valen> aim lower ;->
[23:56:17] <braincracker> well make one ?:)
[23:56:28] <braincracker> toaster oven and temperature profile
[23:56:41] <braincracker> the difficulty is sensing the temperature
[23:56:50] <braincracker> profiling is just piece of cake
[23:56:55] <Valen> I was hoping that there was an off the shelf "kit" that i could use to run it
[23:57:04] <Valen> I want to make some PCB's, not shave yaks ;->
[23:57:16] <theBear> that's the MAIN difference between us Valen :)
[23:57:47] <Valen> theBear: you probably go and make your own soap to make the shaving cream for said yak
[23:58:42] <theBear> Valen, i know a generic 'pid controller' unit would do it, but i don't think they get REAL cheap, there are non 'industrial' ones, little boxes with a few settings and buttons on the front, maybe a mains output or two and a couple sensor/switch kinda inputs, designed for exactly this 'kind of thing', but i think probly still a bit expensive
[23:58:43] <braincracker> temp sensor options: $500 IR thermometers
[23:58:54] <braincracker> PT100 platinum RTD
[23:58:59] <theBear> Valen, heh, i may well, and insist on using my straight razor <grin> fortunately i don't have access to yaks
[23:59:02] <Valen> I have a PID for my actual food oven
[23:59:15] <theBear> braincracker, no way ! k type can take reflow temps
[23:59:16] <Valen> but they won't do temp profiles and rates
[23:59:22] <braincracker> or for fun, try an 1n4148 diode :) may work a few cycles up to 175-200C
[23:59:27] <theBear> ahh, so you both know them, and good point
[23:59:36] <braincracker> ok, thermocouples are option too
[23:59:41] <theBear> Valen, you can do micro stuff tho can't yer ? it's not a HUGE project to pull off
[23:59:54] <theBear> braincracker, and they're 'a few bucks' not hundreds :)