#avr | Logs for 2013-05-30

Back
[01:48:06] <Valen> found the source of my power drain
[01:48:32] <Valen> avr libc for attiny84a seems to not be able to turn off the ADC with the function in power.h
[01:48:51] <Valen> I should probably fix that and submit a patch or something
[01:54:13] <specing> &= ~(1 << ADEN);?
[02:05:14] <Valen> specing: yah
[03:09:29] <Engen> Tim_itx: you there?
[04:26:28] <beaky> hell
[04:26:31] <beaky> hello
[04:27:25] <beaky> what is the cheapest avr MEGA?
[04:30:20] <RikusW> a virtual one :-D
[04:30:30] <beaky> ah
[04:30:36] <RikusW> 0 cents
[04:30:41] <beaky> like one in VHDL or Verilog?
[04:30:53] <RikusW> simulator
[04:31:01] <beaky> ah
[04:31:05] <RikusW> fpga are EXPENSIVE
[04:31:29] <beaky> ah I thought there are fpgas under $10
[04:31:39] <RikusW> small ones maybe
[04:31:46] <beaky> as small as an arduino :D
[04:35:07] <RikusW> even a small fpga will be faster
[04:37:42] <Valen> attiny can be had for like 60c dunno about a mega
[04:37:54] <Valen> but In qty 100 i cant see them being more than a few $
[04:38:18] <beaky> alright I will order 100 atmega328p's
[04:39:09] <Valen> if you have a place to order from then I suggest doing a search for atmega and sorting by price
[04:39:26] <beaky> right
[04:40:01] <beaky> I don't want to lose like last time (I paid around $30 for one of those 40-pin ZIF sockets :P)
[04:40:24] <theBear> zifs are always stupid expensive
[04:40:34] <Valen> yup they are spendy
[04:40:45] <Valen> they don't make bazillions of them
[04:40:49] <beaky> ah
[04:41:52] <Tabaliah> http://evilmadscience.com/component/content/article/270
[04:42:18] <Tabaliah> 40 pin ziff for 3.50 US
[04:42:25] <Valen> cheap
[04:42:26] <theBear> heh, specially since the 80s
[04:42:30] <theBear> wtf ?!!?!? unheard of !
[04:43:02] <Valen> where are you ordering from beaky?
[04:43:16] <beaky> I got them from a website called digi-key
[04:43:46] <theBear> it's a company, not a website :)
[04:43:48] <Valen> what country are you in?
[04:44:13] <beaky> the united arab emirates
[04:46:17] <beaky> I always thought you could directly buy stuff from atmel...
[04:46:36] <beaky> i guess just the debuggers and educational kits are like that
[04:46:42] <beaky> evaluation boards*
[04:54:45] <Tabaliah> wow, digikey is expensive for atmel products - try mouser.com
[04:55:16] <theBear> most things it's worth looking digikey/mouser/farnells/rs until you get a feel for which companies overprice which things
[04:56:29] <beaky> ah
[04:56:53] <beaky> I'll try to find one with free hsipping too :D
[04:56:56] <beaky> shipping*
[05:34:47] <RikusW> beaky: how about uk.rs-online.com
[05:35:07] <RikusW> or just rs-online.com to select your country
[05:36:17] <beaky> ah they seem reasonable :D
[05:38:44] <thetruthisoutthe> mm ice-storm? i feel like in the eye of a tornado zone
[05:40:09] <RikusW> megal0maniac_afk: you'll need YWN40 headers from MT for you aery
[06:18:45] <Horologium> beaky, atmega88 should be about the cheapest and smallest atmega chip out there.
[06:25:00] <RikusW> m168 or m328 maybe ?
[06:32:34] <Horologium> I would think an 88 would be cheaper than a 168...but,,
[06:33:18] <RikusW> I've gotten some cheap m168's, $2 or so
[06:34:29] <Horologium> 88 is the same as a 168 with half the flash.
[06:34:45] <Horologium> and probably less ram and eeprom too
[06:35:02] <Horologium> just quick price check on digikey has 2.40 for 88 and 2.50 for 168
[06:46:02] <thetruthisoutthe> h
[06:46:36] <thetruthisoutthe> Horologium <= i got 168 cheaper than 88 now, it depends on distributor too
[06:46:42] <RikusW> I'd take 168 for sure
[06:46:49] <Horologium> true.
[06:46:58] <RikusW> or maybe 328
[06:47:13] <RikusW> 648 ? does that even exist ? :-P
[06:47:30] <RikusW> 164 324 644 1284 does
[06:55:22] <RikusW> beaky: here is something you won't be able to break ?... http://evilmadscience.com/productsmenu/tinykitlist/438-googly
[06:58:23] <Horologium> RikusW, that must be the most useful ardweeny shield I've ever seen!
[06:58:30] <RikusW> lol
[06:58:39] <RikusW> it will watch you work :-P
[06:58:49] <thetruthisoutthe> hey guys http://www.capturedlightning.com/frames/interesting.html
[07:05:03] <tzanger> ardweeny? you just invented my new favourite word
[07:05:31] <Tom_itx> ardweenie(tm)
[07:06:38] <tzanger> useful as both a verb AND noun!
[07:07:23] <thetruthisoutthe> i dislike weenie
[07:08:30] <thetruthisoutthe> http://www.woohome.com/food-drink/weenie-wing-commander
[07:19:50] <thetruthisoutthe> hahaha http://www.knitwitch.com/weeniewarmer.htm
[07:27:37] <theBear> i like thsoe little red hotdog snossages
[07:27:48] <theBear> cocktail franks !
[07:27:51] <RikusW> http://www.capturedlightning.com/frames/shrinker.html
[07:27:54] <theBear> aka weenie :)
[07:28:07] * RikusW puts and arduino in there :-D
[07:28:27] <xaxes> hey all.. it's offtopic, but I have some parts where I'm not sure what they are.. I guess something like a integrated h-bridge or so.. "c3420 gr" and "41357 y" is written on them, and I cant determine them ..
[07:28:33] <xaxes> any suggestions how to do that?
[07:30:41] <theBear> that is offtopic, talk about tiny sausages instead :)
[07:30:53] <Tom_itx> h
[07:30:55] <xaxes> hehe :)
[07:31:06] <theBear> w
[07:31:39] <thetruthisoutthe> yea, sausages are related to arduino
[07:31:58] <thetruthisoutthe> and windows
[07:32:03] <Tom_itx> ground up pig meat?
[07:32:18] <thetruthisoutthe> no
[07:32:27] <thetruthisoutthe> mostly not, nowadays
[07:32:33] <thetruthisoutthe> maybe 30 years ago
[07:32:41] <theBear> final before dinner comment, making small change ! i know i had a couple drinks, but that's hilarious !
[07:32:53] <theBear> oh, final final, hooves and snouts !
[08:01:19] <twnqx> xaxes: did yoiu even put c3420 into google? :S
[08:02:47] <xaxes> I did, but didn't find it .. only "datasheets include c3420" .. maybe I did something wrong
[08:02:59] <twnqx> toshiba 2sc3420 NPN
[08:03:13] <RikusW> try adding filetype:pdf in google
[08:03:14] <twnqx> http://www.futurlec.com/Transistors/2SC3420.shtml datasheet
[08:03:22] <RikusW> : pdf
[08:04:06] <twnqx> no, without the space.
[08:04:47] <twnqx> 2sc3420 datasheet filetype:pdf works perfectly here (after just c3420 told me that it's a 2sc3420)
[08:05:12] <xaxes> twnqx: thanks! .. I just suggested a integrated h-bridge chip, but maybe it was only a transistor of it .. will check it ..
[08:06:14] <xaxes> to be more precise, I just opened a RC-car circuit to build my own one, to be able to extend it.. and I was wondering how the engines got driven :)
[08:06:19] <twnqx> 41357 is more challenging, unless it's GEs " High Intensity Discharge - Quartz Metal Halide" lamp
[08:07:01] <twnqx> http://forum.allaboutcircuits.com/showthread.php?t=58933 your post, xaxes? :P
[08:07:31] <xaxes> twnqx: excuse me, the '4' isn't correct, it was only some kind of a logo
[08:07:49] <twnqx> nice green transistor :
[08:07:50] <twnqx> :P
[08:08:02] <theBear> is it a map of texas ?
[08:08:05] <twnqx> I'm wondering if that could be an A1357 instead, which would be a 2SA1357?
[08:08:06] <twnqx> Datasheet: http://www.datasheetcatalog.org/data...shiba/3074.pdf
[08:08:06] <twnqx> Seems like it could be reasonably complementary to the 2SC3420.
[08:08:07] <twnqx> >_>
[08:08:15] <twnqx> oh google, you make life so easy
[08:08:38] <twnqx> http://www.datasheetcatalog.org/datasheet/toshiba/3074.pdf
[08:08:48] <xaxes> twnqx: hah! It isn't my post, but maybe a good reference :D
[08:13:32] <RikusW> twnqx: pidgin puts in a :-P if I type :p ....
[08:13:44] <RikusW> graphical icons...
[08:14:00] <twnqx> well, it doesn't do on your transmission to here
[08:14:05] <twnqx> (and you can turn that off)
[08:14:10] <RikusW> heh
[08:27:41] <tomatto> hi
[08:28:45] <tomatto> i have variable with value between 0 and 20 and i want to do hysteresis for it, how can i do it?
[08:32:35] <jacekowski> tomatto: do you know what hystheresis is?
[08:32:59] <tomatto> yes
[08:33:16] <jacekowski> explain then
[08:33:53] <jacekowski> what is it supposed to be doing in your case
[08:34:23] <tomatto> when value is higher or lower than some range do something
[08:35:14] <tomatto> it is supposed to update another variable
[08:35:25] <jacekowski> if (variable > 10) {do something}else{do something else}
[08:35:47] <twnqx> that doesn't sound much like hysteresis.
[08:35:53] <jacekowski> yeah
[08:36:11] <jacekowski> that's why i wanted him to explain
[08:36:36] <tomatto> if variable change about some value
[08:36:49] <twnqx> that's still not hysteresis
[08:36:53] <RikusW> its more like trigger low and then wait till higher to trigger high (and in reverse)
[08:37:04] * twnqx triggers on RikusW
[08:38:00] <RikusW> like a Schmidt trigger
[08:38:21] <jacekowski> if (variable >12 ) {something=1} if (variable<8){something=0}
[08:38:45] <RikusW> ah, that easy :)
[08:38:51] <tomatto> if(now > last + 1 || now < last - 1) do something?
[08:39:39] <jacekowski> that's more like deadband implementation
[08:41:12] <tomatto> so how can i do it right way?
[08:42:00] <RikusW> jacekowski just showed you above
[08:45:30] <tomatto> it is not what i want
[08:47:17] <tomatto> when value goes from 1 to 2 for example, it vibrating sometimes between these two values and i want to suppress this behavior
[08:57:19] <tomatto> isn't it hysteresis?
[08:57:25] <tomatto> thing
[08:58:32] <DagoRed> Sounds like you want some kind of filter.
[08:58:54] <DagoRed> Or depending on the application, debouncing.
[09:00:56] <tomatto> can i do it in software?
[09:27:15] <tzanger> fffjfjfjfjfjfjf
[09:28:01] <xaxes> does anyone have used avrstudio4 on linux?
[09:29:02] <tzanger> not me, no
[09:30:31] <xaxes> thx for reply
[09:52:44] <UnderSampled> so, buspirate vs USBTiny MkII
[09:53:06] <UnderSampled> which is better?
[09:53:19] <UnderSampled> :D
[09:54:27] <tomatto> i have usbtiny diy :)
[09:54:27] <tomatto> but buspirate can work with eeproms too
[09:56:49] <UnderSampled> I will probably be programming attiny4 s
[10:09:24] <tzanger> bus pirate is not a very good programmer IMO
[10:09:27] <tzanger> too screwy
[10:09:49] <tzanger> it works but is more difficult to use IMO
[10:10:01] <tzanger> unless maybe you have a nice wire harness for it, I'm using the jumper cable
[10:10:40] <UnderSampled> ok
[10:23:19] <megal0maniac_afk> UnderSampled: USBTiny MkII is definitely a better option if you're looking for a programmer. No COM port enumeration stuff and support out of the box for all 8 bit avrs in avrdude and Atmel Studio without having to muck about with .xml files. And it's fast
[10:24:38] <megal0maniac_afk> If you're looking for something to sniff protocols with the ability to program AVRs as a sort-of feature, then bus pirate because USBTiny MkII is only a programmer. Depends on what you want to do, as usual
[10:25:07] <RikusW> megal0maniac_afk: sent you the HV board image
[10:26:16] <RikusW> xaxes: I'm using AS4 in Linux Mint, well inside a VirtualBox with XP installed
[10:26:39] <RikusW> (and VirtualBox extension to make USB work)
[10:32:02] <UnderSampled> how about stk500 vs USBTiny MkII ?
[10:32:17] <UnderSampled> though I don't really want to budget that
[10:32:58] <UnderSampled> does this work on the stk500, or just the stk600? : http://www.digikey.com/product-detail/en/ATSTK600-ATTINY10/ATSTK600-ATTINY10-ND/2136151
[10:33:33] <UnderSampled> alternatively, where can I find just the plastic past in the middle>
[10:34:39] <UnderSampled> ah, found one on tewwark
[10:34:45] <UnderSampled> *newark
[10:34:54] <UnderSampled> same price as that board :(
[10:35:30] <twnqx> is that a soic socket?
[10:35:50] <twnqx> UnderSampled: http://wvshare.com/column/Adapter_2.htm
[10:36:12] <UnderSampled> it's a sot-23
[10:36:44] <twnqx> there as well
[10:36:46] <RikusW> UnderSampled: only STK600 and AVRISP mkii can do TPI
[10:36:51] <twnqx> 27$
[10:37:25] <UnderSampled> RikusW: you mean USBTiny MkII right?
[10:37:42] <RikusW> that one is a AVRISP mkii clone, it will work too
[10:37:48] <RikusW> (the LUFA one )
[10:37:59] <RikusW> I've actually tested the LUFA code with TPI :)
[10:38:10] <RikusW> got 2 t10's for testing
[10:38:30] <RikusW> UnderSampled: thats Tom's board right ?
[10:41:34] <UnderSampled> RikusW: yes
[10:42:27] <UnderSampled> so, which one should I get?
[10:42:43] <UnderSampled> seeing as I can get this: http://www.wvshare.com/product/SOT6-TO-DIP6-B.htm
[10:43:04] <UnderSampled> I don't need the fancy-shmancy stk600
[10:43:24] <twnqx> st600 rocks.
[10:43:38] <twnqx> unless it breaks, then it sucks.
[10:43:45] <UnderSampled> and is expensive
[10:43:58] <UnderSampled> to my meager budget
[10:44:14] <twnqx> i could offer you a broken one :P
[10:44:18] <twnqx> no idea how to repair though
[10:44:24] <UnderSampled> does it work? :P
[10:44:42] <twnqx> nope
[10:45:02] <twnqx> can't update the software on it
[10:45:05] <twnqx> no idea what's dead
[10:45:15] <UnderSampled> I would expect that If I had a broken programmer, I'd be comming to you for advice
[10:45:30] <UnderSampled> so if you can't fix it...
[10:46:54] <UnderSampled> so, for less that $100, what is the best programmer for an attiny4?
[10:49:26] <twnqx> probably depends on your other needs
[10:49:31] <twnqx> and how you want to program
[10:50:14] <UnderSampled> avrstudio
[10:50:47] <twnqx> spi? hvsp? probably not jtag, doesn't have enough pins for that
[10:51:17] <UnderSampled> I have an avr644p that I'll be using for early testing
[10:51:33] <UnderSampled> right now it has an arduino bootloader on it
[10:52:02] <UnderSampled> the attiny 4 does not support jtag, but my avr644p should, and it would be nice
[10:52:18] <UnderSampled> but the important thing is programming the attiny
[10:52:21] <twnqx> if you want it all the stk600 will be good :P
[10:52:34] <UnderSampled> but 250 is more than 100 :(
[10:57:05] <UnderSampled> I could even go for something like http://junkplusarduino.blogspot.jp/p/attiny10-resources.html or http://irq5.wordpress.com/2010/07/15/programming-the-attiny10/
[11:06:07] <UnderSampled> when programming in assembler in avrstudio, would writing from 0000 in order to set what happens after reset interfere with the arduino bootloader?
[11:15:31] <Tom_itx> bootloaders are loaded higher in memory
[11:15:42] <Tom_itx> it's all in the data sheet for the looking
[11:16:39] <megal0maniac> UnderSampled: DEFINITELY USBTinyISP MkII over STK500
[11:18:24] <Tom_itx> UnderSampled, if you want to be programming tiny4's you should get my programmer and the reset recovery thingy for them
[11:18:32] * megal0maniac nods
[11:19:00] <Tom_itx> that way you can use all 4 io
[11:19:08] <megal0maniac> Tom_itx: You'd swear I own a few of your programmers :P
[11:19:23] <Tom_itx> somebody does
[11:19:39] <Tom_itx> i've shuffled plenty out the door
[11:19:47] <megal0maniac> I know :)
[11:20:26] <megal0maniac> I've used the firmware, I can see how the board is laid out and other people have spoken for the quality so there isn't much more I could know
[11:21:05] <Tom_itx> owning is everything :)
[11:23:34] <cart_man> Hi. I have asked this question before but my simulation is confusing me.So before I go on code with my confusion I would like to know.... Does (bit_is_clear(PINC,2)) Check PINC2 for a LOW or a HIGH ? other word. Will that return a TRUE or a FALSE if there is 5V pulled up by a 10K Resistor on it? It got me really confused just now.
[11:24:28] <Tom_itx> false
[11:24:48] <cart_man> OK so
[11:24:57] <cart_man> to say a bit is CLEAR mean its LOW right?
[11:25:30] <Tom_itx> unless you're talking about fuses
[11:25:37] <cart_man> Nope
[11:25:37] <cart_man> no
[11:25:50] <cart_man> Just a PIN thats working as a signal receptor
[11:25:53] <megal0maniac> SET=1 CLEAR=0
[11:26:14] <cart_man> Like a Flip Flop....hm makes sense
[11:26:16] <cart_man> Thanks guys
[11:26:39] <Tom_itx> just drop a quarter in the jar by the door
[11:27:04] <megal0maniac> I think I have a quarter...
[11:27:40] <cart_man> How do I do the purple emoticons ?
[11:27:58] * Tom_itx it's very simple
[11:28:08] <cart_man> * O.o
[11:28:12] <cart_man> not working
[11:28:22] * megal0maniac smacks cart_man with specing's tree
[11:28:31] <cart_man> lol ok ok im out
[11:28:35] <megal0maniac> There are no emoticons here
[11:29:08] <cart_man> well not emoticons morelike the actions in pruple writing
[11:29:08] <megal0maniac> Where is specing anyways?
[11:29:11] <cart_man> purple`
[11:29:16] * megal0maniac knows what you mean
[11:29:21] <RikusW> cart_man /me msg
[11:29:35] <RikusW> /me test
[11:29:37] * RikusW test
[11:29:47] * Tom_itx RikusW /me msg
[11:29:49] <cart_man> Thanks Rikus..dam youre helpfull !
[11:29:52] <RikusW> / must be the first char on the line
[11:30:10] * megal0maniac Tom_itx RikusW /me msg
[11:30:15] * cart_man O.o
[11:30:17] <cart_man> Working
[11:30:29] <RikusW> cart_man: its used as 3rd person
[11:30:31] <Tom_itx> go abuse your new found power
[11:30:49] * RikusW sees the message mixup above :-P
[11:30:51] <cart_man> hahaha nah im on president
[11:30:51] <megal0maniac> And smeding
[11:31:27] <megal0maniac> Is that a drug?
[11:31:47] <RikusW> took me a while to figure out /me try /help
[11:31:55] <RikusW> or /msg alis help :)
[11:32:05] <Tom_itx> i'm still trying to figure you out
[11:32:11] <RikusW> heh
[11:32:44] * megal0maniac calls out for smeding and Steffanx
[11:32:56] <RikusW> where is the X ?
[11:33:03] <RikusW> not seen him for a while..
[11:33:28] <Tom_itx> he was on bumbleb this am
[11:34:25] <Tom_itx> still is actually
[11:34:46] <RikusW> maybe got bored with #avr ?...
[11:34:57] <megal0maniac_afk> BORED WITH #AVR???
[11:35:09] <RikusW> ask him...
[11:35:44] <UnderSampled> Tom_itx: which version is more popular? and do you manufacture them yourself?
[11:35:59] <Tom_itx> both and yes
[11:36:16] <UnderSampled> both are more popular?
[11:36:32] <Tom_itx> i've probably sold more of the plain ones
[11:36:48] <UnderSampled> how many have you sold (of either)?
[11:36:48] <Tom_itx> some like the box though
[11:36:57] <Tom_itx> i haven't added up lately
[11:37:01] <Tom_itx> several hundred
[11:41:22] <UnderSampled> Tom_itx: If I buy both the hiV cable and the programmer, is shipping combined?
[11:41:32] <Tom_itx> i can
[11:41:43] <UnderSampled> And do you accept bitcoin?
[11:41:49] <Tom_itx> if you let me know, i don't have an item for both on my page
[11:41:56] <Tom_itx> paypal
[11:42:00] <UnderSampled> :(
[11:43:04] <GuShH> lawl bitcoin
[11:43:08] <GuShH> do you accept lemons?
[11:43:16] <GuShH> or cat litter
[11:43:18] <Tom_itx> seems they're in trouble
[11:43:36] <DagoRed> No they aren't in trouble
[11:43:47] <UnderSampled> bitcoin's couldn't be stronger right now
[11:44:02] <GuShH> bitscam
[11:44:41] <UnderSampled> btw, I would take lemons and/or cat litter, if I had a way to keep them liquid assets (ie futures)
[11:44:58] <GuShH> you can make lemonade with lemon which is a liquid sir.
[11:45:01] <UnderSampled> bitcoin is the most liquid asset I've come across
[11:45:12] <GuShH> bitSCAM
[11:45:15] <twnqx> my euros are pretty liquid
[11:45:31] <Tom_itx> beer is liquid
[11:45:32] <GuShH> so is my cat's poop, not really...
[11:45:34] <twnqx> hey, i could even biy Tom_itx's boards with them if i wanted :P
[11:45:44] <UnderSampled> and yet, to get them to Tom_itx's dollars...
[11:45:52] <GuShH> he takes bitscam?
[11:45:57] <twnqx> no :P
[11:45:58] <Tom_itx> no
[11:46:03] <GuShH> so you can't
[11:46:17] <GuShH> see, they're useless.
[11:46:33] <GuShH> Tom_itx: you should consider making tomcoins on the CNC
[11:46:38] <UnderSampled> I can find other people willing to take my bitcoins in return for the dollars Tom want's
[11:46:44] <DagoRed> I'll admit, taking bit coins makes me feel like I am getting paid with prostitutes and coke.
[11:46:48] <Tom_itx> i do have some caymen island coin
[11:47:06] <GuShH> do they come pre laundered?
[11:47:39] <GuShH> it seems most people will take dollars to give you any bitcoin related benefit, funny huh? that's because it's all part of a scam.
[11:47:43] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/temp/misc/caymen_heads.jpg
[11:47:44] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/temp/misc/caymen_tails.jpg
[11:48:00] <UnderSampled> btw, how liquid something is isn't a measure of how many people are willing to take it
[11:48:07] <Tom_itx> a burger is like $30 there
[11:48:11] <UnderSampled> it's a measure of how hard it is to do a transaction involving it
[11:48:21] <UnderSampled> for the lemons, I'd actually have to ship something
[11:48:33] <GuShH> but you can eat the lemons!
[11:48:42] <GuShH> or use them to ruin someone's eyesight.
[11:48:45] <UnderSampled> and you can eat dollars somehow?
[11:48:58] <GuShH> even hit them with them, specially if frozen - very reliable weapon.
[11:49:15] <GuShH> frozen lemons, invest in lemons!!
[11:49:36] <GuShH> UnderSampled: you could eat dollars if you wanted
[11:49:45] <Tom_itx> Liberty Reserve, which now stands accused of involvement in a $6bn money laundering scheme.
[11:49:49] <GuShH> it wouldn't be a smart choice
[11:50:58] <UnderSampled> GuShH: I might be able to eat a federal reserve note (also called cash)
[11:51:13] <UnderSampled> but I could also eat one of these: https://www.casascius.com/
[11:53:40] <GuShH> you could eat .... -INSERT DISGUSTING THING HERE- for all I care!
[11:55:22] * GuShH slaps UnderSampled
[11:55:30] <UnderSampled> physical abuse now?
[11:55:41] <GuShH> and now you eat this rotten shark or else I'll slap you again!
[11:55:53] <GuShH> WITH THE SHARK
[11:56:09] <UnderSampled> hmm
[11:56:19] <Tom_itx> mkay, we get the point. let it go
[12:25:57] <megal0maniac_afk> Tom_itx: A burger is certainly not $30 in the Cayman Islands
[12:26:11] <megal0maniac_afk> I have been there. The weather is amazing/awful :)
[12:26:45] <Tom_itx> that's what i was told
[12:27:12] <megal0maniac_afk> Can I buy programmers with CI$?
[12:27:26] <Tom_itx> no
[12:28:03] <megal0maniac_afk> I have USD56 in my wallet and I can't do anything with them :/
[12:28:16] <twnqx> lol
[12:28:53] <Tom_itx> convert it to bus tokens and take a bus ride
[12:29:46] <megal0maniac_afk> I'm in the wrong country/continent/hemisphere
[13:08:23] <abcminiuser> https://www.youtube.com/watch?v=6qfoBpou114
[13:21:37] <abcminiuser> Well y'all are no fun
[13:33:36] <DagoRed> Maybe for today. Things are a bit dead.
[13:33:56] <abcminiuser> Not with CoffeeTimer MKII
[13:36:05] <DagoRed> Oh? I didn't hear about that project.
[13:36:10] <abcminiuser> https://www.youtube.com/watch?v=6qfoBpou114
[13:36:27] <abcminiuser> Two others and I made it after work tonight
[13:37:37] <R0b0t1> It is sufficiently annoying for an alarm, yes.
[13:38:37] <DagoRed> heh
[13:52:16] <Badaboom> Help
[13:52:20] <Badaboom> :)
[13:52:55] <Badaboom> anyone around?
[13:53:02] <dfletcher> When I was younger so much younger than today. I never needed anybody's help in any way. Oh wait not that kind of Help :P
[13:53:56] <dfletcher> Badaboom, just ask and stick around. might take a while but someone can probably help you.
[13:53:59] <Badaboom> so all the sudden last night i think i have a conflict with using the USI as an SPI
[13:54:17] <Badaboom> lol,, this i know,, im usually in here:)
[13:54:29] <abcminiuser> Oh christ no
[13:54:31] <abcminiuser> NOOOOOOOOOO
[13:54:36] <Badaboom> ?
[13:54:37] <megal0maniac_afk> ?
[13:54:41] <Badaboom> lol
[13:54:42] <abcminiuser> USI is awful
[13:54:42] * megal0maniac_afk runs
[13:54:47] <megal0maniac_afk> Oh...
[13:54:53] * Badaboom hides behind megal
[13:54:53] <dfletcher> USI is evil :P
[13:55:06] <Badaboom> well,, so here goes
[13:55:08] <megal0maniac> USI is one step above bit-bashing
[13:55:21] <Badaboom> now my 7 digit display only displays 1 digit
[13:56:03] <Badaboom> I think i am trying to do to much with this poor little 2313
[13:56:07] <megal0maniac> abcminiuser: It's overkill but I like it. Buzzer doesn't have to be loud, it's annoying enough to get your attention
[13:56:19] <abcminiuser> megal0maniac, overkill?
[13:56:20] <abcminiuser> One sec...
[13:56:24] <megal0maniac> Oh no...
[13:56:39] <abcminiuser> https://twitter.com/abcminiuser/status/340141000695619584/photo/1
[13:56:54] <abcminiuser> We tried it and after putting on a new pair of underwear decided the .3W was enough
[13:56:54] <megal0maniac> I think I know what that is...
[13:57:06] <megal0maniac> Oh no, I didn't 0.o
[13:57:15] <Badaboom> Damn ausi's:)
[13:57:49] <UnderSampled> why does the atmega644p require the instruction at the reset vector to be a JMP, while the attiny4 requires it to be an RJMP?
[13:57:59] <megal0maniac> abcminiuser: What does it do? And what is an STK1000?
[13:58:10] <Badaboom> 1000?
[13:58:26] <abcminiuser> STK1000 was an old AP7000 series AVR32 eval kit
[13:58:34] <abcminiuser> Before we cancelled the AP7000
[13:58:42] <abcminiuser> And it's a coffee timer we made today
[13:58:46] <abcminiuser> https://www.youtube.com/watch?v=6qfoBpou114
[13:58:48] <Badaboom> lol
[13:59:33] <megal0maniac> I understand the coffee timer. But not the boom box...
[13:59:38] <Badaboom> and u got paid for that?
[13:59:43] <ferdna> leaving out of town... and don't have a cell phone or laptop available!!!!
[13:59:43] <abcminiuser> We did this after work
[13:59:45] <ferdna> what i do!!!!
[13:59:49] <Badaboom> ahh
[13:59:59] <abcminiuser> The boom box was a speaker and amp we used with the STK1000 to test the audio on it
[14:00:07] <abcminiuser> So we rigged it to the new coffee timer we made
[14:00:11] <abcminiuser> It was...loud
[14:00:11] <Badaboom> lol
[14:00:16] <megal0maniac> Haha!
[14:00:27] <megal0maniac> The joys of working at Atmel :)
[14:00:38] <abcminiuser> I said we needed a hackathon
[14:00:44] <Badaboom> Bring that to the metro areas of the US and they might run in the other direction
[14:00:46] <abcminiuser> Also I didn't like the current coffee timer
[14:01:07] <abcminiuser> Yeah, I said as we were making it it was a text-book "suspcious package"
[14:01:09] <megal0maniac> Not only do you get free coffee, you have a coffee timer at work :/
[14:01:13] <Badaboom> lol
[14:01:33] <inkjetunito> coffee timer?
[14:01:53] <Badaboom> btw: ive been reading alot of your tutorials,, nice work
[14:03:00] <dfletcher> instead of a timer put a humidity sensor near the top of the coffee machine and make it beep after it hits a threshold
[14:03:19] <Badaboom> so i guess i should ditch the 2313 and use a mega for my project then
[14:03:23] <megal0maniac> dfletcher: That would be horrible inacurate
[14:03:40] <megal0maniac> Badaboom: atmega328p is pretty much a standard
[14:04:15] <megal0maniac> And it's smaller counterparts, the 168 and 88. But the price difference doesn't really justify it
[14:04:16] <Badaboom> megal0maniac: i have the "non p" versio here
[14:04:25] <megal0maniac> Badaboom: Same thing essentially
[14:04:25] <Badaboom> version
[14:04:36] <Badaboom> yeah,, pretty much
[14:04:50] <Badaboom> ive been reading the comparisons
[14:04:58] <Badaboom> Is it a drop in?
[14:05:17] <Badaboom> I thought i read code wouldnt work exactly
[14:06:11] <megal0maniac> The device signature is different so you'd have to change makefiles and such if you don't want complaints when uploading. And there are some lesser used power saving features that you can't use, but otherwise yes. Drop in :)
[14:06:51] <Badaboom> nice:)
[14:07:57] <Badaboom> Does studio accoubt for changes if you select a different device?
[14:08:07] <Badaboom> account,, sigh,,i cant type
[14:08:56] <megal0maniac> As long as you aren't trying to shut of stuff that you can only shut off on the P version, yeah. Just change device and it'll handle the rest
[14:09:28] <Badaboom> Im still learning all the ins and outs of studio,, but like it
[14:09:56] <megal0maniac> I'm going out on a limb here, but I'm pretty sure you can use the same .hex files on either device
[14:10:01] <Badaboom> although my machine froze in the middle of a soultion last night:(
[14:10:21] <Badaboom> Im willing to test it:)
[14:10:49] <megal0maniac> abcminiuser: Can you?
[14:11:07] <Badaboom> Naa,, i dont want the nick AVR killer:)
[14:11:34] <abcminiuser> In most cases P and non P devices are identical in the base feature set
[14:11:46] <abcminiuser> With one a few exceptions, such as the MEGA169
[14:12:29] <megal0maniac> Badaboom: Even if it doesn't work (and it should), you won't kill it with the wrong .hex file
[14:12:50] <Badaboom> no i know,, only if i set the wrong fuse
[14:12:56] <Badaboom> which ive done'
[14:15:18] <Badaboom> so any thoughts on why all the sudden the max7219 just stopped displaying all but 1 digit via SPi form the 2313,, i never changed any code
[14:16:46] <Badaboom> the only thing i can think of is the clock line but that still doesnt make sense on only 1 digit
[14:20:32] <Badaboom> I hate to abandon this chip for the mega but it was never meant to be a true SPI tho
[14:20:59] <UnderSampled> why does the atmega644p require the instruction at the reset vector to be a JMP, while the attiny4 requires it to be an RJMP?
[14:23:31] <Badaboom> UnderSampled: im no expert but try this : http://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=21053&start=0 it may help you to understand the difference at least
[14:32:23] <jadew> Badaboom, you're working on this project for quite some time, right?
[14:32:36] <Badaboom> jadew: yes
[14:32:37] <jadew> did I wrote some example for you?
[14:32:57] <jadew> or was that a different guy?
[14:33:00] <Badaboom> yes,, all the sudden the display stopped ptting out all 7 digits
[14:33:14] <Badaboom> now,, now its putting out 4
[14:33:18] <Badaboom> instead of 1
[14:33:41] <jadew> at least it's the right digit?
[14:33:43] <Badaboom> I must have dont something i didnt notice in the code
[14:33:49] <Badaboom> yes
[14:33:59] <jadew> then SPI is probably working properly
[14:34:05] <Badaboom> true
[14:34:10] <jadew> you'll have to re-read the datasheet of the chip
[14:34:17] <jadew> you don't have a scope, do you?
[14:34:19] <Badaboom> several times
[14:34:27] <Badaboom> no
[14:34:32] <jadew> logic analyzer?
[14:34:35] <Badaboom> yes
[14:34:38] <jadew> which LA?
[14:35:17] <jadew> if it's capable of sampling the data properly, maybe you can take a screenshot
[14:35:35] <jadew> I'll take a look at it after work and I'll check the datasheet of the chip too
[14:35:53] <Badaboom> rgr
[14:36:19] <Badaboom> i personally think its the max7219,, but then again what do i know:)
[14:37:23] <jadew> in the meantime you can take a look at this: http://eenoob.com/ and try to compare that with what you have + what the datasheet says you should have
[14:37:33] <Badaboom> Holy crap,, just reflashed it and its working???
[14:37:37] <Badaboom> wth
[14:37:43] <jadew> heh
[14:37:47] <Badaboom> son of a
[14:38:07] <jadew> well, don't reset it once it breaks
[14:38:20] <Badaboom> ahh,, removed power and its back to square 1
[14:38:20] <jadew> and check take some samples with the logic analyzer
[14:38:31] <Badaboom> yep
[14:38:41] <sabesto> UnderSampled: doesnt it work if you use jmp on the tiny?
[14:39:42] <UnderSampled> sabesto: I don't have the tiny, and don't have the mega set up either, I'm just reading the datasheets
[14:40:07] <UnderSampled> see page 27, section 8.1 in http://www.atmel.com/images/atmel-8127-avr-8-bit-microcontroller-attiny4-attiny5-attiny9-attiny10_datasheet.pdf
[14:40:13] <sabesto> rjmp is faster and half the size of jmp, and if flash isnt larger then the limit of rjmp, there is no reason to use jmp
[14:40:37] <UnderSampled> compare with page 50 (same section) of http://www.atmel.com/Images/Atmel-8011-8-bit-AVR-Microcontroller-ATmega164P-324P-644P_datasheet.pdf
[14:41:13] <UnderSampled> which implies that I can't use rjmp on all devices
[14:41:22] <UnderSampled> (for that spot)
[14:41:52] <UnderSampled> I was hoping to write it for the attiny and just test it on the atmega
[14:42:23] <sabesto> UnderSampled: check out the addresses in the interrupt vector
[14:42:53] <sabesto> the tiny cant fit the jmp command
[14:43:09] <sabesto> on the mega its 0,2,4
[14:43:14] <sabesto> the tiny 0,1,2
[14:43:41] <sabesto> guess you could use jmp if you disable int0
[14:43:45] * RikusW would have liked an interrupt vector table in ram instead...
[14:44:35] <UnderSampled> at 32bytes of ram, are you sure RikusW?
[14:44:43] <RikusW> why not
[14:45:00] <sabesto> for speed?
[14:45:04] <RikusW> dedicated list of addresses
[14:45:11] <RikusW> not normal ram
[14:45:16] <jadew> I guess you can implement that
[14:45:26] <jadew> you fill the entire interrupt table with nop
[14:45:32] <jadew> at the end jmp to interrupt router
[14:45:45] <jadew> and then you handle your interrupts yorself
[14:45:46] <sabesto> haha
[14:45:49] <jadew> you would lose a few cycles tho
[14:45:55] <sabesto> yeah, a few
[14:46:28] <UnderSampled> so what's the benefit?
[14:46:34] <jadew> could be done more efficently I guess
[14:46:44] <jadew> UnderSampled, the posibility to change your interrupt routine on the fly
[14:46:59] <UnderSampled> interesting
[14:47:20] <jadew> you could make a routine that looks up the address of the real routine for each interrupt, that would save some cycles
[14:48:01] <UnderSampled> or I could just have the jump for each one go to it's own handler
[14:48:28] <UnderSampled> if it's smaller that way
[14:49:02] <UnderSampled> I was only planning on using the pin change and watchdog interrupts
[14:50:44] <UnderSampled> but if I do keep changing the vector, I don't have to keep an if else state machine
[14:52:16] <UnderSampled> but this doesn't answer why the mega can't use the RJMP
[14:52:48] <sabesto> try and see
[14:52:56] <sabesto> just simulate
[15:00:47] <jadew> only chicks simulate
[15:03:17] <sabesto> said he didnt have hw to test on so
[15:10:52] <RikusW> mega should be able to do rjmp
[15:11:19] <RikusW> just make sure the table is setup correctly
[15:11:27] <RikusW> maybe .org for each vector
[15:24:20] <cart_man> How can I declare a Global Struct and use its Variables inside functions?
[15:29:28] <seldon> typedef struct { int foo; int bar; } baz_t; extern baz_t variable_name; in a header, baz_t variable_name in one translation unit, then use variable_name.foo, variable_name.bar whereever. If you plan to use it in ISRs, you will want to apply volatile.
[15:30:48] <seldon> Or do you want to declare a variable with static storage duration and use it in only one function, so the value is remembered in the next call to that function?
[15:31:36] <cart_man> well actually I made a struct in global right, Struct foo { unsigned short XX; }
[15:32:07] <cart_man> then use that foo.struct in functions as if its a global variable
[15:32:31] <seldon> That doesn't declare a variable but a type (named struct foo).
[15:33:11] <seldon> You can later say struct foo bar; to declare a variable named bar of type struct foo.
[15:33:58] <cart_man> then call it like foo.bar?
[15:34:06] <cart_man> inside any functions?
[15:34:47] <seldon> No, it's just a regular variable named bar. You could use bar.XX where bar is valid. Where bar is valid depends on where you declared it.
[15:35:09] <cart_man> Ohh I see ok let me try that quickly
[15:35:15] <seldon> You could say extern struct foo bar; in a header, struct foo bar; in one translation unit, and then use bar.XX whereever the header is #included (i.e., bar is known).
[15:37:00] <seldon> http://codepad.org/WksTLJAm <-- like this.
[15:37:32] <cart_man> http://bpaste.net/show/hZ1W82dgI9fMJ4jZA3jm/ seems to work
[15:37:34] <cart_man> Ok ill look
[15:38:02] <cart_man> Ohh I see
[15:38:04] <seldon> That will work if you have only one TU, but you'll get linker errors if you #include that header in two translation units.
[15:38:42] <cart_man> Ohh ok I see...wel lthen Id rather do it your way
[15:39:45] <seldon> My way would use the typedef struct { ... } type_name; syntax because having "struct" all over my code displeases me. :P
[15:39:56] <seldon> But either will work.
[15:42:57] <cart_man> I like structs because
[15:43:12] <cart_man> I have to declare a TON of unsigned shorts to keep track of ms Ticks
[15:43:27] <cart_man> so I make all my Tick counters inside the struct
[15:44:16] <cart_man> Oh also...If I make a function that will get some parameters like int Func(unsigned short x){}
[15:44:51] <cart_man> must the function also be delcared a unsigned short if it will get unsigned shorts as parameters or can it be ints or voids?
[15:45:37] <cart_man> and why cant I assign values to my variables inside my structs? sorry last question
[15:45:45] <seldon> The return value is independent of the parameters. You can have a void foo(int x, short s, char c, struct bar *ptr);
[15:46:32] <cart_man> ah ok cool makes sense
[15:46:40] <seldon> And I suspect that your structs so far are types, not variables. If you write struct foo { unsigned short XX; }, foo is not a variable.
[15:46:57] <seldon> In fact, there is no foo, there's a type named "struct foo."
[15:47:16] <seldon> You can then make variables of that type by saying struct foo bar, baz, qux; like you would say int bar, baz, qux;
[15:47:27] <seldon> And *then* you can assign to bar.XX, baz.XX and qux.XX.
[15:48:20] <seldon> struct foo is essentially a blueprint for variables.
[15:49:18] <cart_man> ohhh i see. ok cool but the extern doesnt work for me
[15:49:20] <cart_man> though
[15:50:26] <seldon> The line with extern is a declaration that says "there is a variable of type struct foo named bar somewhere, trust me." The line struct foo bar; in the source file actually makes the struct, so the linker can find it later.
[15:51:07] <seldon> s/makes the struct/defines the variable/
[15:53:31] <cart_man> Ok ok aweseom...Thanks allot for your patience :)
[15:54:13] <seldon> Don't mention it. I'll wager that there's not a person in this channel who didn't go through the same thing at some point.
[15:55:59] <Badaboom> Nope,, i never did,, wait im still going thru:)
[15:56:26] <Badaboom> I think i may eed to reinstall studio:(
[15:59:25] <Badaboom> I dont get it,, compile a program,, flash it,, everything works,, reflash and dead
[15:59:54] <cart_man> what do you mean dead?
[16:00:27] <Badaboom> well,, its for a diplsy driver and im only getting 1 digit,, then all 7,, then 1...
[16:00:45] <cart_man> I got the same thing but I later on found that my Atmega328 is broken and only gets the right MCU ID every 3rd time or soo...
[16:01:14] <RikusW> cart_man: check your connections and ISP speed
[16:01:18] <cart_man> Wait are you making a Display Driver? like a LCD display driver?
[16:02:01] <Badaboom> cart_man: 7 segment 7 digit
[16:02:14] <cart_man> RikusW: I have 2 atmegas 328 right next to each other with the same setting...I use them both because im making alittle bit bang implementation, the one is fine
[16:02:23] <cart_man> Ohhh i see...ok yea thats not so bad
[16:02:43] <Badaboom> lol,, funny thing is ive changed nothing
[16:02:58] <seldon> Badaboom, Is there something in your circuit that may remember state if VCC is maintained? I'm thinking along the lines of shift registers.
[16:03:34] <RikusW> seldon + Badaboom == bbt ?
[16:03:35] <Badaboom> seldon: only thing i can thik of is the max7219
[16:03:45] <seldon> bbt?
[16:03:55] <RikusW> tv series
[16:04:05] <RikusW> big bang theory
[16:04:10] <Badaboom> lol,,
[16:04:20] * RikusW don't even watch it...
[16:05:21] <seldon> Someone else mentioned that recently. IIRC, the name in question is slightly different, though. Mine is lifted from Asimov's Foundation trilogy.
[16:05:43] <Badaboom> Mine comes fro the fifth element
[16:05:49] <Badaboom> from
[16:06:17] <RikusW> sheldon I think
[16:06:19] <Badaboom> I used to use Echelon
[16:06:29] <Badaboom> but that was taken
[16:07:25] <RikusW> cart_man: I'll be in pta in 3 months or so, will stay somewhere near lynwood
[16:08:31] <seldon> Anyway, that display driver will remember state, so that *could* be your difference in starting conditions. Cut and reconnect the power to see if it works again, and if it does, fix your code to reset the display driver before you use it.
[16:09:07] <Badaboom> seldon: ive seen ppl using as a "prototype" called display clear
[16:09:42] <Badaboom> actually this: void updateDisplay();
[16:09:53] <Badaboom> then called for it after init
[16:11:07] <seldon> I'm afraid I have no idea where that updateDisplay() function comes from, so I can't comment.
[16:11:27] <Badaboom> yeah i think its just a function name he gave it
[16:13:07] <Badaboom> the funny thing is i thought maybe i accidently reset the scanlimit setting due to me only having 7 digits vs 8 but i checked the datasheet
[16:18:41] <seldon> I suspect the IC won't care if one of its digit channels isn't connected to anything. If I understand this correctly though, you just toggle /CS and clock out 56 bits to set the display state, and anything it remembered will just be shifted "out the other end," in a manner of speaking. So my first wild guess seems unlikely.
[16:18:55] <seldon> My second wild guess is undefined pins.
[16:19:17] <seldon> Ah, wait. I should read more carefully.
[16:20:34] <seldon> Or rather, the whole thing.
[16:26:13] <Badaboom> yeah,, if a digit isnt used, 1 that is they say to keep it the same for contrast
[16:26:50] <Badaboom> Do you think it matters if i have it set to scan 0-6 instead of 7?
[16:28:20] <seldon> It would be a little brighter, but otherwise I don't think so.
[16:28:56] <Badaboom> this is one of those things that is quirky
[16:28:58] <seldon> What you do seems to be exactly what the scan limit register is for.
[16:31:52] <Badaboom> 0X0B is define and 0x07 is what i have it set at
[16:32:48] <MarkX> anyone here know how to collapse if statements in atmel studio 6?
[16:33:05] <UnderSampled> way to see what the PC is?
[16:48:23] <Badaboom> seldon: I never saw this section before and here i thought i read the whole thing... Program the display driver prior to
[16:48:23] <Badaboom> display use. Otherwise, it will initially be set to scan one
[16:48:23] <Badaboom> digit, it will not decode data in the data registers, and
[16:48:23] <Badaboom> the intensity register will be set to its minimum value.
[16:48:48] <Badaboom> so how the heck did it get reset,,lmao
[16:50:48] <Badaboom> so reding up from your original response you are correct sir:)
[16:50:56] <Badaboom> and i cant spell
[16:56:07] <seldon> You got it working now?
[16:56:52] <Badaboom> Not yet,, making the corrections now,, sorry,, "the boss" was talking aka my lady:)
[16:58:16] <seldon> Here's hoping that the problem was identified correctly, then.
[17:08:08] <Badaboom> No sorry,, no go:(
[17:08:49] <beaky> hello
[17:09:03] <beaky> why is the atmega8 more expensive than the more capable atmega328?
[17:10:53] <beaky> the atmega8A *
[17:15:01] <RikusW> don't know, but I'll buy the 328
[17:16:22] <beaky> my professor said I'm only allowed to use an ATmega8 :(
[17:16:30] <RikusW> not the 8A
[17:16:49] <RikusW> 328 is nearly the same as 8
[17:16:53] <RikusW> only more memory
[17:16:59] <beaky> but isn't the 328p just an atmega8 with more features and memory?
[17:17:00] <beaky> ah
[17:17:06] <RikusW> and maybe a bit different peripherals
[17:17:18] <RikusW> and it is pin compatible
[17:17:25] <beaky> ah thats awesome
[17:17:32] <beaky> I will get the 328 and scratch of the "32"
[17:17:36] <RikusW> looks like a m8
[17:17:43] <Badaboom> seldon: ive got it,, can u believe it was the intensity??
[17:17:46] <RikusW> cheater :-D
[17:17:58] <RikusW> though not much of a cheat either
[17:18:24] <RikusW> ask your professor, there isn't too much of a difference actually
[17:18:34] <beaky> btw is the atmega328 the biggest of those narrow 28-pin dip atmegas that atmel sells?
[17:18:43] <RikusW> afaik yes
[17:18:54] <RikusW> it goes 4 8 16 32
[17:19:26] <beaky> ah
[17:19:45] <beaky> so the 32 means it has 32 kB... finally I understand electronics components naming conventions :D
[17:20:17] <RikusW> then there is 164 324 644 1284
[17:20:35] <beaky> thats the big fat 40-pin one
[17:20:41] <RikusW> 325 and 3250 too, not sure what those are for
[17:20:44] <RikusW> yes
[17:21:13] <beaky> do the big fat ones have any additional features over the narrow ones, apart from more IO pins?
[17:21:13] <RikusW> m169 is for lcds
[17:21:23] <RikusW> not too much
[17:21:30] <RikusW> they do have 2 serial ports
[17:21:39] <RikusW> xx4 series anyways
[17:22:13] <RikusW> beaky: https://sites.google.com/site/megau2s/home/datasheets
[17:28:55] <beaky> wow, the atmega8 and 8a only has 2 external interrupts, while the rest have 24...
[17:29:35] <UnderSampled> atmelstudio knows about SE, and not just SMCR. is there some sort of way to say something like SBI SE, instead of SBI SMCR, 000 ?
[17:30:21] <UnderSampled> is it supposed to even be sbi?
[17:30:47] <RikusW> sbi = set bit io
[17:31:00] <RikusW> iirc sbi reg,bit nr
[17:31:21] <RikusW> sbi only works on low io registers
[17:31:47] <UnderSampled> so what do I do for the higher ones?
[17:32:28] <RikusW> reg |= (1<<bit nr);
[17:32:42] <cart_man> I am working with Atmega328P and Atmel Studio sees them as Atmega328 without the P
[17:32:59] <cart_man> if I add the Atmega328P to the devices it sais the ID is wrong
[17:33:07] <cart_man> says`
[17:34:15] <UnderSampled> RikusW: this is assembler
[17:34:25] <RikusW> 328 sig is 1e9514 328p is 1e950f
[17:35:05] <UnderSampled> am I supposed to use SBR then?
[17:35:29] <RikusW> in r16,IO sbr r16,bit out IO,r16
[17:35:50] <RikusW> or use ori r16,0x01
[17:37:27] <RikusW> iirc sbr and ori is the same instruction (in machine code)
[17:41:07] <beaky> How do I port programs between avrs
[17:41:10] <beaky> if the pins are different?
[17:45:28] <beaky> wow I just renamed the ports and pins and they worked :D
[17:46:18] <cart_man> Guys if I have a variable int X = 0b00110010; and I want to disect the bits and attach very bit to chars seperately. How would I do that? Example above will then be char Ext7 = 0 , char Ext6 = 0, char Ext5 = 1 etc etc coresponding with the bits of X from the Most Significant bit ?
[17:51:13] <twnqx> cart_man: ext7 = (X >> 7) & 1; ext6 = ( X >> 6) & 1; ...
[17:59:09] <cart_man> twnqx: Thanks allot its working :)
[18:24:28] <UnderSampled> the documentation seems to use out for setting WDTCSR
[18:24:42] <UnderSampled> (see page 56 of http://www.atmel.com/Images/Atmel-8011-8-bit-AVR-Microcontroller-ATmega164P-324P-644P_datasheet.pdf )
[18:24:57] <UnderSampled> out WDTCSR, r16
[18:26:35] <UnderSampled> and if I use ORI, it says "invalid register"
[19:18:24] <MarkX> anyone here know how to collapse if statements in atmel studio 6?
[19:20:08] <Engen> Tom_itx: you there?
[19:21:45] <Tom_itx> no
[19:22:28] <Engen> turns out delay(); did the trick
[19:22:55] <Tom_itx> good stuff
[19:23:13] <Tom_itx> did you change the 'if' statement?
[19:23:51] <Engen> I'll show you the code it is now, you'll laugh at the trivial nature.
[19:24:12] <Tom_itx> it wasn't a difficult problem
[19:24:45] <Engen> http://pastie.org/7986239
[19:26:33] <Tom_itx> so you're waiting 2.3 sec between loops
[19:27:02] <Tom_itx> after it fires the first time
[19:27:26] <Engen> that's only if it detecs the signal
[19:27:36] <Engen> or else the drive motor constantly runs
[19:28:01] <Tom_itx> now write it all in c
[19:28:17] <Engen> what for?
[19:28:26] <Tom_itx> for real world experience
[19:28:33] <Engen> albeit it's not a difficult thing
[19:28:36] <Engen> okay
[19:28:47] <Engen> oh wait...
[19:29:03] <Engen> hmm the inputs
[19:37:23] <Tom_itx> you're not using pwm on the motor are you?
[19:37:29] <Tom_itx> just turning it on
[19:38:54] <Engen> for the delivery motor because it's load is little to none we have to, else the egg flies off before it drops into the container. the drive motor, full speed.
[19:39:47] <Engen> so pwm on one and not the other
[19:40:08] <Tom_itx> i don't see pwm in the code
[19:40:20] <Tom_itx> analogwrite?
[19:40:36] <thetruthisoutthe> h
[19:40:39] <Tom_itx> w
[19:40:48] <Engen> Tom_itx: yes
[19:41:05] <Tom_itx> that's not pwm
[19:41:06] <thetruthisoutthe> driving motor on/off is not cool
[19:41:20] <thetruthisoutthe> the starting currents are large
[19:42:10] <Engen> Tom_itx: http://arduino.cc/en/Reference/AnalogWrite
[19:43:42] <Tom_itx> misleading function description
[19:44:02] <Engen> yeah as was the description of the delay function
[19:44:24] <Engen> dodgy site
[19:46:19] <Tom_itx> well, consider the c approach as an exercise at least
[19:46:25] <Tom_itx> it would be good experience
[19:47:53] <Tom_itx> there are macros to read / write pins to make it easy
[19:47:56] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/avr/c_bits/bits_index.php
[19:48:00] <Tom_itx> midway down
[19:48:25] <Engen> I'm just thinking how i'd initialise the inputs (because I have no knowledge/experience of C with hardware), only just started learning C 11 weeks ago
[19:49:08] <Tom_itx> write to the DDRx register
[19:49:18] <Tom_itx> to set them to input or output
[19:50:01] <Tom_itx> a simple blink program using delay: http://tom-itx.dyndns.org:81/~webpage/how_to/atmega168/mega168_led_blink_delay_index.php
[19:50:27] <Engen> ! thank you
[19:50:30] <Tom_itx> in that case it's using portb
[19:50:41] <Tom_itx> you don't need to set the whole port but i did there for simplicity
[19:50:45] <Tom_itx> you can use a mask
[19:51:00] <Tom_itx> other tutorials there as well
[19:51:13] <Tom_itx> basic
[19:52:00] <cart_man> Whats new with C 11?
[19:52:09] <Tom_itx> you send 80 to the analogwrite function
[19:52:21] <Engen> yes
[19:52:24] <cart_man> should it feel welcome on my computer?
[19:52:27] <Tom_itx> that would be similar to setting the OCR0A register
[19:52:38] <Tom_itx> or OCR0B
[19:52:47] <Tom_itx> both are timer outputs
[19:53:24] <Engen> OCR0A = 0; // PD6 pin12 Timer0 output compare A
[19:53:25] <Engen> OCR0B = 0; // PD5 pin11 Timer0 output compare B
[19:53:30] <Engen> yep yep
[19:57:11] <Tom_itx> the 'while(1)' is the same as your loop function
[19:58:31] <Engen> that's what hit me intially, heh, how do I do an infinite loop.
[19:58:44] <Engen> and then I can just start a while and never fulfill the condition
[19:58:53] <Engen> or simply, as you say, while(1)
[19:59:05] <Tom_itx> if(;;)
[20:05:12] <Engen> Tom_itx: would you know if it's possible to code the arduino with C code since it's using an atmel chip?
[20:05:27] <Tom_itx> we do it all the time
[20:05:46] <Tom_itx> be careful you don't overwrite the bootloader
[20:05:55] <Tom_itx> or save it in case you do
[20:06:06] <Engen> awesome! just downloaded atmel studio and I'll try to do it in C
[20:06:22] <Tom_itx> just use a txt editor and a makefile
[20:06:27] <Roklobsta|2> enegn: as long as you have a tool like avrdude you can do what you like
[20:06:28] <Tom_itx> like the ones on my site
[20:06:44] <Tom_itx> avrdude works to download too, arduino uses it
[20:07:13] <thetruthisoutthe> programstart:
[20:07:18] <thetruthisoutthe> goto programstart;
[20:07:56] <thetruthisoutthe> for (;;) { }
[20:07:57] <Roklobsta|2> FFS AVRSTudio6 is giving me a hard time
[20:08:20] <Tom_itx> the tools should not overwhelm the work
[20:08:36] <Engen> time to run. will be back with query regarding C conversion of code most likely. thanks Tom_itx
[20:08:52] <Roklobsta|2> debug complains source is missing. WTF?
[20:11:41] <Roklobsta|2> anyone use freertos at all?
[20:14:22] <seldon> cart_man, the big new stuff in C11 is multithreading support, which isn't terribly interesting for AVRs. There's some other useful stuff, but compiler support is lacking at this point in time. If you can get it, do so, but don't lose sleep over it if you can't.
[20:18:38] <thetruthisoutthe> Tom_itx> if(;;) < what?
[20:19:25] <Roklobsta|2> tom: what editor/compiler/debooger do you use?
[20:19:50] <Tom_itx> thetruthisoutthe i was guesssing but i'm pretty sure i've seen that
[20:19:54] <Tom_itx> as an infinite loop
[20:20:02] <thetruthisoutthe> lold
[20:20:18] <Tom_itx> or was it the 'for' you mentioned...
[20:20:20] <thetruthisoutthe> if is an if
[20:20:20] <Tom_itx> i use while
[20:21:14] <seldon> Real programmers, of course, manipulate the stack and use return to loop.
[20:21:30] <Tom_itx> aarg, it was for
[20:21:31] <Tom_itx> sry
[20:22:20] <Tom_itx> owner is not registered
[20:22:33] <thetruthisoutthe> seldon <= real programmers use a piece of wire, and short some cpu pins to make a n infinite loop
[20:22:44] <seldon> Touche.
[20:22:50] <MarkX> hhahaha
[20:22:52] <Tom_itx> Roklobsta|2, i use avrgcc and programmers notepad
[20:23:15] <Tom_itx> btw, you can download avrgcc from atmel aside from what comes with studio
[20:23:32] <Tom_itx> i got the latest one from them and it supports attiny 4 etc with c now
[20:24:43] <Tom_itx> winavr 3.4.1
[20:26:45] <Roklobsta|2> tom yeah I am aware of that. it doesn't come with avarice though like the old winavr did
[20:27:01] <Tom_itx> or avrdude or pn
[20:27:02] <Tom_itx> etc
[20:27:34] <thetruthisoutthe> http://www.sharenator.com/Picdump_3/150098/touche_my_friend_touche_demotivational_poster_1255897214-86607.html
[20:27:48] <Roklobsta|2> why not?
[20:27:51] <Roklobsta|2> it should
[20:28:14] <seldon> thetruthisoutthe, if you have an hour to waste on weird programming: http://29c3.dontpanic.lu/webm/29c3-5265-en-page_fault_liberation_army_webm.webm
[20:28:26] <thetruthisoutthe> i don't
[20:28:41] <Tom_itx> Roklobsta|2, because it was packaged with studio?
[20:28:48] <thetruthisoutthe> but i do weird programming naturally
[20:28:49] <tzanger> touché the wrong part and you'll have infinite NOPs :-)
[20:28:50] <seldon> Aw.
[20:28:55] <Roklobsta|2> ehhhh, i mean the seperate avr gcc package
[20:29:17] <Tom_itx> oh wait.. it has avrdude
[20:29:25] <seldon> Not that weird. The man does branching by doublefault.
[20:29:49] <Tom_itx> no pn
[20:30:06] <Roklobsta|2> i think i just got the shits with Bertos
[20:31:17] <tzanger> triple faulting the CPU was the only way to get out of protected mode on 286s :-)
[20:32:17] <seldon> Now we're cooking with charcoal! :D
[20:38:28] <thetruthisoutthe> seldon <= wanna see my alien aircraft hovering?
[20:38:29] <seldon> Do you know if that still works on newer x86*s?
[20:39:37] <seldon> Sure, just let me get my tinfoil protective suit.
[20:39:46] <Tom_itx> http://www.electronicproducts.com/Optoelectronics/Lasers/Image_of_the_Day_5_million_Legos_used_to_create_a_Star_Wars_X-Wing_starfighter.aspx
[20:41:09] <thetruthisoutthe> Tom_itx <= i'd definitely not use legos, even if it were free
[21:18:20] <Roklobsta|2> anyone uses RTS/CTS logic with a UART
[22:17:36] <stanreg> groundsbreaking discovery: seems that when enabling "Any logical change on INT0 generates an interrupt request" and going into deep sleep, attiny44 never wakes up. For all other types of INT sense control: all good.
[22:24:43] <R0b0t1> Are there other dedicated interrupt pins? Does it occur with those?
[22:25:39] <R0b0t1> Anyhow, request: attiny that can source/sink 300mA on at least one pin.
[22:26:35] <Casper> R0b0t1: use a transistor
[22:26:49] <R0b0t1> But that's more than one component!
[22:27:23] <stanreg> only one ext interrupt on attiny44..
[22:27:46] <Casper> http://imgur.com/BGqlsof ← I found a Wile E. Coyote road
[22:27:50] <R0b0t1> Does the pin change interrupt work properly?
[22:28:43] <stanreg> R0b0t1, haven't tested, but I don't think you can do deep sleep with pin change.
[22:29:49] <R0b0t1> stanreg: iirc any pin interrupt (dedicated or per-port) would wake from any runlevel
[22:30:12] <stanreg> hm
[22:30:18] <R0b0t1> If not there would be no way to wake from sleep?
[22:30:21] <R0b0t1> Oh only that one mode fails
[22:33:04] <Casper> afaik, that behavior is documented in the datasheet under the sleep mode
[22:40:14] <thetruthisoutthe> stanreg <= edge trigger needs clock.
[22:40:36] <stanreg> thetruthisoutthe, oh.. hm.
[22:40:54] <thetruthisoutthe> use level trigger ?
[22:42:01] <stanreg> thetruthisoutthe, actually, level trigger is what I used ... there's no edge trigger.
[22:42:19] <thetruthisoutthe> you said logical change
[22:42:29] <thetruthisoutthe> that means edge
[22:43:24] <stanreg> I thought edge was the "ramp up/down" to high/low.
[22:43:32] <stanreg> Isn't it?
[22:43:36] <thetruthisoutthe> that is called an edge
[22:43:50] <thetruthisoutthe> rising, or falling edge.
[22:44:14] <thetruthisoutthe> i thjink that needs a clock even for int0 int1
[22:45:42] <stanreg> right, so we have 4 options: (a) low-level (eg: when signal is low), (b) logical change (eg: when signal was low and is now high, or the opposite), (c) falling edge (eg: right as you go from high to low), and (d) rising edge (eg: right as you go from low to high). Correct?
[22:48:01] <stanreg> I selected option (b) [logical change]. I don't see where it says that clock is needed, but would that mean that it cannot deep sleep with that option unless it relies on ext. clock?
[22:53:23] <thetruthisoutthe> you still dont get it
[22:53:45] <MarkX> anyone here know how to collapse if statements in atmel studio 6?
[22:53:50] <thetruthisoutthe> read my last 5 lines
[22:54:58] <tomatto> LUFA is only for avrs with hardware usb support?
[22:55:11] <thetruthisoutthe> xmega
[22:55:42] <tomatto> ok
[22:56:04] <tomatto> is there some differente between adc in mega and xmega? (in hardware)
[22:56:32] <stanreg> thetruthisoutthe, what's a "level" trigger, if you don't mind?
[22:56:53] <thetruthisoutthe> stanreg <= you press a button that pulls low, set low level trigger, it triggers
[22:57:17] <thetruthisoutthe> (it will continuously trigger whiule low)
[22:57:26] <stanreg> understood.
[22:58:04] <thetruthisoutthe> this obviously will work without a running clock
[22:58:13] <thetruthisoutthe> on int0 int1
[22:58:26] <stanreg> only int0 on tiny44, but I understand now.
[22:58:39] <thetruthisoutthe> kk
[22:59:07] <stanreg> So using a 2-position-switch to execute two different codes becomes harder now, if we want to deep-sleep, as one of the positions will be constantly firing up the device from sleep.
[22:59:53] <thetruthisoutthe> you can reprogram your interrupt from the interrupt
[23:00:15] <thetruthisoutthe> and disable sleep mode...
[23:01:56] <stanreg> looks like pin change interrupts might be a better way
[23:02:12] <thetruthisoutthe> after you wake up you do whatever
[23:02:14] <stanreg> and i believe they support deep sleep without requiring clock
[23:03:41] <thetruthisoutthe> on an atmega, every pcint requires clock
[23:04:31] <thetruthisoutthe> i assume the pin changes are registered at clock edge.
[23:04:51] <thetruthisoutthe> an atmel is not an fpga
[23:05:47] <theBear> bwaaahahahaaa i just looked at the weenie warmer link from last night :)
[23:05:50] <stanreg> looks like pin change interrupts is the solution for deep sleep, look:
[23:05:55] <stanreg> Only an External Reset, a Watchdog Reset, a Brown-out Reset, USI start condition
[23:05:55] <stanreg> interupt, an external level interrupt on INT0 or a pin change interrupt can wake up the MCU. This sleep mode halts
[23:05:55] <stanreg> all generated clocks, allowing operation of asynchronous modules only.
[23:09:44] <thetruthisoutthe> stanreg <= i don't say it is impossible, try it
[23:09:53] <thetruthisoutthe> 5 minutes
[23:09:56] <stanreg> roger that, thanks for the assistance
[23:10:42] <thetruthisoutthe> apparently atmels mcus have very different features