#avr | Logs for 2013-10-27

Back
[02:09:06] <jenia_> how do you control the rate of polling for an adc?
[02:09:38] <jenia_> for lets say PWM, i controlled the frequeny using anyoher timer to toggle the led on aand off
[02:09:54] <jenia_> how do you control the frequecny using the ADC module
[06:34:05] <inflex> lo there Tom_itx
[07:15:21] <megal0maniac> Is there a way to simulate operation of an AVR in conjunction with something like pspice? I.e. virtual logic analyzer
[07:25:56] <RikusW> with labview yes $$$$
[07:26:01] <RikusW> hi
[07:26:18] <RikusW> guess what a blaster cable cost ? R4000 at RS....
[07:26:37] <RikusW> ping megal0maniac
[07:27:03] <RikusW> http://www.labcenter.com/index.cfm
[07:28:05] <RikusW> 295 GBP for AVR
[07:28:12] <megal0maniac> Owie
[07:28:18] <RikusW> though the educational version might be cheaper
[07:28:26] <RikusW> http://www.labcenter.com/ordering/cprices.cfm
[07:29:04] <megal0maniac> Hmmm... http://www.hobbytronics.co.za/p/586/ni-labview-student-edition
[07:29:08] <RikusW> megal0maniac: get the platinum edition :-P
[07:29:54] <megal0maniac> I think I'll pass, thanks ;)
[07:34:37] <RikusW> http://www.fpga4fun.com
[07:35:16] <specing> Damn
[07:35:21] <specing> I have a homework
[07:35:57] <specing> in java :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :(
[07:36:29] <RikusW> specing: did you enter 50i :( ? :-P
[07:36:50] * RikusW didn't know vim did irc ;)
[07:39:21] <specing> RikusW: python -c 'print (":( " * 50)'
[07:39:28] <specing> <3 python
[07:57:05] <inflex> aaaah, Java... one of the few languages I wish would die faster than Python
[07:57:26] <w|zzy> I'm with inflex
[07:58:23] <inflex> I think Python could have been truly a good system, but dang, that active-whitespace is such a killer for a lot of things. It was bad in FORTRAN77, it's bad new
[07:58:25] <inflex> now
[07:59:30] <w|zzy> agree. white space shouldn't mean anything
[08:00:29] <inflex> Obviously it's loved by many... just doesn't gel with me :( I'm no fan of C either, it's excrutiating to do anything "big" with, but at least it works well for uCs
[08:02:29] <w|zzy> yeah
[08:08:26] <specing> inflex: big? -> C++
[08:08:55] <w|zzy> erlang
[08:16:53] <Roklobsta> haskell
[08:21:30] <carabia> scala
[08:21:36] <megal0maniac> Arduino
[08:22:01] <carabia> yes
[08:22:12] <megal0maniac> :P
[08:26:10] <Roklobsta> megal0maniac: you win. worst ide ever
[08:27:05] <megal0maniac> Is it an IDE though?
[08:28:06] <megal0maniac> Most text editors have more reason to be called IDEs. Heck, with some clever preprocessing and makefile magic, many text editors could do the same job better
[08:28:41] <twnqx> emacs does it better. meta-x compile for the win.
[10:53:03] <tetrad> has anyone worked with the atmega164a / atmega164 part?
[10:56:21] <tetrad> I'm trying to get some code running on it with an avr-gcc toolchain, having some stack problems
[10:57:30] <megal0maniac> tetrad: So ask a real question :)
[10:58:18] <tetrad> hmm
[10:58:39] <tetrad> it seems like what is happening is that the default memory layout only allows me to nest something like 2 functions deep or the device resets
[10:58:47] <tetrad> my stack is running into something
[10:58:55] <tetrad> I tried to re-arrange things and it just won't run
[10:59:02] <tetrad> it would be really nice to have JTAG right now :(
[10:59:22] <tetrad> so I guess the question: any advice? :)
[11:00:38] <tetrad> (the device resets when it returns from a function, seeming to indicate stack corruption)
[11:02:53] <megal0maniac> Are you using Atmel Studio?
[11:03:18] <tetrad> no, avr-gcc with a custom Makefile on Linux
[11:04:23] <megal0maniac> Well if you can get access to Atmel Studio, then you could try http://gallery.atmel.com/Products/Details/c34c555d-86dc-4514-af24-013bc3fd2141?
[11:04:53] <tetrad> I believe the device arch is avr5 not avr8
[11:07:18] <megal0maniac> I think you're making that up
[11:07:40] <megal0maniac> It's an 8bit uC, not 5bit. And AVR is AVR
[11:09:30] <tetrad> maybe avr-gcc uses a different terminology than atmel... yeah there's no avr8 on this list so that must cover most of them
[11:09:33] <tetrad> http://gcc.gnu.org/onlinedocs/gcc/AVR-Options.html
[11:10:21] <tetrad> I think I've got AVR studio in a VM somewhere I'll just have to see if I can port makefiles back and forth
[11:14:18] <megal0maniac> It works quite well. Add instrumentation code, start debugging with simulator, when debugging is paused (at a breakpoint) then refresh and you see how much stack you're using
[11:19:00] <tetrad> hmm I've got avr studio 4 :)
[11:19:20] <megal0maniac> That won't do :)
[11:19:25] <tetrad> lol no
[11:45:12] <megal0maniac_afk> Welcome back abcminiuser :)
[11:46:28] <abcminiuser> Ahoyhoy
[11:46:31] <abcminiuser> Tusen takk
[11:46:35] <abcminiuser> Europe was fun
[11:47:08] <Tom_itx> hi
[11:49:09] <beaky> hello
[11:49:12] <beaky> are there any pid libraries for avr
[11:49:23] <specing> PID?
[11:49:23] <beaky> also are there any caveats to using 32-bit floats in avr
[11:49:25] <beaky> yes
[11:49:29] <Tom_itx> i doubt it
[11:49:34] <beaky> ah how come? :(
[11:49:43] <Tom_itx> because you didn't write one
[11:49:54] <specing> beaky: floats are not efficient on AVRs
[11:50:05] <Tom_itx> specing, Proportional Integral Derivative
[11:50:06] <specing> fixed point arithmetic with custom ASM is fastest!
[11:50:09] <megal0maniac_afk> Except for the ones with FPUs
[11:50:20] <beaky> ah
[11:50:27] <specing> megal0maniac_afk: there are 8-bit AVRs with FPUs?
[11:50:28] <specing> :O
[11:50:41] <beaky> yeah 8-bit avr with fpu is like a honda with a v12
[11:51:01] <megal0maniac_afk> Of course! mega328f for example
[11:51:06] <beaky> how do i do fix point with C?
[11:51:11] <Tom_itx> with training wheels
[11:51:23] <specing> megal0maniac_afk: 32-bit FPU?
[11:51:29] <specing> or is it some 8-bit FPU?
[11:51:37] <megal0maniac_afk> >.<
[11:51:48] <megal0maniac_afk> </troll>
[11:51:53] <specing> EHRMAGHERD!!!!
[11:52:00] <beaky> ?
[11:53:39] <beaky> so using floats is a bad idea?
[11:53:55] <beaky> what if i use them in a computation done every 10 minutes?
[11:54:01] <beaky> or every millisecond
[11:54:50] <specing> Its very slow
[11:55:01] <specing> your AVR will grind to a halt and die of shame
[11:55:10] <beaky> hah is it that bad?
[11:56:03] <specing> look at disasm and see for yourself
[11:56:11] <abcminiuser> Hrm Tom_itx I think I can improve the PDI programming speed...
[11:56:24] <Fornaxian> faster than my old commodore 64 doing floating point!
[11:56:33] <beaky> so I shouldn't sue floats
[11:56:37] <beaky> use*
[11:56:48] <Tom_itx> abcminiuser, ehh? after all these years...
[11:56:57] <beaky> whats pdi?
[11:56:57] <abcminiuser> Indeed
[11:56:59] <abcminiuser> My bad
[11:57:08] <Tom_itx> beaky if you don't know don't worry
[11:57:15] <abcminiuser> Some of the protocol overhead can be reduced
[11:57:22] <abcminiuser> Might make a difference for readback
[11:57:35] <Tom_itx> better or worse?
[11:57:37] <beaky> pdi = Program and Debug Interface?
[11:58:15] <Fornaxian> beaky, floating point math is doable...it takes a lot of memory and is a processor hog as you don't have a floating point processor in hardware like your PC does.
[11:58:25] <megal0maniac_afk> Tom_itx: Why would you change it knowing it would be worse?
[11:58:28] <Fornaxian> all depends on what you need to do iwth it.
[11:58:35] <beaky> i just want to compute my pid with it
[11:58:50] <Tom_itx> i wouldn't
[11:58:55] <Fornaxian> I like fixed point math myself.
[11:58:58] <beaky> ah
[11:59:02] <beaky> how do i fo dixed point
[11:59:04] <Tom_itx> however that _was_ done early on to improve reliability
[11:59:09] <Fornaxian> do everything in integer and shift the decimal point when done.
[11:59:45] <beaky> wow that is genius why didn't i think of that
[11:59:50] <beaky> that is way faster than floating point
[11:59:58] <abcminiuser> Tom_itx, better
[12:00:05] <beaky> or is that what avr-libc does to emulate ieee 754 for float
[12:00:05] <Fornaxian> beaky, yup.
[12:00:08] <abcminiuser> Much less read overhead, a little less write
[12:00:13] <Fornaxian> there are also fixed point math libs ou tthere.
[12:00:18] <Tom_itx> same for TPI?
[12:00:25] <Fornaxian> http://avrfix.sourceforge.net/
[12:00:41] <beaky> wow i love libraries
[12:00:44] <beaky> libraries are awesome
[12:00:51] <MrMobius> you can also do BCD if you need more accuracy than float and it doesnt need to be fast
[12:01:48] <beaky> BCD is genius
[12:01:57] <beaky> okay i will try all three and see which is best
[12:02:01] <Fornaxian> I do it all as integer math these days myself...
[12:02:23] <Fornaxian> work from a fixed decimal point and shift everything by 10, 100, or 1000
[12:02:32] <Fornaxian> then do the math in integer
[12:02:45] <Fornaxian> then shift the answer back out the 1,2, or 3 decimal places.
[12:02:51] <abcminiuser> Not for TPI
[12:02:59] <abcminiuser> But that's so small it doesn't matter
[12:03:02] <Fornaxian> very little on a microcontroller that I do ever needs much more accuracy than that anyhow.
[12:03:04] <beaky> are there alternatives to finite state machines to formally express microcontorller applications
[12:03:08] * abcminiuser wonders who ate his PDI cable
[12:03:17] * Fornaxian burps
[12:03:35] <Fornaxian> not even sure that I have any chips that use PDI.
[12:03:45] <beaky> i think only the new ones
[12:03:52] <beaky> like avr32?
[12:03:53] <twnqx> and thus you just ate abcminiuser's cable. nice.
[12:04:11] <Fornaxian> avr32 is a whole other world from the 8bit avr chips I have.
[12:04:17] <Fornaxian> it's more like arm only different.
[12:04:43] <Tom_itx> abcminiuser, ahh i forgot you can test
[12:04:56] <beaky> I love avr
[12:05:01] <beaky> it is the best microcontroller
[12:05:12] <beaky> and the best community
[12:05:15] <Fornaxian> interestingly, it seems gcc has the ability to be compiled with fixed point math support.
[12:05:21] <Tom_itx> i liked the 68332 personally
[12:05:34] <Fornaxian> and there seems to be a patch for avr-gcc to support it too.
[12:05:46] <MrMobius> Fornaxian, why even shift at all? just leave it unsihfted
[12:05:54] <Tom_itx> you can download avrgcc from atmel now
[12:06:09] <Fornaxian> MrMobius, if you have fixed point math capability, yeah, that's fine.
[12:06:24] <Fornaxian> but I don't have that so far as I know without the fixed point math lib.
[12:06:35] <abcminiuser> Balls.
[12:07:07] <Tom_itx> no cable?
[12:07:16] <abcminiuser> Must be in a box somewhere
[12:07:29] * Tom_itx stares at his cable
[12:07:29] <beaky> any ideas why my avr dragon programs slower than my avr isp mkii
[12:07:41] <beaky> even though both isp clock frequency are same (~1Mhz)
[12:07:42] <abcminiuser> Oh right, I have a B1 Xplained
[12:07:52] <MrMobius> Fornaxian, i dont get what you mean. i dont use any libs either. if you have 4 represented as 400 and you want to see f its less than 5 just compare if to < 500. no need to convert 400 to 4 before checking < 5
[12:08:06] <megal0maniac_afk> I actually nearly ordered Atmel samples the other day. But, again, I was scared away by the page that asks for project details
[12:08:19] <megal0maniac_afk> attiny10 was one of them
[12:08:20] <Fornaxian> MrMobius, if you have 3.46 and 4.13 and want to add them...or whatever..
[12:08:31] <Tom_itx> attiny10 is cool
[12:08:32] <MrMobius> Fornaxian, why not? 346+413
[12:08:33] <Fornaxian> shift by 100...do the math in integer...then shift back.
[12:08:42] <MrMobius> Fornaxian, but why even shift?
[12:08:43] <Fornaxian> so you are doing the shift there.
[12:08:55] <megal0maniac_afk> Tom_itx: But I don't have a huge industrial project that I'm designing for :P
[12:08:57] <Fornaxian> you just did it by removing the decimal point..or by shifting it 2 places to the right.
[12:09:46] <MrMobius> megal0maniac_afk, just be honest. i never lie on sample forms and i almost always get approved. i just tell them about my latest hobby project and pick less than 100 for expected usage
[12:11:04] <beaky> wow i didnt know they give freebies to hobby projects :D
[12:11:19] <megal0maniac_afk> MrMobius: Look what you've done :P
[12:11:19] <Fornaxian> some do, some don't, some don't care.
[12:11:34] <beaky> maybe they are hoping that that hobby project is the next arduino :D
[12:14:46] <MrMobius> maybe. ive only sampled once but 10 different companies sent me stuff. enough time has pased that i can sample again but i havent tried all that stuff yet
[12:15:33] <Tom_itx> megal0maniac_afk, they like students too
[12:15:44] <Tom_itx> future industrial project designers
[12:16:15] <Tom_itx> they even intern and hire a few
[12:18:34] <megal0maniac_afk> So I've heard :)
[12:23:44] <carabia> i wonder if beaky loves free samples
[12:27:03] <twnqx> some people are strange
[12:27:13] <megal0maniac_afk> carabia: Are free samples something?
[12:27:19] <twnqx> i got a call back from analog devices after asking for some isolating CAN transceivers
[12:28:20] <beaky> whats a can transciever
[12:28:31] <Tom_itx> for CAN buss
[12:28:50] <Tom_itx> optoisolated
[12:29:01] <beaky> wow
[12:29:06] <beaky> that is awesome
[12:29:33] <abcminiuser> Hrm, not a measurable improvement for that
[12:29:35] <abcminiuser> Damn
[12:29:45] <Tom_itx> back to the drawing board
[12:29:49] <beaky> what is a most abused feature of avr?
[12:29:54] <beaky> that i am probably abusing right now
[12:30:00] <beaky> and for which better alternatives exist
[12:30:24] <Tom_itx> poor supply filtering
[12:30:39] <beaky> i stick 100nF caps everywhere i can
[12:30:46] <beaky> or is taht not enough
[12:31:32] <Tom_itx> every board is different, every application is different
[12:32:04] <beaky> ha
[12:32:06] <beaky> ah*
[12:33:02] <tzanger> in general I use 100nF peppered around, and on nets that I feel have to be especially quiet I'll add 1uF and 10nf after either a 47 ohm resistor or a ferrite bead to try to help isolate the net (as long as the net doesn't need a ton of current)
[12:33:30] <tzanger> it's important to ahve the caps as physically close to the supply pins as possible. ideally on the other side of the board
[12:34:00] <tzanger> but like Tom_itx says the details really are board and application specific
[12:34:35] <tzanger> for a rule of thumb, 100nf at every device, 1uf for every group of devices and some bulk capacitance for the board is usually the right approach
[12:35:03] <beaky> so i keep the caps on the component side?
[12:36:28] <tzanger> for most cases that is perfectly fine
[12:36:39] <tzanger> opposite side and right at the power pins reduces inductance
[12:37:07] <beaky> ah right
[12:37:38] <beaky> wow i have ceramic capacitors all over this board
[12:38:07] <beaky> so its noraml to have at least one per power pin... i am not crazy... everythihg is okay... :|
[12:39:31] <tzanger> heh no you're not crazy
[12:40:07] <beaky> my design probably still sucks
[12:41:09] <beaky> i have dozens of vias, 6 traces going underneath my ICs, undisambiguated terminals for power and for transducers, mosfets close to each other, etc.
[12:41:26] <beaky> also lack of diodes and fuses for protection
[12:41:58] <twnqx> there's one thing that matters: it works
[12:46:17] <Tom_itx> some must work underwater, on the moon, in a vaccuum, in a noisy flourescent industrial environment...
[12:46:36] <twnqx> and then you take the needed action
[12:46:40] <Tom_itx> outdoors all year round
[12:46:58] <twnqx> but you don't make your hobby project work in all of those environments, at the same time
[12:47:17] * twnqx considers vacuum thermally challenging
[12:47:18] <Tom_itx> i'm illustrating differences
[12:47:29] <beaky> yeah how do you get designs to work in space
[12:48:02] <megal0maniac_afk> bigger caps and aluminium foil
[12:48:14] <Tom_itx> particle bombardment from space atmosphere
[12:48:20] <twnqx> select components for wide thermal ranges, preferable radiation hardened
[12:48:30] <megal0maniac_afk> Tom_itx: That's what the foil is for
[12:48:36] <twnqx> that won't do
[12:48:50] <twnqx> you need a bit more
[12:48:56] * Tom_itx throws an asteroid thru megal0maniac_afk's tin foil
[12:49:15] * megal0maniac_afk catches it
[12:49:21] <carabia> megal0maniac_afk: yeah free samples are
[12:49:23] <carabia> ever heard?
[12:50:04] <megal0maniac_afk> carabia: If it's something, then beaky loves it :)
[12:50:19] <megal0maniac_afk> I've gotten samples before
[12:52:04] <carabia> i love sampling!
[12:52:54] <Tom_itx> me too... cake, pie, custards, ice cream....
[12:56:18] <carabia> yes...
[12:56:21] <carabia> pastry sampling
[12:56:25] <jenia> hello
[12:56:33] <carabia> hello
[12:56:50] <carabia> what can i get for you? today's special is pwm and loving
[12:56:56] <jenia> i have a number in int16_t that i want to assign to two 8 bits registers
[12:57:27] <Tom_itx> >> << are your friends
[12:57:32] <jenia> OCR1AH/L
[12:58:20] <carabia> uint8_t a = int16 >> 8; uint8_t b = int16;
[12:58:47] <carabia> may i interest you in some smps?
[12:59:04] <jenia> ahh okay thanks a lot
[13:01:28] <megal0maniac_afk> carabia: For IO level translation? Yes please!
[13:01:42] <megal0maniac_afk> Silly mosfets, wasting all my mA
[13:05:11] <carabia> USB?
[13:05:22] <carabia> seriously this powering off of usb is just BS
[13:05:36] <carabia> get a proper supply
[13:05:42] <carabia> mA's are nothing
[13:13:01] <SethHope> Is anyone on who can help me with a PS/2 keyboard issue?
[14:04:49] <Fornaxian> SethHope, probably.
[14:05:06] <Fornaxian> you should just ask the question you want an answer to rather than asking if someone can help you.
[14:40:00] <malinus> Fornaxian, it's naive to think you can have a technical irc channel without having "don't ask to ask, just ask", in the topic :)
[14:46:43] <megal0maniac_afk> Woah! Just accidentally learnt that you can launch applications on Windows 7 using Windows key + 1, 2, 3 etc
[14:54:14] <carabia> whoa
[14:55:12] <carabia> someone was making some sort of an oven hack... So he states he found a line that controls the heater elements, but then he decided, nah, i'll just cut the ac mains line and use that as a power switch
[14:55:37] <carabia> using an ssr
[14:56:04] <Tom_itx> like this? http://tom-itx.dyndns.org:81/~webpage/toaster_oven/toaster_oven_index.php
[14:56:09] <Tom_itx> triac
[14:56:11] <Tom_itx> no ssr
[14:56:57] <carabia> okay, too lazy to go through pictures here
[14:57:06] <carabia> why put the switch on the mains
[14:57:21] <Tom_itx> mine is on the heating elements
[14:57:34] <carabia> yeah okay. That's reasonable
[14:57:48] <carabia> this was some guy on youtube, he just said he had better access to the mains line
[14:57:50] <carabia> :D
[14:58:01] <Tom_itx> only thing between them and the mains is the original timer
[14:58:08] <Tom_itx> so it wouldn't matter
[14:58:14] <carabia> alrightey
[14:58:31] <carabia> well yeah doesn't. But you can bypass the timer then
[14:58:52] <Tom_itx> or lock it on high
[14:59:00] <carabia> was thinking it'd be more sophisticated to it would drive a relay or something
[14:59:09] <carabia> to=so
[15:00:50] <Tom_itx> triac is the shizzle
[15:01:05] <Tom_itx> relay is way old school
[15:02:21] <carabia> i love relays
[15:02:29] <carabia> beaky does too
[15:06:15] <Tom_itx> what does beaky know
[15:06:17] <Tom_itx> :)
[15:06:33] <Tom_itx> relays need back emf diodes
[15:07:48] <Zad0k> Hi! I'm trying to blink 3 leds with an attiny85, but this code doesn't work (http://pastie.org/8435389) : the led on PB0 is the only one to blink...(and it's barely viewable)
[15:12:13] <megal0maniac_afk> Zad0k: Well firstly, I'd change = to |=
[15:12:35] <megal0maniac_afk> Then DDRB = (1<<DDB0) to DDRB = (1 << 0)
[15:13:03] <megal0maniac_afk> And I think the main problem is PORTB ^= (1<<DDB0)
[15:13:16] <megal0maniac_afk> I'd just go PINB |= (1 << 0)
[15:13:31] <megal0maniac_afk> (PINB will toggle pin state if a 1 is written to it)
[15:14:16] <Tom_itx> PORTB ^= 0xFF will blink the whole port
[15:14:21] <megal0maniac_afk> And put your #defines before your #includes as delay.h relies on F_CPU being defined, and I've had it moan at me
[15:16:01] <Zad0k> megal0maniac_afk, you said "Then DDRB = (1<<DDB0) to DDRB = (1 << 0)", but how do I do for the two others? DDRB = (1 << 1) and DDRB = (1 << 2) ?
[15:16:08] <megal0maniac_afk> Yip
[15:16:37] <megal0maniac_afk> You're just flipping bits in DDRB, no need to overcomplicate it
[15:17:05] <Zad0k> Thanks. Do you know any good sort of tuts on C for microcontrollers btw ?
[15:20:36] <Zad0k> Okay megal0maniac_afk , am I right now ? http://pastie.org/8435417
[15:21:13] <megal0maniac_afk> Zad0k: No, but if you know C, then get familiar with bitwise operations, and then the datasheet should show you the rest. For specific stuff, these tuts are pretty good. The registers very possibly won't be the same, but it's probably a good thing as it forces you to dig into the datasheet :P The concepts don't change http://fourwalledcubicle.com/AVRArticles.php
[15:21:47] <megal0maniac_afk> What are lines 13-15 supposed to do?
[15:21:55] <Tom_itx> Zad0k, go read this: http://tom-itx.dyndns.org:81/~webpage/avr/c_bits/bits_index.php
[15:22:35] <Zad0k> megal0maniac_afk, It's suppose to ensure that the pin is off
[15:22:41] <juri_> um, stupid question: i'm trying to build a 5V <-> 3.3V level shifter... whats the diode i see integrated into many mosfets' symbols mean?
[15:22:50] <Zad0k> Erf, i'm french, ,ot sure about the translation
[15:23:00] <Zad0k> Thanks Tom_itx
[15:23:03] <juri_> http://www.rocketnumbernine.com/2009/04/10/5v-33v-bidirectional-level-converter
[15:23:29] <juri_> ^--- i'm building the last item off of that page, but using a different mosfet (irf510). will i run into "complications"?
[15:23:32] <megal0maniac_afk> Zad0k: Replace those 3 lines with PORTB &= ~0x07;
[15:23:58] <Zad0k> megal0maniac_afk, I have no idea what it is but I'll do so :)
[15:23:59] <megal0maniac_afk> Or PORTB &= ~0b00000111
[15:24:40] <Zad0k> Okay, I'll try it on my breadboard
[15:25:21] <Tom_itx> also make sure you got good connections on your breadboard, they suck for that
[15:25:32] <megal0maniac_afk> Zad0k: 0x07 (hex) expands to 00000111 in binary, thus the lower 3 bits that you're trying to change. The ~ means not, so you're setting those 3 bits to 0, and the &= ensures that the other bits aren't changed to a 1 unless they are already 1. I.e. don't change the other bits
[15:25:53] <Zad0k> Okay I see
[15:26:01] <Zad0k> Thanks
[15:26:09] <megal0maniac_afk> And strictly speaking, lines 9 to 11 should also be |=
[15:27:18] <megal0maniac_afk> And you can compound the whole thing into DDRB |= 0x07; PORTB &= ~0x07; for(;;) { PINB |= 0x07; _delay_ms(DELAY); }
[15:27:31] <Zad0k> I do know the thruth tables of all the basic operators since I had to learn them at school, but we don't use microcontrollers yet, only basic thinks like 4071, 4081, 4011 components
[15:27:59] <Zad0k> megal0maniac_afk, Does this short code make all the ports blink?
[15:28:50] <Tom_itx> ^= 0xFF will
[15:29:18] <Zad0k> Okay, I uploaded it, the result is the same
[15:29:24] <megal0maniac_afk> Zad0k: What Tom_itx said. The shortened version does exactly the same thing as yours, just in less lines
[15:29:34] <Zad0k> except that it's way longer to blink
[15:31:28] <Tom_itx> Zad0k, http://tom-itx.dyndns.org:81/~webpage/how_to/atmega168/mega168_howto_main_index.php
[15:32:04] <Zad0k> Tom_itx, Thanks, that's exactly what I have done :)
[15:37:30] <Zad0k> Well, thanks for your help guy, I'll just dig a little by my own, it's only 3 leds to blink after all :) Thanks, cya
[15:46:51] <megal0maniac_afk> I blame rogue electrons
[15:54:48] <abcminiuser> Sweet tapdancing jesus
[15:54:53] <abcminiuser> Tom_itx, you around?
[15:55:03] <Tom_itx> should i be?
[15:55:14] <Tom_itx> after that entrance...
[15:55:27] <abcminiuser> Any idea why I chose a 250KHz PDI/TPI carrier speed?
[15:55:30] <Tom_itx> kinda a hard act to follow
[15:55:35] <abcminiuser> The real one is 2MHz, and it's a LOT goddam faster
[15:55:44] <Tom_itx> no idea
[15:55:46] <abcminiuser> 2 seconds vs 9 seconds
[15:56:08] <Tom_itx> does it affect the recovery clock?
[15:56:32] <Tom_itx> i thought they used the lowest common denominator for programming
[15:56:42] <abcminiuser> No, shouldn't
[15:56:49] <abcminiuser> Recovery is 4MHz, and that's for ISP only
[15:56:53] <abcminiuser> TPI and PDI doesn't need it
[15:57:00] <Tom_itx> early recovery used the PDI clock
[15:57:18] <Tom_itx> still in code afik
[15:57:37] <Tom_itx> compiler switch for it
[15:57:39] <Tom_itx> iirc
[15:58:08] <Tom_itx> i can test in a bit if needed
[15:59:38] <abcminiuser> Double checked, XCK_RESCUE_CLOCK_ENABLE still uses a fixed (correct) speed
[15:59:42] <abcminiuser> So this is entirely seperate
[16:00:03] <abcminiuser> Looks like I bumped it up to 1MHz at one point, then back to 500KHz in 2010
[16:00:21] <Tom_itx> what about progmem programming?
[16:00:21] <abcminiuser> Aha: " Slow AVRISP-MKII clone PDI/TPI programming speed back to 250KHz due to issues with the XPLAINBridge when PDI programming at faster rates."
[16:00:26] <Tom_itx> were there issues there?
[16:00:40] <Tom_itx> i knew there was something
[16:00:49] <abcminiuser> Still that might have been a bug
[16:00:55] <Tom_itx> worth a try
[16:00:56] <abcminiuser> I'll try on 2MHz on the XPLAIN
[16:01:03] <megal0maniac_afk> Why no ifdef?
[16:01:29] <abcminiuser> megal0maniac_afk, guess I decided if it didn't work for one it might not work for others
[16:01:47] <megal0maniac_afk> Ah, fair enough
[16:02:59] <abcminiuser> Christ knows what past me thought
[16:03:41] <Tom_itx> it was faster for a while but you slowed it down
[16:04:02] <abcminiuser> Hrm, seems stable at 2MHz
[16:07:04] <abcminiuser> Ah, hrn
[16:07:06] <abcminiuser> *hrm
[16:08:32] <Tom_itx> are you appreciating your comments now?
[16:14:07] <abcminiuser> Baesh
[16:14:20] <abcminiuser> 2MHz works, but apparently my updates today broke it
[16:14:23] <abcminiuser> Time to git diff :P
[16:15:57] <Tom_itx> holler if you get something to test
[16:17:03] <hjohnson> man, I can hardly wait until I can see again...
[16:17:36] <Tom_itx> blinded by the light?
[16:17:42] <hjohnson> laser light, yeah. :P
[16:17:55] <hjohnson> (I had my eyes zapped on Friday... so I'm still in the recovery process
[16:17:59] <Tom_itx> wear goggles
[16:18:19] <Tom_itx> if there is recovery from that
[16:18:19] <hjohnson> haha, that would kinda defeated the purpose.
[16:18:32] <allgood38> How is your vision while reading irc?
[16:18:47] <hjohnson> it's fuzzy... so I can't do this very often
[16:18:49] <hjohnson> hah
[16:19:09] <Fornaxian> Warning: Do not look into laser with remaining eye.
[16:19:30] <hjohnson> hehe... it will be wierd to be able to go around without glasses
[16:19:30] <carabia> i damaeg braen
[16:19:35] <hjohnson> (which is the ultimate goal here)
[16:20:35] <Fornaxian> "they" can't force you to wear glasses.
[16:20:41] <Fornaxian> no matter how bad your eyesight.
[16:20:51] <Fornaxian> they can fine you if you need them to drive and don't use them.
[16:21:03] <Fornaxian> but you don't have to wear them.
[16:21:05] <Tom_itx> laser surgery... not foolish laser play
[16:21:14] <megal0maniac_afk> It's ironic that shining bright, powerful, concentrated light into your eyes can actually improve your eyesight in the right hands
[16:21:24] <hjohnson> yeah
[16:21:46] <hjohnson> well, in this case it doesn't actually make it into your eyes.. it's absorbed by the outer layer of the cornea and vapourise it.
[16:22:06] <hjohnson> Fornaxian: if I didn't wear my glasses before, I'd not be able to see more than about 6" in front of my face.
[16:22:14] <carabia> concentrated light and concentration camps can both help with your perspectives
[16:22:21] <Fornaxian> hjohnson, details details.
[16:24:44] <megal0maniac_afk> http://therevolvinginternet.com/
[16:24:51] <megal0maniac_afk> It is what it says
[16:32:02] <carabia> yes the song's a classic
[16:32:19] <abcminiuser> Oh goddamit, I'm an idiot
[16:32:37] <Tom_itx> what's that make the rest of us?
[16:33:57] <abcminiuser> Smarter than me :P
[16:34:25] <Tom_itx> not on USB
[16:35:21] <abcminiuser> In any case, 2MHz is stable on the XPLAIN
[16:35:35] <abcminiuser> So guess the original change was either a bad board or a bug that I since fixed
[16:36:21] <abcminiuser> If you grab the latest code and set #define XPROG_HARDWARE_SPEED 2000000
[16:36:24] <abcminiuser> See if you can break it
[16:36:39] <Tom_itx> what file?
[16:36:54] <Tom_itx> i haven't been in there for a very long time
[16:37:05] <abcminiuser> Lib/XPROG/XPROGTarget.h
[16:37:07] <abcminiuser> Me either, apparently
[16:37:11] <Tom_itx> gotta finish my homemade stew first
[16:37:16] <abcminiuser> Mmmmmm
[16:38:54] <Tom_itx> would my files work or do i need the latest git?
[16:39:39] <abcminiuser> As long as they aren't ancient they should be OK, but I've cleaned up a bit of the code today
[16:40:03] <abcminiuser> Just shifting some of the bit manipulations into the constants to make the driver read easier, and speed up the read code
[16:40:20] <Tom_itx> looks like i grabbed it 02-10-13
[16:40:28] <Tom_itx> i'll grab another copy
[16:40:28] <abcminiuser> git pull
[16:41:55] <Tom_itx> aww crap, my link to your git is broke
[16:42:40] <Tom_itx> it won't generate a zip now?
[16:48:07] <abcminiuser> lufa-lib.org/latest-archive
[16:49:42] <Tom_itx> thanks
[16:59:05] <megal0maniac_afk> abcminiuser: Read, program, verify to PDI target works well
[17:00:18] <megal0maniac_afk> Even being naughty and running the programmer at 3v3 @ 16mhz works fine
[17:00:43] <abcminiuser> At 2MHz PDI carrier on an XMEGA?
[17:00:50] * megal0maniac_afk nods
[17:00:57] <megal0maniac_afk> x256a3u
[17:00:57] <abcminiuser> Guess I just pooped on leg previously and never re-tested
[17:01:36] <megal0maniac_afk> If it was going to fall over, running the programmer out of spec would have done it
[17:02:05] <abcminiuser> Yeah, 2MHz is fairly fast so I was a bit worried about crappy traces breaking it
[17:02:14] <abcminiuser> But then again the MKII does it with a ribbon cable
[17:02:19] <abcminiuser> So I guess it's probably safe
[17:02:56] <megal0maniac_afk> :)
[17:04:26] <megal0maniac_afk> I'm using this tower of PCBs, to a ribbon cable, to a dev board http://i.imgur.com/TjHdMCo.jpg
[17:04:53] <carabia> seems legit
[17:05:10] <megal0maniac_afk> If it was going to break due to traces...
[17:05:42] <megal0maniac_afk> Middle board is a level translator
[17:05:44] <carabia> what exactly are all the headers
[17:05:46] <carabia> oh
[17:06:12] <carabia> i'm seeing jtag over there
[17:06:17] <abcminiuser> Holy moley
[17:07:43] <megal0maniac_afk> It's a modular design. Base board is the uC itself, middle is level translation (22bit, so all of PORTB, PORTD, half of PORTC and 2 free channels), and top breaks out to JTAG, ISP, PDI, TPI
[17:08:27] <megal0maniac_afk> The other board you can get is for HV. It has the standard pinout (like the dragon) but you can use that top breakout as well for HV TPI
[17:08:53] <carabia> alright. offtopic - but that's one hella nice looking table.. or floor. I'm hoping it's the floor, way cooler that way
[17:09:19] <megal0maniac_afk> http://i.imgur.com/FULRVyb.jpg
[17:09:20] <carabia> In my appartment if hard wood walnut :)
[17:09:42] <carabia> Yeah, figures
[17:10:03] <megal0maniac_afk> carabia: It's my desk. Unfortunately it's just nice varnish, the wood itself is very soft :(
[17:10:16] <Tom_itx> abcminiuser did you try it with one of mine?
[17:10:39] <Tom_itx> i'll test it later.. gotta do a few things here first
[17:10:41] <megal0maniac_afk> Tom_itx: That's your job :P
[17:10:49] <carabia> megal0maniac_afk: well the term hard wood does not refer to the hardness of the wood
[17:10:57] <Tom_itx> but he has one or more of mine to test with
[17:11:06] <carabia> it refers to the floor either being laminate or hardwood :p
[17:11:14] <Tom_itx> i do my homework as well..
[17:11:45] <abcminiuser> Tested with your programmer Tom_itx and a XPLAIN (onboard programmer)
[17:11:50] <abcminiuser> Both seem no not catch fire
[17:11:58] <Tom_itx> ok, i'll try one afterbit
[17:12:00] <abcminiuser> Programming time is faster, read time is MUCH faster
[17:12:01] <megal0maniac_afk> carabia: I know, but it really is very soft. The chair gets marks in it just from the buttons on your jeans
[17:12:20] <Tom_itx> just set that one constant?
[17:12:29] <Tom_itx> and whaever else i needed before..
[17:12:38] <megal0maniac_afk> carabia: That's the board itself: http://i.imgur.com/Eg07Q2G.jpg?1
[17:13:04] <carabia> lookin sharp :) gotta make a hv prog myself
[17:17:13] <megal0maniac_afk> 32u2 dev board (with optional built in CDC stack), usb-serial, JTAGICE MKI, STK500 programmer with HV and automatic DWEN override, debug mode (live access to registers and RAM from custom PC software), STK500 bootloader, AVRISP MKII support with level translation for 3v3 targets and HV TPI support, general IO level translation with solder jumpers for external pull-ups on every pin, and... Arduino support. I think that's it :P
[17:17:51] <megal0maniac_afk> carabia: AVR ISP credit goes to abcminiuser. The rest (the board itself) to RikusW
[17:18:46] <abcminiuser> Which reminds me, RikusW was trying to get me to add the DWEN disable code
[17:18:50] <abcminiuser> But I kept forgetting
[17:19:04] <megal0maniac_afk> Oh yeah
[17:20:07] <megal0maniac_afk> You send 0x06 at some funky baud
[17:20:53] <abcminiuser> Well that's detailed :P
[17:21:25] <megal0maniac_afk> On the reset line. At 125kbps I think. External pull-up is required
[17:21:56] <megal0maniac_afk> But at least one of those details is probably wrong. Except for the pull-up :)
[17:22:30] <megal0maniac_afk> Would be a cool feature though. Dirt simple, and I don't think anyone has implemented it
[17:24:47] <megal0maniac_afk> abcminiuser: Which in turn, reminds me. There are still traces of other board names in the driver files for the U2S. Lines 32 in both LEDs.h and Buttons.h
[17:24:59] <abcminiuser> Le balls
[17:25:15] <megal0maniac_afk> Pretty sure that was my bad, although I'm sure I triple checked
[17:25:57] <megal0maniac_afk> I'm going to cautiously blame it on auto-collapsing sections
[17:26:26] <abcminiuser> Fixed
[17:28:11] <megal0maniac_afk> ...The hell?
[17:28:39] <megal0maniac_afk> "in 2 minutes"
[17:28:50] <megal0maniac_afk> As in the source was changed... in the future
[17:29:00] <CeruleanSky> megal0maniac_afk: I was wondering what is this 32u2 dev board that seems to anything? Is it that it can act as a programmer / jtag?
[17:29:51] <megal0maniac_afk> CeruleanSky: It's RikusW's creation. https://sites.google.com/site/megau2s/
[17:30:28] <CeruleanSky> thanks for the link
[17:31:18] <megal0maniac_afk> It can program, and there's a hackish workaround to make jtag work in AS4 for newer targets. Without hex editing dlls, device support is very limited. The jtag is based on the mkI, which is why AS6 doesn't have, and will never have support for it
[17:31:52] <megal0maniac_afk> I think it's successfully debugged a 32u4
[17:32:13] <megal0maniac_afk> I mainly use it as a dev board though
[17:34:50] <megal0maniac_afk> Applied for Atmel samples. Didn't lie. Lets see what happens
[17:37:15] <CeruleanSky> hmm
[18:08:01] <Tom_itx> megal0maniac_afk, so now they think you're a fortune 500 company??
[18:11:16] <carabia> i applied too. i start with "harro"
[18:11:30] <carabia> +ed
[18:17:47] <Amadiro> megal0maniac_afk, they've sent me samples on several occasions, so you probably won't have any trouble, if things haven't changed
[18:18:08] <Tom_itx> abcminiuser, that define isn't in that file
[18:18:21] <Tom_itx> is it one that needs created or is it somewhere else?
[18:18:39] <Tom_itx> oh crap, i'm in the wrong .h file
[18:18:50] <abcminiuser> https://github.com/abcminiuser/lufa/blob/master/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.h#L60
[18:19:24] <Tom_itx> i had the wrong file open
[18:34:53] <Tom_itx> abcminiuser, yeah it seems to work alot better
[18:35:06] <abcminiuser> Wunderbar let's make a million of them
[18:35:26] <Tom_itx> i'll post an update for the millions out there :D
[18:36:35] <Tom_itx> i've also changed the minor firmware # for 6.1
[18:36:48] <abcminiuser> Should be like that in the current repo
[18:36:59] <Tom_itx> it was 11
[18:37:04] <Tom_itx> which is outdated
[18:38:25] <Tom_itx> i should check the recovery clock as well
[18:39:13] <abcminiuser> Ah right - the config file is 0x11 but disabled, the default is good for 6.1
[18:39:43] <Tom_itx> oh?
[18:42:17] <abcminiuser> #if (!defined(FIRMWARE_VERSION_MINOR) || defined(__DOXYGEN__))
[18:42:17] <abcminiuser> /** Minor firmware version, reported to the host on request; must match the version
[18:42:17] <abcminiuser> * the host is expecting, or it (may) reject further communications with the programmer. */
[18:42:17] <abcminiuser> #define FIRMWARE_VERSION_MINOR 0x17
[18:42:17] <abcminiuser> #endif
[18:44:47] <Tom_itx> i set it to 0x18 to keep ahead a bit
[18:52:03] <Tom_itx> yep, seems ok
[19:02:52] <Tom_itx> the 4Mhz clock still works on the PDI clock for software clocking
[19:03:02] <Tom_itx> as does the hardware pin as the default
[19:27:39] <Tom_itx> ok for those of you that have my programmer there are new firmware files posted to increase the PDI programming clock to 2Mhz
[22:02:41] <ambro718> heh, I've figured out how to implement a "clause macro" which runs some entry and exit code (as is done by avr's ATOMIC_BLOCK). http://ideone.com/LtVtvQ
[22:02:54] <ambro718> it's in pure C99 unlike ATOMIC_BLOCK which relies on gcc destructors
[22:42:56] <funfunctor> hey
[22:43:21] <funfunctor> Anyone know of someone who sells a miniPCIe bringout board..
[22:47:42] <Casper> ebay?
[22:52:25] <funfunctor> yea however what am I looking for?
[22:52:33] <funfunctor> s/sells/makes/
[22:53:11] <theBear> something like minipci-e to pci-e jig/adapter/dock
[23:04:32] <funfunctor> theBear: hmm yea,
[23:10:14] <funfunctor> ebay was a good hint also
[23:10:17] <funfunctor> thanks guys!