#avr | Logs for 2012-01-31

Back
[02:22:22] <lovre> hi all
[02:24:30] <lovre> what would be the best hardware of choice for the following requirements: at least 128k flash, mac+phy ethernet, >=4 ADC... Should be not too many pins, and not too small, for hand soldering... Any ideas?
[02:41:38] <ziph> lovre: ARM Cortex M4? :)
[02:41:44] <ziph> lovre: Or M3
[02:41:58] <ziph> lovre: The STM M4's come in a 64 pin LQFP.
[02:42:05] <grummund> raspberry pi ?
[02:42:27] <lovre> ziph: m3 looks promising
[02:42:31] <lovre> grummund: not out yet :D
[02:43:00] <lovre> ziph: what do you think about LM3S6965
[02:43:02] <grummund> ok, a stupid name anyway :D
[02:43:15] <lovre> grummund: its not that bad :)
[02:43:27] <lovre> ziph: i couldnt find <100 pins for this kind of uC
[02:45:52] <ziph> lovre: http://www.st.com/internet/mcu/subclass/1521.jsp
[02:45:57] <ziph> lovre: Those do.
[02:46:29] <ziph> lovre: The other series from STM do, too.
[02:48:03] <lovre> ziph: when i select only those who have ethernet, this leaves me only with the ones with pins >=100
[02:48:11] <ziph> Oh, right.
[02:48:16] <lovre> those who have less dont have ethernet
[02:48:30] <lovre> guess i will have to make 100 work
[02:48:32] <ziph> What's wrong with 100 pins? They're easy to solder.
[02:48:42] <lovre> nothing, it will work
[02:48:52] <lovre> just wondered whats the lowest amount :D
[02:50:15] <lovre> what if i would use AVR with ENC28J60, what is the common software used for this? like a library for working with it on a higher level (stack implementation or something)?
[02:52:37] <nevdull> lovre: i believe microchip has a software library package for their enc28j chip
[02:52:44] <ziph> There's IP stacks, but you're making your life unnecessarily hard. :)
[02:53:02] <lovre> ziph: im kind of new to networking, so im not sure why :)
[02:53:12] <lovre> ziph: what should i do
[02:53:21] <ziph> lovre: The main difference is RAM to handle the packets.
[02:53:49] <ziph> lovre: ARM's tend to have a lot more. :)
[02:54:57] <lovre> so i should use ARM in any case..?
[02:55:16] <nevdull> lovre: have you considered using a small external board with embedded ethernet PHY and tcp/ip stack that talks SPI to the AVR?
[02:55:23] <nevdull> wiznet makes several models
[02:55:46] <ziph> lovre: It depends on the project.
[02:55:54] <lovre> nevdull: that would be nice, where can i find those?
[02:56:24] <ziph> lovre: Using an ARM will be cheaper and use less board space but it also means you have to tool up for it.
[02:56:37] <lovre> ziph: tool up?
[02:56:51] <ziph> lovre: Get a compiler/JTAG/etc running for it.
[02:56:56] <nevdull> google for 'wiznet' or go to their site at www.wiznet.co.kr
[02:57:08] <lovre> ziph: i see
[02:57:13] <lovre> nevdull: thanks, ill check it out
[02:57:16] <nevdull> alternatively, you could go to www.sparkfun.com and look at the wiznet boards they sell
[02:57:53] <ziph> lovre: If you have the time though it's nice to have the tools and knowledge to use them. :)
[02:58:14] <ziph> And if the software is complex they'll make it easier.
[02:58:51] <lovre> ziph: are there any libraries for arm, i appreciate examples :)
[02:59:26] <ziph> lovre: Yeap. If you use Rowley CrossWorks there's even a nice pre-emptive multitasking kernel.
[02:59:36] <nevdull> nice thing with the wiznet boards is you don't really need to know any tcp/ip programming. you just respond to interrupts on an INT or PCINT pin and then initiate an SPI dialog with the wiznet to transfer the tcp/ip data to the MCU
[02:59:37] <ziph> lovre: Plus there's LUFA for the LPC's.
[03:00:18] <nevdull> lovre: i use codesourcery codebench lite (it's free and uptodate) from www.mentor.com.
[03:00:21] <ziph> lovre: And there's IP stack examples (that due to more code and memory space use far fewer dirty tricks than AVR stacks).
[03:00:43] <nevdull> they support host platforms of windws and linux and target arm boards of gnu/linux and arm-eabi
[03:01:20] <lovre> nice
[03:02:20] <lovre> need to take a look at all this, to decide
[03:02:30] <lovre> ARM looks promising, so does wiznet module
[03:02:43] <lovre> thank you guys very much, you have been most helpful
[03:03:13] <nevdull> lovre: if you go with an arm board, check out my website at www.unix-arm.org. it has the latest feeds about arm development with linux
[03:04:12] <lovre> nevdull: nice, thank you
[03:06:11] <nevdull> sure thing, good luck with it. you're starting out on a journey that will be loads of fun
[03:07:28] <lovre> nevdull: hehe, i hope so :) thanks again
[03:07:53] <nevdull> glad to help
[03:41:51] <karlp> lovre: stm32f107 comes in lqfp64 with ethernet... not just the 100pins
[03:43:36] <karlp> too late, missed him.
[03:46:21] <karlp> nxp's 1700 series comes in 80pin options with ethernet too...
[04:00:43] <amee2k> karlp: you aren't by chance related to some dude who went by the name of KarlProf around freenode a few years ago?
[04:40:51] <karlp> amee2k: not me, sorry.
[04:41:03] <karlp> or, not sorry, depending on what that person was like :)
[04:54:47] <amee2k> karlp: oh, he was a cool guy don't worry
[04:55:43] <amee2k> just that a few years ago he disappeared from the channel we used to hang out in together
[04:55:48] <amee2k> and i haven't seen him ever since
[05:53:57] <amee2k> does the "register" modifier in C actually do anything on AVR C?
[05:55:36] <CapnKernel> In this era of optimising compilers, has it done anything in the last 20 years?
[05:55:47] <CapnKernel> Does the "auto" keyword still work?
[05:57:13] <amee2k> no idea >_>
[05:57:19] <amee2k> thats why i'm asking
[05:58:12] <eruif> how many registers does an avr have ?
[05:58:51] <amee2k> mmh 32-something? i'm not big on avr asm though
[05:59:06] <CapnKernel> 32
[05:59:07] <eruif> wow. that's more than i was expecting.
[05:59:15] <CapnKernel> x 8-but
[05:59:19] <CapnKernel> 8-bit
[05:59:49] <amee2k> AVR is a risc design so it has lots of registers but very few instruction that use RAM operands
[06:00:07] <amee2k> RISC trades more registers for less orthogonal instruction set
[06:00:45] <CapnKernel> I wouldn't agree
[06:00:53] <amee2k> no?
[06:01:18] <CapnKernel> RISC architectures tend to be more orthogonal, because more bits are used for reg specs, and less are used for encoding wacky reg-specific behaviour
[06:01:43] <ziph> Yeah, they're more orthogonal.
[06:01:45] <amee2k> hmm interresting view
[06:01:46] <CapnKernel> In general, you can do anything with one register that you can with another (although there are some minor exceptions on the AVR)
[06:02:11] <ziph> The x86 is a complete dogs breakfast of magic instructions and limitations.
[06:02:13] <CapnKernel> The x86 is perhaps the most unorthogonal architecture ever congealed.
[06:02:21] <ziph> Jinx.
[06:02:24] <ziph> ;)
[06:02:31] <amee2k> ok, no argument about x86 there >_>
[06:03:06] <ziph> The MSP430 instruction set is a thing of beauty.
[06:03:13] <CapnKernel> Cool!
[06:05:04] <amee2k> does gcc optimize "cond ? x : y" away if cond is known at compile time? o.O
[06:05:22] <CapnKernel> Yes
[06:05:30] <amee2k> good :)
[06:06:07] <CapnKernel> gcc's code isn't perfect, but it's certainly worthy
[06:09:12] <amee2k> i'm writing a bunch of macros to try and make configuring pins after start-up (DDRx and PORTx registers) more semantically intuitive
[06:09:29] <amee2k> still working on it, not sure if its going to work yet >_>
[06:19:55] <amee2k> http://paste.debian.net/154154/ << what do you guys think about that try?
[06:20:18] <amee2k> reads much easier than the commented-out register assignments, no?
[06:22:23] <amee2k> all the "PS_" prefixes mildly clobber it, but thats the price of less screwing up the namespace :/
[06:23:35] <CapnKernel> amee2k: Not too bad
[06:24:17] <amee2k> :)
[06:24:25] <amee2k> i wish the compiler could collapse all this until just the bunch of register assignments is left in the assembly code
[06:24:53] <amee2k> but it'll only get executed at start-up once so the execution time should be acceptable
[06:30:06] <amee2k> wait wtf. my flash image actually gets 10 bytes shorter when using the macros??
[06:32:15] <amee2k> wow, shit! GCC's optimizer is pretty good
[06:33:11] <amee2k> http://paste.debian.net/154156/ << this is all whats left of the setup_pins() call in main() 0.0
[06:34:43] <amee2k> it inlined the function call and reduced all the essentially static computations for the register values into just the value assignments itself
[06:43:25] <Tom_itx> what did you expect?
[06:44:06] <Tom_itx> the 'words' are all for the programmer anyway
[06:45:03] <amee2k> well, that it leaves a bunch of essentially static bitwise operations there
[06:45:31] <amee2k> hmm and i found another interresting way to save a bunch of bytes of flash
[06:45:37] <amee2k> void __attribute__((__noreturn__)) main()
[06:46:02] <amee2k> throws a couple warnings but eliminates a pile of redundant push/pop instructions
[06:47:58] <amee2k> saves 34 bytes over the usual "int main()" for me
[07:59:55] <amee2k> wtf
[08:00:03] <amee2k> did i miss something?
[08:02:05] <Kevin`> no
[08:02:37] <amee2k> somehow the connection just crapped out
[08:09:46] <eatyourguitar> your quit is timestamped at 8:11 -----> 43 minutes ago
[08:10:03] <amee2k> >_<
[08:10:05] <eatyourguitar> it says ping timeout
[08:10:30] <eatyourguitar> that means packet loss
[08:10:38] <eatyourguitar> or firewall
[08:10:51] <eatyourguitar> are you on wifi?
[08:11:17] <eatyourguitar> it does not look like a netsplit so I guess its just you that has that problem
[08:12:16] <amee2k> the server is in a colo
[08:12:34] <amee2k> i know the network failure was on my end
[08:12:43] <eatyourguitar> colo?
[08:12:49] <amee2k> thats why i find it so annyoing
[08:13:06] <amee2k> large building full of servers with big ass network connection
[08:13:21] <eatyourguitar> ahh sweet
[08:13:50] <eatyourguitar> 50F in the server room, better wear a sweater
[08:14:21] * amee2k <3 his orange fleece jacket :)
[08:14:55] <eatyourguitar> is it mostly hosting or applications
[08:15:22] <amee2k> its hosting lots of VPSs
[08:15:38] <amee2k> the box belongs to a friend of mine and i've got one of the VPSs
[08:19:18] * amee2k idly eats eatyourguitar's guitar
[08:19:34] <eatyourguitar> laptop died
[08:19:59] <eatyourguitar> how to you open a PM on the command line in IRC?
[08:20:28] <amee2k> "/msg nick blah!" ?
[08:20:36] <amee2k> depends on the client though
[08:21:58] <amee2k> woot! winding machine is winding *nod*
[08:23:26] <OndraSter> hi
[08:27:05] <amee2k> sup OndraSter :)
[08:27:22] <OndraSter> thinking if I should pay extra $20 for DHL shipping rather normal post
[08:27:26] <OndraSter> afterall, chinese post will be overloaded
[08:27:32] <OndraSter> they haven't shipped anything in last 14 days or so :P
[08:28:32] <amee2k> lol
[08:29:24] <OndraSter> I like the fact that iteadstudio is giving 100% etest
[08:29:33] <OndraSter> they were doing 50% before and 100% was paid extra
[08:30:49] <amee2k> nice
[08:30:52] <amee2k> at no extra cost?
[08:31:12] <OndraSter> ye
[08:31:17] <OndraSter> but DHL vs china post :/
[08:31:20] <OndraSter> $20 is $20
[08:31:25] <OndraSter> that's 20x 5x5cm boards :D
[08:31:25] * amee2k just figured out how to do H264 with avidemux \o/
[08:32:50] <amee2k> hmm how much are their 5x10 again?
[08:33:07] <OndraSter> $22 I think
[08:33:10] <OndraSter> 10 boards in it
[08:33:24] <amee2k> hmm
[08:33:49] <amee2k> can you specify 10 different layouts then, or do they have to be 10 identical ones?
[08:34:30] <ziph> 10 different layouts for $22?
[08:35:23] <amee2k> yesterday under the shower i had a new project idea that would work perfectly with their 5x10cm offer
[08:35:31] <OndraSter> 10 same layouts for $22
[08:35:41] <amee2k> but it would only be really practical if i can get different layouts
[08:35:56] <amee2k> i wouldn't know what to do with 10 identical boards >_<
[08:36:23] <amee2k> http://ve504.cugnet.net/~amee2k/sandbox/CIMG8948b.avi \o/
[08:36:28] <OndraSter> the thing is, it is way more expensive everywhere else :P
[08:36:38] <ziph> Use laen, you get better quality and not so many wasted boards. :)
[08:37:29] <amee2k> well, with other places i'd pay 22$ for one board
[08:37:44] <amee2k> with itead i pay 22$ for 10 and throw 9 away :(
[08:37:53] <OndraSter> but if you screw up soldering..
[08:38:09] <OndraSter> I HAVE THE DILEMMA ABOUT THE SHIPPING damnit
[08:38:20] <amee2k> YOU WANT DHL AND YOU KNOW IT
[08:38:35] <OndraSter> yeah
[08:38:36] <OndraSter> I think I do
[08:38:40] <Kevin`> amee2k: neat
[08:38:41] <amee2k> i haven't screwed up a board by soldering in years
[08:39:04] <amee2k> (well, unless it was a scrap board i only wanted the parts from)
[08:39:11] <amee2k> Kevin`: :)
[08:39:25] <OndraSter> $150 total order
[08:39:26] <OndraSter> cool
[08:39:36] <OndraSter> with DHL
[08:41:45] <OndraSter> yay bug, when you click on "update", it adds the order information twice xD
[08:41:53] <amee2k> lol
[08:42:00] <OndraSter> but you pay once
[08:42:01] <OndraSter> :P
[08:42:04] <OndraSter> I need to check the gerber files though
[08:42:10] <OndraSter> to be sure
[08:42:57] <amee2k> Kevin`: i've added a simple PID governor that only implements the integral term and it works pretty good
[08:44:08] <amee2k> using 500rpm for fast setting, 120 form medium speed and 30 for low speed
[08:44:46] <amee2k> fast speed until 20 turns remaining, then medium until 2 turns left, then low speed until zero
[08:45:20] <amee2k> pretty interresting to implement but not sure whether i'll want a fully automatic mode to begin with >_>
[09:02:55] <OndraSter> email to pcb@iteadstudio.com sent!
[09:02:56] <OndraSter> awesome
[09:03:19] <OndraSter> I actually ran into bug on their website... it added two identical orders instead one (and I paid just one) LOL
[09:03:31] <OndraSter> after clicking on "submit" to "notify me on changes @ order XXXX"
[09:04:00] <keenerd> Bah. Spent all night hacking on the Wikireader code, only got half of my feature added in. Starting to wonder if it is even possible.
[09:16:17] <amee2k> mmh
[09:16:27] <amee2k> i appear to have somehow killed a pin on my mega88
[09:16:49] <amee2k> if i just have the DMM on it, it appears to work fine
[09:17:10] <amee2k> but with almost any kind of load, the voltage doesn't go higher than a few hundred mV anymore
[09:17:25] <OndraSter> define "load"
[09:18:13] <amee2k> BJT with 10k base resistor is enough
[09:18:35] <OndraSter> huh
[09:18:38] <amee2k> it won't go higher than 0.8V with that on it, and the relay that the transistor is controlling isn't switching anymore
[09:19:05] <OndraSter> are you sure that the BJT isn't the culprit?
[09:19:12] <amee2k> yes
[09:19:15] <OndraSter> mhmm
[09:19:17] <amee2k> it works if i use a different pin
[09:19:25] <amee2k> and it used to work before
[09:19:38] <OndraSter> ok
[09:19:40] <amee2k> i had a 1k base resistor before though
[09:20:13] <amee2k> i thought for some reason the resistor had died and i only had another 10k handy
[09:20:19] <OndraSter> change the BJT to N channel and switch the position of relay :P
[09:20:38] <amee2k> but it didn't work with that either, so i tested the transistor but that one checked out fine
[09:20:44] <amee2k> "position of the relay"?
[09:21:14] <OndraSter> vcc-relay-bjt ce-gnd vs vcc-bjt ce-relay-gnd
[09:21:31] <OndraSter> switch on = put to 0 instead put to 1
[09:21:41] <amee2k> why would i want the relay on the emitter of the transistor to begin with?
[09:21:54] <OndraSter> because you'd switch PNP for NPN
[09:21:58] <OndraSter> (or the other way)
[09:22:04] <OndraSter> or am I not thinking enough?
[09:22:10] <amee2k> ???
[09:22:14] <OndraSter> never mind
[09:22:20] <amee2k> i don't follow
[09:22:25] <OndraSter> gotta eat :D
[09:22:28] <amee2k> >_>
[09:22:52] <amee2k> the BJT is common emitter / open collector style
[09:23:20] <amee2k> with a common collector / emitter follower circuit i wouldn't want a base resistor
[09:23:50] <amee2k> and i couldn't switch voltages higher than a diode drop below the MCU's supply voltage
[09:40:00] <karlp> amee2k: your pin macros look alright. You should call them "pinMode()" and "digitalWrite()" instead :)
[09:40:51] <OndraSter> sounds arduinoidy
[09:42:49] <karlp> well it looks like they're rather higher performance than the stock arduino ones :)
[09:44:12] <karlp> what's witht he PS_PORTC in the enum, and PS_START(PS_PORTC) ?
[09:44:36] <karlp> is that really just a way of saying, "PORT_COUNT" ?
[09:44:43] <karlp> to make sure the right number of arrays are created?
[09:45:00] <karlp> oh, you probably even meant for the C to be count didn't you :)
[10:19:19] <amee2k> karlp: yeah, same as the 'c' in argc/argv
[10:19:39] <amee2k> since the compiler is optimizing it all away in my case, i could just declare the arrays of fixed size
[10:20:01] <amee2k> but i don't want to exclude use cases where something dynamic sneaks in and the compiler ends up actually generating code
[10:20:25] <amee2k> karlp: i've since changed PS_PORTC to PS_PORTCNT btw
[10:20:56] <amee2k> and i'm a big fan of all-uppercase macro names
[10:21:17] <OndraSter> even the asm mnemonics should be all in uppercase!
[10:21:31] <OndraSter> LDI R17, 0x21; MOV R16, R17
[10:21:33] <OndraSter> ftw!
[10:21:37] <amee2k> hehe
[10:21:51] <amee2k> objdump begs to differ, apparently
[10:22:18] * OndraSter is mumbling something about disassemblers
[10:22:59] <amee2k> karlp: what would pinmode() and digitalwrite() do?
[10:37:28] <amee2k> http://paste.debian.net/154177/ << current version of my draft + example
[10:37:28] <karlp> something like, start, conf, commit, end?
[10:37:47] <karlp> not really important, no-one in arduino land would ever accept a patch anyway
[10:37:56] <amee2k> lol
[10:38:07] <amee2k> who said anything about arduinos anyway?
[10:38:22] <amee2k> or rather why
[10:39:21] <karlp> because digitalWrite is traditionally really really slow on arduino code, compared to PORTB = 0xblah
[10:39:35] <karlp> your stuff might make it easier/faster
[10:39:44] <karlp> though your stuff mostly handles the pinMOde() functions.
[10:40:01] <amee2k> i'm not targeting arduinos, just plain C code
[10:40:13] <karlp> I know :)
[10:40:24] <amee2k> the idea was to make the obligatory PORTx/DDRx assignments at the beginning of main() easier to maintain
[10:40:39] <karlp> I was just thinking this looked good enough that perhaps with a different name, the arduino people might like this, as it does the same thing, but is probably faster.
[10:40:49] <amee2k> hehe
[10:41:38] <amee2k> actually, with my setup_pins() function, my code is 10 bytes shorter after compilation than with a bunch of register assignments at the beginning of main()
[10:42:16] <amee2k> hmm scratch that example, something isn't compiling
[10:43:18] <amee2k> change last macro to this, then it works: #define PS_PUINPUT(pid, pin)PS_CONF(pid, pin, PS_IN, PS_PULLUP)
[10:44:49] <amee2k> any thoughts on PS_FUNCTION? i'm not sure if it is any clever since it obscures the prototype of the resulting function declaration
[10:45:24] <amee2k> because you can't use the same macro for declaring a matching prototype due to the variable declarations
[10:46:21] <amee2k> karlp: hmm i once had a C header file defining macros for lots of BASIC style keywords >_>
[10:47:11] <amee2k> so you could write stuff like "FOR(i = 0 TO 5)" or "IF foo==5 AND bar==6 THEN"
[10:48:29] <karlp> I can't see how you use PS_FUNCTION, so no comments yet.
[10:49:34] <amee2k> i could have written my function declaration as "static PS_FUNCTION(setup_pins, PS_PORTCNT); .... PS_END();"
[10:50:23] <amee2k> http://paste.debian.net/154181/ << like this
[10:53:59] <karlp> amee2k: perhaps you could use the tricks that check uses to make them look more like functions? http://paste.debian.net/154183/
[10:55:04] <amee2k> karlp: hmm interresting
[10:55:48] <karlp> not sure if it really applies to your setup, but an interesting trick with the preprocessor.
[10:56:40] <amee2k> http://paste.debian.net/154184/ << i'd say this *should* compile too since the ; after PS_FUNCTION was redundant and the {} i added are always balanced and redundant as well
[10:57:20] <karlp> that looks nice.
[10:57:27] <karlp> (any chance I can just call commit once?)
[10:57:29] <amee2k> what i don't like is that i'd need a second macro so people could declare a prototype for the resulting function without making lots of assumptions about the macros
[10:58:02] <karlp> I know that the commit line is the bit where you take your maps and apply them to the DDR|PORT pair,
[10:58:36] <amee2k> yeah... thought about it, but i'm not sure it is possible without making assumptions as to which ports are present on the device
[10:58:56] <karlp> that can be buried in ifdefs up in the macro :)
[10:59:05] <amee2k> hmm
[10:59:21] <karlp> if defined(PORTB) (assume DDRB exists)
[10:59:28] <karlp> there's only up to portH I think.
[10:59:43] <karlp> as longa s your macros are defined after avr/io.h is included?
[10:59:44] <amee2k> thats a nasty pile of ifdefs
[10:59:52] <karlp> have you had a look inside avr/io.h?
[10:59:57] <amee2k> not yet
[11:00:03] <karlp> it will be a SHORT pile of ifdefs coimpared to that
[11:00:11] <karlp> anyway, just an idea. I like it!
[11:00:19] <amee2k> :)
[11:00:26] <karlp> you know what would be cool though?
[11:00:30] <amee2k> what?
[11:00:43] <karlp> more USB, and definitely sound support in the same macros :)
[11:00:51] <eatyourguitar> amee2k what compiler has problems with missing ; before }
[11:00:54] <amee2k> u-hu?
[11:01:20] <karlp> amee2k: just playing :) asking for completely unrelated, bogus features that wouldn't make any sense ;)
[11:01:36] <amee2k> eatyourguitar: well, thats the point. by leaving out that ; there wouldn't be any missing. the ; only declares an empty statement which is redundant
[11:01:50] <amee2k> karlp: lol
[11:02:14] <eatyourguitar> yeah I leave them off since I learned perl 15 years ago
[11:02:21] <eatyourguitar> I learned perl before C
[11:03:23] <amee2k> no, i meant the line "static PS_FUNCTION(setup_pins, PS_PORTCNT);" would turn out as:
[11:04:17] <amee2k> static void setup_pins() {uint8_t ddrx[PS_PORTCNT] = {0}; uint8_t portx[PS_PORTCNT] = {0}; uint8_t mask;;
[11:04:29] <amee2k> where the double-; is not a typo, but result of the macro expansion
[11:04:34] <eatyourguitar> is there any performance increase with arduino by using the const before int variable = 0;
[11:04:49] <eatyourguitar> or is it just for read only?
[11:05:02] <CapnKernel> amee2k: Do you know about gcc's inline functions?
[11:05:17] <amee2k> CapnKernel: yeah, why?
[11:05:27] <CapnKernel> They don't have the drawbacks of evaluating macros twice, and so forth
[11:05:44] <CapnKernel> And can do things like typechecking
[11:05:47] <amee2k> hmm how would i use them for this?
[11:05:50] <CapnKernel> And will generate code that is just as good as with #defines
[11:06:06] <CapnKernel> Make your PS_ thingies inline functions not macros.
[11:06:12] <amee2k> the trick with the local variables ddrx and portx wouldn't work
[11:06:30] <CapnKernel> Remind me of the trick, I'm coming late to this discussion
[11:06:42] <amee2k> how would i keep the values across inline function "calls" without declaring true global variables?
[11:07:12] <CapnKernel> Oh, they are somewhat stateful?
[11:07:26] <amee2k> http://paste.debian.net/154177/ << note how the PS_START macro generates a block with local variables
[11:07:34] <CapnKernel> Do you need them to be stateful? To be honest, I wasn't sure why you had the commit
[11:08:00] <amee2k> because this way the compiler can optimize away all the static computations
[11:08:45] <amee2k> the IO register names like PORTx and DDRx are declared in a way that doesn't allow the compiler to optimize away individual accesses
[11:09:23] <amee2k> but since i'm preparing the values in local variables, the compiler can collapse all the bit mask computations at compile time
[11:09:34] <CapnKernel> My opinion, just my opinion, is that I like the PS_CONF macros, but I don't see the need for the PS_START and PS_END.
[11:09:35] <amee2k> unless there is something truely dynamic in there that requires runtime computation
[11:10:13] <CapnKernel> The registers are volatile
[11:10:16] <amee2k> PS_START/END declare a block and temporary variables that the compiler optimizes away in the end for efficient code
[11:10:19] <CapnKernel> So the register can't optimise them
[11:10:50] <amee2k> if i didn't have START/END/COMMIT i would have to use PORTx/DDRx in the PS_CONF macro which would result in a pile of IO register operations
[11:11:10] <amee2k> each PS_CONF would have to load the register values, modify them, then write them back every single time it is used
[11:11:52] <CapnKernel> What if there were pins that you didn't want to touch?
[11:12:00] <CapnKernel> After all, this shouldn't be useful just at chip init time
[11:12:25] <amee2k> PS_READ is for that
[11:12:25] <CapnKernel> (Brain rapidly fading, 1am here)
[11:13:02] <amee2k> with that you can explicitly copy the current state of a port into the temporary variables
[11:13:30] <amee2k> but from my exp, if you need to change pin configuration at a later time, you usually only change a few pins so using the macros for that would be overkill
[11:13:49] <CapnKernel> So in your code, your test function is setup_pins. But what about if you had code in the main loop of your program, that would get executed many times. You mean you have to do that reading again, mod the bits, then write them all over again?
[11:14:08] <amee2k> i wrote the macros with the case where you have to set up a large number of pins at once that are semantically unrelated
[11:14:12] <CapnKernel> For example, I have some code to read a nintendo DS touchscreen.
[11:14:25] <CapnKernel> The pin modes need to be changed constantly
[11:14:29] <karlp> CapnKernel: I think he just means to use it for applications where you don't go and change the pin modes.
[11:14:42] <karlp> otherwise yes, gccs inlines might make better code.
[11:14:49] <amee2k> CapnKernel: for that i would access PORTx/DDRx directly, really
[11:15:28] <CapnKernel> I like the PS_CONF macros, and I think with a little thought, it may be possible to do it without temporaries
[11:15:43] <CapnKernel> Or at least by storing not the final values, but the and/or vals for each reg
[11:15:45] <amee2k> what i mean is, at the beginning of main() i usually have a bunch of register assignments to set up the ports and a huge pile of comments explaining how i arrived at the various constants i write to the registers
[11:15:53] <CapnKernel> Yes me too
[11:16:25] <CapnKernel> So then when the commit happens, the commit reads the reg, does the AND and OR, then writes it back.
[11:16:43] <amee2k> these macros allow me to up pins in any order and with rather streamlined commenting without generating a huge pile of assembly code
[11:17:03] <CapnKernel> There's also the matter of making it safe against interrupts. Copying the registers for a long amount of time is problematic
[11:17:09] <Jan-> Hihi :)
[11:17:15] <Jan-> CapnKernel: that's a very confusing name.\
[11:17:21] <Jan-> What next, CorporalSergeant?
[11:17:30] <CapnKernel> How's Phil?
[11:17:41] <Jan-> How does everyone on IRC know Phil
[11:17:44] <Jan-> that's weird
[11:17:50] <karlp> night phil.
[11:17:59] <CapnKernel> I said that name to prove to you that we've spoken before.
[11:18:01] <Casper> Jan-: you keep talking about him :D
[11:18:10] <Jan-> Casper: Wellll I have lived with him for ten years.
[11:18:16] <amee2k> CapnKernel: http://paste.debian.net/154156/ << this is all that the compiler left of the setup_pins(); call in main() and the function itself
[11:18:17] <Jan-> He does occasionally figure in my life :)
[11:18:19] <CapnKernel> At the time, some six months ago, he was in Tokyo
[11:18:26] <Jan-> Oh yeah.
[11:18:35] <Jan-> Well. He's here now. He says hi.
[11:18:51] <Jan-> He came on here from Tokyo? I didn't know that. I could never get him to call me!
[11:19:05] <CapnKernel> No no, you told me some six months ago about Phil. Never mind.
[11:19:21] <amee2k> http://paste.debian.net/154154/ << which is 10 bytes shorter after compilation than the explicit assignments like i had before (commented out code in lines 30..38)
[11:19:22] <CapnKernel> amee2k: I don't have the brain to look at it now, I'm sorry.
[11:19:28] <amee2k> >_>
[11:19:35] <CapnKernel> My advice is, ask abcminiuser. He is a *whizz* at this stuff.
[11:19:48] <amee2k> :)
[11:19:59] <Jan-> I need to get a decent USB to serial converter
[11:20:11] <Jan-> I bought one once before, but it had TTL level outputs.
[11:20:15] <Jan-> I wonder.
[11:20:21] <CapnKernel> Do you need real serial, or TTL level?
[11:20:31] <Jan-> Real serial I think
[11:20:38] <amee2k> people need to realize that rs232 is, like, DA GEEK PORT
[11:20:48] <CapnKernel> You can get real serial at the high street computer shop for < 5 quid
[11:20:50] <Jan-> This is so I can have an AVR send info to a serial console on a PC, for debugging.
[11:21:03] <CapnKernel> You don't need real serial for that.
[11:21:11] <CapnKernel> TTL is fine, as that's what the AVR produces
[11:21:11] <Jan-> Let me just check what the situation is
[11:21:17] <Jan-> yeah I know I'm trying to remember why I needed one
[11:21:31] <Jan-> maybe it was for the programmer, but I think that's USB natively
[11:21:38] <amee2k> actually, cheap vagoo usb to serial adapters that output TTL level signals will save you the money for a level shifter
[11:21:52] <Jan-> Y'know I think I may have dug myself a hole here
[11:21:53] <CapnKernel> Buy this, cut off the phone connector: http://www.dealextreme.com/p/data-cable-compatible-with-nokia-ca-42-446
[11:22:14] <CapnKernel> Crack the case, the pin names (so you can work out which colour is which) are printed on the PCB
[11:22:15] <Jan-> I think I bought a TTL to RS232 dongle with pins on one end and a 9 pin D connector on the other, that has a max232 in it
[11:22:24] <Jan-> so I *do* need a real serial converter.
[11:22:36] <CapnKernel> Yes. But then you'd need another max232 on your AVR board.
[11:22:50] <Jan-> nono, the pins are designed to connect up to the avr itself.
[11:22:53] <Jan-> Then it has a "real" serial output
[11:22:59] <Jan-> aargh, I are confuse
[11:23:02] <amee2k> how about you sell the MAX232 dongle on ebay?
[11:23:04] <Jan-> Tom_itx built all this gear
[11:23:06] <CapnKernel> What do you mean by "AVR"?
[11:23:24] <Jan-> let me check what I bought
[11:23:27] <Jan-> it was months ago
[11:23:29] <amee2k> i'm suspecting something like an arduino, but with a MAX232 instead of an ftdi
[11:23:55] <CapnKernel> The crux is whether or not her board has a max232 (or similar) on it
[11:23:56] <Jan-> no i just bought bare chips
[11:24:04] <CapnKernel> Bare chips talk TTL level
[11:24:20] <amee2k> ... unless they don't >_>
[11:24:21] <Jan-> everyone told me that the dev boards had almost nothing on them but crystals capacitors and the chip
[11:24:33] <amee2k> depends on the board
[11:24:34] <Jan-> but I'm beginning to regret not getting an easy-duino :)
[11:24:44] <CapnKernel> Does your board have a real D-9 connector on it?
[11:24:45] <amee2k> a 200$ dev board usually has something more than that
[11:24:58] <amee2k> penis-duino
[11:25:11] <amee2k> umm i didn't say that out loud, did i?
[11:25:16] <amee2k> >_>
[11:25:20] <Casper> you did
[11:25:25] <amee2k> oh 0.0
[11:25:37] <Casper> and we should post it on that quote site
[11:25:38] <CapnKernel> If it's good enough for his mother, it's good enough for him.
[11:25:48] <amee2k> qdb/bash?
[11:26:03] <CapnKernel> Jan-: You still there?
[11:26:05] <Casper> and nore
[11:26:08] <amee2k> i don't think my mom has a penis
[11:26:17] <Jan-> OK, it says: "ATMEGA168-20PU"
[11:26:19] <impulze> thinking is good
[11:26:21] <impulze> knowing is better
[11:26:23] <CapnKernel> No but she knew where to get one, and now we have amee2k
[11:26:32] <amee2k> indeed *nod*
[11:26:32] * Jan- steels herself for being told that's the wrong one to get
[11:26:45] <CapnKernel> Jan-: So far, so good
[11:26:52] <amee2k> impulze: you're welcome to try and check. i'll drive you to the hospital afterwards
[11:27:12] <CapnKernel> We're talking about another chip, commonly called a max232, on the same board. Do you have that chip?
[11:27:20] <CapnKernel> Do you have a pic of the beast somewhere?
[11:27:21] <impulze> amee2k: woah free ride ;)
[11:27:34] <CapnKernel> If it's a Tom job, does *he* have a pic on his website?
[11:27:39] <Jan-> I furthermore have a little board with a USB connector on one end and some DIL headers on the other which is marked "USBTiny Mk II LUFA Powered Rev1.1b"
[11:28:06] <CapnKernel> I know that board. What's the question?
[11:28:10] <Jan-> and a DIL header to breadboard adaptor marked things like "MOSI", "MISO", "RST", "GND" and "+5v"
[11:28:18] <Jan-> oh, and "sick"
[11:28:19] <Jan-> no wait
[11:28:22] <Jan-> "SCK"
[11:28:41] <amee2k> yeah, that one was missing for a full SPI link :)
[11:29:09] <Jan-> aaargh
[11:29:09] <Jan-> SPI
[11:29:12] <Jan-> that always sounds complex
[11:29:14] * Jan- hides
[11:29:17] <CapnKernel> As far as I know, the USBTiny is not a board that you can program. Instead, it's used to program other boards.
[11:29:27] <amee2k> less complex than USB
[11:29:27] <Jan-> yes that's the programmer I think
[11:29:39] <CapnKernel> Well that has naught to do with serial
[11:29:49] <Jan-> I also have a selection of xtals and suitable capacitors
[11:29:54] <Jan-> at least I think they're suitable
[11:30:03] <Jan-> we bought the right ones, plus the values either side
[11:30:05] <amee2k> maybe he is raping the programmer board to turn it into a cheap dev board for the mcu on it?
[11:30:08] <amee2k> :)
[11:30:16] <CapnKernel> So you have an ATMEGA168. Good. Is it soldered into anything, or floating loose?
[11:30:16] <Jan-> (crystals are twitchy)
[11:30:22] <CapnKernel> Do you have a circuit board?
[11:30:27] <Jan-> It's in the little plastic tube thing they're supplied in
[11:30:32] <Jan-> Also I have a plug in experimenter's board
[11:30:46] <Steffanx> Jan- is still messing around with that decoder?
[11:30:52] <Steffanx> or whatever it was
[11:30:55] <CapnKernel> You're taking the hard road, but not impossible
[11:31:01] <CapnKernel> taking
[11:31:05] <Jan-> bah
[11:31:13] <Jan-> that's what everyone said to do!
[11:31:17] * Jan- had dark misgivings at the time
[11:31:22] <Jan-> I can just buy an arduino
[11:31:25] <CapnKernel> Everyone here? Yes, they would, this is #avr.
[11:31:34] <Jan-> *sigh* I hate this hacker crap :/
[11:31:38] <CapnKernel> To be honest, an Arduino is a better starting platform.
[11:31:58] <CapnKernel> You'll find it much easier to get started\
[11:32:02] <Jan-> on the other hand I don't really want to get stuck in arduino baby world
[11:32:42] <CapnKernel> Gotta start somewhere. If you "hate this hacker crap" then you're going to find a bare ATMEGA168 very unforgiving.
[11:32:42] <Steffanx> " arduino baby world" :D
[11:32:56] <CapnKernel> Everyone here will give you shit for using an Arduino
[11:33:02] <Jan-> no kidding
[11:33:07] <Jan-> they kicked my ass
[11:33:13] * Jan- displays much-bootprinted seat of jeans
[11:33:15] <CapnKernel> That's because they have small penises, and use AVR chips directly in order to compensate
[11:33:30] <Jan-> that's not really a problem I have
[11:33:36] <keenerd> Yay, finally patched Wikireader and pushed fixes :-)
[11:33:47] <CapnKernel> Wikireader == good :-)
[11:33:49] <impulze> wait, there's the p word again
[11:33:57] <Steffanx> bb all
[11:34:03] <CapnKernel> path?
[11:34:05] <impulze> see what you did there?
[11:34:06] <CapnKernel> patch?
[11:34:11] <Jan-> hm I can't find the serial widget
[11:34:20] <keenerd> CapnKernel: I got tired of scrolling and added pageup/down buttons. https://github.com/keenerd/wikireader
[11:34:43] <CapnKernel> Let's say you you want your AVR to talk to the PC over the serial port
[11:34:58] <CapnKernel> The AVR speaks "TTL level" serial.
[11:35:18] <CapnKernel> So you'll need a "TTL level" USB serial adaptor, like I pointed out to you above.
[11:35:20] <Jan-> anyway, some (most) of the things I want to do with an AVR are timing based things. And it seemed from reading some articles on the subject that the arduino abstractions make precise timing difficult or impossible.
[11:35:30] <CapnKernel> Yes that's true.
[11:35:51] <CapnKernel> But it's necessary to work out how to ride a bike first, before entering the time trials.
[11:35:51] <Jan-> yay
[11:35:53] <Jan-> I'm not a moron
[11:36:02] <CapnKernel> I already knew that.
[11:36:25] <keenerd> CapnKernel: Their code is a mess though. A lot of duplication and dead code that doesn't do anything.
[11:36:36] <Jan-> My professional electronics designing friend told me to use the 8502
[11:36:41] <Jan-> but isn't that a full CPU?
[11:36:45] <CapnKernel> keenerd: You and I know that. Does it invalidate it as a learning platform? No.
[11:37:07] <CapnKernel> I don't know an 8502 is.
[11:37:15] <CapnKernel> I know what a 6502 is, and an 8051
[11:37:21] <CapnKernel> And believe me, you don't want to use either.
[11:37:24] <keenerd> CapnKernel: It means this will probably be my first and only patch. I've got ideas and it'll be easier just to start from scratch.
[11:37:51] <Jan-> Oh.
[11:37:55] <Jan-> Perhaps one of those.
[11:38:01] * Jan- looks sheepish
[11:38:07] <Jan-> it was months ago :/
[11:38:29] <CapnKernel> keenerd: Nice patch!
[11:38:30] <Steffanx> "Their code is a mess though. A lot of duplication and dead code that doesn't do anything." .. sounds like the average project keenerd
[11:38:45] <Jan-> sounds like the average *opensource* project
[11:38:50] <Jan-> their code usually sucks dogs
[11:38:52] <Steffanx> Not only open source
[11:38:54] <Jan-> and enjoys the salty taste :/
[11:39:02] <CapnKernel> Jan-: Despite what I said, you'll find the AVR easier than those two
[11:39:11] <CapnKernel> Just that the Arduino is easier again
[11:39:16] <Jan-> Well with a full CPU you'd need to interface ram and stuff, no?
[11:39:35] <CapnKernel> I don't know if you know it, but the Arduino uses the same chip (ATMEGA). The difference is the software.
[11:39:40] <CapnKernel> On both the PC and on the chip
[11:40:04] <Jan-> however I seem to have entirely lost my handy dandy rs232 interface module.
[11:40:07] * Jan- bah
[11:40:11] <CapnKernel> Jan-: Not always, but usually. Best leave that for another day.
[11:40:20] * Jan- nodnodnod
[11:40:32] <CapnKernel> Jan-: I'm not sure that module is going to be useful to you.
[11:40:34] <Jan-> I like the way the avr has ROM and RAM and storage and everything
[11:40:38] <CapnKernel> does it have a DB-9 connector on it?
[11:40:46] <Jan-> I think it does yes
[11:40:46] <CapnKernel> Yes. Makes it easier to get started
[11:40:47] <Jan-> handy
[11:41:06] <CapnKernel> Then unless your project has a max232, it won't be any use
[11:41:22] <Jan-> nono, that's the thing that had the max232 in it.
[11:41:30] <Jan-> it had flying leads with pins on
[11:41:34] <Jan-> so you could plug it into your project
[11:41:34] <CapnKernel> Yes. To speak to a max232, you need another max232.
[11:41:45] <CapnKernel> You can get that adaptor I told you about, cut the end off, and connect it directly to the ATMEGA
[11:41:47] <Jan-> and then it had a 9-pin connector on the end so you could connect it to your PC
[11:42:01] <Jan-> actually this PC has a serial port card in it anyway I think
[11:42:02] <Jan-> so we may be fine
[11:42:14] <keenerd> I wouldn't really call the Wikireader an opensource project. No community, no contributions. There has been one patch to date, fixing negative numbers in the calculator.
[11:42:14] <CapnKernel> Good luck
[11:42:46] <CapnKernel> keenerd: Good point. Sounds like free software which isn't open source
[11:43:56] <CapnKernel> Cathedral rather than bazaar: http://catb.org/~esr/writings/homesteading/
[11:43:58] <keenerd> CapnKernel: Maybe I phrased that wrong. It is fully f/l/os but it has not gotten the popularity to benefit from it.
[11:44:15] <CapnKernel> I think you were righter than you know.
[11:44:19] <keenerd> Genrally the popular projects have amazingly clean code bases, for example.
[11:44:24] * Jan- is not a fan of open source
[11:44:28] * Jan- finds it all too often sucks
[11:44:52] <keenerd> Tough, you would not have an internet, smartphones, or much of anything without it ;-)
[11:45:02] <Jan-> I would too have smartphones :)
[11:45:06] <Jan-> THey'd just all be made by apple.
[11:45:15] <keenerd> Oh, you mean BSD?
[11:45:16] <CapnKernel> The whole point of open source is that it welcomes community involvement, as a way of improving the code. If they haven't tried to foster a community, it can't be said to be open source.
[11:45:24] <Jan-> And the internet might work better and not say things like "Error 709: Discombobulation of the M-3 membrane."
[11:45:52] <keenerd> CapnKernel: I'm hoping the recent price cuts to $30 might give them a second wind.
[11:45:57] <Jan-> Instead it would say "Sorry, there's been an unfixable problem. Please call support with the code M3_MEMBRN_DISCOMBOB."
[11:45:58] <Jan-> Which is better!
[11:46:02] <CapnKernel> Jan-: you might be in the wrong channel for those kinds of opinions.
[11:46:13] <Steffanx> Hehe
[11:46:33] <Jan-> CapnKernel: I can't really use linux anyway, so it's a moot point.
[11:46:39] <CapnKernel> Unless your stealth purpose is to come and troll us :-)
[11:46:50] <CapnKernel> Jan-: He's not talking about Linux
[11:46:57] <Jan-> well trolling linux people is always hilarity
[11:47:11] <CapnKernel> Why would you intentionally do that?
[11:47:22] <Steffanx> "cause i can" :)
[11:47:24] <CapnKernel> Pulled the wings off any flies lately?
[11:49:01] <Jan-> Mainly because I live with someone who is a "tech support point of contact" for about 30 of his friends
[11:49:14] <Jan-> and there was a phase where they all went out and bought linux netbooks
[11:49:17] <Jan-> and he had to fix them :(
[11:49:19] <Jan-> god it was painful
[11:49:54] <CapnKernel> I think this is #avr, not #agony_aunt. That's over --> there
[11:50:22] <Jan-> oh no it's OK
[11:50:35] <ziph> Jan-: He lost an argument about Open Source just last night, I don't think you'll be able to wind him up again.
[11:50:36] <CapnKernel> I haven't just spent half an hour of my life to be trolled. You want to talk #avr, that's fine
[11:50:37] <Jan-> I just like to troll linux people because they all love it and it makes my life at least 3% less pleasant :)
[11:51:07] * Jan- is of the considered opinion that linux people aren't trolled nearly enough
[11:51:11] <karlp> actually, many linux users hate it,
[11:51:19] <karlp> it just sucks less than other options.
[11:51:43] <CapnKernel> Jan-: Good luck with your serial port. I'm out.
[11:51:46] <Jan-> in other news, when I got on the bus to work this morning, the bus driver called me "love"
[11:51:51] <Jan-> this irritated me also.
[11:52:03] <Jan-> CapnKernel, we're still looking for the little widget
[11:52:12] <Jan-> oh, found it!
[11:53:01] <Jan-> it has four pins on it which plug into the breadboard, marked ToTX, ToRX, +5V, and GND
[11:53:33] <Jan-> but we can't find the RS-232 PCI card.
[11:55:42] <karlp> is there anyway you can put a couple of pictures of everything you'vve got online?
[11:55:54] <Jan-> Sure.
[11:55:55] <karlp> if I follow it right, you have a variety of cables, boards, a programmer,
[11:55:58] <Jan-> But I think I've got it pretty much down.
[11:56:04] <Kevin`> why are you using a pci card for that? unless you are using it for debugging the os or bit-banging io, usb works fine
[11:56:08] <karlp> and you're trying to work out you need to... program the avr?
[11:56:18] <Jan-> Because we were certain the PCI card would have proper RS232 levels.
[11:56:30] <Jan-> There was a photo that showed which chips it used.
[11:56:32] <Kevin`> but you aren't even using those levels for anything
[11:56:38] <karlp> or can you program the avr ok, and you're trying to hook up the avr's output "serial" (ttl) port to the pc somehow?
[11:56:39] <Jan-> oh we are, in other projects.
[11:56:51] <Jan-> I'm just trying to make sure I have all the required parts.
[11:58:13] <Jan-> oh. maybe there was a driver problem with the rs232 card and we sent it back
[11:58:26] <karlp> to do what...? program the avr? or talk from the avr to the pc? or something else?
[11:58:52] <karlp> you have a usbtinymkii or something right?
[11:59:13] <Jan-> The current project is to work out if we can build a breadboard that will make the AVR work, and if we can program it and make it talk back to the PC.
[11:59:21] <Jan-> Basic stuff, to make sure we're in a workable situation
[11:59:28] <karlp> right, you have two common options from there.
[11:59:48] <karlp> one needs two cables/dongles. one is the usbtinymk2 y ou have, which is just used for programming.
[11:59:59] <karlp> it goes usb->a few wires to various pins on the breadboard.
[12:00:03] <Jan-> yup
[12:00:04] <karlp> but you can't talk to the pc through that.
[12:00:07] <Jan-> the other one is for talking back to the PC
[12:00:10] <karlp> yep
[12:00:17] <Jan-> which is the max232-in-a-db9 thing
[12:00:26] <Jan-> the only thing I don't right now have is an RS232 port on the PC
[12:00:28] <karlp> do you have a real db9port on the computer you want to use?
[12:00:35] <karlp> no? even better.
[12:00:41] <karlp> forget everything about rs232 then.
[12:01:05] <karlp> get the nokia cable like capnkernel said, or a FTDI-usb cable, or anything else that is a USB>-<TTL serial cable.
[12:01:17] <Jan-> I'm not sure if we still have that RS232 PCI card
[12:01:22] <Jan-> let's establish that first
[12:01:33] <karlp> what other cables do you have?
[12:01:49] <Jan-> no cables as such
[12:01:54] <Jan-> other than just the required USB hookup and so on
[12:02:17] <karlp> "other than the required usb hookup"
[12:02:19] <karlp> what's that?
[12:02:27] <Jan-> just so we can plug the programmer into the PC
[12:02:30] <Jan-> a normal USB device cable
[12:02:30] <karlp> the one that goes to the usbtinymk2 or something else?
[12:02:38] <karlp> ok. so no other cables at the moment?
[12:02:53] <Jan-> We do have a TTL-level USB to serial.
[12:02:56] <karlp> perfect!
[12:03:00] <karlp> use that.
[12:03:00] <Jan-> But we think it's TTL level.
[12:03:04] <karlp> ttl is good.
[12:03:05] <Jan-> We're not sure.
[12:03:25] <karlp> unless you really have a db9 on your pc that you want to use, just use the usb-ttl cable.
[12:04:03] <Jan-> I don't really trust it
[12:04:05] <karlp> the usbttl cable will have some leads that directly hook up to the uart pins on the avr.
[12:04:09] <Jan-> it's crappy china quality junk
[12:04:20] <karlp> you mean awesome china bargain wondermagic
[12:04:34] <Jan-> ha
[12:04:35] <karlp> there's not much in that cable, just use it and be glad it didn't cost $200
[12:04:48] <Jan-> Why doesn't ebay purchase history go back more than 60 days
[12:05:00] <Jan-> *gr*
[12:05:11] <Kevin`> Jan-: if it has a db9 port, it's still going to have inverted logic levels, even if it's only 5v
[12:05:25] <Jan-> Kevin`: I did recall there was something odd about it
[12:05:33] <Jan-> that's why I wanted to get a real RS232 one and remove all doubt
[12:05:40] <karlp> no! don't do it!
[12:05:58] <karlp> usb-ttl all the way! banish rs232 to the long distance serial nerds who know, understand and love it.
[12:06:02] <karlp> you are not one of them.
[12:06:10] <Kevin`> Jan-: why not just test it with your scope and remove doubt that way?
[12:06:24] <Jan-> long story, but I'm not really a scope person
[12:06:51] <Kevin`> logic analyser would work even better
[12:06:57] <Kevin`> for some parts of that
[12:07:24] <Jan-> ok it doesn't look like we returned that serial card
[12:07:27] <Jan-> maybe we never even installed it
[12:08:16] <Jan-> we may have to take a short break while we find it :D
[12:09:32] <karlp> I'm serious, installing a pci card to get a real rs232 port is going back in time.
[12:09:36] <karlp> don't do it.
[12:09:41] <karlp> use the usb-ttl cable.
[12:09:46] <Jan-> we need it for other unrelated reasons I think
[12:10:18] <karlp> (it might be possible to replace those reasons with a usb-ttl cable too... :)
[12:10:30] <karlp> (or not..)
[12:20:57] <amee2k> i've seen PCI-E cards with piles of serial ports on it
[12:21:18] <amee2k> kinda hard to find and expensive though
[12:21:48] <amee2k> karlp: also, long distance serial nerds use RS422/485 i think
[12:22:12] <amee2k> 232 actually sucks for long distance due to being single ended and having relatively large voltage swings
[12:27:03] <ziph> What difference does the voltage make?
[12:27:33] <amee2k> needs more time and/or current to charge the line capacitance
[12:28:47] <amee2k> if you want to stay within specs, 232 needs a *minimum* voltage swing of 6V iirc
[12:29:02] <ziph> It's slew rate limited anyhow, it is intentionally made slow.
[12:29:29] <amee2k> with the 10..12V dual supply it is usually used with that would be a swing of >20V, which is a lot
[12:30:08] <amee2k> even without slew rate limiting the voltage swings make it fairly difficult on longer distances
[12:30:10] <Casper> official specs say 1 = <=-6V and 0 = >=6V for rs232
[12:30:25] <amee2k> oh, +/-6V?
[12:30:34] <amee2k> i thought it was +/-3V minimum
[12:30:55] <Casper> rs232 is the most abused specs
[12:31:22] <amee2k> even wikipedia says +/-3V lol
[12:31:24] <karlp> amee2k: yeah, I use rs485 here. the point stands, "don't use rs232 unless you really really know you need it)
[12:31:27] <Casper> most receiver now is <0V >3V
[12:32:00] <Casper> and some are just 3.3V logic with +/-24V tolerance
[12:32:01] <ziph> Reducing the voltage of RS232 would make it worse.
[12:32:09] <ziph> The main issue with long cables and RS232 is crosstalk.
[12:32:21] <karlp> anyway, home time!
[12:32:28] <amee2k> !time
[12:32:38] <amee2k> o.O
[12:32:43] <impulze> !date
[12:32:44] <impulze> aw
[12:32:53] <amee2k> tobbor is afk taking a shower again >_<
[12:33:05] <impulze> clean tobbor is clean
[12:33:05] <Jan-> The one we have has two serial ports, and one parallel port
[12:35:51] <Jan-> I say I say I say....
[12:36:02] <Jan-> how do you get the cornflakes and the weetabix to school?
[12:36:06] <Jan-> on the universal cereal bus!
[12:36:11] * Jan- will get her coat...
[12:38:31] <Jan-> hey
[12:38:40] <Jan-> if there's an atmega, is there also an.. er... what would it be... atmini series?
[12:38:59] <amee2k> attiny, yes
[12:39:42] <Jan-> what're they, just the same thing binned for nonworking peripherals I guess
[12:39:57] <amee2k> possibly
[12:40:27] <ziph> Nah, non-working peripherals is a sign that you're using XMEGA's. ;)
[12:40:48] <amee2k> but then, you can rarely be sure for many other manufs unless you crack open some chips
[12:41:29] <amee2k> ziph: i think what he meant was if some peripherals don't work they disable them and others until they reach the feature set as a lower-spec type. then sell it as that one instead
[12:41:29] <Jan-> what, they're all exactly the same, just priced differently :)
[12:41:41] <Jan-> amee2k: it's short for "Janine" :)
[12:41:48] <amee2k> 0.0
[12:41:49] <amee2k> ooh
[12:41:56] <amee2k> my apologies >-<
[12:41:58] <amee2k> >_<
[12:41:59] <ziph> amee2k: I know, I didn't let that get in the way of making a joke about how buggy the XMEGA's are though. ;)
[12:42:07] <amee2k> lol
[12:42:09] <Jan-> don't worry
[12:42:14] <Jan-> most people assume I'm a swedish guy
[12:42:32] <amee2k> from my exp, on irc everyone is assumed male unless proven innocent
[12:42:33] * amee2k runs and hides behind the sofa
[12:44:03] <Jan-> I'm fairly sure I'm a girl. I can check, if you like.
[12:44:07] * Jan- *grope*
[12:44:11] <amee2k> 0.0
[12:44:44] <ziph> abcminiuser knows when to come in. :)
[12:45:07] <amee2k> does he want to call "pics or it didn't happen"?
[12:45:19] <abcminiuser> ?
[12:45:25] <abcminiuser> What did I miss?
[12:45:29] <amee2k> you just missed the groping session
[12:45:30] <ziph> abcminiuser: There's a hot chick in here groping herself.
[12:45:46] <abcminiuser> Woo
[12:45:50] <abcminiuser> Wait, what?
[12:46:21] <amee2k> want logs? :P
[12:47:47] <ziph> abcminiuser: You're missing some great summer weather.
[12:48:06] <ziph> abcminiuser: The monsoon is practically low enough to get to Melbourne this year. ;)
[12:48:06] * Jan- is too short to be hot
[12:48:11] * impulze puts on his robe and wizard hat
[12:48:14] <impulze> oh wait, this is #avr
[12:48:17] <impulze> nvm
[12:48:35] <impulze> .oO(it is, right?)
[12:48:38] <abcminiuser> !thislog
[12:48:49] <abcminiuser> Goddammit tobbor
[12:48:54] <abcminiuser> Oh, he's dead
[12:48:55] <impulze> tobbor is showering
[12:49:02] <impulze> no, amee2k said he's in the shower
[12:49:15] <impulze> clean bot needs to be clean!
[12:50:10] <amee2k> maybe he is f... nevermind
[12:50:27] <impulze> yeah nevermind
[12:50:32] <amee2k> >_>
[12:51:33] <amee2k> speaking of showers, i'm gonna go have one too now
[12:51:43] <keenerd> Wooo Wikireader, more patches for the patch god!
[12:52:36] <keenerd> Think I am done fooling with this for today, need to actually get some stuff done :-)
[12:52:41] <amee2k> abcminiuser: hmm someone earlier mentioned you're good with C preprocessor hacks and stuff like that, right?
[12:52:58] <abcminiuser> amee2k, yeah, pretty good
[12:53:01] <abcminiuser> What are you after?
[12:53:45] <amee2k> abcminiuser: i made some macros this afternoon to make setting up pins at the beginning of main() look nicer. i don't remember who right now, but when i showed it around earlier someone said i should show it to you for comments :)
[12:54:31] <abcminiuser> MY EYES!
[12:54:34] <abcminiuser> AAAUURRGGGHHH
[12:54:38] <amee2k> http://paste.debian.net/154196/
[12:54:39] <abcminiuser> Oh wait, show me first
[12:54:44] <amee2k> LOL
[12:54:47] <abcminiuser> MY EYES!
[12:55:11] <Jan-> omgwtf? people are quoting my (old, abandoned) allexperts account on pay-for-essay sites?
[12:55:13] <amee2k> the assembly code at the bottom is all that the compiler leaves of the setup_pins call at the beginning of my main()
[12:55:15] <Jan-> wtf?!
[12:55:50] <abcminiuser> Hrm, neat
[12:56:09] <amee2k> :)
[12:56:37] <abcminiuser> Readable and compact output, looks good
[12:56:43] <amee2k> yep
[12:57:37] <amee2k> the intended improvement over a bunch of register assignments was that i can set up pins in arbitrary order now, and that stuff that belongs to one pin is on the same line
[12:58:49] <amee2k> at first i didn't realize that the compiler is smart enough to reduce all the essentially static computations on temporary variables... i just thought if it is only going to happen at power-up i don't care about execution time
[12:59:35] <amee2k> but then i noticed that instead of larger, the compiled binary was actually shorter than with my PORTB=0x... kind of assignments
[12:59:52] <abcminiuser> Post it on 'Freaks
[12:59:53] <amee2k> then i decided to look at the assembly output and realized what is going on
[13:01:10] <ziph> Advanced Compiler Design and Implementation is good if you want to read about all the kind of magic that compilers do.
[13:01:20] <amee2k> "on freaks"?
[13:01:55] <amee2k> ziph: we had a compiler construction class last summer that was fairly interresting
[13:02:02] <Tom_itx> abcminiuser i didn't get a chance yet to test the code
[13:02:10] <amee2k> pretty basic, but still interresting
[13:02:13] <ziph> amee2k: It didn't just spend most of the time on parsing and lexing?
[13:02:15] <Tom_itx> had a plumbing issue to deal with
[13:02:19] <abcminiuser> Tom_itx, no worries
[13:02:27] <Tom_itx> is the git current now?
[13:02:37] <abcminiuser> amee2k, avrfreaks.net
[13:02:37] <Tom_itx> and does it matter what test program I use?
[13:02:42] <abcminiuser> Tom_itx, yes it is and no
[13:02:52] <amee2k> ziph: a lot since we got to implement a simple compiler for a language we could make up at will, but not all of it
[13:02:59] <Tom_itx> i'll load it up in a bit and try it
[13:03:05] <amee2k> abcminiuser: oh
[13:03:16] <Tom_itx> the changes won't affect the recovery clock will they?
[13:03:18] <amee2k> do i need to register there to post?
[13:04:45] <amee2k> 19:54 < amee2k> abcminiuser: oh
[13:04:47] <amee2k> 19:54 < amee2k> do i need to register there to post?
[13:04:52] <Steffanx> Yes
[13:05:11] <amee2k> i can't even find where to post anything on there >_>
[13:05:11] <Steffanx> You can use my login amee2k :P
[13:05:25] <Tom_itx> can I?
[13:05:29] <Steffanx> You too
[13:05:46] <amee2k> we could make a community login for the channel
[13:06:04] <Steffanx> bugmenot.com?
[13:07:13] <abcminiuser_> amee2k, Yes you should, it's a decent AVR community
[13:07:20] <abcminiuser_> amee2k, forums
[13:07:57] <Tom_itx> abcminiuser, the changes won't affect the recovery clock will they?
[13:07:57] <Jan-> Great! So I bought a nice plug-in PCI card with two proper RS-232 ports and a parallel port on it
[13:08:02] <Jan-> and Phil immediately lost it
[13:08:11] <amee2k> abcminiuser_: you mean, as opposed to this channel? >_>
[13:08:15] * Jan- mutters darkly
[13:08:32] <Steffanx> Dr. Phil, Jan- ?
[13:08:49] <Jan-> why does everyone say that
[13:09:00] <Steffanx> That's the only phil we know
[13:09:22] <abcminiuser> Tom_itx, not at all
[13:09:41] <abcminiuser> Tom_itx, it just resets the command timeout each time a portion of a programming command completes without error
[13:09:51] <Tom_itx> ok
[13:09:52] <abcminiuser> So that long running commands don't timeout when they're still working
[13:10:03] <Tom_itx> i got new boards to test it out on later on
[13:10:06] <abcminiuser> amee2k, well, another good place to post
[13:10:07] <Tom_itx> i still gotta solder one up
[13:10:19] <Jan-> Phil is my partner, boyfriend, significant other, or possibly live-in, carnal-sin boy toy,
[13:10:21] <abcminiuser> Tom_itx, check the changelog, there are other fixes too like TPI
[13:10:40] <amee2k> hmm
[13:10:44] <Tom_itx> what was wrong with TPI?
[13:10:49] <amee2k> wouldn't even know where that would fit
[13:11:08] <amee2k> thats what i don't like about message boards... too much organization lol
[13:12:51] <Steffanx> And you want a toolbox amee2k ?!
[13:12:57] <Steffanx> I knew you didn't really need it
[13:13:09] <amee2k> i want a toolbox?
[13:13:22] <Steffanx> Yeah.. one big enough for your scope
[13:13:43] <amee2k> well, i do. but whats that got to do with C code and it not fiting into any of the board topics?
[13:13:48] <abcminiuser> Tom_itx, fixes the device not starting after a programming session exits
[13:14:02] <Steffanx> " too much organization lol" amee2k
[13:14:05] <Tom_itx> that was fixed ages ago
[13:14:13] <Jan-> can I make a sexist comment
[13:14:20] <Jan-> WHY DO MEN LOSE THINGS
[13:14:20] <Steffanx> You can
[13:14:29] <Tom_itx> abcminiuser, maybe not commited but it was fixed
[13:14:31] <amee2k> Steffanx: you haven't seen my existing toolboxes then :P
[13:14:37] <Steffanx> Woman grab all their stuff Jan- .
[13:14:44] <Steffanx> I have amee2k
[13:14:52] <Steffanx> You have an Nth one
[13:14:53] <Jan-> Oh do you live together
[13:14:57] <abcminiuser> Jan-, in my experience it's due to women moving things
[13:15:10] <abcminiuser> Tom_itx, ah well check the changelog
[13:15:12] <amee2k> Steffanx: no, these are parts boxes
[13:15:15] <Jan-> I don't move things or I wouldn't be able to find them
[13:15:16] <Steffanx> Ah true
[13:15:36] * Jan- has an excuse here
[13:16:04] <Jan-> well it doesn't look like we returned that serial card
[13:16:14] <amee2k> http://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Toolbox.jpg/220px-Toolbox.jpg << i've got two toolboxes like these, but with two levels of the upper thingies that fold outwards
[13:17:09] <Jan-> I can't see pics, amee2k, but I know what you mean
[13:17:27] <Steffanx> Heavy duty toolboxes, amee2k :D
[13:18:00] <amee2k> yeah, i like them
[13:18:06] <amee2k> simple and practical
[13:18:35] <amee2k> i'd get a third one right away but my scope doesn't fit in them
[13:18:57] <Steffanx> "too much organization lol"
[13:19:31] <amee2k> well, then tell me what category on that board my C macros would fit?
[13:19:46] <amee2k> if you think such a thing doesn't exist
[13:19:52] <Steffanx> avr-gcc ?
[13:20:11] <amee2k> thats what i'm using but i think they should work for C in general
[13:20:13] <amee2k> anyway, showertime
[13:20:18] <Tom_itx> abcminiuser, yeah i think that had been done on PDI but missed on TPI and was added afterward
[13:20:19] <Steffanx> Have fun
[13:28:37] <Jan-> is there anything to do with avrs that isn't a tla
[13:35:01] <zgaga> Which AVR processor does have largest program space?
[13:35:53] <Tom_itx> check the parametric table
[13:36:29] <Steffanx> atmega256x :)
[13:37:18] <Tom_itx> what about 32 bit?
[13:37:24] <Tom_itx> he didn't specify
[13:38:18] <keenerd> zgaga: http://codoba.net/avr/ Click 'Flash', select '512'.
[13:39:02] <zgaga> great
[13:39:02] <zgaga> tnx
[13:45:46] <Tom_itx> abcminiuser
[13:45:53] <Tom_itx> 168 failed to erase device
[13:47:22] <Tom_itx> 128 erased ok
[13:47:25] <Tom_itx> but not the 168
[13:47:37] <Tom_itx> all other tests seem ok
[13:47:38] <Tom_itx> so far
[13:48:41] <Tom_L> Setting mode and device parameters.. OK!
[13:48:42] <Tom_L> Entering programming mode.. OK!
[13:48:42] <Tom_L> Reading signature from device .. 0x1E, 0x94, 0x06 .. OK!
[13:48:42] <Tom_L> Leaving programming mode.. OK!
[13:49:02] <Tom_L> .
[13:49:05] <Tom_L> Setting mode and device parameters.. OK!
[13:49:05] <Tom_L> Entering programming mode.. OK!
[13:49:05] <Tom_L> Erasing device.. OK!
[13:49:05] <Tom_L> Leaving programming mode.. OK!
[13:49:22] <Tom_itx> but it still executes the old code
[13:49:28] <Tom_itx> not erased
[13:49:41] * Tom_itx thumps abcminiuser in the head
[13:50:13] <Tom_itx> reads signature and fuses ok
[13:50:26] <Tom_itx> oh.. test is on as4 btw
[13:50:52] <abcminiuser> Tom_itx, that's a new one
[13:51:00] <abcminiuser> Also unrelated to what I've changed
[13:51:02] <abcminiuser> Hrm
[13:51:12] <Tom_itx> yeah, the 128 erased ok though
[13:51:32] <Tom_itx> as did the t10 and atxmega
[13:52:09] <Tom_L> Erasing device.. OK!
[13:52:09] <Tom_L> Programming FLASH .. OK!
[13:52:10] <Tom_L> Reading FLASH .. OK!
[13:52:10] <Tom_L> FLASH contents is equal to file.. OK
[13:52:10] <Tom_L> Leaving programming mode.. OK!
[13:52:21] <abcminiuser> Wierd, the erase code is super simple
[13:52:27] <Tom_L> Setting mode and device parameters.. OK!
[13:52:27] <Tom_L> Entering programming mode.. OK!
[13:52:27] <Tom_L> Reading FLASH .. OK!
[13:52:27] <Tom_L> FLASH contents is equal to file.. OK
[13:52:27] <Tom_L> Leaving programming mode.. OK!
[13:52:44] <Tom_itx> it loaded the new code although it may have been the same code
[13:52:57] <Tom_itx> but verify failed until i reprogrammed it
[13:53:29] <Tom_itx> power cycle had no effect
[13:54:14] <Tom_itx> fuses are 0xE2, 0xDF, 0xF9
[13:55:01] <abcminiuser> Bizzare
[13:55:05] <abcminiuser> Only with that one chip?
[13:55:10] <Tom_itx> so far
[13:55:16] <Tom_itx> wait a sec
[13:55:41] <Tom_itx> yeah it's a 168
[13:55:59] <Tom_itx> i'd been playing with a 328 so i wanted to be sure i had the 168 on the breadboard
[13:56:54] <abcminiuser> Damned odd
[13:57:02] <Tom_itx> very
[13:58:41] <mapee> could you suggest me a digital multimeter? i would like to buy one, but dont know them. maxwell maybe?
[13:58:47] <abcminiuser> Both use the same mechanism to erase
[13:58:50] <Tom_itx> fluke
[13:58:56] <abcminiuser> Issue with the part file in AS4 perhaps?
[13:59:04] <mapee> fluke is really expensive :(
[13:59:07] <Tom_itx> never been before abcminiuser
[13:59:23] <abcminiuser> Tom_itx, must have been bitten by a cosmic ray
[13:59:26] <Tom_itx> gimme a day to load as5 here and i'll test it there
[13:59:53] <Tom_itx> that's about how long it takes to start
[13:59:53] <keenerd> mapee: Just about anything is fine. 95% of the time a $5 DMM is enough.
[14:00:41] <mapee> keenerd, then why are they so expensive? (branded ones)
[14:01:30] <SilicaGel> i got avrdude installed
[14:01:33] <keenerd> Accuracy, fancy features. A basic 2000 count model goes a long way though.
[14:01:35] <SilicaGel> and i received my avrdragno from central shipping
[14:01:39] <SilicaGel> and i compiled a project
[14:02:09] <Tom_itx> abcminiuser, erase device on as5 fails as well
[14:02:25] <abcminiuser> Does it happen with the old firmware?
[14:02:36] <mapee> keenerd, thanks the info
[14:02:50] <keenerd> mapee: If nothing else, get a cheap one first so you'll later know which fancy features you feel are worth the expense ;-)
[14:03:57] <mapee> keenerd, i would like to use it in robotics projects mostly
[14:04:11] <Tom_itx> abcminiuser, i get errors on the 128 after programming with verify
[14:04:32] <Tom_itx> failed at address 0x0080 expected 0x0c actual 0xff
[14:04:47] <keenerd> mapee: Get something cheap then, more money for the expensive robots.
[14:04:57] <Tom_itx> it did erase ok though
[14:05:01] <mapee> keenerd, ok ty
[14:05:31] <abcminiuser> Tom_itx, wrong programming speed?
[14:06:05] <SilicaGel> does avrdude use libusb?
[14:07:05] <Tom_itx> abcminiuser, it's worked before with as4 and as5 but where do i check that in as5?
[14:07:11] <SilicaGel> or do I need a device driver(for linux) for it
[14:07:15] <Tom_itx> yes
[14:07:22] <Tom_itx> it uses libusb iirc
[14:07:47] <Tom_itx> abcminiuser, 125khz is what it's set to
[14:07:55] <SilicaGel> i must not know how to make avrdude know how to reference the usb port then.
[14:08:07] <abcminiuser> Try changing it to a lower freq, just for the hell of it
[14:08:16] <abcminiuser> Doesn't make sense that it would fail otherwise
[14:08:37] <Tom_itx> 64khz still fails
[14:08:45] <Tom_itx> but it programs
[14:08:50] <Tom_itx> after an erase
[14:09:15] <Tom_L> Timestamp: 2012-01-31 14:00:06.671
[14:09:15] <Tom_L> Severity: ERROR
[14:09:15] <Tom_L> ComponentId: 20000
[14:09:15] <Tom_L> StatusCode: 0
[14:09:15] <Tom_L> Verifying Flash...Failed! address=0x0080 expected=0x0c actual=0xff
[14:09:24] <SilicaGel> oh I see it's -P usb
[14:09:25] <SilicaGel> not -P USB
[14:10:39] <abcminiuser> Odd
[14:10:39] <Tom_itx> abcminiuser, it's failing on the verify
[14:10:47] <Tom_itx> i tuned off verify after program and no error
[14:11:00] <abcminiuser> Yeah, that means there's a glitch in the program algo which doesn't make sense, that's ancient code now
[14:11:00] <SilicaGel> It flashed!
[14:11:03] <Tom_itx> this is on a m128
[14:11:39] <Tom_itx> i'm gettin the hell outta as5
[14:11:43] <Tom_itx> bak to as4
[14:12:56] <Tom_itx> god dammit
[14:13:05] <Tom_itx> hang on a sec
[14:14:26] <Tom_itx> operator error
[14:16:28] <atmega> Tom_itx: you are using Win or Linux?
[14:16:43] <Tom_itx> win
[14:16:49] <Tom_itx> as4 and as5
[14:17:06] <Tom_itx> ok abcminiuser, that problem fixed however the erase on the m168 is still there
[14:17:23] <abcminiuser> Tom_itx, verified my code, it's SUPPOSED to work
[14:17:33] <abcminiuser> Unless the part files had the wrong erase command
[14:17:34] <Tom_itx> however i can program a new program and that works
[14:17:39] <abcminiuser> AS4.19?
[14:17:44] <Tom_itx> as5
[14:18:07] <abcminiuser> But it happens in AS4 as well?
[14:18:21] <Tom_itx> lemme try a couple things then i'll check
[14:18:59] <Tom_itx> erase fails, programming a different program works
[14:19:18] <Tom_itx> erasing the blink program works
[14:20:02] <Tom_itx> aarg
[14:20:06] <Tom_itx> forget about it
[14:20:25] <Tom_itx> i'm looking at the quadrature leds on i had on the input from the quad
[14:20:27] <Tom_itx> it erased ok
[14:20:29] <Tom_itx> sorry
[14:20:31] <Tom_itx> :(
[14:20:42] <Tom_itx> i had 2 pairs of leds
[14:20:46] <Tom_itx> one input and one output
[14:21:29] <Tom_itx> ok near as i can tell it's working
[14:21:43] <Tom_itx> i'll put a la or scope on the reovery clock later on
[14:22:40] * abcminiuser shakes fist
[14:22:46] <Tom_itx> excuse: i feel like i'm still in vacation mode
[14:22:59] <Tom_itx> just got back
[14:23:33] <abcminiuser> hehe
[14:23:43] <abcminiuser> I forgive my free beta tester, I guess :P
[14:24:23] <Tom_itx> so as5 appears to be ok and i'm pretty sure as4 would be too
[14:24:48] <Tom_itx> 128 168 t10 and xplain all respond as expected
[14:25:30] <Tom_itx> had to get you worked up a bit
[14:25:33] <Tom_itx> good for the soul
[14:35:09] <Tom_itx> so abcminiuser, what do they have you working on this time?
[14:35:27] <Tom_itx> figures
[14:38:17] <SilicaGel> does printf, optimization, and avr-libc == BIG TROUBLE?
[14:38:19] <SilicaGel> This
[14:38:24] <SilicaGel> printf(" F");
[14:38:30] <SilicaGel> produces GARBAGE at -O s
[14:38:34] <SilicaGel> OK at -O 2
[14:38:38] <SilicaGel> OK at -O 1
[14:39:06] <SilicaGel> I'm new to this architecture/toolchain so I'm at a loss why
[14:39:36] <Tom_itx> is 0 high optimized?
[14:39:46] <Tom_itx> maybe it removes stuff it things you aren't using
[14:39:52] <Tom_itx> thinks*
[14:39:56] * specing slaps Tom_itx with a large 0
[14:39:56] <SilicaGel> no, s is considered optimal
[14:40:06] <SilicaGel> the numbers don't really indicate "more optimization" as much as 'dfferent optimization'
[14:40:27] <SilicaGel> it actually seems ok at -S 3
[14:40:31] <SilicaGel> sorry I meant to say -O 3
[14:40:43] <Tom_itx> so abcminiuser, what do they have you working on this time?
[14:40:58] <SilicaGel> it's really not a problem to use -O 3 ... i'm just curious.
[14:40:58] <abcminiuser> Tom_itx, just AVR support so far
[14:41:39] <Tom_itx> ahh yeah i remember you griping about emails from hell
[14:42:49] <Bushman> http://www.youtube.com/watch?v=rNjtZ5V4P-c
[14:44:42] <abcminiuser_> That guy with the SPI came back
[14:44:48] <abcminiuser_> That re-wrote my test code twice
[14:44:57] <keenerd> Oh boy.
[14:46:25] <SilicaGel> yeah. i was wrnog. -O 3 is brokne too
[14:46:33] <SilicaGel> code is 6080 bytes at -O 2, and 59790 at -O 3
[14:46:40] <SilicaGel> haha 5970 I meant
[14:46:47] <SilicaGel> so the size difference is pretty minimal
[14:46:52] <SilicaGel> I just find it all quite curious
[14:48:11] <Tom_itx> maybe this evening i'll get a chance to solder up the new programmer
[14:48:16] <Tom_itx> with the hardwired recovery
[14:54:39] <atmega> Tom_itx: try this -> http://www.fischl.de/usbasp/
[14:56:00] <Tom_itx> what for?
[14:56:22] <Tom_itx> mine's faster and does 3x more than those
[14:56:59] <Tom_itx> oh and i made a bunch of those using a t2313 already
[14:57:01] <Tom_itx> but thanks
[14:58:00] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/attiny2313/mini_usb_batch1.jpg
[14:58:28] <ben1066> Hey
[14:58:48] <ben1066> does QTouch require an external IC on avrs, or can it just use an io/
[15:16:27] <amee2k> ben1066: i haven't used it before but from what i can see, it is just clever use of the GPIO pins
[15:16:45] <karlp> don't some parts have qtouch built in?
[15:16:57] <amee2k> qtouch sections have been popping up in datasheets for chips that clearly predate it
[15:17:10] <karlp> amee2k: I thought qtouch was some extra hardware taht did the charge counting for you?
[15:17:21] <karlp> sure it's not only for newer revisions of the chips?
[15:17:29] <amee2k> as i said i haven't used it myself
[15:17:40] <karlp> yeah, me either
[15:17:49] <amee2k> but i think they just do the "pull pin low and measure rise time through resistor" trick
[15:17:56] <amee2k> probably with the built in pullups
[15:18:36] <ben1066> Hmm
[15:18:38] <amee2k> the appnote about qtouch board design talks a lot about controlling parasitic capacitance iirc
[15:18:43] <ben1066> I know there are external ics...
[15:18:53] <ben1066> I wanted to see if an avr alone could do it
[15:19:03] <amee2k> i remember some dude implementing touch buttons this way by himself
[15:19:05] <ben1066> albeit, after a sligth rethink, ill probly use an arm micro...
[15:19:30] <ben1066> but an avr could end up cheaper than a qtouch ic, from what I remember they arent cheap
[15:20:30] <karlp> they're cheap as chips these days aren't they?
[15:20:59] <ben1066> avrs could do more
[15:21:00] <amee2k> even a shitty megaX8 seems to support qtouch
[15:21:04] <ben1066> say take the input, spit out spi
[15:21:18] <ben1066> its the dedicated ics that cost more :P
[15:22:09] <amee2k> mmh, i can't find the project website of the dude who did it by himself anymore
[15:22:24] <amee2k> all that comes up on google for avr and touch is qtouch and touchscreen bullshit
[15:24:42] <atmega> ben1066: this is not qtouche, but easy to use and implement http://elm-chan.org/works/capsens/report_e.html
[15:25:43] <amee2k> ben1066: anyway, if you can afford a dedicated MCU for it you can do it with pretty much anything that can measure rise times in the microsecond range
[15:26:29] * karlp loves elm-chan
[15:26:51] <amee2k> 50pF take about 5us to charge to 3V through 100kR from 5V source
[15:27:39] <amee2k> so you can do it with pretty much everything that runs at several MHz... AVR, ARM, PIC, MSP430 orwhatsthename
[15:27:42] <ben1066> ill be doing bplain buttons
[15:28:24] <amee2k> i did a touch button with a 555 and a bunch of 74HC00 once >_>
[15:28:30] <amee2k> it filled three breadboards
[15:28:51] <ben1066> why :P
[15:29:03] <amee2k> because i wanted to see if i can pull it off with a 555
[15:29:25] <amee2k> ooh, i think a couple 741s were in there too
[15:30:23] <karlp> amee2k: see, that's the sort of project I don't understand.
[15:30:35] <amee2k> you don't?
[15:30:42] <karlp> you knew how they worked, you probably learnt more, but it was hardly done as a learning experience?
[15:30:49] <karlp> I mean, what was the learning goal?
[15:30:55] <amee2k> the 555 was generic astable configuration with the touch plate as the... oh.
[15:30:59] <atmega> I use the simple method of elm-chan, it works good and it is cheap (and vandalism protected)
[15:31:50] <amee2k> karlp: well, i did learn a lot doing it too
[15:32:04] <amee2k> but i really just wanted to see if i could do it with a 555
[15:33:11] <atmega> ben1066: you should create a GND ring around the buttons
[15:33:21] <amee2k> ooh, hey atmega
[15:33:40] <amee2k> atmega: this afternoon i figured out what you meant by being on my ignore list >_>
[15:33:57] <Tom_itx> amee2k did you enter it in that 555 contest?
[15:34:07] <amee2k> i had my irc window pretty small because the whole desktop was full of coil winder firmware code
[15:34:13] <amee2k> and didn't see the PM tab
[15:34:37] <amee2k> Tom_itx: no, i heard about it like a week before the deadline lol
[15:35:10] <amee2k> if any, i'd want to submit a trinary digital clock using 555s as gates
[15:35:24] <atmega> if you hold a drilling machine in the neighbourhood of the pads, then the AVR think that the pads are pressed (a much disturbances of the drilling machine)
[15:35:33] <amee2k> constructed on sandwhiched boards with cordwood style construction
[15:36:07] <amee2k> there is an atmel appnote about making touch buttons on circuit board
[15:38:11] <ben1066> Yea, i saw that
[15:38:15] <ben1066> Thats what gave me the idea
[15:38:16] <ben1066> :P
[15:38:21] <amee2k> hehe :)
[15:38:47] <ben1066> i need a keypad, and tactile buttons are so <2012 :P
[15:39:13] <RikusW> atmega: ever heard of atmel's qtouch ?
[15:39:35] <amee2k> RikusW: qtouch is what started the discussion ;)
[15:39:42] <RikusW> ah
[15:39:52] <amee2k> (just sayin' since you joined after the conversation has already gone on)
[15:39:59] <RikusW> seems qtouch have noise filtering
[15:40:28] <RikusW> but the qtouch app on my 3a3 board take about 20kb flash
[15:40:40] <amee2k> 0.0
[15:40:44] <atmega> yes, but I do not try it ... do you know how it works?
[15:40:44] <amee2k> thats huge
[15:40:54] <RikusW> it is
[15:41:12] <RikusW> haven't looked at whats taking all that space yet....
[15:41:53] <RikusW> just loaded the newer firmware on the 3a3 xplain board
[15:41:53] <amee2k> since i remember qtouch sections popping up in datasheets for parts that clearly predate it, we were guessing the "pull pin low, then measure rise time with pullup resistor" trick
[15:42:39] <RikusW> qtouch is capacitive sensing afaik
[15:42:49] <amee2k> yeah, thats what i mean
[15:43:01] <RikusW> my xplain board even have a slider
[15:43:09] <RikusW> there is 3 segments
[15:43:30] <RikusW> but it don't have just 3 levels
[15:44:00] <RikusW> its connected to a pwm led which dims quite nicely
[15:44:01] <amee2k> touchpads like on laptops only have three capcitance sensors or so either
[15:44:50] <RikusW> its stock code at32uc3a3-xpld
[15:44:58] <amee2k> distance to your finger is related to capacitance reading, so they measure normalized distances between sensors and your finger
[15:45:07] <RikusW> $29
[15:45:07] <amee2k> then compute the position of the finger on the pad from that
[15:46:11] <RikusW> and it does have hi-speed usb too
[15:46:19] <RikusW> thats what I got it for
[15:46:50] <Tom_itx> what is the butterfly board>
[15:46:56] <Tom_itx> isn't that qtouch?
[15:47:09] <RikusW> its a m169 + lcd
[15:53:11] <RikusW> amee2k: probably 20k because of asf ?
[15:53:34] <amee2k> "asf"?
[15:53:53] <amee2k> soft floating point crap?
[15:54:19] <RikusW> avr sw framework
[15:54:25] <amee2k> o.O
[15:54:36] <amee2k> sounds useless
[15:54:44] <RikusW> abcminiuser: can tell you all about it
[15:55:08] <abcminiuser> Tom_itx, Butterfly is an old, old board
[15:55:14] <abcminiuser> As in, MEGA169 old
[15:55:14] <RikusW> it makes it easy to create app
[15:55:19] <Tom_itx> i figured
[15:55:32] <amee2k> like dot net does(n't)?
[15:56:10] <abcminiuser> Qtouch and Qmatrix are seperate products
[15:56:16] <abcminiuser> But both give capacitive touch
[15:56:30] <abcminiuser> Newer chips accelerate it in hardware, older ones need software to do it
[15:56:36] <amee2k> http://ompldr.org/vM2dsMA
[15:56:51] <abcminiuser> RikusW, ah, the UC3A3 Xplained demo app, guess who cleaned that up for release?
[15:57:12] <abcminiuser> Original only turned on the LED, I added the PWM because, seriously, slider with no PWM feedback?
[15:57:35] <RikusW> thats nice :)
[15:57:53] <RikusW> the pushbutton still don't turn its led on
[15:59:10] <abcminiuser> Really?
[15:59:11] <abcminiuser> Derp
[15:59:23] <abcminiuser> I gotta get to bed
[15:59:25] <RikusW> the qtouch button does turn its led on
[16:00:01] <RikusW> good night then
[16:00:16] <Tom_itx> later dean
[16:00:21] <atmega> http://sensi.org/~svo/capsensor/index.en.html
[16:00:58] <abcminiuser> Night all
[16:01:05] <atmega> good night
[16:01:06] <RikusW> Tom_itx: where have you been last week ?
[16:01:15] <Tom_itx> vacation
[16:01:20] <RikusW> ah
[16:01:20] <eatyourguitar> this thing says its compatible with avr studio 5 http://www.amazon.com/Pololu-Co-USB-AVR-Programmer/dp/B003XOHVUW/ref=sr_1_2?ie=UTF8&qid=1328046551&sr=8-2
[16:01:23] <abcminiuser> Send me bug decent bug reports in the meantime if you want me to file them for ASF, AS5, AS5.1 et al
[16:01:30] <abcminiuser> Catch soon
[16:01:35] <RikusW> sort of unusual to so you gone that loong ;)
[16:01:36] <eatyourguitar> and also does serial
[16:01:58] <eatyourguitar> is this thing legit?
[16:02:04] <RikusW> ok
[16:03:59] <Tom_itx> was there a disturbance in the force?
[16:13:36] <ben1066> hmm
[16:13:46] <ben1066> How could you use qtouch for power button...
[16:21:54] <RikusW> eh
[16:22:01] <RikusW> catch22
[16:23:00] <keenerd> Same way all the other power buttons work. You shut down 99% of everything, except for a tiny corner of the CPU which watches the power button.
[16:23:09] <karlp> well, use it to drag up the "enable/_shutdown" on some of the power supplies.
[16:24:19] <keenerd> I think light fixtures are the only thing you can buy today that still uses a hard power switch :-)
[16:26:56] <ben1066> so qtouch isnt even atmels...
[16:27:06] <ben1066> its quantum research groups
[16:28:06] <Valen> lol i was just about to ask if anybody had seen abcminiuser since his big move lol
[16:45:15] <ben1066> he was on
[16:45:18] <ben1066> then he left
[16:45:18] <ben1066> :P
[16:48:09] <Valen> yeah i noticed when i looked at the history
[16:59:28] <Valen> with lufa am i supposed to use the lowlevel or classdriver to make some simple apps with? i can never rember
[16:59:35] <ben1066> never usd it
[16:59:56] <Kevin`> Valen: whichever you prefer working with
[17:00:09] <Valen> what is the actual difference?
[17:00:42] <Kevin`> class driver is easier/faster to use, low level exposes some more details
[17:00:54] <Valen> class driver it is then lol!
[17:03:30] <vectory> amee2k: lol, i dont seem to get a thing of your macros %-)
[17:04:04] <vectory> thats why ill stick to asm just a bit longer
[17:09:38] <amee2k> vectory: hehe
[17:09:44] <amee2k> they're for C >_>
[17:31:52] <CanyonMan> d
[17:31:55] <CanyonMan> hardware queston:
[17:32:43] <CanyonMan> The 6 pin ISP setup on the ATMega328... I can have my app use those pins as GPIO right, and then disconnect my thing when it's time to hook up the programmer right?
[17:33:30] <Casper> yup
[17:33:37] <CanyonMan> ok good
[17:33:39] <CanyonMan> they are SPI pins
[17:33:47] <Casper> yup
[17:33:51] <CanyonMan> hopefully I can convert 2 of them to inputs
[17:33:56] <CanyonMan> what'd be even nicer would be if they could geerate interrupts
[17:34:16] <Casper> also you can leave the circuit connected as long as it can tolerate the garbage and that it will not interfere with the transfert
[17:34:47] <CanyonMan> Yeah. well it's an anemometer, so I want to take 5V from that connetor, but what it sees back will be two reed switches
[17:35:09] <CanyonMan> Stupid computer is stealig keypresses from me again grrr
[17:35:48] <CanyonMan> It' sdoing this because it knows my family is from the azores
[17:35:52] <CanyonMan> stupid racist anti-azorian computer!
[17:36:08] <CanyonMan> ... ok i made that up
[17:37:44] <CanyonMan> crud, just gneral GPIO pins can't generate interrupts on this thing by default can they
[17:38:40] <jadew> CanyonMan, you won't be able to use the reset pin
[17:38:48] <CanyonMan> that's fine
[17:39:08] <CanyonMan> How does ISP actually initiate (curious) ? Hold it in reset and do magic on the SPI ?
[17:40:12] <jadew> I think I tried to follow the traffic on the reset pin and IIRC there was something else going on there, not sure tho
[17:40:41] <CanyonMan> hm there are these "pin change interrupt requests" hrm
[17:40:49] <Kevin`> the datasheet does cover how isp works
[17:41:07] <CanyonMan> sure. I'll read about it there.
[17:42:09] <CanyonMan> ah ok maybe pinchange is what i want
[17:44:05] <amee2k> CanyonMan: if you use the ISP pins as inputs with other circuitry on the board, it is usually recommended to put a resistor between MCU pin/ISP header pin and the onboard peripherals
[17:44:24] <amee2k> to prevent the pin drivers of the ISP programmer and the onboard device from trying to drive against each other
[17:45:44] <amee2k> megaX8 has debugwire as well, which you may or may not want to consider as an alternative
[17:47:08] <amee2k> i think there was an appnote on that, or at least a schematic sketch in some datasheet
[17:47:27] <amee2k> (the protection resistor thing i mean)
[17:51:56] <CanyonMan> yeah
[17:52:00] <CanyonMan> i'll think about what to do about that.
[17:52:11] <CanyonMan> this thing is on a 40' wire that goes up to my roof
[17:52:27] <CanyonMan> so I may go to the trouble of optoisolating it, or at least putting a couple of bipolar transistors on it
[17:52:28] <CanyonMan> we'll see
[17:54:15] <amee2k> !units 40ft m
[17:54:26] <amee2k> mmh
[17:54:37] <amee2k> thats quite a bit
[17:54:56] <amee2k> what kind of signalling are you using?
[17:56:12] <amee2k> i think running ISP over that distance isn't overly practical. how about a bootloader and carrying serial over RS-422/485 for firmware updates?
[17:57:11] <ElMonkey> why, the ISP shouldnt really care if you put some drivers into the line
[17:57:14] <amee2k> ISP is based on SPI, debugwire is based on TWI/I2C. both were intended as on-board busses for low to medium speed peripherals, not for long distances
[17:57:52] <amee2k> well, ISP doesn't care but ensuring signal integrity over a 4" cable is quite easier than over 40'
[17:58:50] <amee2k> if the ISP cable is supposed to stay in place permanently, you should at least consider protection like for any other external connection
[17:59:00] <Casper> CanyonMan: yes, hold reset low and send a magic packet, which the avr intercept and then go into programmation mode, then it do the rest of the magic from there
[17:59:01] <Kevin`> ElMonkey: what interface are you using to actually communicate with the device?
[17:59:12] <amee2k> like extra protection diodes and/or TVS/MOVs and other surge protectors
[17:59:32] <ElMonkey> ISP, mostly
[17:59:36] <Casper> and yeah you need another protocol than SPI
[18:00:16] <ElMonkey> ISP is the least hassle
[18:01:40] <amee2k> all SPI lines are unidirectional. you can run SPI over RS485 style twisted pair lines with appropriate line transcievers with three-state buffers. that could be a robust solution, but flashing on an arduino bootloader and running a serial link would be easier i suppose
[18:02:29] <Casper> what about the clock propagation delay?
[18:03:04] <ElMonkey> you just need to clock slowly enough
[18:03:08] <amee2k> just running wires from the MCU pins like on normal ISP is not a stellar idea... you might find that your board suddenly stops working after a thunderstorm
[18:03:33] <ElMonkey> at 40ft its still ok up to the MHz range
[18:04:34] <amee2k> RS485/422 style signalling is good far into the 10s or 100s of MHz with asynchronous signalling. bandwidth isn't the issue
[18:04:53] <amee2k> as Casper pointed out, propagation delays through the transcievers and signal lines is
[18:06:34] <amee2k> if the delay from the master's clock output to the slave's clock input, through the slave's SPI interface and back through the MISO line to the master is too long, the master will latch the wrong bit
[19:24:43] <Kre10s> anyone else at times have problems with arvdude and usbprog? sometimes it will upload to ~96% and just hang for a while..
[19:28:01] <Tom_itx> try using -B 32
[19:28:08] <Kre10s> I also find that fresh chips need a good binary shaking before they are usable. avrdude will sometimes read out strange signatures, before finally reading the correct ones.
[19:29:45] <Kre10s> just before i tried some ADC and the converted value was stuck at whatever the first conversion returned. I changed the output register alignment and it all returns to normal.
[19:30:16] <Kre10s> s/changed/toggled
[19:30:27] <Tom_itx> try using -B 32
[19:34:41] <Kre10s> wouldn't avr-dudes verify step catch that?
[19:35:06] <Kre10s> that the memory isn't being programmed properly?
[19:35:06] <Tom_itx> it's the spi clock speed
[19:35:34] <Tom_itx> i don't use avrdude that much
[19:35:37] <Tom_itx> i'm not sure
[19:36:00] <Tom_itx> are you using at least rev 5.10?
[19:36:15] <keenerd> Dirty contacts on your programmer maybe?
[19:36:29] <Kre10s> yes 5.10
[19:53:41] <Casper> Kre10s: dirty contacts, if you have to do anything more than plug and play, then you have dirty contacts
[19:53:52] <Casper> or bad socket