#avr | Logs for 2012-11-22

Back
[01:53:51] <specing> Just got linked this in ##math: http://www.hackersdelight.org/
[01:54:01] <specing> optimizations at the bit level
[01:54:03] <specing> :)
[07:03:41] <eni23> does someone knows which sensor&what optic he is using: http://www.youtube.com/watch?v=R-6b2pCTJsw (diy thermal camera)
[07:05:42] <eni23> seems like an university-project. allready mailed the prof few weeks ago but no answer. or does someone knows other cheap infrared-thermal-sensors and optics?
[07:29:57] <GuySoft> hey, if i set F_CPU 8000000UL will my avr work at 8Mhz? or is F_CPU unchangeable for a specific avr?
[07:31:30] <Horologium> F_CPU is just a constant set in your software to be used for figuring out timing delays and stuff.
[07:32:36] <Horologium> you set it to the actual speed that the processor is running.
[07:32:36] <Horologium> it does not actually change the speed of the processor at all.
[07:32:36] <Horologium> it is used in calculating things like timer delays and USART baud rates.
[07:33:27] <Horologium> this was answered for you 12 hours ago.
[07:33:32] <MrTrick> it would be nice to define F_CPU and just do something like #include <avr/cpu.h> .... init_cpu();
[07:33:51] <MrTrick> (and no, that doesn't exist, I'm just saying)
[07:34:12] <Horologium> unfortunately there is no way to read the clock frequency..would be nice but doesn't exist.
[07:34:34] <Horologium> if you had another external clock source you could calculate it based on that clock source.
[07:34:44] <MrTrick> ah yeah, wouldn't work for external
[07:35:44] <Horologium> like, something connected to the USART sending 01010101 at 9600 baud could give you a known external and you could then play with USART settings till you start getting that stable then infer the cpu speed from that.
[07:36:19] <Horologium> or if you had a 32khz crystal attached you could use that to calcuate processor speed.
[07:36:27] <Horologium> both of which I've seen done.
[07:37:29] <Horologium> don't think you can even read fuses from within the processor.
[07:42:33] <GuySoft> Horologium, was it? i was afk at the time, sorry :( and didn't see a mention alert
[07:43:17] <GuySoft> Horologium, is there a way to change the clock speed in a at90usb162?
[07:43:25] <Horologium> it was pretty much what I just said.
[07:43:54] <Horologium> there is, yes...however, playing with the clock speed will screw with any USB software you have on it, specially a bootloader.
[07:45:02] <Horologium> is this on some kind of dev board or what?
[07:48:26] <Horologium> as for a mention alert, they might not actually use your nick when replying.
[07:48:44] <Horologium> but the reply was 5 minutes after your question last night.
[07:49:07] <Horologium> to change the clock you need to play with prescalers.
[07:51:48] <Horologium> http://www.atmel.com/Images/doc7707.pdf page 26 tells how to change the clock prescaler in software.
[07:51:56] <Horologium> with that you can cut the clock speed in half.
[07:53:51] <Horologium> prescaler is talked about starting on page 34
[07:55:21] <karlp> also "clock_prescale_set(x) " in avr-libc
[07:55:26] <karlp> http://www.nongnu.org/avr-libc/user-manual/group__avr__power.html
[07:58:10] <Horologium> but, again, remember, changing your processor clock speed will change all kinds of things. Make sure F_CPU is set to whatever you are setting the clock speed to. If you are going to change it, do it early in the program before you try to do any external communications that might rely on clock speed and F_CPU setting like USART or USB.
[09:45:46] * megal0maniac is looking at http://www.xess.com/prods/prod048.php again...
[09:46:12] <megal0maniac> And can't decide
[09:51:47] <Richard_Cavell> megal0ma1iac_afk: looks nice doesn't it
[09:53:01] <megal0maniac> Richard_Cavell: Who are you talking to? :)
[09:53:14] <Richard_Cavell> whichever one of you is at the keyboard
[09:53:30] <megal0maniac> megal0ma1iac_afk has been accidentally abandoned.
[09:53:42] <megal0maniac> Tomorrow, he shall be kicked
[09:54:18] <megal0maniac> And yes, it does look nice... Everything you need and nothing more
[09:54:43] <megal0maniac> Damn USD exchange rate though :/
[10:02:31] <megal0maniac> Otherwise Open Bench Logic Sniffer
[10:03:09] <megal0maniac> Richard_Cavell: What are you messing with these days?
[10:03:19] <Richard_Cavell> Mate I finished my project
[10:03:23] <Richard_Cavell> The AVR hardware thing
[10:03:32] <Richard_Cavell> Now I'm studying some other matters, and I shall return to AVRs next year
[10:03:46] <Richard_Cavell> Our hackerspace is moving into a new space though, and I waterblasted the concrete floor
[10:05:37] <Richard_Cavell> I had to wash all my clothes, but it was fun
[10:06:40] <megal0maniac> You can't be finished with AVRs. Pah!
[10:06:52] <Richard_Cavell> Not totally
[10:06:55] <Richard_Cavell> I'm just reading some other things
[10:06:58] <Richard_Cavell> I'm reading a C programming book
[10:16:30] <tld> Richard_Cavell: Are you reading *the* C programming book though?
[10:17:10] <Richard_Cavell> I have read K&R2 3 times this year and done all the exercises and posted them on a blog for public critique
[10:17:41] <karlp> you did _all_ the exercises in k&r? you're a masochist!
[10:18:01] <karlp> wherez the blogz?
[10:18:15] <tld> You're not supposed to actually *do* the excercises…
[10:18:32] <tld> Read once, keep for reference, live happily ever after.
[10:18:33] <Richard_Cavell> he he
[10:18:45] <Richard_Cavell> No, trust me
[10:18:47] <Richard_Cavell> Do the exercises
[10:18:54] <karlp> I did some of the exercises, they were useful, but I sure didn't do all of them
[10:19:12] <tld> Doing some of the pointer ones, would probably make sense.
[10:19:22] <Richard_Cavell> karlp: http://www.blogger.com/profile/00154358395331815154
[10:19:27] <tld> generally mucking about is probably more constructive though, if you're good at mucking about.
[10:19:44] <Richard_Cavell> Go to ##c, they'll tell you to do the exercises and they're right
[10:20:35] <megal0maniac> They're always right
[10:20:50] <tld> I used to be an op there for a while.
[10:20:54] <tld> Or maybe on efnet.
[10:20:56] <tld> I get confused.
[10:21:06] * tld is old. :(
[10:22:09] * megal0maniac wants ops on #avr :)
[10:22:12] <megal0maniac> just because
[10:22:23] <tld> it's boring. you have to do stuff.
[10:22:44] <megal0maniac> Not all that much to do here
[10:22:46] <megal0maniac> But when there is...
[10:22:56] <megal0maniac> Your hands aren't tied :)
[10:23:22] <tld> I like tied hands.
[10:23:32] * megal0maniac runs
[10:24:07] <tld> a) I'm playful, b) means I can just wash my hands of things, and come back when it's all sorted out.
[10:24:36] <tld> speaking of which,.. bbl.
[10:33:40] <Tom_itx> megal0maniac why?
[10:33:54] <megal0maniac> Tom_itx: Why what?
[10:34:02] <Tom_itx> why do you want ops?
[10:35:10] <megal0maniac> Because I like knowing that I can kick someone out should it be necessary. It's extremely satisfying to do it yourself instead of waiting for someone else to :)
[10:35:34] <megal0maniac> No real need here, only seen one incident, but yeah. I like the idea.
[10:36:13] <karlp> if power satisfies you, you don't deserve power, or something something mumblew something
[10:36:54] <megal0maniac> karlp: I'm satisfied by justice, or something like that
[10:37:34] <Tom_itx> what happened?
[10:38:16] <megal0maniac> You mean the one time I've seen that someone with ops was necessary?
[10:38:22] <Tom_itx> this is a very clean channel comparatively
[10:38:36] <Tom_itx> yeah
[10:38:55] <megal0maniac> You were there, kicked the bugger. Spambot or something.
[10:52:32] <megal0maniac> Tom_itx: Do you market your programmers anywhere other than here?
[10:54:17] <Tom_itx> just on my website
[11:04:10] <OndraTabby> hello there
[11:04:24] <OndraTabby> so I paid $40 VAT + $20 for some form
[11:04:32] <OndraTabby> no ripping heads..
[11:04:41] <OndraTabby> FedEx forgot me to make them pay $15 :P
[11:04:56] <OndraTabby> $60 better than $88
[11:05:29] <OndraTabby> :D
[11:05:29] <OndraTabby> I went there between school
[11:05:29] <megal0maniac> And the stuff has arrived?
[11:06:39] <jadew> OndraTabby, how exactly does that work?
[11:06:51] <jadew> they gave you the package and you went by yourself to the vamal office?
[11:06:56] <jadew> if so, why did you go?
[11:07:10] <OndraTabby> no
[11:07:14] <OndraTabby> you get papers from fedex
[11:07:17] <OndraTabby> you go to the custom
[11:07:17] <OndraTabby> s
[11:07:20] <jadew> ah
[11:07:22] <OndraTabby> they yell at you that you need some "JST" paper
[11:07:26] <OndraTabby> so you go somewhere
[11:07:36] <OndraTabby> he shouts at you "ARE YOU SERIOUS! 29 ITEMS?!"
[11:07:48] <OndraTabby> so we made some deal like "it will be taxed based on the highest rate"
[11:07:54] <OndraTabby> so I waited 1 hour in line
[11:08:05] <OndraTabby> (5 people, but no custom officers)
[11:08:14] <OndraTabby> then they yelled at me again that they fucked it up
[11:08:17] <OndraTabby> so I went there
[11:08:26] <OndraTabby> finally it came through the office
[11:08:30] <OndraTabby> I paid the VAT
[11:08:36] <OndraTabby> and went to fedex with the papers
[11:08:39] <OndraTabby> and they gave me the package
[11:08:45] <jadew> got it
[11:09:05] <OndraTabby> on the way home I met some nice woman from the US :D
[11:09:16] <megal0maniac> Ohmygosh that's over-complicated
[11:09:21] <jadew> banged her?
[11:09:21] <OndraTabby> yeah
[11:09:24] <OndraTabby> jadew: no lol
[11:09:28] <megal0maniac> Haha
[11:09:30] <OndraTabby> she was not bad
[11:09:41] <OndraTabby> but I had to go to school already
[11:09:47] <OndraTabby> I spent like 4 hours on the customs
[11:09:51] <OndraTabby> running between buildings
[11:10:12] <jadew> sounds worse than in here
[11:10:25] <megal0maniac> I just make sure I order below the limit :)
[11:10:36] <jadew> in here, you have have to wait in a long line, just so you can deal with a bunch of angry chicks
[11:11:08] <OndraTabby> haha
[11:11:24] <OndraTabby> megal0maniac: here you have to come even when it is below the limit because the shipping itself would be above thel imit :D
[11:11:30] <OndraTabby> I haven't opened the package yet
[11:11:42] <OndraTabby> because I dont have ducktape with which I could close it again
[11:11:46] <megal0maniac> Can I order next week?
[11:11:50] <jadew> I opened mine today
[11:11:56] <jadew> lots of presents
[11:11:58] <OndraTabby> megal0maniac: from where?
[11:12:04] <OndraTabby> yes you can actually
[11:12:07] <megal0maniac> Xboard mini :P
[11:12:07] <OndraTabby> but not through me
[11:12:08] <OndraTabby> oh
[11:12:11] <OndraTabby> mini duino? :P
[11:12:23] <megal0maniac> Whatever you're selling
[11:12:23] <OndraTabby> I need mouser to arrive
[11:12:26] <OndraTabby> and also ethernet shield :)
[11:12:35] <OndraTabby> but I don't have those long stackable headers
[11:12:41] <OndraTabby> and I am running out of money :D
[11:12:47] <megal0maniac> Me too...
[11:14:34] <jadew> OndraTabby, that's good, because it means you don't get to spend insane ammounts on stuff you might not really need
[11:14:48] <OndraTabby> :D
[11:14:48] <jadew> if you wouldn't run out of money, then you'd have to control yourself :)
[11:14:57] <OndraTabby> I have got few hundreds bucks left :D
[11:15:00] <OndraTabby> I need to sell all xboard minis
[11:15:02] <OndraTabby> all 25!
[11:15:05] <OndraTabby> and all 10 eth shields
[11:15:17] <jadew> put them on e-bay
[11:15:20] <jadew> ebay
[11:15:23] <OndraTabby> :P
[11:15:26] <OndraTabby> I will of course
[11:15:26] <jadew> seriously
[11:15:30] <OndraTabby> and then I will move to the US
[11:15:44] <OndraTabby> I can't take all this ass raping from customs and everything here :D
[11:16:47] <jadew> I don't think the US is such a great place right now
[11:17:05] <jadew> they have a lot of debt, few jobs
[11:17:20] <OndraTabby> look at CZE and debts
[11:17:28] <jadew> the US does a lot worse
[11:17:37] <OndraTabby> but they RUN the money :P
[11:17:37] <jadew> they have like 100k USD / person
[11:17:58] <jadew> they run shit, big companies are fleeting the US
[11:18:03] <OndraTabby> o'rly
[11:18:08] <OndraTabby> show me something like digikey but in the Europe
[11:18:43] <jadew> well, they don't have VAT, but that's what's kicking companies out
[11:19:02] <jadew> because no VAT means less taxes for the people, higher taxes for companies
[11:19:28] <jadew> that's only part of the problem
[11:19:45] <jadew> anyway, europe is not in a great spot either
[11:19:56] <jadew> we're on the edge as well
[11:20:12] <jadew> if I were to move somewhere, I'd go to china and start a business there
[11:21:06] <jadew> well, I don't think I'd live there, but for a business (in electronics) it's a good place to be
[11:22:35] <GuySoft> might anyone know what this line does?: bit_is_set(PINB,3) , i am not sure what PINB is in the context of an attiny
[11:22:58] <jadew> it's PINB
[11:23:07] <megal0maniac> Africa :)
[11:23:12] <jadew> it's a port
[11:23:19] <jadew> and it's used for reading the value on a set of pins
[11:23:26] <jadew> read the datasheet
[11:23:46] <GuySoft> jadew, why is it not PORTB then?
[11:24:16] <jadew> because that's used for output
[11:24:23] <jadew> DDRB sets the direction
[11:24:27] <jadew> PORTB outputs stuff
[11:24:30] <jadew> PINB inputs stuff
[11:28:26] <jadew> I got 2 atmega16, they're huge
[11:28:57] <OndraTabby> 40 dip?
[11:29:20] <eni23> i got few 32er's they are bigger :P
[11:29:32] <jadew> yeah 40 dip
[11:29:45] <jadew> really? bigger than this?
[11:30:14] <megal0maniac> OndraTabby: FPGA dev board or AVR Dragon?
[11:30:22] <OndraTabby> dragon
[11:30:25] <jadew> any device you're gonna build, that's going to use an atmega16, will look retro
[11:30:28] <eni23> nevermind just saw that atmega16 are also dip40
[11:30:34] <OndraTabby> i got fpga and have never used it
[11:30:45] <megal0maniac> Send it to me with xboard :)
[11:31:02] <OndraTabby> i didnt say i wont use it!
[11:31:05] <eni23> could also use tqfp-version
[11:31:30] <jadew> 0.8 pitch?
[11:31:31] <eni23> they are quite small
[11:31:35] <eni23> yup
[11:31:44] <jadew> not bad
[11:32:06] <eni23> do it in a oven with a little practice its easy to do this at home
[11:32:14] <OndraTabby> i got cyclone ii plus usb blaster
[11:32:27] <megal0maniac> Chinese blaster?
[11:32:31] <OndraTabby> aye
[11:32:51] <OndraTabby> 100 i/o or so, lvds support etc
[11:33:20] <eni23> jadew: but think its really pain to solder such a chip with hands
[11:33:28] <OndraTabby> it is easy
[11:33:35] <eni23> wtf?
[11:33:57] <OndraTabby> i did 144 hlqfp 0.5mm with big solder iron
[11:34:03] <eni23> mabye i dont have the right equipment but never worked really well
[11:34:23] <OndraTabby> Typing on software keyboard sucks
[11:34:48] <OndraTabby> At least handwriting recognition works great.
[11:34:53] <eni23> um yes shure with an iron. same as in the oven
[11:36:45] <eni23> are you guys using hcl+h2o2 or fe3 to make your boards?
[11:37:58] <OndraTabby> fe
[11:38:20] <GuySoft> jadew, ok thanks :) .. hmm, does not explain why the code is not working
[11:39:26] <eni23> me has used fe for years now but this week i tried hlc. i have to say thats really nice, much better than fe
[12:07:22] <OndraTabby> taylor polynom? wtf
[12:23:12] <megal0maniac> Eh.
[12:23:25] <megal0maniac> Itead is selling the TP-Link WR703N
[12:23:32] <megal0maniac> Now I have to buy it :(
[14:50:21] <mebus> Hi! Is anyone familiar with CAN on AVR in here?
[14:57:36] <OndraSter__> maybe
[15:25:09] <DarkSector> Hey guys, I have a question regarding the sink and source of a controller. Suppose I were to connect a component that withdraws a lot of current for the controller to handle, I could sink the ground into the controller's GPIO and have it draw power from a source. But the controller can only sustain so much current. What hardware modifications need to be done for such an arrangement? Do we use a ze
[15:25:09] <DarkSector> nner for this?
[15:27:39] <tld> DarkSector: zener can be used for over-voltage-protection, but for current-limiting you'd want a resistor.
[15:28:02] <tld> so it depends on which kind of load it is.
[15:28:15] <tld> if it's a purely resistive load, you'd be fine with a current limiting resistor.
[15:28:35] <tld> if it's an inductive load, you could get a higher voltage back, than you provided it with, and you'd want both a resistor and a zener.
[15:28:46] <tld> possibly two resistors actually
[15:29:04] <tld> a lot of controllers can only source/sink 20mA on a pin.
[15:29:09] <OndraSter__> MrTrick, the SMD batt holders are so sweet! :)
[15:29:12] <DarkSector> Yeah
[15:29:15] <tld> so you might want to use a FET or transistor to move more current.
[15:29:32] <tld> OndraSter__: SMD batt holder? got link?
[15:29:38] <OndraSter__> CR2032 off digikey
[15:29:43] <OndraSter__> just the "top" plate
[15:29:45] <OndraSter__> I don't have the link here
[15:29:47] <OndraSter__> ask MrTrick
[15:30:07] <OndraSter__> <tld> a lot of controllers can only source/sink 20mA on a pin.
[15:30:11] <OndraSter__> all megas/xmegas/tinys
[15:30:19] <OndraSter__> some tinys/megas do even 40mA per pin
[15:30:53] <DarkSector> yeah that might work with a PWM configuration as well
[15:31:01] <DarkSector> ~(PWM) value actually
[15:31:32] <tld> Generally; don't f*sck with the max ratings… if you're not sure, just use a transistor or mosfet, to open/close a pullup or pulldown, to Vin or ground.
[15:31:50] <OndraSter__> yep
[15:31:55] <OndraSter__> make your own output transistor stage :)
[15:32:01] <DarkSector> :)
[15:43:09] <day> .
[15:43:48] <slidercrank> day, is that all you could say?
[15:43:49] <OndraSter__> ;
[15:43:54] <OndraSter__> no
[15:43:58] <OndraSter__> that is all he NEEDED to say
[15:44:05] <day> slidercrank: :< was only testing if i have to login first
[15:44:13] <day> OndraSter__: exactly!
[15:44:37] <day> no that i have your undivided attention
[15:44:59] <OndraSter__> you don't
[15:45:01] <OndraSter__> I am going afk
[15:45:13] <day> if i bitshift a 8bit variable 8+times. is it legit to think that it will be 0x00?
[15:45:28] <OndraSter__> if it is 8bit wide.. yes
[15:45:32] <OndraSter__> afk
[15:46:03] <slidercrank> day, is it an arithmetic shift or logical? left or right?
[15:46:05] <specing> day: unless you roll it
[15:46:30] <day> slidercrank: x<=8
[15:46:39] <slidercrank> if he's shifting a negative value right, it will be 255
[15:46:55] <slidercrank> day, than 0
[15:46:57] <slidercrank> *then
[15:47:19] <day> slidercrank: and im not able to break other memory areas with that right?
[15:47:32] <specing> what memory areas?
[15:47:35] <specing> lol
[15:47:42] <specing> ops are on registers
[15:48:09] <slidercrank> day, if you are working with this value as a byte in memory, then no adjacent bytes will be affected
[15:48:20] <day> slidercrank: thanks
[15:48:54] <day> it just looks somehow dirty to me thats why i asked :)
[15:49:30] <specing> day: go look into the dissassembly and the i-set reference
[15:51:29] <slidercrank> day, you might be wondering what happens to the bits you shifted (say, if it was 1000 1001) and you shifted it 1 bit right. Then you get 0010010. But what happens to the left-most bit you shifted? Does it die? Will it go to hell or paradise? Nobody knows
[15:52:01] <slidercrank> *one bit left
[15:53:15] <eni23> lol
[15:53:18] <day> y that was my problem.
[15:53:56] <slidercrank> day, that was a silly joke anyway
[15:54:14] <slidercrank> day, are you coding in C or Asm?
[15:54:40] <day> both but this one was in c
[17:09:57] <OndraSter__> Nerd joke. What is the difference between chmod and chattr? man chmod > 1; man chattr > 2; diff -d 1 2
[18:35:10] <Malinuss> so quiet in here. electronics don't really feel like helping me, maybe somone here is bored enough to help me with so RF stuff? It's avr related though ;)
[18:39:31] <Malinuss> this is my current circuit (https://www.circuitlab.com/circuit/p89778/screenshot/1024x768/) If I put anything between Q1 and Q2 the signal actually gets worse then without Q2 at all. Also a antenna on Q2 emitter doesn't change the range at all, not even the slightest. Putting the emiiter of Q2 into ground, gives a good boost though, since the whole breadboard propably works as a antenna then
[18:58:15] * froggyman can't believe how much of his life he has wasted on arduinos
[18:58:25] <froggyman> using PORT assignments is much nicer.
[19:02:02] <Tom_itx> hard to breadboard rf
[19:02:38] <Malinuss> Tom_itx, what?
[19:03:01] <Malinuss> froggyman, yeah haha.
[19:03:15] <Malinuss> froggyman, some of the arduino stuff is nice though
[19:04:36] <froggyman> Malinuss: It's great for those just getting into the uC world. But after having a few digital logic clases at my uni, this is much much nicer to work with.
[19:04:50] <froggyman> Will definitely make programming for my 8x8x8 cube a bit nicer
[19:06:30] <Malinuss> froggyman, I'm not just talking about port manipulation, but lets take pwm, if you just want to test something fast, it will be faster and nicer to just use analogwrite...
[19:07:20] <froggyman> Malinuss: ahh I see. How do you do PWM on the avr?
[19:07:55] <Malinuss> froggyman, like everything else - setting some registers ;)
[19:08:27] <MrTrick> froggyman: which part are you using? Do you have enough PWM channels to do it in hardware, or will you be looking at software implementation? (Or 'screw this, lights will be on or off.')
[19:09:19] <froggyman> MrTrick: I've never done PWM on the AVR... so hardware would probably be a good place to start
[19:09:45] <froggyman> I'm on a atmega32
[19:10:17] <MrTrick> Well, an 8x8x8 cube, how were you planning to wire it?
[19:10:53] <froggyman> I just meant PWM in general. I was thinking about using the shiftPWM library to have brightness control
[19:11:26] <froggyman> It's just wired in a standard multiplexed setup I guess. 64 anodes (in columns) and 8 cathodes (each layer)
[19:11:55] <MrTrick> yeah, but there are only a finite number of pwm channels available on a chip. For the '32, I think it's only 4, and that's if you're using two of the hardware timers for PWM generation. (so you can't use them for something else)
[19:12:43] <froggyman> Let's start over here... I'm not concerned about PWM for my cube, just PWM in general on the avr
[19:12:51] <MrTrick> Okay. :-)
[19:14:34] <froggyman> so, how do I use a PWM channel ?
[19:14:34] <MrTrick> You prefer graphical explanations or words?
[19:14:40] <froggyman> surprise me
[19:14:46] <MrTrick> Look at p69 of http://www.atmel.com/Images/doc2503.pdf
[19:15:10] <MrTrick> Fig 27 on that page is what timer0 looks like.
[19:15:21] <slidercrank> froggyman, what's your cube? is it a 3D matrix of leds?
[19:15:37] <MrTrick> (Most AVR parts are variations on the same thing, so learn it once and the next chip is easy)
[19:15:44] <froggyman> slidercrank: yes it is. https://sphotos-b.xx.fbcdn.net/hphotos-snc6/182052_10200105756874810_1861505649_n.jpg
[19:16:21] <slidercrank> cool. some interesting stuff may be programmed :)
[19:16:22] <MrTrick> froggyman: So, there are two data registers, TCNT0 and OCR0.
[19:16:48] <MrTrick> and a configuration register TCCR0
[19:17:07] <MrTrick> (More complex chips often have TCCR0A and TCCR0B registers)
[19:17:42] <froggyman> slidercrank: yes, most definitely. So many things I can't wait to see visualized on it :)
[19:17:49] <MrTrick> So to use it for PWM, you set up TCCR0 correctly... then TCNT0 starts incrementing itself, wrapping around to 0, etc.
[19:18:17] <MrTrick> And you set a value in OCR0 for the duty cycle. (eg 0x80 for 50%)
[19:18:23] <froggyman> Mr_Sheesh: definitely seems a bit more complicated then analogWrite
[19:18:34] <slidercrank> froggyman, it takes ages to solder all the leds:)
[19:18:43] <Tom_itx> basic pwm: http://tom-itx.dyndns.org:81/~webpage/how_to/atmega168/mega168_pwm_index.php
[19:18:48] <MrTrick> It is a bit, but you can see on that fig what's happening in the hardware.
[19:18:56] <froggyman> slidercrank: only ~100 minutes per layer
[19:19:28] <MrTrick> As TCNT0 increases, it reaches a point where the [ = ] block will trigger, leading to the waveform generation block that produces your PWM.
[19:23:56] <Tom_itx> zlog
[19:24:16] <MrTrick> gives you 16 channels, and you can daisy-chain lots of them together.
[19:24:42] <Tom_itx> basic pwm: http://tom-itx.dyndns.org:81/~webpage/how_to/atmega168/mega168_pwm_index.php
[19:25:59] <froggyman> MrTrick: those are expensive though!
[19:26:34] <MrTrick> sparkfun is pricey compared to other places, depends what you need.
[19:26:42] <MrTrick> (and where you live)
[19:28:11] <MrTrick> $3.78 ea from http://www.digikey.com/product-detail/en/TLC5940NT/296-17732-5-ND/716896
[19:28:52] <MrTrick> anyway, you don't have 64+8 pins on an ATmega32 anyway, you're going to have to buy something similar no matter what.
[19:29:55] <MrTrick> I suggest you buy 4 of these, and a darlington transistor array like a ULN2803 to provide a high current source.
[19:30:13] <froggyman> I was planning on trying out the shiftPWM, since I have loads of 595s
[19:31:29] <MrTrick> hmm.
[19:32:00] <froggyman> I was only planning on having 4 bit PWM for each LED anyways
[19:33:05] <MrTrick> yeah, that might be alright.
[19:33:30] <froggyman> these cheap LEDs from eBay don't seem to respond to PWM too well
[19:45:41] <MrTrick> how come?
[19:47:28] <froggyman> MrTrick: that's a good question. They just don't seem to dim very well
[19:48:09] <froggyman> on another topic, are you allowed to treat a PORT as a byte? for example would "PORTA ^= 0x03;" be valid?
[19:49:12] <froggyman> yep
[20:01:28] <slidercrank> why not?
[20:03:24] <MrTrick> froggyman: you might be encountering the human response to light.
[20:04:11] <MrTrick> eg if you have a lit LED, and you make it twice as bright, you won't perceive it as double the brightness.
[20:04:42] <MrTrick> Or if you have a list LED and you dim it to the point where you think it's half as bright, the drive level will be significantly less than half.
[20:10:08] <Essobi> /wl/wl
[20:10:12] <Essobi> herp.
[21:16:32] <rue_mohr> Tom_itx,
[21:25:00] <Tom_itx> ?
[21:25:33] <rue_mohr> what do you think would be the easiest LUFA code to modify to make a virtual serial port scope
[21:25:36] <rue_mohr> usb
[21:26:48] <Tom_itx> a couple here have made them but i'm not sure where to tell you to start on it
[21:26:51] <rue_mohr> I'm looking at the usb to serial converter, but....
[21:26:59] <Tom_itx> there's lufa serial stuff
[21:27:02] <Tom_itx> yeah
[21:27:28] <rue_mohr> the idea being to make a usb device emulate a serial port and send/recieve data
[21:27:46] <rue_mohr> maybe I can work out how to make a usb serial echo
[21:28:49] <Tom_itx> did you make his docs with doxygen?
[21:28:56] <Tom_itx> that may help
[21:30:43] <rue_mohr> hmm
[21:31:00] <Tom_itx> i can't find my parts now
[21:31:01] <rue_mohr> I'm falling asleep aain
[21:36:56] <Tom_itx> ok, found the 7660s
[21:37:01] <Tom_itx> now to find the rest
[21:38:39] <froggyman> is there any reason to not use atmel studio over winavr/programmers notepad?
[21:42:01] <Tom_itx> author's preference
[21:42:09] <Tom_itx> i use notepad
[21:42:25] <Tom_itx> but i upload hex with studio mostly
[21:44:56] <froggyman> Tom_itx: ah, I'm having troubles programming my atmega32 with studio. I'm using a pocketISP.... any ideas?
[21:45:07] <froggyman> I've programmed it successfully many times with winavr
[21:45:28] <Tom_itx> you can't use studio with a non atmel programmer
[21:45:51] <Tom_itx> use avrdude
[21:46:20] <Tom_itx> unless you can fool studio into thinking it's an original :)
[21:47:17] <froggyman> ohhh, that's stupid
[21:47:30] * froggyman decides to just stick with winavr then
[21:47:49] <Tom_itx> mine works with both
[21:48:05] <Tom_itx> but yeah i'd just use avrdude
[22:02:07] <Tom_itx> ok, starting to find a few needed parts