#avr | Logs for 2013-10-17

Back
[02:36:15] <megal0maniac_afk> Tom_itx: http://blog.saleae.com/
[02:36:36] <megal0maniac_afk> And everyone else who uses a Saleae Logic
[02:37:18] <megal0maniac_afk> Especially those who are getting annoyed with the apparent lack of development on the client software
[02:50:19] <vsync_> why are everyone using arduinos
[02:50:24] <vsync_> they are total dogshit with their ide
[02:52:15] <megal0maniac_afk> vsync_: Because they're an easy way to get into things. Make "cool stuff" happen with minimal knowledge of AVR and basic programming skills
[02:53:24] <N1njAway> Pretty much.
[02:53:37] <N1njAway> They work well as long as one doesn't expect TOOO much.
[02:53:44] <megal0maniac_afk> You can set up the UART and print text at a specified baud with only 2 lines of code. Proper AVR programming takes a lot more time to learn and understand
[02:54:39] <N1njAway> People just risk the "glass ceiling" development problem where you simply cannot go any further without delving in a LOT deeper.
[02:54:59] <megal0maniac_afk> And given that the code is just C with libraries, you can add inline ASM if you want to, making it pretty flexible even for a simplified environment.
[02:55:21] <megal0maniac_afk> N1njAway: Why are we on IRC? You're away and I'm afk :/
[02:55:58] <N1njAway> Yep. My Atmel FAE was under the impression that "Wiring" wasn't compiled in C and that you couldn't just write straight Atmel register code. I clarified that.
[02:56:44] <N1njAway> I've had to do hardware that people program with Arduino (for reasons I won't go in to!) but for test-purposes, I just bang the ports and registers the same way I normally do. :)
[02:56:51] <N1njAway> mega: Eh, it happens!
[02:56:59] <N1njAway> I'm about to head home shortly, though. Too late here.
[02:57:11] <megal0maniac_afk> N1njAway: Haven't mastered tab complete yet? :P
[02:57:37] <N1njAway> megal0maniac_afk: Keep forgetting
[02:58:08] <N1njAway> Been doing IRC since way before we had nifty clients and tab completion and stuff XD
[02:59:25] <megal0maniac_afk> Personally, I started with an Arduino and an ISP programmer. Messed around with it a bit, then slowly started looking at how to do the stuff that I was doing in Ardweenie, in Atmel Studio. Eventually I was using the Arduino as a dev board. And now I have too many dev boards :) But it was a good introduction - not that everyone will make that progression. Many are happy with the "glass ceiling" approach because it works "well enough"
[02:59:59] <N1njAway> My point exactly :)
[03:00:22] <megal0maniac_afk> Which is why I don't know why it gets so much flack
[03:00:47] <megal0maniac_afk> s/flack/something else
[03:01:14] <megal0maniac_afk> Ah. Flak
[03:03:02] <N1njAway> Part of the friction comes from people doing Arduino development and then needing to move in to the bigger realm. I've talked to countless people that have clients who prototyped something in Arduino, then try to move it in to production, and are flustered when they find out that it's not really straightforward because they're really using it for something it's not necessarily intended for.
[03:04:39] <N1njAway> I'm also kind of blown away that the Arduino stuff really doesn't have (as far as I am aware) source-level debugging with JTAG/DW, because the beginners are especially the ones that need debugging and source stepping and breakpoints the most. Kind of weirdly... backwards.
[03:05:10] <megal0maniac_afk> No, it doesn'
[03:05:11] <megal0maniac_afk> t
[03:05:42] * megal0maniac_afk wonders if debugwire will work
[03:06:09] <megal0maniac_afk> There's a 10K pull-up. In parallel with the jtagice pull-up, should still be enough
[03:07:08] <N1njAway> I also think there's a bit of an annoyance because Arduino users CAN just bang certain pieces of code together quickly due to the Wiring macro-libraries and stuff, which Atmel is just starting to help better support and equivalent through their ASF stuff. But the difference is the Arduino users haven't had to learn the deeper nuances as to what is going on in their libraries versus those of us
[03:07:08] <N1njAway> who have had to code much of that ourselves. At least WE can go in there and super-customize everything as much as needed to do what is necessary vs glass-ceiling development on the Arduino side. But from a "need to do a simple app" the Arduino side is admittedly faster for a lot of stuff.
[03:07:18] <N1njAway> +an equivalent
[03:08:06] <N1njAway> But that's easily remedied by writing reusable libraries on the AVR side. In C. And using that whole object-oriented approach to reusable code. :)
[03:10:03] <megal0maniac_afk> I think debugging is just too expensive to be viable, and most users wouldn't use it. And not having debugging in the IDE conforms with the idea of keeping it as simple as possible
[03:11:11] <N1njAway> Michael Abrash said it best in Zen Of Graphics Programming, 2nd Ed (waaaay back in the 90s, when video cards started to take off more and several dozen MB of RAM was becomming regular) -- (paraphrased) "There is a tendancy for programmers these days to be very much out of touch with what is actually going on behind the scenes due to the layering of libraries and pre-provided code and the overall
[03:11:12] <N1njAway> bloat that comes with it. It's very much 'Why should I, as the programmer, have ANY idea what the hell my code is ACTUALLY doing' but with hardware getting faster and storage getting cheaper, few people seem to really care."
[03:11:34] <N1njAway> +doing?
[03:12:05] <megal0maniac_afk> Arduino Due. Case and point :P
[03:12:08] <N1njAway> And that addage has pretty well carried through to present day. And I have to download a 150MB file just to load a PRINT DRIVER.
[03:12:26] <Roklobsta> N1njAway: do you ever sleep?
[03:12:30] <megal0maniac_afk> Dare I mention FPGA toolchain? :P
[03:13:45] <megal0maniac_afk> Oh yes.
[03:13:52] <N1njAway> I am quite proud that some of the OpenGl-hosted full-GUI real-time signal synthesis tools I've developed on Windows are still EXEs that are less than 1MB and have zero external dependencies on .dll's, and don't have to be installed. Versus turning on .NET or VCL frameworks, and a simple Hello World EXE is 2-5MB!
[03:13:56] <megal0maniac_afk> N1njAway: Go home! Don't let #avr draw you in!
[03:14:14] <N1njAway> Rok: I sometimes sleep :)
[03:14:43] <N1njAway> I am popping the rest of these USB connector pins in their sockets then I will head home :)
[03:16:01] <megal0maniac_afk> QT seems nice. I can't figure out whether it's bloaty or not
[03:16:53] <N1njAway> We were so displeased with GTK/QT/etc that we just wrote our own from scratch :)
[03:17:40] <megal0maniac_afk> RikusW did something like that. Not very pretty, but EXTREMELY small
[03:22:57] <N1njAway> Here's an example of the GUI in action -- http://www.digisynth.com/temp/DS3LiveExample.png
[03:23:34] <N1njAway> It's quite pretty in that example, but we coded it because we needed a LOT more control over graphical widgets and interaction.
[03:26:58] <megal0maniac_afk> Good grief. That /is/ nice :)
[03:27:10] <N1njAway> http://www.digisynth.com/temp/DS3LiveExample2.png
[03:27:48] <N1njAway> http://www.digisynth.com/temp/DS3-test.png -- the "patch" on the left creates the real-time vector image on the right :)
[03:28:00] <megal0maniac_afk> N1njAway: A guy I know was working on this: https://www.facebook.com/hardcodeide/photos_stream
[03:28:08] <N1njAway> And they get complex at times -- http://www.digisynth.com/temp/DSPatchBig.png
[03:28:14] <megal0maniac_afk> Seems to have stalled before anything happened
[03:28:37] <N1njAway> That looks quite nice :)
[03:28:55] <megal0maniac_afk> It could be :P
[03:29:45] <megal0maniac_afk> Ooh. Lasershows
[03:30:04] <N1njAway> Examples of production that result from said software -- http://www.youtube.com/watch?v=rNAh30bLlx8, http://www.youtube.com/watch?v=pjNuhgjwYYQ, and http://www.youtube.com/watch?v=FA6eL3xOAOg
[03:31:02] <N1njAway> It's fun stuff.
[03:31:42] <megal0maniac_afk> Client?
[03:31:53] <N1njAway> mmm?
[03:32:05] <megal0maniac_afk> Digisynth
[03:33:03] <N1njAway> Nope, that's just one minor face of the business. It's kind of a pet project that grew in to filling a particular commercial niche for a side of laser that wasn't getting much love - namely classic abstracts.
[03:33:58] <N1njAway> I like to refer to it as my best programming practive ever. It was a great way to learn to develop scalable software, as well as get REALLY friendly with the Windows API and similar.
[03:34:05] <megal0maniac_afk> N1njAway: Awesome :) I like the 2nd video. Might have to show this to my boss :P
[03:34:11] <megal0maniac_afk> One of my bosses, anyway
[03:34:18] <N1njAway> Feel free :)
[03:36:59] <megal0maniac_afk> He runs an events company. HUGE vertec 4 set-up, rtl mics and all the fancy stuff. And they only had 1 laser, which they sold. They do all the cool visual stuff with a contractor that supplies LED display panels, and lots of lights.
[03:38:13] <N1njAway> We do the engineering for a lot of special effects for lighting that goes in to stage shows and themeparks. We don't go do the shows (generally) but we work with the folks who do.
[03:41:29] <megal0maniac_afk> Good fun, that. They have avolites stuff for control. The lighting guy enjoys what he does :)
[03:41:33] <N1njAway> I love the art and engineering, and I love talking to people. I'm always happy to pay it forward, hence why I'm happy to give back where I can in here. :)
[03:42:30] <megal0maniac_afk> I'm glad that's the case :P
[03:43:11] <N1njAway> There's a LOT of people that helped me to getting to do the kind of stuff I am these days, so it's the best I can do, because many times I can't say a proper thanks to those people who helped me along. Or sometimes those people end up as clients and you come full-circle. It's really weird sometimes.
[03:45:06] <N1njAway> More than a few companies that inspired me to get in to entertainment engineering stuff now use stuff I design. To me, that's a sense of satisfaction that is worth more than anything that money can buy. And if I of all people can do this, anyone can.
[03:46:07] <N1njAway> Anyhow, I ramble :)
[03:47:47] <GargantuaSauce> laser projection is cool as hell
[03:47:57] <GargantuaSauce> i only got as far as this https://www.youtube.com/watch?v=OELxDGtESMI which was pretty halfassed but it was a lot of fun
[03:48:46] <N1njAway> GargantuaSauce: Niiice!
[04:01:39] <N1njAway> Alright, I think it's time for me to go sleeeeeep. This has been a long day. See you guys later!
[04:04:52] <megal0maniac_afk> Goodnight! :)
[06:21:05] <megal0maniac_afk> Hi RikusW :)
[06:21:15] <RikusW> hi megal0maniac
[06:22:00] <megal0maniac> Quick question. Some people in the lab are playing with interrupts. In main, there's a 4bit counter linked to LEDs. They're trying to pause the timer using code in the interrupt handler. How can they do this?
[06:22:14] <megal0maniac> They're using PIC, but the principle should be the same
[06:22:42] <RikusW> on AVR you can turn off the timer prescaler
[06:23:41] <megal0maniac> But wouldn't that just make the counter run at F_CPU?
[06:23:46] <megal0maniac> Rather than stopping it?
[06:24:04] <RikusW> there is a off setting in it too
[06:25:00] <RikusW> look at the CS0x bits on AVR
[06:25:24] <RikusW> if all are 0 the clock is stopped
[06:25:57] <megal0maniac> They're using a delay routine for the counter
[06:26:03] <megal0maniac> Not an actual timer...
[06:26:38] <megal0maniac> I'm building an opamp lowpass filter. How boring :P
[06:31:59] <megal0maniac> Oh well. They're using PIC, they can suffer :P
[06:32:15] <RikusW> heh :-P
[06:32:28] <megal0maniac> I could do it with an fpga
[06:32:35] <specing> megal0maniac: ##pic
[06:32:38] <specing> megal0maniac: go there
[06:32:43] <megal0maniac> specing: I don't want to go there
[06:33:16] <megal0maniac> I was essentially asking about interrupts, on AVRs, hoping I might be able to apply the same logic to PIC
[06:35:11] <RikusW> it appears there are timers bits like TMR1ON etc on PIC
[06:35:39] <megal0maniac> But it doesn't help if they aren't using the timer
[06:35:53] <megal0maniac> Maybe they can tristate the pins :P
[06:37:50] <specing> megal0maniac: why not?
[06:38:46] <megal0maniac> Because that won't stop the clock, you just won't see that it's counting
[06:39:30] <RikusW> I still don't quite understand, they are using the timer but they are not ?!
[06:39:44] <RikusW> which is it ?...
[06:39:52] * RikusW is confused
[06:40:35] <megal0maniac> They're using delay(ms)
[06:40:44] <megal0maniac> They seem to have fixed it now
[06:40:48] <RikusW> why not code everyting in sw then ?
[06:40:55] * megal0maniac shrugs
[06:41:33] <RikusW> PIC multibank registers are a pain....
[06:44:12] <specing> ya
[06:48:43] <megal0maniac> PICs are a pain :P
[06:49:16] * megal0maniac looks at all the PICKIT2s, plugged vertically into breadboards, supported by only the 6 pins that connect it
[07:37:05] <vsync_> yeah i get the point on arduinos. still i hope idiots would just fry them
[07:37:52] <vsync_> like, retards use 5v linear regs out of 24 V and wonder "how does this get hot?!?!?"
[07:38:47] <vsync_> googloids are the problem
[07:44:52] <jadew> there's so much "doing X with arduino" "arduino and xxx sernsor" around... I want to stab those people in the face
[07:45:45] <jadew> FUCK YOU AND YOUR ARDUINO, IT'S JUST A FREAKING AVR CHIP, STOP PUTTING EMPHASIS ON THE FUCKING DEV BOARD!
[07:46:10] <jadew> ARRRGH! so annoying!
[07:47:32] <jadew> it's not like it has some firmware that they're controlling trough a SDK, no, they are programming the damn chip.
[07:48:01] <jadew> if it was via SDK, then yes, you'd be using the whatever product that is, otherwise you're using the AVR chip
[07:51:29] <theBear> c'mon, more than half of them haven't read enough to know what an avr chip is
[07:51:44] <theBear> and that's not exaggerating
[07:51:56] <jadew> theBear, you're probably right
[07:52:02] <theBear> i'm definately right
[07:56:48] <twnqx> vsync_: i want SMPS modules in TO220 as a drop-in replacement, too :P
[07:57:08] <megal0maniac_afk> twnqx: I second that!
[07:58:56] <twnqx> 78SW05
[07:58:56] <twnqx> yumm.
[08:09:07] * megal0maniac_afk hates the path variable in Windows
[08:09:33] <megal0maniac_afk> What will happen when you type make? NOBODY KNOWS!
[08:10:32] <megal0maniac_afk> Is there not a nicer way to manage having various compilers?
[08:12:22] <jadew> usually different toolchains have a bat file that sets the PATH to the right thing
[08:12:51] <megal0maniac> Haven't seen that
[08:12:58] <megal0maniac> But I shall look
[08:17:33] <theBear> been a while but something like echo %PATH% should make it a bit clearer... if it was a real os there would be a which command :)
[08:17:56] <megal0maniac> Yeah, that's what I like. And yes. echo %PATH% is correct
[08:18:11] <megal0maniac> But to make it even uglier, there's a path variable per user, and a global one
[08:18:41] <megal0maniac> I'm getting "make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3)" when I run make. Any quick fixes?
[08:19:43] <theBear> how many different users you use ?
[08:20:02] <megal0maniac> Just 1. But that makes 1 more path variable than I'd like
[08:20:24] <theBear> so everytime you look at path it will be the same, that's 1 path variable
[08:20:29] <theBear> and trust me, you wouldn't like less than 1
[08:20:41] <megal0maniac> No, 1 is great
[08:21:39] <theBear> hangon, make works in a dos shell ?
[08:21:49] * megal0maniac nods
[08:21:58] <theBear> technology eh
[08:22:04] <megal0maniac> Because it's an executable in a dir listed in %path%
[08:22:09] <theBear> well, except the part where it doesn't work
[08:22:25] <megal0maniac> Might just be the wrong one. I'm busy reorganising PATH
[08:23:15] <theBear> if you know the right one just do like PATH=\rightpath,%PATH% and type make on the next line
[08:25:22] <megal0maniac> It appears that I don't know what it should be :)
[08:25:48] <megal0maniac> IIRC, the way the Atmel Toolchain is structured, you set 1 path for both avr8 and avr32
[08:31:32] <megal0maniac> FFFFFUUUUUUUUU!!!!!!!!
[08:31:38] <megal0maniac> *sigh*
[08:32:50] <megal0maniac> On the other hand, I just realised how much I like cygwin. I keep typing ls out of habit, and it just works
[09:01:47] <megal0maniac> Cool, doing something avrish for a change. Using studio to avoid stupid $PATH.
[09:03:20] <megal0maniac> In ISR() function, what do I put in the brackets? INT0_vect seemed like the obvious choice but apparently not (I'm trying to use INT0, obviously)
[09:03:43] <megal0maniac> This is on a tiny85
[09:03:48] <megal0maniac> Other than that, I have sei()
[09:04:02] <megal0maniac> GIMSK |= (1 << INT0); and GIFR |= (0 << INTF0); inside the ISR routine
[09:10:03] <megal0maniac> Idiot. Put ISR inside main >.<
[09:15:54] <Tom_itx> who would do such a silly thing?
[09:19:25] <Tom_itx> INT0_vect would be correct
[09:19:37] <Tom_itx> #define INT0_vect _VECTOR(1)
[09:19:38] <Tom_itx> #define SIG_INTERRUPT0 _VECTOR(1)
[09:24:18] <megal0maniac> Tom_itx: Me
[09:24:22] <megal0maniac> I did that
[09:24:26] <megal0maniac> http://pastebin.com/xGsnTB3P
[09:24:53] <megal0maniac> Haven't run it yet (need to get the chip out, programmer, power etc first) but at a glance, is there anything missing or unnecessary?
[09:27:14] <megal0maniac> Also, in the datasheet it says that an interrupt can wake the device from power down. There's a note saying "For INT0, only level interrupt." What do they mean by level interrupt?
[09:32:04] <megal0maniac> Ah. Level _change_. But the change is implied
[09:57:30] <Tom_itx> make sure it wakes it up, i haven't used any sleep functions yet but hear that some don't work as advertised
[09:58:22] <megal0maniac> I can't even program the damn thing at the moment. Every time I push reset, it stops where it is
[09:58:42] <megal0maniac> Might be time for HVSP chip erase
[09:58:46] <Tom_itx> why can't you program it?
[09:58:55] <Tom_itx> did you fiddle with the reset fuse?
[09:59:02] <Tom_itx> or does it have one...
[09:59:16] <Tom_itx> i'm not familiar with the t85
[09:59:21] <megal0maniac> It does
[09:59:25] <megal0maniac> And I think I did
[09:59:29] <megal0maniac> Needed more IO :)
[09:59:37] <Tom_itx> then you need to reset it with 12v
[09:59:45] <megal0maniac> Yip. Busy setting it up
[09:59:46] <Tom_itx> or you can't program it again
[09:59:57] <Tom_itx> i do know that
[10:00:43] <megal0maniac> Rikus' programmer magically disables DWEN temporarily. But I've probably disabled the pin altogether
[10:02:03] <Tom_itx> the only one i've done that on is the t10 and i've got a 12v adapter for it to reset the fuse
[10:02:15] <Tom_itx> unfortunately it doesn't work on isp
[10:03:21] <megal0maniac> Yeah.. I've got an adapter board with a 12V charge pump
[10:03:39] <megal0maniac> In the meanwhile, does the code look alright?
[10:03:41] <Tom_itx> what did you use to get the 12v?
[10:03:49] <Tom_itx> i didn't look, been on the phone
[10:04:15] <Tom_itx> i _can_ show you some int0 code though
[10:04:51] <megal0maniac> I'll pass for now, thanks :P Just want to make sure mine is right before I complicate things
[10:05:09] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/avr/atmega328/INT0/
[10:05:21] <megal0maniac> http://i.imgur.com/BEGhCPOl.jpg
[10:06:03] <Tom_itx> is that yours or rikus?
[10:06:27] <megal0maniac> Rikus'. It uses a ST622AB
[10:06:41] <Tom_itx> i think that's what i used but i forget
[10:06:56] <megal0maniac> It's a "DC-DC converter from 5V to 12V, 0.03A for flash memory programming supply"
[10:07:05] <megal0maniac> So you probably did :)
[10:07:21] <Tom_itx> he may have gotten the pn from me
[10:07:23] <bss36504> N1njAway, are you around?
[10:09:16] <Tom_itx> yeah, it's alot cheaper than the max counterpart
[10:09:24] <Tom_itx> ST662ACD-TR
[10:10:07] <Tom_itx> quick! everybody hde
[10:10:10] <Tom_itx> hide*
[10:10:19] <Tom_itx> hah
[10:10:23] <megal0maniac> Nicely done
[10:11:00] <Tom_itx> i put a switch on mine so you can leave it in circuit
[10:11:05] <Tom_itx> 5 or 12v
[10:11:12] <Tom_itx> err 0 or 12v
[10:11:16] <Tom_itx> to reset
[10:20:05] <megal0maniac> Hmmm... DWEN was set. But the debugger might have done that by itself
[10:20:09] <megal0maniac> Oh well
[10:28:51] <megal0maniac> Okat then. The code I posted, the interrupt never fires
[10:29:02] <megal0maniac> *okay
[10:42:22] <megal0maniac> Strange. I call sei(), but I never gets set :?
[10:44:42] <megal0maniac> Even if I write 1 to the bit
[10:44:53] <megal0maniac> halp!
[10:45:17] <megal0maniac> If I pause and manually flip the bit, then it works
[10:45:17] <bss36504> Is it interrupting immediately and clearing the bit?
[10:45:38] <megal0maniac> bss36504: No, because an LED comes on and it delays for 500ms, so I'd see.
[10:45:54] <bss36504> Oh wel I dunno then...that is tricky
[10:45:57] <megal0maniac> Also when I set it with the debugger and continue, it works fine indefinitely
[10:46:50] <megal0maniac> bss36504: Would you mind taking a quick look? It's only 27 lines long
[10:46:55] <bss36504> sure
[10:47:51] <megal0maniac> http://pastebin.com/y2Rpe1GF
[10:48:53] <megal0maniac> Strangely, when I continue, the interrupt fires immediately
[10:49:22] <megal0maniac> Using a button as my source
[10:50:24] <bss36504> what part?
[10:50:44] <bss36504> ohhh wait. put a while(1) at the end of main.
[10:51:04] <bss36504> the program just ends because main returns
[10:52:33] <MannImmond> megal0maniac: There was a bug when single stepping over sei(). Not sure if it ever got fixed. Try setting a breakpoint after it and run over it with F5
[10:53:20] <bss36504> MannImmond, megal0maniac: But there is nothing to break on after sei(). thats the last instruction. so you need some sort of infinite loop at the end.
[10:53:53] <megal0maniac> Ah! There we go :)
[10:54:04] <MannImmond> That shouldn't matter. If you run F5 without a breakpoint and then pause it should display correctly
[10:54:23] <megal0maniac> Well it seems to have solved the problem. I didn't change anything else
[10:54:38] <megal0maniac> Also, it was doing that regardless of whether I was debugging or just running
[10:54:48] <bss36504> MannImmond: It does matter. you cant break on nothing.
[10:55:11] <bss36504> It will just end execution when it reaches the end of main.
[10:55:59] <megal0maniac> Now, last part. If I were to power the AVR down, where would I do this? Theoretically the interrupt would bring it out of sleep
[10:56:12] <MannImmond> depends on the interrupt and the sleep level
[10:56:31] <bss36504> Honestly never played with sleep, but I would assume you do that after enabling interrupts.
[10:56:44] <megal0maniac> I'll just try :)
[10:56:47] <megal0maniac> And see what works
[10:56:59] <bss36504> which part are you using?
[10:57:29] <megal0maniac> Also, is it standard to have all the init code where it is? Presumably it will run every time the interrupt finishes
[10:57:36] <megal0maniac> bss36504: tiny85
[10:58:43] <bss36504> I mean, its not really a time critical application so it doesnt hurt, but generally you would perform all inits of I/Os in one place that way you dont have to repeat the steps.
[10:58:55] <bss36504> You people and your Attinys.
[10:59:22] <megal0maniac> bss36504: I have others, this was just the first one I grabbed :)
[10:59:38] <megal0maniac> Was actually going to try with an AVR32 first but my toolchain is broken
[10:59:50] <bss36504> haha I'm just kidding. I usually need more pins.
[11:00:54] <megal0maniac> Well I have the AVR32UC3A1128, mega1284p and xmega256a3u. But for a button and an LED it seemed like over kill :)
[11:02:59] <megal0maniac> Ah, here's an easy one. I want to write 1 to SM1 and 0 to SM0. They're on bits 4 and 3 of MCUCR, how would I write to them simultaneously?
[11:07:32] <bss36504> MCUCR |= (1<<SM1) | (1<<SM0);
[11:08:36] <megal0maniac> But that would write a 1 to SM0
[11:08:50] <bss36504> Oh derp. Misread that
[11:09:11] <megal0maniac> Setting 2 bits I can do ;)
[11:10:22] <megal0maniac> Because I'd imagine that setting them 1 at a time is a bad idea. Weird stuff could happen
[11:11:38] <bss36504> 1) Store MCUCR. 2) Set SM1 in temp var. 3) Clear SM0 in temp var. 4)set MCUCR to temp
[11:11:57] <bss36504> You cant do both bit operations in one go
[11:12:04] <bss36504> I'll be back in a bit
[11:12:04] <megal0maniac> Got it
[11:12:09] <megal0maniac> Thanks :)
[11:12:12] <bss36504> no problem
[11:24:28] <vsync_> has anyone seen the eevblog guy's comparison of microchip vs atmel
[11:26:33] <vsync_> megal0maniac: what are the prices for avr32's?
[11:26:46] <ColdKeyboard> Anyone had an issue that code execution "stops" after sending 1st character over USART? :\
[11:27:51] <twnqx`> no, but i had deadlocks before :P
[11:28:21] <ColdKeyboard> What is deadlock? :)
[11:28:50] <vsync_> the hairdo. oh wait, was dreadlocks. soz
[11:30:08] <twnqx`> a situation where two parts of a program wait on each other
[11:37:12] <megal0maniac> vsync_: I got an aery32 dev board. They were basically giving away their rev0 (beta) boards, just paid shipping
[11:37:14] <megal0maniac> So I have no idea
[11:37:50] <megal0maniac> INT0 wakes the avr from idle sleep, but not power down, like the datasheet says it should
[11:41:36] <theBear> lol, those hippies are always getting deadlocks, spose they don't practice programming enough :)
[11:42:25] <twnqx`> no safer programming for the hippos!
[11:53:54] <megal0maniac> I'll be back for further brain-picking later :)
[13:37:21] <execi> stuck with initializing an sd card :( cmd0 only gives me alternating responses of 0x00 and 0xFF and after around 10 of these it starts giving out weird responses
[13:41:13] <N1njAway> execi: Try several different SDCard if you have them. I had compatibility issues on one of my implementations that I never 100% tracked down in the initialization phase, and I solved it by buying 30 more SDCards of a diffrent brand and they worked fine :)
[13:41:56] <N1njAway> It was admittedly an 11th hour fix in order to ship, but these items would never have their SDCards removed, so it didn't matter.
[13:43:13] <N1njAway> I assume you have a copy of the SD spec you are working through? I believe there's a fairly specific initialization routine that needs a certain number of dummy clock cycles pumped through to help get the card initialized, etc.
[13:43:27] <N1njAway> It's been a while since I did much with that.
[13:44:19] <bss36504> N1njaneer: :O What haven't you done? Where do you work?
[13:44:54] <execi> N1njaneer: yeah, i thought sending 80 dummy clocks works for all
[13:45:09] <execi> this is an age old SD, don't even know the brand. Thought they all follow the spec
[13:45:28] <N1njaneer> bss: I haven't written a TCP/IP stack from scratch as an excercise yet - that's still on the list? :D
[13:45:53] <execi> what brand would you recommend to be reliable?
[13:46:12] <N1njaneer> execi: They're supposed to all follow the spec, but as I had a problem where some would work and some would not, there was nother another delineating factor at play that I hadn't tracked down yet.
[13:46:45] <execi> gonna grab a few tomorrow then =D
[13:46:48] <N1njaneer> execi: I THINK these were Kingstons - I'd have to go look at the few that are left from that project. They were very inexpensive 4 or 8GB cards
[13:47:05] <execi> the ones you got to work?
[13:47:07] <N1njaneer> It's just something to try that's easy to see if your code is at least partially there.
[13:47:18] * bss36504_ takes notes on SD issues for upcoming project...
[13:47:34] <N1njaneer> execi: Yeah, I think so.
[13:48:10] <execi> yeah this is just irritating. running mega32 at 16mhz, tried spi clock fsck/128 and /64 for the init, neither works reliably
[13:48:10] <N1njaneer> I would like to find out what that problem ultimately was on that compatibility issue, but as of yet I haven't had a chance to look at it further.
[13:48:24] <execi> sometimes i have gotten the card to reset and get out of idle, but it's once in a blue moon...
[13:49:11] <N1njaneer> execi: If you suspect timing stuff, I would probably try kicking up the prescalar divider to 1024 and (if possible) use the 1Mhz internal RC oscillator. Just run it slowly, see if your results change.
[13:49:25] <N1njaneer> execi: What did you wind up doing for the voltage conversion?
[13:50:00] <execi> i'm using dividers at the moment
[13:50:21] <N1njaneer> Did that document help with setting your values?
[13:51:03] <execi> high state goes 3v into the sd
[13:51:12] <N1njaneer> If you're using the dividers, I would probably suggest slowing the clock speed waaaay down to see if the results change. At least that would help to point to potentially being a hardware issue, etc.
[13:51:24] <bss36504> I've had very good luck with SN74AVC4T245 level shifters for high speed SPI. You need to do something else for CS, but you can usually get away with a voltage divider for that.
[13:51:25] <execi> yeah, could try it. I guess
[13:51:46] <execi> gonna set the oscillator fuses to default
[13:51:52] <execi> and then just
[13:51:59] <execi> use like fsck/4
[13:52:11] <execi> for initing the spi bus
[13:52:20] <execi> err, sd card anyway~
[13:53:12] <N1njaneer> Worth trying.
[13:57:35] <N1njaneer> I've used 74LVX125s on a recent design to level-shift up and down from 5V to 3.3V for an FPGA interface.
[13:58:06] <N1njaneer> Well, actually just down. Up doesn't require it. :)
[14:01:42] <execi> question
[14:01:52] <execi> if using internal oscillator can you still have an xtal connected
[14:01:54] <execi> or must you remove it
[14:04:34] <bss36504> You can have it and even swap on the fly (in some(?) parts).
[14:04:48] <juri_> why would avr-ld be not finding -lc ? if i specify /usr/lib/avr/lib/avr4/libc.a on my command line, my program links.
[14:08:33] <N1njaneer> Nope, just switch the clock bits
[14:14:52] <beaky> hello
[14:15:01] <beaky> has anyone played with the ATtiny85 chip?
[14:15:16] <beaky> what kidns of applications can it replace bigger MegaAVR chips
[14:15:42] <theBear> ones where it has enough memory and pins
[14:15:42] <beaky> s/^/for /
[14:15:57] <beaky> ah
[14:16:14] <beaky> cool maybe i can use it as a USB transducer
[14:16:35] <beaky> the attiny packs such power in such a tiny, energy-efficient, low-cost package
[14:19:30] <theBear> you don't mean transducer
[14:20:02] <execi> N1njaneer: yeah okay sure. got it set up now. 250 kHz spi and 1 MHz avr
[14:21:37] <beaky> oh oops meant transciever*
[14:21:39] <beaky> transceiver*
[14:22:08] <beaky> low cost, high efficiency ftw
[14:22:45] <N1njaneer> Depends on what you need to do with it I suppose :)
[14:23:51] <vsync_> low cost ftw
[14:24:21] <beaky> i love analog to digital conversion
[14:24:32] <beaky> its like bridging two ideologies into one
[14:26:36] <N1njaneer> And one cannot forget digital to analog conversion, too
[14:26:54] * twnqx` forgot that
[14:27:34] <execi> N1njaneer: you remember sd stuff by heart by any chance?
[14:27:46] <execi> like, some basic stuff, like r1's?
[14:28:58] <N1njaneer> execi: I'd have to go back and look at it - it's been a while. There are some good pieces of SDCard reference code out there for AVR, though, that may be worth looking at. I used some of that as reference when getting my stuff up and going.
[14:29:06] <execi> Yeah
[14:29:16] <execi> was just wondering wth does it mean for the r1 response to have crc bit set
[14:29:23] <execi> does it mean invalid crc or what
[14:29:37] <N1njaneer> Do you have a current copy of the SD standard?
[14:30:06] <execi> was actually trying to be cheap and look for a cheat sheet for r1¨'s, hahah
[14:30:21] <execi> gonna have to go deeper than that =)
[14:30:27] <N1njaneer> The documentation you need is free
[14:32:25] <N1njaneer> execi: https://www.sdcard.org/downloads/pls/
[14:32:58] <vsync_> Yeah, thanks
[14:35:07] <vsync_> getting multiple 0xFF, then 0x00, and this alternates for a while, after which it throws a 0x08 which is apparently command crc error
[14:35:20] <vsync_> however it goes to show it has already set the idle bit...
[14:35:50] <vsync_> well. Think i'll go grab myself a few newer sd cards than this age old one :)
[14:36:19] <N1njaneer> vsync_: http://www.dharmanitech.com/2009/01/sd-card-interfacing-with-atmega8-fat32.html has some excellent information and code that I found very useful to reference and build from when I was doing my implementation.
[14:36:45] <vsync_> yupp thanks!
[14:36:50] <vsync_> sd cards are a pain
[14:37:14] <N1njaneer> They're a pain until they work correctly. Then they're fantastic.
[14:37:18] <vsync_> finally this god damn terminal works
[14:37:34] <vsync_> yeah!
[14:37:47] <vsync_> everything's quite fab once it works...
[14:38:05] <N1njaneer> Gotta enjoy the process, though :)
[14:38:22] <N1njaneer> If you don't, then probably best to use libraries where possible and skip over things :)
[14:38:23] * juri_ tears her hair out. ;)
[14:39:06] <vsync_> yeah, i do like it. that's why i do this
[14:40:17] <N1njaneer> Good good
[14:43:29] <jaldunate> hello. would someone explain me a c line...
[14:43:41] <jaldunate> USISR = _BV(USIOIF)
[14:43:56] <jaldunate> supposedly it clears the 4bit counter flag
[14:44:13] <jaldunate> but, for my understanding, it would keep the flag
[14:46:21] <N1njaneer> jaldunate: You probably want a |= or &= when using those macros
[14:46:41] <jaldunate> shouldn't it be like ~=_BV(...)
[14:46:45] <N1njaneer> That line as written would only set USIOIF and would clear everything else
[14:47:26] <N1njaneer> USISR &= ~_BF(USIOIF) would AND out the USIOIF bit to a zero and preserve the others
[14:47:35] <jaldunate> okay. is just that i grabbed it from someone much more experienced, so i'm not confident to change it without asking
[14:47:38] <jaldunate> thanks!
[14:48:24] <N1njaneer> jaldunate: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=561044 may be useful
[14:52:16] <bss36504> jaldunate: I personally prefer using (1<<Some_bit_name) rather than _BV(). I think it's a bit cleaner and easy to follow, but thats just my opinion.
[14:52:51] <N1njaneer> bss36504: Same here. The BV macros just make it harder to read.
[14:53:39] <bss36504> I like macros a lot, but usually I make them a bit more useful and/or descriptive. Like INIT_LEDS or something.
[14:53:40] <jaldunate> oh. okay. so it's just the same as bitshift. i you wanted a bit value from a register it'd be i.e. PORTB&=_BV(4)
[14:54:09] <bss36504> well reading a bit is a bit different if I follow what you said correctly.
[14:55:24] <bss36504> PORTB&=_BV(4) would clear bit 4 in PORTB. (PINB&(1<<4)) or (PINB&_BV(4)) would mask out bit 4 from the port B input register.
[14:58:01] <jaldunate> sorry i missed an important part. PORTB|=_BV(4) same as PORTB|=1<<4
[14:58:35] <bss36504> yes
[14:59:36] <jaldunate> cool. :) then i'll prefer the old way <<
[15:00:08] <bss36504> It's immediately obvious what's happening, thats why I like it.
[15:44:27] <juri_> kf5: i'm not familiar enough with it to tell.
[15:44:31] <juri_> er. :D
[15:47:26] <megal0maniac_afk> juri_: Are you lost? :P
[15:52:31] <megal0maniac_afk> Can anyone tell me why an external interrupt, set to fire on falling edge, will wake the chip from idle but not from power down? The datasheet says that it should. Running, the chip uses 7.4mA. Idle it uses 4.6mA. Since it's doing essentially nothing, I want to cut it down more
[15:54:13] <juri_> megal0maniac_afk: no, just frustrated. ;)
[15:54:14] <N1njaneer> megal0maniac_afk: Dunno, possibly dig through the datsheet more - you may need to set something else. I've gotten the micros down in to the 17uA deep-sleep power consumption modes and have been able to wake on interrupts just fine, but it took some fiddling :)
[15:55:09] <ChrisSc> hi all
[15:55:18] <ChrisSc> could use a little help wit studio 6
[15:55:27] <megal0maniac_afk> I know that to get super low power I need to switch off stuff like BOD. But i first want to make sure that it's sleeping, not in a coma XD
[15:55:49] <ChrisSc> I have a c project and want to include some cpp code
[15:56:20] <ChrisSc> already found out that i need to change my whole project to cpp in order to enable the c++ compiler
[15:57:04] <ChrisSc> nevertheless it still complains on "expected ';',',' or ')' before & token
[15:57:27] <ChrisSc> i think its because it treats the file as C and not as c++
[15:58:03] <ChrisSc> what am I doing wrong?
[15:58:06] <MannImmond> megal0maniac_afk: What are you using? Tiny2313?
[15:58:25] <ChrisSc> Its the FastSPI_LED2 lib I want to include btw
[15:58:43] <megal0maniac_afk> t85
[15:59:06] <megal0maniac_afk> Going for a quick run, will be back in a bit
[16:00:23] <TechIsCool> anyone use the nrf24l01? need a little help on something
[16:00:44] <MannImmond> megal0maniac_afk: Uhm, there's a note at the Sleep mode table external interrupt can only wake from sleep when configured to level interrupt...
[16:03:16] <megal0maniac_afk> MannImmond: What exactly does that mean? I assumed that it needs to be a level change, not held low. Or have I got it backwards? I feel like I do...
[16:05:17] <megal0maniac_afk> Hmmm... I'm starting to think now that only "The low level of INT0 generates an interrupt request." is valid
[16:05:33] <MannImmond> Try configuring it for level interrupt not edge interrupt
[16:05:44] <megal0maniac_afk> Will do. Running now :)
[16:05:53] <megal0maniac_afk> Well, not now. About to :P
[16:16:48] <N1njaneer> ChrisSc: What is your file extension? .c or .cpp?
[16:17:34] <N1njaneer> ChrisSc: Unless the compiler is forced via flags to compile everything at C++, often times the extension of the file determine which version of the compiler is invoked.
[16:18:25] <N1njaneer> +as
[16:20:16] <ChrisSc> N1njaneer: The error actually occurs in a .h file
[16:20:53] <ChrisSc> lib8tion.h belongs to lib8tion.cpp though
[16:21:08] <N1njaneer> You can try .hpp as well
[16:21:34] <ChrisSc> is there an option in studio 6 to compile everything as c++?
[16:21:43] <N1njaneer> Are you using AVR Studio, and did you create the project as C++ when you started?
[16:21:55] <ChrisSc> yes and yes
[16:22:04] <N1njaneer> I THINK there may be an option in the compiler settings to force C++ complilation.
[16:23:51] <ChrisSc> haven't found anything bout that in the projects properties
[16:23:52] <N1njaneer> Yeah, in previous projects that I've done as C++ I remember this being an issue. All of my project files are named .cpp and .hpp
[16:24:01] <N1njaneer> Try changing that header file over to .hpp extension
[16:24:31] <N1njaneer> The compiler has no way to associate it with the .c/.cpp file to know if it's supposed to be C or C++
[16:24:35] <ChrisSc> same error
[16:25:27] <ChrisSc> In this line: LIB8STATIC void nscale8_LEAVING_R1_DIRTY( uint8_t& i, fract8 scale) {
[16:25:42] <ChrisSc> its the & he's compleining about
[16:26:05] <N1njaneer> I believe that would make sense if it's compiling at C instead of C++
[16:26:24] <N1njaneer> Inherent pass by reference is only part of the C++ standard if I recall, not C.
[16:26:47] <N1njaneer> +as
[16:28:25] <ChrisSc> I think theres sth wrong in the way i'm using fastSPI as I cannot find any other matches on google
[16:29:08] <bss36504> FastSPI?
[16:29:12] <ChrisSc> yep
[16:29:24] <bss36504> What is that?
[16:29:28] <ChrisSc> FastSPI_LED2 RC4
[16:29:43] <ChrisSc> Is a library to control led strips
[16:29:56] <bss36504> Ohhh ok. I've never used it.
[16:30:14] <ChrisSc> it works fine with the arduino ide ;-)
[16:32:17] <bss36504> probably using some arduino defined macros? I dont recognize some of the stuff in this file: https://code.google.com/p/fastspi/source/browse/trunk/FastSPI_LED.cpp
[16:32:48] <ChrisSc> at least not in this file
[16:33:03] <bss36504> Is it using the timer channel to bit bang an spi protocol? Seems like it would be better just to write your own lib using the actual SPI
[16:33:07] <ChrisSc> the compiler throws 46 errors but none in this file
[16:33:22] <bss36504> Can you paste up the errors?
[16:33:31] <ChrisSc> lib8tion.h for example
[16:33:59] <ChrisSc> will do
[16:34:13] <N1njaneer> ChrisSc: Is this used for controlling the 3-wire LEDs?
[16:34:38] <ChrisSc> by 3 wire you mean vcc, data, gnd?
[16:34:43] <N1njaneer> Yep.
[16:34:48] <bss36504> Does this lib use ALL of those files listed in the google code trunk? Controlling an led strip is not this hard.
[16:35:06] <ChrisSc> yes, but it can be as well used to control 4wire leds with vcc, data clk, gnd
[16:35:58] <ChrisSc> http://pastebin.com/VeUnpajH
[16:36:02] <N1njaneer> bss36504: The reason this code is complicated is because this is not actually "SPI" bus control - the LED controllers in question used kind of a hacked type of SPI that uses specific timing protocols to carry data without needing seperate framing info as per CS lines, etc.
[16:36:14] <ChrisSc> It handles color conversion as well
[16:36:20] <N1njaneer> It helps cut down the number of wires between devices.
[16:36:26] <bss36504> that sounds awful
[16:36:34] <N1njaneer> (Though we've actually done it with a single wire :D)
[16:36:42] * bss36504 excuses himself from the discussion :P
[16:37:36] <ChrisSc> its actually quite nice to be able to select/change the chipset of the leds at the beginning and then to be able to reuse the whole code
[16:38:37] <ChrisSc> bss36504: here's one example: http://pastebin.com/VeUnpajH
[16:39:03] <ChrisSc> Error in line 3 of the paste at the "&"
[16:39:36] <bss36504> are you compiling this with a C++ compiler?
[16:39:46] <N1njaneer> ChrisSc: As I said, I believe it is because you are compiling this as C and not CPP
[16:39:50] <ChrisSc> I have selected AVR 8bit c++ project
[16:39:55] <megal0maniac_afk> 525uA. It's certainly turning off ;)
[16:40:19] <ChrisSc> changing the ending to hpp didn't change anything
[16:40:51] <MannImmond> megal0maniac_afk: So, does it wake up with interrupt set to level interrupt?
[16:41:13] <megal0maniac_afk> I killed both timers and counters and ADC and USI, then it only fired once and went comatose :P So I left PRR alone
[16:41:27] <megal0maniac_afk> MannImmond: Yip, thanks for pointing that out :)
[16:41:52] <megal0maniac_afk> Produces the desired result, so it's good enough
[16:42:29] <MannImmond> No Problem, I always nice to know the product. Never used that one though
[16:42:54] <megal0maniac_afk> It's a nifty little chip. Quite capable, but small. Should get some SOIC ones :)
[16:43:26] <MannImmond> I supposed I could fine some, somewhere in the office...
[16:43:51] <MannImmond> suppose*
[16:43:56] <MannImmond> but then again....
[16:46:48] <N1njaneer> ChrisSc: Do me a favor... Under Properties->Toolchain->AVR/GNU C++ Compiler and AVR/GNU Linker, can you tell me what the "Command:" is listed as?
[16:47:11] <N1njaneer> Is it avr-gcc or avr-g++?
[16:47:31] <ChrisSc> g++
[16:47:51] <ChrisSc> in compiler and linker
[16:48:21] <ChrisSc> even -x c++ lib8tion.h changes nothing
[16:48:40] <bss36504> ChrisSc: What happens if you move that ampersand away from uint8_t and over next to the i (uint8_t &i)
[16:48:40] <N1njaneer> Did you rename the library to .hpp?
[16:49:22] <ChrisSc> bss36504: Same error, tried that already
[16:49:28] <bss36504> hmmm...
[16:49:49] <N1njaneer> Also, why is there LIBSTATIC prepending that line? Are you compiling this in to an executable from stand-alone source, or trying to link with existing object files ,etc?
[16:49:57] <ChrisSc> N1njaneer: tried both way, no change
[16:50:00] <bss36504> well I guess that makes sense. I'm still learning C++, but I guess it would be invalid C anyway.
[16:50:50] <ChrisSc> Im trying to compile it as an executable
[16:51:00] <N1njaneer> Also, your paste with the "LIB8STATIC void nscale8_LEAVING_R1_DIRTY( uint8_t& i, fract8 scale) {" -- is this in a .cpp file or a .h/.hpp file?
[16:51:12] <ChrisSc> all i have are the .h and .cpp files
[16:51:19] <ChrisSc> this was taken from the .h file
[16:52:00] <ChrisSc> do i have to compile the source as a stic library first, then include it into my project?
[16:52:09] <N1njaneer> There shouldn't be executable code in the .h file.
[16:52:12] <bss36504> N1njaneer: This was taken from an arduino lib, and they might require some interesting things to make it work with their compiler...
[16:52:22] <N1njaneer> Their compiler is gcc
[16:53:25] <N1njaneer> ChrisSc: In any case, your http://pastebin.com/VeUnpajH code compiles fine under AVR Studio for me.
[16:53:55] <N1njaneer> It's generally bad form to put any executable code in a header file unless you are creating an in-line function.
[16:54:10] <ChrisSc> well, when i try to compile only the code for this lib as a static library, it gets stuck at not finding arduino.h
[16:54:15] <bss36504> Lots of people put C++ inline in header files
[16:54:22] <bss36504> inline functions*
[16:54:43] <N1njaneer> bss: And an inline function should be extremely short and tiny.
[16:55:11] <N1njaneer> bss: But it can be extremely bad form unless you understand specifically why you would need to make it defined as an in-line.
[16:55:41] <bss36504> Yes, but executable nonetheless. I'm not saying its not bad form, but it would work.
[16:55:51] <N1njaneer> Especially on a micro where space is at a premium. Inline functions will be replicated in to your code in-place EVERY place they are called.
[16:55:53] <bss36504> operator overloading is a classic example of inlining in a header
[16:56:13] <bss36504> right, but thats why you choose why you're inlining carefully
[16:56:34] <bss36504> like if you're just wrapping a bit shift or something.
[16:57:03] <bss36504> I could say #define LED_ON PORTB|=1<<3; or I could throw that in an inline.
[16:57:14] <N1njaneer> operator overload has nothing to do with inlining in a header, though. The header file should define the prototype definitions for the functions. The implementation should always be done in the .c/.cpp file with very little exception.
[16:57:53] <N1njaneer> ChrisSc: In any case, your pastebin header runs through the compiler just fine for me.
[16:58:11] <ChrisSc> I'm a bit confused as well
[16:58:32] <ChrisSc> as I said, compiling it as a static lib throws only an error for missing arduino.h
[16:58:53] <bss36504> strictly speaking it's good form to follow that model, but sometimes I feel that it makes sense to put simple things in header files. Take a trawl through LUFA. Inlines, inlines everywhere....
[17:00:10] <N1njaneer> ChrisSc: Oops sorry, wasn't explictly including the header in to my main.cpp to pull it through the compiler. It's complaining about the LIB8STATIC missing
[17:00:51] <ChrisSc> maybe you can try to pull the complete sources from https://code.google.com/p/fastspi/downloads/detail?name=FastSPI_LED2.RC4.zip&can=2&q=
[17:01:29] <N1njaneer> Unfortunatly I don't have time to at the moment. In any case, you may need to finagle this code a bit to get it to work under AVR Studio. Shoudn't be too difficult.
[17:01:40] <ChrisSc> I've only added #include "FastSPI_LED2.h"
[17:01:55] <ChrisSc> No, problem, thanks anyway
[17:03:27] <N1njaneer> Oh sheesh, why in the hell are they using templates all over this?
[17:03:28] <ChrisSc> well, after including the missing .h fromt he arduino folders, a static lib compiles without errors
[17:04:27] <N1njaneer> That explains why all of this executable code is in the headers -- because they're doing all of this as template classes.
[17:04:32] <ChrisSc> If I get you correctly, its for the different chipsets
[17:04:47] <ChrisSc> ws2801, ws2811, etc
[17:05:00] <N1njaneer> ChrisSc: Templates would not be my first choice for abstracting that away, but that's just me.
[17:07:17] <N1njaneer> ChrisSc: Nothing in here from my casual glance as the source zip file seems to indicate it shouldn't compile in AVR Studio just fine.
[17:07:32] <ChrisSc> It compiles as a static lib
[17:07:46] <ChrisSc> now i have to figure out how to use it ;-)
[17:08:37] <N1njaneer> If that's the case, you should be able to include the resulting static library file and the appropriate .h file and just build your application off of that.
[17:09:12] <ChrisSc> the .h file is the original one of the main class?
[17:10:57] <N1njaneer> Generally you should just have to include one .h file to use with a library -- it looks like FastSPI_LED2.h in this case, as it has all of the class prototypes for what is compiled in to the library.
[17:11:00] <ChrisSc> or better: where do I find the appropriate .h file
[17:11:23] <ChrisSc> okay, so i copy my .a and the .h to my project
[17:11:42] <N1njaneer> So then you should only need to move the static library, the .h file, and (unfortunatly) all of the . h files that it includes in to your project.
[17:12:47] <N1njaneer> Most commercial library releases like this tend to concatenate the contents of all the headers in to one large header file to make dispatch easier, so you only have a single lib or dll and a single .h file you have to put in your project.
[17:13:05] <ChrisSc> okay, so i will include the arduino dirs
[17:13:33] <N1njaneer> No no
[17:13:43] <N1njaneer> Look in FastSPI_LED2.h at the top
[17:13:55] <ChrisSc> but there are all the nedded .h
[17:13:57] <N1njaneer> ALL of those .h files listed will also need to be copied over in to your project as well
[17:14:17] <ChrisSc> include path for the compiler will not work?
[17:14:32] <N1njaneer> The ones specific to the library, or moreso the class prototypes necessary for the use of the library.
[17:15:15] <N1njaneer> You can optionally add an include path to point at those files elsewhere, but be aware that if you ever move or archive your project, you are not getting the full thing.
[17:15:34] <ChrisSc> I know
[17:17:41] <N1njaneer> Personally I have found it exceedingly beneficial to ALWAYS gather all files required for a project to fall under one directory, and work from there. You can still use include-paths, but those can then be defined relative to the project. Or better practice still is structuring things so they are either local in the same directories as makes sense, or you do #include "../folder/include.h" from
[17:17:42] <N1njaneer> inside the source where necessary. The latter allows even more superior code reuse when you move chunks of project around, as it is no longer necessary to have to explicity go in an configure a bunch of include paths as long as the relative paths are unchanged.
[17:19:41] <ChrisSc> :-( I've included the lib but it again gets stuck at the .h file
[17:20:09] <N1njaneer> (But anyhow, much of that is just style decisions. I've found it to work well for me for many of the reasons I have listed. A lot of that stems from working on massive software that has hundreds of source-files that need to be grouped, developing toolkits and frameworks that need easy self-dependencies for recycle, as well as ease of managing version control and project exchange over things like
[17:20:10] <N1njaneer> SVN and GitHub. Find what works best for you! :D)
[17:20:22] <N1njaneer> Which .h file?
[17:20:23] <juri_> gitorious. github is non-free. ;)
[17:20:55] <ChrisSc> again lib8tion.h, same as before
[17:21:38] <ChrisSc> copied all needed .h to my project
[17:21:42] <N1njaneer> That's odd
[17:22:38] <N1njaneer> juri: I highly prefer SVN myself. GitHub continues to be a super pain in the ass for dealing with source merges, vs something like TortiseSVN
[17:25:12] <megal0maniac_afk> It really depends on the type of project / development, like most things
[17:25:40] <juri_> N1njaneer: i've adapted to a pure git methodology. it took some time to get used to multiple remotes.
[17:27:10] <N1njaneer> Well as I said, gotta find what works for you.
[17:27:16] <megal0maniac_afk> From rockbox.org: "SVN only has one way of working: you check out, you make changes, you try and commit, and it fails if anyone else committed before you. You then have to update, resolve conflicts, and try and commit again. This means there's not really any policy element there: you are always committing directly on top of all existing changes."
[17:27:46] <N1njaneer> I have had pretty much bad experience trying to use GitHub to handle some things. SVN has been much smoother, is free, and very ubiquitously supported.
[17:28:47] <N1njaneer> mega: And with a good SVN client the changes are easy to resolve. GitHub just goes "I can't deal with this!" and dumps you in to a cryptic command-line shell with menacing cursor. Personally, I'll take Tortise.
[17:29:19] <N1njaneer> But again, it works for me, so I prefer to use it.
[17:29:24] <megal0maniac_afk> Your mileage may vary ;) I've only ever used Git, and I'm still scared of it
[17:29:25] <Roklobsta|2> toirtose svn in the past has for me has not always brought back what i put in.
[17:29:45] <Roklobsta|2> this was using it with the free VisualSVN server.
[17:29:50] <N1njaneer> I've not seen much monumental with GitHub other than the cloud-hosting on it.
[17:30:14] <Roklobsta|2> which was a complain of Linus, traditional repo systems sometimes ate your homework.
[17:30:41] <N1njaneer> Rok: We've typically run SVN with Tortise as the client, and an internal Linux machine hosting standard SVN, though I know people who have had good luck with running the Windows version of the server as well for easier management.
[17:32:23] <Roklobsta|2> i have been happy wityh git for my own private stuff, never had to merge with it ... yet.
[17:32:53] <N1njaneer> But again, finding out what works for you and accomplishes your task most easy is the best answer for you personally :)
[17:33:56] <Roklobsta|2> then there is the old <cr><lf> vs <cr> thing you get with SVN. TortoiseSVN bolloxes AVRDude updates. I have to use Cygwin SVN to get it updated properly.
[17:34:55] * megal0maniac_afk nudges N1njaneer (tab complete) :P
[17:35:56] <N1njaneer> mega: I'm saving Internet bandwidth!!
[17:36:12] <Roklobsta|2> bah avrstudio 6.1 can't seem to find updates
[17:36:18] <Roklobsta|2> WTF
[17:36:19] <megal0maniac_afk> Suuuure
[17:36:39] <bss36504> Really N1njaneer just has kinked ethernet wires and it restricts the flow of internet, so he has to use less characters.
[17:37:28] <Roklobsta|2> if you put a ferrite around your cat5 cable it slows the internet down too.
[17:37:31] <N1njaneer> bss36504: But if I unkink the Ethernet, it momentairly turns in to an OC-192 fiber backbone for a few moments, just like pinching a garden-hose
[17:38:07] <bss36504> All those backlogged internets clogging up the wire.
[17:38:14] <bss36504> absolutely gushing out.
[17:38:20] <N1njaneer> Because the internet is a series of tubes.
[17:38:32] <bss36504> Ah yes, we have arrived at this.
[17:39:07] <Roklobsta|2> toobs? http://www.oz8.org/gallery/albums/Seedyrom/toobs1.jpg
[17:39:53] <N1njaneer> That does look tasty
[17:40:22] <megal0maniac_afk> That is NOT the internet
[17:40:52] * megal0maniac_afk wants to put his jtagice and saleae in the same box so they can become friends
[17:41:02] <bss36504> What sort of place has such a product?
[17:41:12] <Roklobsta|2> you can shove a cat 5 cable through at00b.
[17:41:43] <N1njaneer> I like "power over fiber" myself
[17:41:47] <beaky> how do I become a better avr
[17:42:07] <Roklobsta|2> overclock
[17:42:23] <beaky> overclock? nah ill stick to 128kHz
[17:42:24] <Roklobsta|2> diup yourself in LiNi and dial up the Hz.
[17:44:26] <bss36504> megal0maniac_afk: is the saleae website copyright Apple Inc.?
[17:44:48] <N1njaneer> Roklobsta|2: Actually, gotta make a circuit that takes an audio input in to a comparator and then a PLL. So the higher pitch you scream in to the microphone, the faster the AVR runs
[17:44:51] <megal0maniac_afk> bss36504: I know, right?
[17:45:54] <megal0maniac_afk> Gotta learn PLL!
[17:45:59] <bss36504> N1njaneer: That might be the most usefull useless invention ever
[17:46:02] <bss36504> PLL is fun
[17:46:56] <N1njaneer> Heck, AVR is a static design. Set it to external TTL clock, stick a 0.1uf cap on the pin, and dump audio right in there.
[17:47:07] <N1njaneer> You just won't get it up much above 20Khz or so XD
[17:47:17] <N1njaneer> But that would be fun to make with some sequencing LEDs
[17:47:49] <bss36504> better yet, use the avr as the phase detector...
[17:47:52] <megal0maniac_afk> I've already considered doing that with a 555 and a pot
[17:49:08] <Roklobsta> N1njaneer: But you ain't no Mariah Carey.
[17:52:09] <bss36504> megal0maniac_afk: A PLL isn't especially hard to conceptualize, but the implementation is a lot harder, particularly at the ultra-high frequencies used inside chips. Making a stable VCO that runs at 1.2V or less and clocks at >1GHz is pretty hard. Technically though, you could implement a pretty decent software PLL on a micro that has all of the parts of a "real" PLL and it would show off how it works pretty well.
[17:52:42] <Roklobsta> DLL
[17:52:57] <bss36504> Well not exactly either
[17:53:09] <bss36504> I mean, it wouldnt really be a PLL nor a DLL
[17:53:17] <Roklobsta> DPLL
[17:53:25] <Roklobsta> NQADLLOPLL
[17:54:30] <bss36504> Well a DPLL uses a digital phase detector, but still an analog filter and VCO.
[17:55:11] <bss36504> an ADPLL (all digital) is done with a numerically controlled oscillator and usually implemented in hardware.
[17:56:21] <bss36504> But anyway, it would be a neat exercise to do some interrupt driven phase detection -> some DSP software to filter down to a number (average? successive approx.?) -> a timer controlled oscillator output
[17:57:12] <bss36504> the feedback would have to be a division of that clock number to trigger some sort of software compare value for the PD
[17:57:22] <bss36504> two timer compare numbers?
[17:57:34] <megal0maniac_afk> bss36504: Most "simple" things get horribly complicated as speed increases. Factors that were negligible suddenly make huge differences.
[17:59:26] <megal0maniac_afk> Took a trip to the magnetic observatory a few weeks ago. They make fpga based high frequency equipment that uses big antennae in the antarctic to blast HF into the ionosphere and measure what comes back, and other things like that. Really cool stuff
[18:01:44] <Roklobsta> HAARP in the antartic? Melting the icecaps!
[18:01:52] <bss36504> I wasnt suggesting you run this software pll at full speed. like 2x or 3x multiply a few hundred hz. Also, that sounds pretty neeeeet.
[18:02:17] <bss36504> yeah wont all that radiation make our brains melt too?
[18:02:59] <megal0maniac_afk> Roklobsta: Yeah, it looked like that. I was more interested in the amplifiers they were building, the FPGA that was driving it and the massive capacitor banks that juice it
[18:03:15] <megal0maniac_afk> bss36504: I have no idea. Maybe that's why they put it so far away :)
[18:08:40] <megal0maniac_afk> Roklobsta: Not Quite A Delay Locked Loop Or Phase Locked Loop?
[18:08:52] <bss36504> Digital*, but yes
[18:09:04] <megal0maniac_afk> :)
[18:09:06] <bss36504> er...I think. I'm not them
[18:09:30] <megal0maniac_afk> Well logical conclusion. It followed "DPLL"
[18:10:22] <megal0maniac_afk> I'm off. 'Nite!
[18:10:41] <bss36504> night!
[18:34:11] <braincracker> h
[18:39:48] <N1njaneer> Aww I missed all the PLL discussion :)
[18:40:46] <juri_> bad bootloader. NO COOKIE!
[18:45:36] <megal0maniac_afk> braincracker: i think we should ban you from doing that
[18:45:55] <braincracker> you don't have to
[18:46:03] <megal0maniac_afk> h
[18:46:33] <braincracker> i see greeting is luxory here
[18:49:34] <megal0maniac_afk> is h supposed to be a greeting?
[18:52:18] <megal0maniac_afk> I guess it is
[18:52:32] <megal0maniac_afk> Strange.
[19:06:38] <Fornaxian> h is the new hi like u is the new you.....it's all about eliminating extra letters in the words you type because of course it's so hard to type those two and three letter words these days on those 104 key keyboards.
[19:18:05] <seldon> I would have expected "i", though, since "h" is short(er) for "age" and doesn't sound anything like "hi." AOLspeak is highly onomatopoetic.
[19:24:51] <Fornaxian> aolspeak is way too advanced for some of these kids these days.
[19:26:01] <seldon> They don't make stupid kids like they used to. Now git off my lawn!
[19:27:33] <Fornaxian> why isn't phonetically spelled phonetically?
[19:35:09] <seldon> Because pronunciation changes more rapidly than orthography, I guess.
[19:47:14] <theBear> nah they don't, they perfected making them now
[19:50:57] <seldon> Who? The Scottish or the Texans?
[20:08:43] <N1njaneer> And don't forget that everyone everywhere in the world speaks English, too. :)
[20:10:20] <seldon> Aber ja!
[20:15:50] <Tom_itx> with various accents
[20:18:51] <seldon> Très bien!