#avr | Logs for 2013-05-29

Back
[02:56:11] <Qantourisc> LPM Load Program Memory R0 ← (Z) None 3
[02:56:41] <Qantourisc> Can that be used to access arrays stored in program memory ?
[02:59:23] <Qantourisc> ok found something on internet
[03:03:06] <Qantourisc> Look at the speed, unles you care about 2 or 3 cycle, they are all fast
[03:03:23] <Qantourisc> in this case I need it once (or a few times) per loop, so i'm fine :)
[04:47:38] <RikusW> http://llbit.se/?p=1744 shortest crashing C program
[04:47:45] <RikusW> main;
[05:12:11] <beaky> hello
[05:12:51] <[z_z]> So I've got a very large global variable its a struct with 2200 bytes. If i compile without this global usb works fine. with it usb works but no longer gives usb strings like manufacturer and serial #. the chip I'm using is an avr32 with 64KB of SRAM shouldn't that be enough for my global?
[05:13:53] <beaky> sizeof my_type /* 2200 :O */
[05:18:07] <[z_z]> yup assert(sizeof(mytype)==2200)
[05:40:17] <Kev-> How do I measure the voltage of the battery that's powering a circuit? The battery is connected straight, no regulator
[05:40:47] <theBear> erm, with a volt or multimeter ?
[05:41:00] <Kev-> Ah yeah, I want to measure it in the circuit
[05:41:12] <Kev-> I assume the reference voltage is always the same as the battery voltage?
[05:41:21] <theBear> oh... how about a voltage divider to the a-d
[05:41:35] <theBear> umm, reference voltage can be less, but not more than batt voltage
[05:42:54] <theBear> say you go for a 95% voltage divider, without checking the fineprint, i'm pretty sure that's enough to read anything from full .... oh wait, vcc drops as the battery gets lower... ok
[05:43:34] <Kev-> Yeah that's what I was wondering'
[05:43:48] <Kev-> Seems like I need a known reference or something
[05:44:06] <theBear> so say you got a 4.5v battery(s) and expect to go no lower than 3v... setup a slightly under 3v aref, or take a shortcut and use whatever highest internal (selected by fuses) reference is available in your chip
[05:44:22] <theBear> and a voltage divider so full batteries is around 95% of that for best resolution
[05:44:40] <theBear> most current/modern avrs have 2 selectable internal refs from memory
[05:45:56] <Kev-> I assume I need to provide the reference?
[05:46:27] <Kev-> I'm trying to do a low power build, running on a 3v coin cell
[05:46:43] <Kev-> And I want to measure the voltage of the coin cell, so i know when to replace it
[05:47:18] <theBear> no providing, just pick the highest internal ref your chip has
[05:48:11] <Kev-> ah ok.
[05:48:32] <Kev-> Thanks for your help :) I appreciate it
[05:49:14] <theBear> :)
[05:49:58] <Kev-> I'm using a few 3.3v arduino pro minis from ebay for this... Much cheaper than buying the chips, parts and PCB
[05:50:05] <Kev-> It's ridiculous how cheap they are
[05:50:25] <theBear> i believe you :)
[05:51:15] <Kev-> http://www.ebay.com/itm/130905365831
[05:52:03] <Kev-> Looks like the internal reference is 1.1v on the atmega328
[05:52:15] <Kev-> That's perfect, I didn't know this :)
[05:57:11] <megal0maniac> Kev-: There's also a temperature sensor in the chip
[06:00:00] <Kev-> hmm in what chip?
[06:00:04] <Kev-> atmega?
[06:00:54] <megal0maniac> Yip. The 328
[06:02:11] <Kev-> Didn't know that
[06:03:18] <Kev-> Probably not particularly useful in enclosures and such tho
[06:03:51] <megal0maniac> I know :) I just mentioned it because those are two features which aren't obvious at first
[06:03:56] <Kev-> Yeah
[06:04:01] <Kev-> Appreciated
[06:05:09] <twnqx> megal0maniac: since you're an export in transistors now... wanna help me out with a mosfet drive circuit?
[06:05:20] <twnqx> i have no idea what voltage i need to drive them
[06:05:33] <twnqx> well, a slight one... but no ide how to generate it :P
[06:06:11] <megal0maniac> twnqx: No
[06:06:20] <megal0maniac> Something will explode :P
[06:07:40] <megal0maniac> (I'd gladly assist if I could, but..)
[06:13:47] <cart_man> The Max current a Pin on the AVRs are 0.050 or 50mAmp Right?
[06:14:02] <megal0maniac> 40mA
[06:14:15] <cart_man> so 5/270 will be just fine since its 20mA
[06:14:23] * megal0maniac nods
[06:14:32] <cart_man> kk ty ty
[06:14:36] <megal0maniac> keep in mind there's a port and device limit as well
[06:14:54] <cart_man> by the way...if they say "Set PWM resolution" They mean set the PWM Frequency right?
[06:15:17] <megal0maniac> Mmm.. That would make sense
[06:15:25] <cart_man> Wait a port and device limit? You mean PORTB1,2,3,4,5s current combined?
[06:16:53] <megal0maniac> I mean that even though you can push 40mA through a pin, it doesn't mean that you can push 40mA through all of the pins at the same time
[06:21:40] <thetruthisoutthe> h
[06:22:21] <megal0maniac> l
[06:48:34] <OndraSter__> u
[06:48:55] <megal0maniac> fff
[06:49:48] <OndraSter__> so, I am having a beer with Microsoft on monday.. again :D
[06:49:57] <OndraSter__> although, not sure about beer this time, it is in their HQ, not in the pub
[06:54:04] <theBear> it's a trap !
[07:16:36] <Tom_shop> they're luring you in with beer?
[07:16:42] <Tom_shop> it's a trap for sure
[07:16:49] <OndraSter> :P
[07:16:55] <OndraSter> I have already been on beer with MS few times
[07:17:11] <Tom_itx> it kinda drives ya to that sometimes
[07:17:34] <theBear> yeah, they lulled you into a false sense of security now !
[07:17:40] <megal0maniac> I get lunches with the dept. of communications
[07:17:45] <megal0maniac> Never beer :(
[07:18:15] <Tom_itx> maybe you looked hungry
[07:18:55] <megal0maniac> Weird I looked sober too
[07:19:03] <megal0maniac> -Weird
[07:19:39] <theBear> i look sober and hungry often, noone ever offers me lunch :(
[07:20:27] <megal0maniac> You're doing it wrong
[07:28:16] <beaky> hello
[07:29:28] <beaky> how do i get a copy of eagle to show you guys my design? :D
[07:33:04] <theBear> you go to the eagle site and download it i suppose
[07:37:51] <beaky> lah
[07:37:52] <beaky> ah*
[07:38:49] <beaky> aww it's expensive and proprietary :(
[07:39:02] <tzanger> morning
[07:39:21] <beaky> hello
[07:39:31] <beaky> oh wait there's a freeware license! :D
[07:39:48] <tzanger> OndraSter: MS-branded beer. bluescreen your piss
[07:39:50] <theBear> pfft, i wouldn't say go there and download it if it wasn't free
[07:40:07] <theBear> and it's still proprietary in pretty much every definable way even if it is free
[07:40:12] <beaky> ah right
[07:40:33] <beaky> probably better than KiCad or gEDA even if its just some limited freeware :D
[07:40:57] <beaky> it's even cross-platform :D
[07:41:09] * beaky does the cross-platform dance
[07:41:25] <theBear> kinda different in purpose/features to geda, and i dunno kicad too well, but it is a VERY usable product, and always has been, and has always been free for almost anything a hobbiest could ever want
[07:41:58] <beaky> yes I love big professional companies that acknowledge the needs of hobbyists
[07:42:09] <beaky> like atmel and cadsoft
[07:50:06] <megal0maniac> Woah!
[07:50:15] <beaky> http://imgur.com/lIWGpgs alright how do I improve my design?
[07:50:30] <theBear> tho technically cadsoft haven't owned eagle for a few years now
[07:50:57] <beaky> ah
[07:51:27] <megal0maniac> SDRAM controller and ethernet MAC and USB OTG and DMA and 2ch sigma-delta 16bit ADC and 7ch PWM and and and..
[07:51:36] <megal0maniac> I like this thing
[07:54:31] * hackvana loves KiCad
[07:55:38] <megal0maniac> That says a lot
[07:55:59] <theBear> heh, it does ?
[07:56:04] <beaky> yes
[08:04:03] <tzanger> beaky: there's not much you can do there. you might want to start with a real schematic editor :-) eagle is free, with board space restrictions. also don't paste pics, they're terrible to view. pdfs are way better, especially black on white, not dark blue on black
[08:04:35] <tzanger> megal0maniac: what part is that?
[08:05:01] <theBear> not much you can do ? what could you want on a schematic that eagle can't do ?
[08:05:01] <megal0maniac> AT32UC3A1128
[08:11:02] <beaky> ah
[08:11:34] <beaky> I wanna emulate my circuit
[08:12:59] <beaky> http://www.labcenter.com/products/vsm/avr.cfm I think i will buy this package :D
[08:13:08] <beaky> since it can emulate schematics :D
[08:14:02] <thetruthisoutthe> twnqx ?
[08:14:29] <theBear> emulation is somewhat different to drawing a schematic tho, that's why the things that do it are called emulators, not schematic editors
[08:14:40] <beaky> ah
[08:20:53] <twnqx> ?
[08:27:27] <Kev-> Is it ok to supply analog pins with voltage > reference?
[08:27:30] <thetruthisoutthe> twnqx <= whatkind of fet?
[08:27:37] <xaxes> megal0maniac: hey, am I right that isoJtag is kinda standard? I mean I have the schematic from another page. Does the prefix 'iso' implicit define the pinning?
[08:27:38] <Kev-> f.e. supplying with 3.3v when ref is at 1.1?
[08:27:38] <thetruthisoutthe> you mean IGBT ?
[08:28:14] <megal0maniac> xaxes: I have no clue
[08:28:26] <xaxes> okay, just guessed ;)
[08:28:47] <megal0maniac> But the JTAGICE MK1 set-up is pretty standard
[08:29:28] <xaxes> okay.. so due it's a clone Ill give it a try and flash the bootloader and stuff from the alelec page you provided yesterday.. thanks again
[08:29:51] <megal0maniac> Let us know how it goes
[08:29:59] <xaxes> Ill :)
[08:33:31] <xaxes> mhh.. just tried it again, I'm able to connect "a little bit" avrdude: jtagmkI_open(): succeeded
[08:33:56] <xaxes> And it seems to be able to read some data from the controller, maybe this is the data of the target controller, Im not sure
[08:34:22] <xaxes> all following requests get answered by 0x3f (unknown message)
[08:34:44] <twnqx> thetruthisoutthe: mosfet. like in http://xplorestaging.ieee.org/ielx5/63/4418431/4395155/html/img/4395155-fig-5-large.gif
[08:34:51] <twnqx> two mosfets connected at the source, connected to 230VAC
[08:39:47] <twnqx> my understanding is that i need ca. 15V above the point on the connection
[08:40:20] <twnqx> whose potential is defined by one of the parasitic diodes
[08:42:37] <thetruthisoutthe> 15V is fine
[08:42:43] <twnqx> yes
[08:43:14] <twnqx> but 15V above an unknown value between -325V and +325V
[08:43:32] <thetruthisoutthe> the thing i s floating, so you must isolate the drv
[08:43:35] <twnqx> oh, and not outside the range of +-20V around that point
[08:44:11] <thetruthisoutthe> no problem, use an isolation transformer
[08:44:52] <thetruthisoutthe> (little ferrite core)
[08:45:58] <thetruthisoutthe> interesting pfc idea
[08:46:05] <twnqx> there are better ones
[08:46:09] <twnqx> tons of them
[08:46:17] <thetruthisoutthe> one advantege is it will work down to 0V in
[08:46:34] <twnqx> i even found some that kill the need for a separate PWM stage for output voltage
[08:46:58] <thetruthisoutthe> why do you care about pf anyway?
[08:47:08] <twnqx> because i can
[08:47:11] <thetruthisoutthe> building arc welder?
[08:47:22] <twnqx> well, i intend to go in the range of 400-600W
[08:47:42] <thetruthisoutthe> pfc is extra at 500W
[08:47:49] <twnqx> nah
[08:49:19] <twnqx> http://powerelectronics.com/images/DesignFeatures_3-1110.pdf circuit 1b
[08:49:41] <twnqx> basically a boost, but with the isolation transformer in...
[08:51:23] <robotustra> hi
[09:14:08] <tzanger> what are you trying to do?
[09:14:40] <tzanger> two mosfets in series? trying to build up the vds?
[09:15:16] <twnqx> no, manage to turn off in any direction
[09:18:43] <tzanger> "in any direction" ?
[09:18:58] <Casper> fet have a build in diode
[09:19:25] <Casper> so only effectve at cutting power in one way due to the diode
[09:19:32] <tzanger> well most mosfets do yes
[09:19:46] <Casper> a reverse series config is needed to block it both way
[09:19:57] <tzanger> oh I see, I did not notice the reverse of the second one
[09:20:16] <tzanger> how do you intend on driving the mosfet with the source in the middle?
[09:20:35] <tzanger> isolated driver with driver common at that center node?
[09:21:14] <twnqx> to be fair
[09:21:20] <twnqx> that was MY question
[09:21:23] <tzanger> haha
[09:21:26] <tzanger> sorry
[09:27:04] <tzanger> synchronous converters are interesting. I attended a power electronics seminar (I forget whose, I want to say it was TI but I may be mistaken) where they tried to claim that they had invented it. One of the attendees was schooling them on it pretty badly. :_)
[09:35:53] <beaky> hah
[09:36:44] <jacekowski> tzanger: people tend to hate you for that
[09:39:30] <Casper> it's annoying when they claim to have invented something when they clearly did not :(
[09:39:48] <Casper> soon, some will claim they invented the wheel...
[09:40:48] <Casper> but yeah, synchronious converters are nice
[09:40:56] <tzanger> jacekowski: I just think it's a common problem with "patent everything" mentality
[09:40:58] <megal0maniac> That was actually me
[09:41:59] <jacekowski> tzanger: well, i think you should only be allowed to patent something that required investment from you (time or money)
[09:42:21] <jacekowski> tzanger: and patent should expire automatically after you get your investment back
[09:44:22] <Casper> it should also expire when you do not enforce them
[09:44:54] <Casper> like you know, or should have known, for many years that the patent is used without permission...
[09:46:13] <Casper> "oh look! they use our patent! let's wait until they release the third version of it, that they sell it well, then hit them hard with an huge lawsuit!"
[09:46:30] <beaky> are patents evil?
[09:46:43] <xaxes> megal0maniac: I was able to flash the isojtag1.5 sw (as used at the page which isn't available anymore) and now trying to upgrade the firmware using the recently flashed bootloader.. but avrstudio 4/5 on vista-box doesn't find a "supported device" for upgrading firmware.. Im remembering that I had problems the last time I did it, but don't know how to fix it.. actually I would like to upgrade using my linux box
[09:46:58] <xaxes> instead of some crappy, non-informative gui tools
[09:48:17] <beaky> is threre a nice command-line sim for avr?
[09:48:25] <beaky> or emulator
[09:48:34] <beaky> that integrates with gdb or something
[09:49:13] <Casper> simulator / emulators sucks, avoid them
[09:49:19] <Casper> none work well
[09:49:27] <beaky> ah good point
[09:49:39] <beaky> maybe I should just deploy it on a test board
[09:49:40] <cart_man> Sorry I got DCed for a whil there
[09:49:40] <megal0maniac> xaxes: I'm afraid I have absolutely no experience with the JTAGICE MKI. RikusW could help you maybe, though
[09:49:43] <beaky> and run it on a jtag
[09:50:12] <cart_man> RikusW is the most resourcefull guy I know O.o
[09:50:17] <xaxes> hah.. I think I know this nickname.. if Im right he helped me the last time too :)
[09:50:27] <cart_man> Probably...
[09:50:33] <megal0maniac> xaxes: He did
[09:50:47] <megal0maniac> cart_man: Are you the third South African? :P
[09:50:50] <beaky> why is the jtag useful? I never used it myself
[09:50:54] <xaxes> hehe :) okay, will see if I can find some logs ^^
[09:51:25] <beaky> my jtag is just sitting here like an expensive translucent blue brick :(
[09:51:48] <megal0maniac> beaky: Because it can program and debug on supported hardware
[09:52:32] <beaky> ah neat
[09:52:41] <beaky> I thikn I will try it
[09:53:00] <beaky> finally I will know why my controller is greenlighting two adjacent streets
[09:55:45] <megal0maniac> cart_man: Don't be shy
[09:55:51] <cart_man> megal0maniac: yea lol
[09:56:08] <cart_man> You as well
[09:56:08] <cart_man> ?
[09:56:15] * megal0maniac nods
[09:56:31] <cart_man> nice nice ! Good to know some MCU peoples around
[09:56:49] <megal0maniac> Well I'm in Cape Town. Not exactly "around" :)
[09:59:24] <cart_man> Ahh well no problem...agter im done studying Ill be going to cape town to study at Potch HOPEFULLY!
[09:59:32] <cart_man> So then ill be around the area as well
[09:59:52] <cart_man> How did you figure out that he is from South AFrica/
[10:00:45] <megal0maniac> I can't remember
[10:00:49] <megal0maniac> I've been here for a while
[10:01:05] <megal0maniac> I think someone else mentioned him when I said where I was from
[10:01:58] <cart_man> Ohh ok .... I saw his name and thought it was my friend who lives in Standerton also Rikus and his Surname also starts with W. BUT he knows nothing of MCUs or electronics so I had to ask
[10:02:12] <cart_man> at that Time he wasnt even far from Standerton O.o crazy stuff huh?
[10:02:56] <megal0maniac> I'm confused. Cape Town is nowhere near Potch
[10:04:09] <cart_man> Oh soz I meant Stellenbosch
[10:04:33] <cart_man> ups just said soz -.-
[10:06:27] <RikusW> cart_man: my hometown is Warden, quite close to Standerton ;)
[10:07:02] * RikusW have been busy coding a configuration terminal
[10:07:24] <RikusW> just a printf and a big switch
[10:07:34] <cart_man> If I have 8 pins all of which are from PORTB. Anyone of the pins could be a High or a Low, How can I ask the MCU to check all the pins and write what it finds in a small code form
[10:07:36] <RikusW> and did the GUI terminal too
[10:07:50] <cart_man> RikusW: Yoo Rikus
[10:07:59] <RikusW> var = PINB;
[10:08:20] * RikusW have been in the XP virtualbox...
[10:08:37] <RikusW> then I don't see pidgin messages...
[10:08:46] <cart_man> Really ? And it will write var = 01101011 ? Ghez thats much simpler then I thought
[10:08:53] <RikusW> yes
[10:09:01] <RikusW> I use hex, much faster to type
[10:09:09] <RikusW> PORTB = 0xF0;
[10:09:14] <cart_man> Oh yea no worries love them Virtual Boxes...I use to try and hack Virtual servers . LOL
[10:09:18] <xaxes> man! wrong crystal.. actually I had a 8MHz crystal, but now have the 7,.. due to the suggestion of RikusW the last time.. and woohoo, avrstudio recognizes it.. thanks again, you're awesome!
[10:09:19] <RikusW> 0xF0 = 1111 0000
[10:09:21] <cart_man> back in my sit in room alone days
[10:09:42] <RikusW> cart_man: I did put iATKOS ML2 in a VB too :)
[10:09:53] <megal0maniac> xaxes: Yay! :)
[10:09:58] <RikusW> xaxes: 7.372 ?
[10:10:04] <megal0maniac> RikusW: Pfft! I put it on my pc :P
[10:10:15] <RikusW> and it worked then ?
[10:10:24] <megal0maniac> Perfectly. Also, I finally have an AVR32 dev board
[10:10:26] <RikusW> my Intel HD isn't supported...
[10:10:33] <RikusW> which AVR32 one ?
[10:10:41] <megal0maniac> Would be running it now if my damn motherboard worked
[10:10:45] <RikusW> I have xplain 3A3, but haven't used it yet...
[10:10:50] <megal0maniac> AT32UC3A1128
[10:10:59] <megal0maniac> So 3A1
[10:11:04] <RikusW> I have 3A3256
[10:11:26] <megal0maniac> From http://www.aery32.com/
[10:11:42] <megal0maniac> It's their rev0 board, so less flash
[10:12:08] <RikusW> I paid R270 or so
[10:12:15] <RikusW> and its got hi-speed USB
[10:12:21] <megal0maniac> I paid EUR5 :)
[10:12:23] <cart_man> lol Rikus you have the Mac OS on your virtual machine?
[10:12:40] <RikusW> cart_man: yes :) and its graphics is SLOW
[10:12:48] <xaxes> RikusW: yeah :)
[10:12:51] <cart_man> awwww yea HD stuff
[10:12:51] <cart_man> agm
[10:12:53] <RikusW> megal0maniac: I want to use it for high speed data
[10:13:01] <cart_man> you have a Graphics card in yoru PC right?
[10:13:09] <RikusW> only on CPU
[10:13:13] <cart_man> You can give it more Video memory
[10:13:15] <cart_man> ohhh ahhhhhh
[10:13:15] <RikusW> Pentium G2020
[10:13:22] <cart_man> yea youre out of luck buddy
[10:13:31] <RikusW> and VBox don't support acceleration for mac...
[10:13:47] <xaxes> wooop, got my programmer working again :) *happy* .. as I remembering there was a way to lock the memory of the atmega16 to not be able to rewrite it, right? ^^
[10:13:48] <megal0maniac> Ah, nice. It's R370 now
[10:14:03] <cart_man> isnt that a pretty old CPU?
[10:14:05] <megal0maniac> xaxes: Not entirely true
[10:14:19] <xaxes> from external*
[10:14:20] <RikusW> cart_man: actually G2020 is a 2013 CPU
[10:14:26] <RikusW> cart_man: the only reason I have it is to see how easy/hard it will be to port sw to mac
[10:14:41] <RikusW> I installed XQuartz to enable xlib
[10:14:44] <megal0maniac> The lockbits prevent you from reading the firmware, but they are cleared by chip erase
[10:14:56] <megal0maniac> Which implies that it does not protect from chip erase :)
[10:15:07] <RikusW> megal0maniac: I got the 3a3 from arrow not RS
[10:15:10] <cart_man> Ohh I see
[10:15:26] <xaxes> mhh damn ^^
[10:15:35] <RikusW> but getting stuff from them is a chore....
[10:15:51] <megal0maniac> RikusW: Yeah, you said they don't like small orders
[10:16:03] <megal0maniac> xaxes: But you can't really accidentally program the thing..
[10:16:27] <xaxes> okay.. so setting this bit should be all, right?
[10:17:14] <megal0maniac> Shouldn't be necessary unless you don't want to be able to read it back (used to protect from cloning)
[10:17:40] <megal0maniac> Which, unless you've made some clever modifications, doesn't apply to you
[10:18:21] <megal0maniac> And there he goes
[10:18:23] <xaxes> The mkI boots with a period where you're able to upgrade it.. I think I bricked it last time trying to flash the target while in this 'boot'mode
[10:18:48] <xaxes> +it was
[10:18:52] <megal0maniac> xaxes: Then don't do that :)
[10:19:02] <xaxes> accident ;)
[10:19:34] <xaxes> costs me several hours .. but to avoid the research again, I gonna make a git repo for private usage with images and a short howto ;)
[10:19:50] <megal0maniac> Otherwise you can connect an LED to a free pin, and modify the JTAG firmware to make the pin high when the program starts. That way, you'll know it's ready for use
[10:20:18] <xaxes> currently in boot-mode the connected LED blinks heavily ;)
[10:21:25] <[z_z]> what is the difference between these two architectures? ucr3 ucr3fp
[10:21:44] <RikusW> floating point ?
[10:24:01] <cart_man> RikusaWay: Shoulndt I say (bit_is_clear(PINC,5)) first?
[10:25:00] <RikusaWay> PINC is input
[10:25:04] <RikusaWay> PORTC output
[10:25:12] <RikusaWay> DDRC is pin direction
[10:25:31] <RikusaWay> bit clear -> PORTC &= (1<<5);
[10:25:43] <RikusaWay> bit clear -> PORTC &= ~(1<<5);
[10:25:58] <RikusaWay> bit set -> it clear -> PORTC |= (1<<5);
[10:26:10] <RikusaWay> paste fail
[10:26:19] * RikusaWay is going cycling for a bit
[10:28:22] <cart_man> SOrry cellphone
[10:28:32] <cart_man> yea but if I want check the whole port
[10:28:43] <cart_man> would it still be var = PORTB
[10:29:22] <cart_man> Oh ...lol went cycling
[10:30:15] <RikusaWay> var = PINB; to read
[10:30:23] <RikusaWay> PORTB = var; to write
[10:30:29] <megal0maniac> IRC on a bicycle? Impressive :)
[10:30:33] <RikusaWay> and now I'm really going ;)
[10:30:36] <rue_house> #define IsHigh(BIT,BYTE) ((BYTE & (1<<BIT)) != 0)
[10:30:36] <rue_house> #define IsLow(BIT,BYTE) ((BYTE & (1<<BIT)) == 0)
[10:30:36] <rue_house> #define SetBit(BIT,BYTE) BYTE |= (1<<BIT)
[10:30:36] <rue_house> #define ClearBit(BIT,BYTE) BYTE &= ~(1<<BIT)
[10:30:37] <RikusaWay> lol no
[10:30:47] <rue_house> sorry I forgot I'm supposed to post those every week
[10:31:06] <rue_house> where ofcourse BYTE is PORTx or PINx
[10:33:18] <megal0maniac> AVRs :D http://i.imgur.com/EX9fvHU.jpg
[10:33:24] <megal0maniac> Not including Arduino
[10:34:13] <cart_man> Thanks and enjoy
[10:34:13] <twnqx> lol @ "5V intolerant"
[10:34:45] <megal0maniac> ^^ OndraSter
[10:35:12] <megal0maniac> And lol @ my bad soldering on the Aery32
[10:35:45] <tzanger> man some of the pdfs I've downloaded are really obscure
[10:36:01] <tzanger> a paper on flywheel explosions from an insurance perspective from the 19th century?
[10:36:09] <twnqx> lol
[10:36:35] <tzanger> I've got hte Intel LPC spec too
[10:36:58] <tzanger> lol
[10:37:15] <tzanger> marriage is like a deck of cards. in the beginning all you need is two hearts, but by the end all you want is a club and a spade
[10:37:48] <theBear> heh
[10:39:48] <tzanger> NATO handbook on emergency war surgery?
[10:40:26] <twnqx> ummm
[10:42:12] <tzanger> lots of volumetric display docs
[11:03:07] <cart_man> RikusaWay: Are you back yet?
[11:03:17] <RikusaWay> just now
[11:03:32] <cart_man> Could youplease do me a favour and check a really short piece of code?
[11:03:37] <RikusW> ok
[11:04:42] <cart_man> http://bpaste.net/show/tYkWCCCC8ungUQOXa597/
[11:05:16] <cart_man> I just need it to take whats on its PORTD in total and put it into an INT var and then I need it to set OCR0A to it ?
[11:06:01] <RikusW> var = PORTD; this is AVR not PIC :-D
[11:06:05] <RikusW> var = PIND;
[11:06:38] <RikusW> and you'd probably want to enable pullup on B0
[11:06:40] <cart_man> Oh shit :s
[11:06:46] <RikusW> D0
[11:06:53] <RikusW> PORTD = 0b00000001; //enable pullup
[11:07:01] <cart_man> knew i was going to get confused ... I code Pics aswell
[11:07:05] <cart_man> yea but I dont want pullups
[11:07:05] <RikusW> ddr=0 port=1 -> pullup
[11:07:11] <RikusW> ah
[11:07:20] <cart_man> its sourcing from another Atmega
[11:07:26] <cart_man> soo direct input is fine
[11:07:28] <RikusW> don't worry I've read from PORT too :) even recently...
[11:07:30] <cart_man> :) thanks allot thought
[11:07:38] <cart_man> lol...weird it doesnt even complain
[11:07:45] <RikusW> why would it ?
[11:08:00] <RikusW> you're just reading the contents of PORTD
[11:08:10] <RikusW> whatever you set it to previously
[11:08:47] <RikusW> cart_man: why not use hex ? 0x01 ?
[11:09:00] <cart_man> ahm I dont know really
[11:09:01] <RikusW> much faster to work with once you're used to it
[11:09:09] <cart_man> the 0b000000 just stuck I guess
[11:09:14] <RikusW> heh
[11:09:15] <cart_man> well I will try
[11:09:21] <cart_man> I do every now and then
[11:09:49] <RikusW> and do use proper bitnames with other registers
[11:09:59] <RikusW> I've seen it move around on occasion
[11:10:12] <RikusW> so its a good thing for portability between avrs
[11:11:57] <cart_man> wait bitnames?
[11:12:56] <cart_man> Sorry im not really in a daily AVR environment im actually doing all this from my house, So dont know the lingo to well
[11:14:31] <cart_man> Sorry got Diconnected
[11:18:43] <RikusW> (1 << OCIE0A)
[11:18:43] <RikusW> thats the bit name
[11:18:43] <RikusW> OCIE0A
[11:18:43] <RikusW> the 1<< converts it to a bitmask
[11:24:11] <cart_man> I stil find those a little confusing though probably because there's so manny to learn and also switching from Microchip to AVR and back is such a drag with those things
[11:35:55] <RikusW> same can be used on PIC..
[11:40:57] <megal0maniac_afk> RikusW> PORTD = 0b00000001; //enable pullup
[11:40:59] <megal0maniac_afk> RikusW> PORTD = 0b00000001; //enable pullup
[11:41:01] <megal0maniac_afk> RikusW> PORTD = 0b00000001; //enable pullup
[11:42:34] <twnqx> <megal0maniac_afk> RikusW> PORTD = 0b00000001; //enable pullup
[11:42:42] <twnqx> more amplification?
[12:14:38] <beaky> if I fail to set DDR and output on a pin, what happens?
[12:15:06] <[w_w]> hmm. 0b... thats some new binary literal thing gcc has now right? thats not always been supported.
[12:16:02] <beaky> yes
[12:16:05] <beaky> it's a gcc extension
[12:16:14] <beaky> a really convenient one though :D
[12:16:22] <[w_w]> beaky, the IO section of the datasheet gives a nice diagram with signal names and how they are hooked up to the actual pin.
[12:16:46] <[w_w]> i don't think anything happens.
[12:16:48] <beaky> ah
[12:16:59] <beaky> I love IO, IO is so easy
[12:17:06] <beaky> digital IO*
[12:26:56] <tzanger> 0bxxx has been around for a long long long time
[12:27:15] <beaky> I'm surprised it isn't standard
[12:27:38] <beaky> at least it's standard 'in practice' i.e. any compiler worth their salt supports binary literals
[12:28:57] <tzanger> GCC, TCC and Clang all support it apparently
[13:07:24] <RikusW> megal0maniac_afk: seems the AERY32 is rather pricy ?...
[13:32:37] <Amadiro> RikusW, doesn't look unreasonable to me, but certainly can't compete with many others
[13:32:46] <Amadiro> I wouldn't consider it worth the investment, though
[13:34:48] <RikusW> them 3a3 xplain board is $29
[13:35:00] <RikusW> direct from atmel
[13:37:08] <Amadiro> is that the same chipset?
[13:37:31] <beaky> what are the xplain boards for?
[13:37:42] <Amadiro> educational purposes
[13:37:54] <beaky> ah
[13:37:58] <beaky> they're like demos?
[13:38:09] <beaky> demos for a chip
[13:38:44] <Amadiro> beaky, they are evaluation boards with a bunch of peripheral you can program yourself (but they also come with demos)
[13:39:02] <Amadiro> I have one with an atxmega, and it has an LCD, a realtime clock, some EEPROM and some capactive touch sensors onboard
[13:39:26] <Amadiro> and some LEDs and dip switches, I guess
[13:49:30] <Badaboom> Can someone check my work and see if theres a betetr way to SPI over the USI on the attiny2313?
[13:49:37] <Badaboom> better
[14:12:15] <RikusW> http://www.bunniestudios.com/blog/?p=2407
[14:20:00] <Fleck> old RikusW :D
[14:27:41] <RikusW> older than you I bet ;)
[14:28:26] <Badaboom> Still neat tho:)
[14:28:41] <RikusW> even if its Arduino
[14:28:48] <Badaboom> lol
[14:28:53] <RikusW> 25k Arduinos...!
[14:29:14] <RikusW> seems like the old beta/vhs thing...
[14:29:15] <Badaboom> I love anything to do with electronics,, even arduinos
[14:29:23] <Badaboom> lol,, yep
[14:29:51] <Badaboom> Named after a King Arduino
[14:29:52] <RikusW> though nothing prevents you using an Arduino board for AVR C development
[14:30:11] <Badaboom> Yep
[14:30:55] <Badaboom> The only think i have against Arduino is the size of their bank account;)
[14:31:33] <tld> I have a buspirate v3, but I'm thinking about ordering a second one. I see there's v3.6 and v4 now. Anyone been following the development and have any wise words on which to get?
[14:34:27] <beaky> why is arduino so popular
[14:34:49] <Amadiro> beaky, it's simple to use, has lots of add-ons that are also simple to use, and is (well, used to be) cheap
[14:35:15] <tld> beaky: it feels safe.
[14:35:28] <tld> beaky: it's presented to people as something they can do. not scary.
[14:35:29] <Amadiro> It also has a wiki that helps beginners to get started, has lots of examples, tutorials, and whatnot
[14:35:43] <tld> beaky: it's like ruby on rails.
[14:37:01] <RikusW> AVR is easy too... just get a breadboard..
[14:37:21] <tld> RikusW: AVR is just as easy, arduino just *feels* easier.
[14:38:09] <Badaboom> tld: to some
[14:39:50] <tld> to some, and probably on average. (if you measure by head-count, not by hours spent on it)
[14:40:39] <tld> but… I'm off. take care guys. :)
[14:46:11] * RikusW is installing Quartus II web on Linux :)
[14:46:41] * Badaboom is working on Scary atmega644
[14:47:09] * RikusW will be working on even scarier Altera MAX II
[14:47:18] <Badaboom> lol
[14:47:24] <RikusW> maybe an FPGA sometime
[14:47:30] <Badaboom> Nice
[14:47:44] <RikusW> Already got the MAX II board
[14:47:58] <RikusW> got it for $10 from buybuyfast.com
[14:48:10] <RikusW> EPM240T100C5N
[14:48:14] <RikusW> *EPM
[14:48:16] <twnqx> :/
[14:48:35] * RikusW correcting correct stuff :-P
[14:48:38] <Badaboom> btw that "data sheet" was a joke
[14:48:45] <twnqx> :(
[14:48:47] <RikusW> which one ?
[14:48:49] <Badaboom> yeah:(
[14:49:01] <twnqx> what was it?
[14:49:03] <Badaboom> twnqx: it had the dimensions,,,
[14:49:07] <twnqx> lol
[14:49:10] <Badaboom> im like wtf
[14:49:13] <Badaboom> lmao
[14:49:38] <twnqx> so
[14:49:41] <twnqx> grab a phone
[14:49:43] <twnqx> go reversing
[14:49:45] <twnqx> :]
[14:49:46] <Badaboom> At least send me where the vcc vdd enable etc etc
[14:49:56] <Badaboom> I gonna have to
[14:49:58] <tzanger> quartus on linux is nice
[14:50:01] <Badaboom> No way around it
[14:50:12] <tzanger> I'm installing Quartus 13 on a windows vm for my sockit seminar tomorrow
[14:50:30] <twnqx> heh, i have ISE 13 iny a VM
[14:50:35] <twnqx> though i wanted to try somethign
[14:50:45] <twnqx> i seem to remember something i came across on the internets
[14:51:02] <twnqx> a driver for impact/platform cable usb ii on linux
[14:51:18] <tzanger> eh?
[14:51:23] <tzanger> impact/platform cable?
[14:51:40] <twnqx> xilinx' fpga programming software / jtag hardware
[14:51:58] <Casper> twnqx: I once went close to make a script to ban "invalid" names... your would have triggered it :D
[14:52:16] <tzanger> ah
[14:52:17] <twnqx> why :(
[14:52:32] <twnqx> i am using this nick for a decade.. or even more :(
[14:52:37] <tzanger> probably lack of vowels
[14:52:42] <Casper> yup
[14:52:55] <Casper> I was in a channel that we got lots of issues with spammers
[14:53:08] <Casper> and they used random letters
[14:53:15] <Badaboom> fml,, erase command by accident
[14:53:24] <Casper> most of them wasn't pronouncable, like your
[14:53:29] <twnqx> this is a perfect, short, collision-free nick
[14:53:37] <twnqx> noone else is using it on the net :/
[14:54:04] <[w_w]> so id sdhfj :P
[14:54:06] <Casper> so the script I wanted to do was basically: for each letter, check the next one, if it do not work, increase the likellyness of a ban
[14:54:23] <twnqx> good you didn't, then!
[14:54:53] <Casper> tw wn nq qx I doubt those are valid in a normal nick :D
[14:55:13] <twnqx> ouch! don't just take me apart
[14:55:14] <RikusW> tzanger: I downloaded the linux version, seems the device support files for win/lin are identical
[14:55:17] <Amadiro> RikusW, that's more of a CPLD than an FPGA...
[14:56:50] <RikusW> it seems like a hybrid
[14:56:53] <megal0maniac> RikusW: They had an offer (I think it's still valid) where they gave away rev0 aery32 boards. Same board but with minor differences, and 128K flash instead of 256K. Paid EUR5 for shipping and nothing else
[14:57:07] <twnqx> ah, that offer
[14:57:22] <RikusW> megal0maniac: is it still available ?
[14:57:22] <megal0maniac> They had 10 of them. I think only two have been taken so far. One of those was me
[14:57:32] <megal0maniac> RikusW: I think so. Ask in #aery32
[14:57:34] <RikusW> link ?
[14:57:45] <megal0maniac> Freeeeeeenode :)
[14:57:59] <RikusW> only 5E ? :)
[14:58:24] <megal0maniac> Well the shipping cost
[14:58:35] <Amadiro> RikusW, it looks *really* tiny, I doubt you'll be able to put a microcontroller core on there or something like that
[14:58:51] <RikusW> Amadiro: its just to toy around with
[14:59:01] <RikusW> get my feet wet with verilog
[14:59:34] <megal0maniac> Not VHDL? :)
[14:59:39] <RikusW> maybe that too
[14:59:43] <twnqx> verilog > vhdl
[14:59:45] <Amadiro> RikusW, check out the ECP3 versa kits from lattice, I think those are a good deal too
[14:59:52] <megal0maniac> twnqx: Why?
[14:59:58] <twnqx> it's more C-like :P
[15:00:01] <Amadiro> 100USD for a PCIe card with a smallish FPGA on it
[15:00:19] <RikusW> megal0maniac: where did you hear about the rev0 boards ?
[15:00:20] <Amadiro> 2 gigabit ethernet ports, 128MiB RAM (AFAIR), 4 SERDES channels
[15:00:28] <twnqx> RikusW: here
[15:01:09] <megal0maniac> RikusW: kobsu posted a link to an avrfreaks forum post. He's one of the devs
[15:10:32] <hwgasdfasdf> I have an interesting problem with sleep mode / external interrupts
[15:10:33] * RikusW got ping of 236 seconds :S
[15:11:17] <hwgasdfasdf> if I go into idle sleep, occasionally (probalby 1 in 1000 times), my external interrupt fires, and my ISR never gets called
[15:11:37] <hwgasdfasdf> pin is being held low by the device that's interupting
[15:11:58] <hwgasdfasdf> if I force the interrupt pin high, and then let it fall low agian, the ISR is called, and everything continues as normal
[15:12:18] <hwgasdfasdf> if I never go into sleep mode, there's never a problem
[15:12:40] <hwgasdfasdf> the external interrupt is set for falling edge
[15:17:14] <megal0maniac> Casper: What would your filter do with that nick? :P
[15:19:29] <Casper> first, it would translate 0 to 0
[15:19:59] <Casper> and then check all the letters pairs, and would find that all are normally found in words
[15:20:07] <Casper> so would give it a perfect clean score
[15:20:30] <Casper> oh you mean hwwhatever?
[15:21:14] <Casper> would probably have found hw gw df df...
[15:21:54] <megal0maniac> Yeah, that
[15:22:34] <Casper> the ratio of good/bad would have been too bad, so might have trigged it
[15:22:48] <megal0maniac> I rate it would've.
[15:22:54] <megal0maniac> What was this for, anyway?
[15:23:06] <Casper> boss
[15:23:06] <Casper> bbl
[15:49:40] <Badaboom> twnqx: gonna try to open one this evening,, illo have to scope it and check the voltages etc
[18:23:06] <thetruthisoutthe> hahah http://www.halicery.com/8042/dasm42.c
[19:19:42] <hwgasdfasdf> no one has any ideas about my interrup problem?
[19:19:50] <hwgasdfasdf> interrupt
[19:25:27] <thetruthisoutthe> what?
[19:25:51] <hwgasdfasdf> I have an interesting problem with sleep mode / external interrupts
[19:26:02] <hwgasdfasdf> if I go into idle sleep, occasionally (probalby 1 in 1000 times), my external interrupt fires, and my ISR never gets called
[19:26:13] <hwgasdfasdf> if I force the interrupt pin high, and then let it fall low agian, the ISR is called, and everything continues as normal
[19:26:16] <Tom_itx> pin is being held low by the device that's interupting
[19:26:18] <Tom_itx> the external interrupt is set for falling edge
[19:26:32] <hwgasdfasdf> yes
[19:26:38] <Tom_itx> doesn't sound like a good combination
[19:26:42] <thetruthisoutthe> if it needs clock and you sleep and no clock then it wont work
[19:26:50] <Tom_itx> if it's held low it won't fire on the falling edge
[19:26:50] <hwgasdfasdf> the edge is getting missed somewhere during sleep mode
[19:27:16] <hwgasdfasdf> well, it is high, then it goes low to interrupt, but is held low until the ISR reads the status register of the external part
[19:27:20] <hwgasdfasdf> but the ISR never fires
[19:27:35] <Tom_itx> i don't know much about sleep mode
[19:31:27] <sabesto> hwgasdfasdf: which uC+
[19:31:28] <sabesto> ?
[19:33:45] <hwgasdfasdf> atmega 1284p
[19:33:56] <hwgasdfasdf> and avr-gcc
[19:34:12] <hwgasdfasdf> and I'm doing sleep mode the way it's recommended in the manual
[19:35:01] <hwgasdfasdf> (the avr-gcc manual)
[19:38:48] <sabesto> edge or level triggered?
[19:39:24] <sabesto> because it must be held in the interrupt state for some time so that the uC can wake up
[19:39:33] <sabesto> maybe the pulse it too short
[19:40:02] <hwgasdfasdf> it's edge triggered
[19:40:16] <hwgasdfasdf> and it is held, until the ISR reads the status register via spi
[19:40:24] <sabesto> hm
[19:40:26] <hwgasdfasdf> and it works 999/1000 times
[19:40:40] <hwgasdfasdf> but every once in a while, the ISR doesn't fire, and then it gets stuck
[19:41:09] <hwgasdfasdf> other interrupts still work, but that external interrupt pin is held low, and because there's never a falling edge again, the ISR never gets called
[19:41:50] <Horologium> http://feedproxy.google.com/~r/hackaday/LgoM/~3/bgyXZ-J2WEc/
[19:41:55] <hwgasdfasdf> if i force the pin high overriding the external part driving it low, then let it go back low, the ISR fires, and then everything works as it should, until it happens the next time
[19:42:01] <Horologium> CO2 encased homemade reflow oven.
[19:42:24] <sabesto> could you try a level interrupt instead just for testing? that will obviosly trigger all the time untill you read out the data
[19:42:37] <hwgasdfasdf> I could, yes...
[19:42:38] <Engen> Hi, is it ok to ask for arduino help here?
[19:42:47] <Horologium> you can ask.
[19:42:48] <Tom_itx> oh i suppose
[19:42:54] <Tom_itx> but just one question
[19:42:55] <Horologium> we generally aren't ardweenies in here though.
[19:42:56] <Tom_itx> so make it good
[19:44:47] <Tom_itx> they are after all just innocent avrs that someone captured to punish
[19:45:06] <Engen> Ok, so this is what I'm trying to do: http://pastie.org/7981872 and this is the code I have: http://pastie.org/7981901 end problem is that it takes 4 seconds of a constant low input to actually turn on the egg LED (motor) from when the signal is given and then as soon as the signal disappears, the LED (motor) turns off straight away
[19:51:27] <hwgasdfasdf> my code essentially doesn't work at all with a level sensitive interrupt
[19:53:28] <sabesto> Engen: what are the high/low freq pins for?
[19:54:27] <Engen> when the car reaches a certain point
[19:54:50] <Engen> there is a sound module which when triggered by our moving car with IR LEDs, produces a sound
[19:55:31] <Engen> we then have a circuit that picks up either sound (produces 2 different frequencies) and outputs a low when either is received
[19:55:39] <Engen> otherwise it outputs high
[19:55:53] <Tom_itx> is that circuit working?
[19:56:01] <Engen> oh ye
[19:56:08] <Tom_itx> how do you know?
[19:56:38] <Engen> because this code works
[19:56:38] <Engen> http://pastebin.com/gVEC3C4v
[19:57:21] <Engen> but that only runs the egg motor as long as there is a constant input which we do not have
[19:58:10] <Tom_itx> so add a delay before it shuts off
[19:58:49] <Tom_itx> hear sound -> turn motor on -> delay -> turn motor off
[19:59:01] <Engen> delay stops all input/output
[19:59:24] <Tom_itx> so maybe you need an interrupt input instead then
[19:59:42] <Engen> "No other reading of sensors, mathematical calculations, or pin manipulation can go on during the delay function, so in effect, it brings most other activity to a halt. "
[20:00:04] <Tom_itx> who said that?
[20:00:12] <sabesto> basicly; http://pastebin.com/Xd0i4VvP
[20:00:37] <Engen> http://arduino.cc/en/Reference/Delay
[20:00:59] <Tom_itx> sabesto, i think he want's to read the other signal so he knows when to switch functions
[20:02:13] <Engen> receive signal for short period of time > turn off motor 1 > turn on motor 2 for ~15s > turn off motor 2 > turn on motor 1
[20:02:29] <sabesto> obviosly, the code i pasted is not functioning, just the idea
[20:02:32] <Tom_itx> rinse and repeat?
[20:02:37] <Tom_itx> yes
[20:02:49] <Tom_itx> or is this a one shot run
[20:02:53] <Engen> Tom_itx: it only needs to do one run
[20:03:55] <Tom_itx> why are you reading high and low at the same time then?
[20:04:21] <hwgasdfasdf> I don't think my library would ever work with level sensitive interrupts, becaue this ISR depends on the SPI, which is also all interrupt driven
[20:04:32] <Engen> Tom_itx: which line?
[20:04:34] <Tom_itx> you want to read one frequency to do something and you want to read another frequency to do soemthing else
[20:04:37] <hwgasdfasdf> so I can't make this ISR blocking to prevent being called infinitely
[20:04:40] <sabesto> Engen: i think your code needs a fair bit of rework
[20:04:43] <Tom_itx> 25
[20:04:51] <Tom_itx> 31
[20:05:12] <sabesto> but if this is the only thing it has to do you can just use a delay
[20:05:21] <Engen> because we don't know which frequency the marker is going to make the module produce we run off either
[20:05:40] <Tom_itx> so either one can turn it on or off
[20:05:58] <Engen> yes, either frequency (signal).
[20:06:01] <Tom_itx> is this a school assignment?
[20:06:21] <Engen> first year uni course
[20:07:13] <sabesto> i would use a timer interrupt to handle the delays, but thats not implemented in arduino for some reason
[20:07:52] <Tom_itx> i would use int0 int1
[20:08:17] <sabesto> that too
[20:08:41] <sabesto> hwgasdfasdf: i dont know, never had this problem
[20:08:51] <Tom_itx> i couls write it for you but since it's school, i won't
[20:08:55] <Tom_itx> could*
[20:09:54] <Tom_itx> and god help us all if we've resorted to teaching ardweenine at uni level courses
[20:09:58] <sabesto> isnt this late for a school project?
[20:10:17] <Engen> late as in?
[20:10:22] <sabesto> Engen: what course btw?
[20:10:32] <sabesto> i'm done for this summer
[20:10:36] <Tom_itx> Engen, look at int0 int1 as a solution
[20:10:46] <Tom_itx> use those as inputs for your signals
[20:11:09] <Tom_itx> and use the external interrupt
[20:11:15] <hwgasdfasdf> sabesto: are there any cases you know of where an edge can be lost? if global interrupts are disabled, and an edge happens during that time, the ISR should fire after global interrupts are re-enabled shouldn't it?
[20:12:09] <sabesto> hwgasdfasdf: i belive so, its the same thing that happens when interrupts happen while another it executing
[20:12:15] <hwgasdfasdf> Tom_itx: I know a place where a first year computing course for engineers is taught in Matlab, so go figure
[20:12:44] <hwgasdfasdf> and all grad students, save a few, do everything in matlab, and then wonder why they can't do anything in realtime
[20:13:10] <hwgasdfasdf> in comp-sci and ee / cmpe
[20:13:39] <hwgasdfasdf> so arduino isn't very shocking (to me at least)
[20:14:27] <Tom_itx> Engen, another thing.. you are continually looping so as soon as the signal dissappears it will turn off again
[20:14:36] <sabesto> yes
[20:14:54] <Tom_itx> try 'while' instead of 'if' to wait for the signal
[20:14:58] <Tom_itx> possibly
[20:16:34] <Tom_itx> Engen how long do the signals sound?
[20:16:46] <Tom_itx> that's how long your motors will run with exhisting code
[20:16:51] <Engen> I know
[20:16:57] <Engen> hence trying to fix it
[20:16:57] <Tom_itx> do you see why?
[20:17:03] <Engen> only a second or two
[20:17:17] <Tom_itx> line 25 and 31 are the culprits
[20:17:53] <Tom_itx> so lets see...
[20:18:16] <robotustra_> oh, long day
[20:18:22] <hwgasdfasdf> damn, I probably need an in circuit debugger to figure this out, and I don't have one
[20:20:28] <Tom_itx> Engen, starting at line 25
[20:20:30] <Tom_itx> while (digitalRead(highFreqPin) == LOW || digitalRead(lowFreqPin) == LOW)
[20:20:30] <Tom_itx> {};
[20:20:30] <Tom_itx> digitalWrite(outputEgg, LOW);
[20:20:30] <Tom_itx> digitalWrite(outputMotor, HIGH);
[20:20:52] <Tom_itx> it will wait for either pin to go high
[20:21:07] <Tom_itx> then write to the chicken and egg
[20:21:31] <Engen> outside of the brackets?
[20:21:40] <Tom_itx> well of course
[20:21:48] <Tom_itx> you want it to wait for the signal don't you?
[20:22:29] <Engen> yes
[20:22:34] <Engen> it drives along
[20:22:38] <Engen> triggers the sound
[20:22:40] <Engen> gets the sound
[20:22:51] <Sam0b1100> Hi
[20:22:52] <Engen> stops, delivers the egg, keeps move
[20:23:07] <Tom_itx> so write that senario in code
[20:23:44] <Tom_itx> what i said will wait for a signal to begin
[20:24:16] <Tom_itx> what you just said doesn't agree with that
[20:24:35] <Engen> but I still come to the same issue of only receiving a signal for only a small amount of time
[20:24:52] <Tom_itx> you just said: 1. it drives along 2. triggers the sound 3. gets the sound
[20:24:55] <Sam0b1100> I have a basic asm program: loop: rjmp loop, and when I do "avra <filename.asm>" it says it is 2 bytes, but if I open <filename>.asm.hex, it doesn't have two bytes, more like 50. What happened?
[20:25:15] <Tom_itx> Sam0b1100, overhead
[20:25:23] <Sam0b1100> What? I'm new.
[20:27:09] <Tom_itx> Engen, if you use external interrupts it will get the signal even with a short time period
[20:27:34] <Sam0b1100> Shouldn't the hex file be only instructions and data to be loaded into the memory?
[20:28:10] <Sam0b1100> I don't have anything else but the two instructions, no directives.
[20:28:30] <sabesto> Sam0b1100: http://en.wikipedia.org/wiki/Intel_HEX
[20:28:43] <Sam0b1100> ok, but why Intel?
[20:28:47] <Engen> Tom_itx: the car drives along with 4 IR LEDs along the side. when it comes next to the 'control module' the IR triggers the module and the module produces a sound (can be one of two frequencies). our circuit picks up that sound and outputs a low with either sound. arduino takes in signal > stop moving > deliver > start moving.
[20:28:55] <Tom_itx> Sam0b1100, cause that's what avr uses
[20:29:05] <sabesto> its a file format, thats what they decided to use
[20:29:12] <sabesto> no need to reinvent the wheel
[20:29:21] <Tom_itx> rue did
[20:29:27] <Sam0b1100> who?
[20:29:30] <Tom_itx> rue
[20:29:38] <Tom_itx> he reinvented the wheel
[20:29:48] <Tom_itx> used brainfuck to program an avr
[20:30:12] <Sam0b1100> neat. pure?
[20:30:16] <Sam0b1100> with no asm?
[20:32:23] <Sam0b1100> Anyway. So the CPU parses the intel hex?
[20:32:23] <sabesto> asm (or optcode which it turns into) is the only thing the uC understands
[20:32:34] <sabesto> no, the programmer does
[20:32:54] <Sam0b1100> But, I load the intel hex to the avr, then what?
[20:33:05] <Tom_itx> add power
[20:33:10] <Tom_itx> and wait for it to run
[20:33:25] <MarkX> hey
[20:33:36] <Sam0b1100> What does the CPU (or uC in this case) do next?
[20:33:44] <Sam0b1100> Hi MarkX!
[20:34:02] <sabesto> starts doing the instructions loaded to it
[20:34:18] <Sam0b1100> what about the byte counts and addresses?
[20:34:28] <Sam0b1100> What does it do with those?
[20:34:34] <MarkX> quick question, i was looking at this code >> https://diyps3controller.googlecode.com/svn-history/r4/trunk/ps-2/usb_joystick.h << there are a few lines "#define EP_TYPE_*" followed by a hex number, where is that number from?
[20:34:43] <sabesto> first hits the interrupt vector table, reset vector comes first and it points to the first instruction in "main"
[20:34:53] <sabesto> Sam0b1100: nothing
[20:34:57] <sabesto> it isnt loaded
[20:35:01] * Tom_itx sees why abcminiuser didn't like the help desk very much
[20:35:07] <Sam0b1100> What?
[20:35:24] <sabesto> the hex file isnt directly put on the micro
[20:35:24] <MarkX> is it from the USB standard? or just a number made up by the writer to differentiate the different endpoint types?
[20:35:36] <Sam0b1100> Why?
[20:35:44] <Sam0b1100> What format then?
[20:35:50] <sabesto> 01010010101
[20:36:15] <Sam0b1100> Where? Can't I do that without intel hex? Why intel hex?
[20:36:19] <sabesto> but the extra info in the file tells the programmer where to put the data
[20:36:33] <Sam0b1100> what does that instruction mean anyway.
[20:36:44] <Sam0b1100> Programmer? Me?
[20:37:02] <Sam0b1100> you mean hardware programmer right?
[20:37:03] <Tom_itx> no the programming device
[20:37:07] <sabesto> the device that transfers the data to the micro
[20:37:30] <Sam0b1100> i'm using arduino uno with avra and avrdude.
[20:37:40] <Sam0b1100> and a USB cable :)
[20:38:18] <sabesto> the programmer is programmed in a special area of the memory of the "arduino"
[20:38:47] <MarkX> Tom_itx: any ideas? you're usually always there to lend a hand ;)
[20:38:50] <Sam0b1100> How can I get the plain instructions then of the binary code?
[20:39:13] <Sam0b1100> For modification :)
[20:39:29] <Sam0b1100> I want to get down to that level for fun.
[20:40:25] <Tom_itx> what is EP_TYPE ?
[20:40:31] <Sam0b1100> I'm on Cygwin, wishing I was on Linux, and I'm building LFS on another computer.
[20:40:37] <sabesto> it will be a pain in the ass to modify the hex file
[20:40:42] <Sam0b1100> Why?
[20:40:49] <Sam0b1100> People did a while ago.
[20:41:02] <sabesto> because you have to "disassemble" it
[20:41:18] <Tom_itx> MarkX, those are probably numbers from whatever EP_TYPE is
[20:41:23] <Sam0b1100> Why? can't I edit the machine code?
[20:41:29] <sabesto> http://www.atmel.com/images/doc0856.pdf
[20:41:33] <Sam0b1100> I've got opcode tables
[20:41:41] <Sam0b1100> what is that?
[20:41:49] <sabesto> the instruction set
[20:41:59] <Sam0b1100> Opcode table?
[20:42:18] <Sam0b1100> But how to I get to the instructions from a hex file...?
[20:42:20] <Tom_itx> MarkX, END POINT TYPE ?
[20:42:27] <MarkX> Tom_itx: yes
[20:42:56] <MarkX> Tom_itx: thats why im confused. are they defined by the programmer? or from the usb spec?
[20:43:02] <Sam0b1100> you mean amtel, right?
[20:43:08] <Tom_itx> maybe those are defined for the controler itself
[20:43:47] <Sam0b1100> link won't go.
[20:44:11] <MarkX> you mean possibly shown somewhere in the documentation of the atmega i'm using?
[20:44:16] <Tom_itx> MarkX, i bet abcminiuser has a ps3 example
[20:44:44] <MarkX> nah, this isnt ps3 specific, that code actually is written by the teensy guy
[20:44:45] <sabesto> Sam0b1100: this maybe: http://www.avrfreaks.net/index.php?func=viewItem&item_id=272&module=Freaks%20Tools
[20:44:52] <Tom_itx> paul
[20:44:55] <MarkX> pjrc
[20:45:04] <Sam0b1100> How do I get that in the browser??
[20:45:10] <MarkX> i see it in all the code examples hes posted (god bless him)
[20:45:15] <Sam0b1100> (emacs erc)
[20:45:27] <sabesto> MarkX: maybe vendor stuff from usb spec + driver dependent
[20:45:29] <MarkX> (and yes i know the channels .... disliking .... of him :P )
[20:45:38] <Tom_itx> i don't know where it comes from unless it's something needed to emulate the ps3 control
[20:46:01] <Sam0b1100> 8-bit avr instruction set?
[20:46:09] <Sam0b1100> 155 pages?
[20:46:28] <MarkX> nah, its in every "usb.h" which he uses for usb related stuff
[20:46:35] <Sam0b1100> atmel, you are right.
[20:46:57] <Sam0b1100> link works.
[20:47:47] <Sam0b1100> that's ASM instructions, not opcodes.
[20:48:07] <Tom_itx> abc has a joystick demo
[20:48:35] <sabesto> the last link is a tool to read the files
[20:48:53] <MarkX> does it use VUSB or LUFA?
[20:48:55] <Sam0b1100> What one? avrfreak one?
[20:48:57] <sabesto> you calculate the optcode from the instruction set, or the other way
[20:48:59] <sabesto> yes
[20:49:09] <Sam0b1100> how do I copy that?
[20:49:15] <Tom_itx> MarkX, it IS lufa
[20:49:34] <MarkX> hehe not going to lie...LUFA confused me more
[20:49:46] <Tom_itx> but he's usually here to help
[20:49:53] <Sam0b1100> how do I copy it?
[20:49:58] <Sam0b1100> the link.
[20:50:12] <MarkX> yep i've seen him before. in the mean time i'll just make note and carry on
[20:50:15] <MarkX> thanks as always Tom_itx
[20:50:21] <sabesto> there are probably 100 different IRC clients, how on earth could i know
[20:50:26] <Tom_itx> can't help with those defines...
[20:50:29] <Sam0b1100> ERC on emacs
[20:50:37] <Sam0b1100> cygwin on win7
[20:50:43] <sabesto> dont know
[20:50:48] <Sam0b1100> ok.
[20:50:51] <MarkX> yea but he might be able to shine some light on if the type needs to get defined or not
[20:51:34] <sabesto> MarkX: you trying to hook a PS3 controller to an uC or emulate a controller?
[20:51:42] <Tom_itx> emulate
[20:52:00] <MarkX> sabesto: neither actually, that was just some random code i found online to showcase my problem
[20:52:18] <MarkX> i'm just trying to get a "hello world" going with the usb source that pjrc provided
[20:52:44] <Sam0b1100> I will try that. Thanks.
[20:52:51] <MarkX> but stumbled upon #define EP_TYPE_CONTROL 0x00 #define EP_TYPE_BULK_IN 0x81 #define EP_TYPE_BULK_OUT 0x80
[20:52:52] <sabesto> havent seen anyone interface with a ps3 controller using bluetooth on a uC yet
[20:52:55] <MarkX> and i have no idea what they do
[20:53:01] <sabesto> it would be really handy
[20:53:04] <Sam0b1100> (I wrote it in by hand)
[20:53:06] <Sam0b1100> bye
[20:53:17] <sabesto> cya
[21:03:51] <MarkX> oh yea, one more question, how secure is a program once its been flashed to an AVR mcu?
[21:04:00] <Sam0b1100> hi again, it only seems to edit hex and 16 bit binary, what about 8 bit binary?
[21:04:21] <MarkX> can it be ripped out and disassembled? or can the mcu be flashed with another program?
[21:04:28] <Tom_itx> sure can
[21:04:37] <Tom_itx> or just saved and reflashed
[21:04:59] <sabesto> MarkX: you can lock it from being downloaded
[21:05:01] <Tom_itx> i think the lock bits are supposed to help but i've never used them
[21:05:09] <sabesto> Sam0b1100: the instructions are 16 bits
[21:05:33] <Sam0b1100> Oh, I forgot. ok, little endian?
[21:05:37] <Sam0b1100> I think so
[21:05:46] <sabesto> yes
[21:05:49] <MarkX> ah, so in devices which don't use fpgas or ASICs, do they often use AVR and lock it down?
[21:06:21] <Tom_itx> there ain't a horse that can't be rode or a cowboy that can't be throwed
[21:06:30] <Sam0b1100> gives me 0000: CFFF
[21:06:35] <Sam0b1100> not binary
[21:06:43] <Engen> Tom_itx: thank you. got to run.
[21:06:56] <MarkX> Tom_itx: hahhaha well said
[21:07:05] <Sam0b1100> Why?
[21:07:25] <sabesto> Sam0b1100: noone reads in binary
[21:07:36] <sabesto> hex is the preferred
[21:07:36] <Sam0b1100> nor hex, so...
[21:07:40] <Sam0b1100> why?
[21:07:48] <sabesto> CFFF is hex
[21:08:00] <Tom_itx> 0xCFFF is hex
[21:08:02] <sabesto> because its much easier to read
[21:08:12] <Sam0b1100> opcode tables don't list that, and each bit will change the number
[21:08:22] <Sam0b1100> yes, I do know number systems
[21:08:43] <sabesto> i dont even understand what you are trying to do
[21:08:49] <Sam0b1100> Have fun!
[21:09:04] <Sam0b1100> Does it need to have another purpose?
[21:09:09] <sabesto> then download atmel studio and write programs in asm
[21:09:38] <Sam0b1100> asm is good, but it's not raw machine code
[21:10:00] <Sam0b1100> avra is better than atmel studio, and I like open source.
[21:10:55] <sabesto> if you want to program in optcode because you dont think asm is the same i wont bother helping, if you want to do it for fun, fine
[21:11:15] <Sam0b1100> ok, but why are you agaist optcode?
[21:11:24] <Sam0b1100> or opcode, as I learned it.
[21:11:26] <sabesto> because its pure stupidity
[21:11:30] <Sam0b1100> Why?
[21:12:00] <Sam0b1100> I could then say ASM is pure stupidity, because C is faster to make something in.
[21:12:00] <sabesto> asm is just about the same, but 100 times easier to read and program in
[21:12:08] <Sam0b1100> Why the same?
[21:12:22] <sabesto> its just a simple math conversion
[21:12:28] <Sam0b1100> What?
[21:12:44] <Sam0b1100> Oh, I get it.
[21:13:01] <Sam0b1100> Still, I want to at least learn opcode.
[21:13:05] <Sam0b1100> for fun
[21:13:07] <sabesto> its like writing an essay in ascii codes
[21:13:15] <Sam0b1100> That would be fun!
[21:13:16] <sabesto> exactly the same
[21:13:22] <Sam0b1100> for you?
[21:14:05] <Sam0b1100> I need to go now, so bye, I'll see you later. (bedtime over here)
[21:14:10] <Sam0b1100> bye
[21:14:52] <MarkX> that was interesting
[21:14:57] <sabesto> how is it even possible
[21:15:43] <MarkX> how is what possible
[21:16:08] <sabesto> that guy
[21:16:12] <MarkX> hehe
[21:16:20] <MarkX> ah well
[21:16:29] <MarkX> i'm not one to hate
[21:16:40] <MarkX> im still trying to get hello world running over usb
[21:16:40] <MarkX> XD
[21:28:48] <MarkX> Tom_itx: i figured it out!
[21:29:05] <Tom_itx> do tell
[21:30:53] <MarkX> well in the avr doc it talks about a register "UECFG0X – USB Endpoint Configuration 0 Register". Bit 7:6 – EPTYPE[1:0]: Endpoint Type Bits (defined in a table below) and Bit 0 – EPDIR: Endpoint Direction Bit.
[21:31:11] <MarkX> an Interrupt EP type is "1,1"
[21:32:06] <MarkX> so if we want interrupt we do "1100000X" (where X can be our specified direction)
[21:32:29] <MarkX> in the code, it is "#define EP_TYPE_INTERRUPT_IN 0xC1"
[21:32:45] <MarkX> 0xC1 = 11000001
[21:32:47] <MarkX> :)
[21:33:19] <[w_w]> I'm trying to compile for an at32uc3c2512c but i don't know if it is an at32uc3c2512c or a at32uc3c2512crevc... regardless, when I specify -mpart uc3c2512crevc -march ucr3fp i get bad part/arch combo... any ideas about the right comno?
[21:34:06] <Tom_itx> you might ask in #avr32
[21:34:10] <Tom_itx> or is it ##
[21:34:12] <Tom_itx> i forget
[22:01:03] <MarkX> is there an advantage of allocating 16 bits of memory to 2 banks over 32 bits to one bank?
[22:24:38] <rue_bed> heard of the at91 usb to serial windows driver?
[22:25:15] <Tom_itx> rue_bed link to your brainfuck avr compiler
[22:25:28] <rue_bed> uh, hmm
[22:25:46] <rue_bed> tutorials/prog/avrbf?
[22:26:05] <Tom_itx> the site that mentioned it...
[22:27:10] <rue_bed> http://eds.dyndns.org/~ircjunk/tutorials/prog/avrbf/main.html
[22:27:16] <rue_bed> which site?
[22:27:44] <Tom_itx> oh my mind draws a blank
[22:28:16] <rue_bed> that would be cool if someone had some interest in it
[22:28:39] <Tom_itx> you've landed there a couple times
[22:29:24] <rue_bed> where? I had nothing to do with it
[22:30:57] <rue_house> whats at91 anyhow
[22:31:06] <rue_house> the usb chips are megas ?
[22:31:36] <rue_house> my vaccation was so long, how can tommorow be thursday
[22:31:55] <Tom_itx> at90usb162
[22:32:02] <rue_house> ah
[22:32:03] <Tom_itx> aka atmega32u2
[22:32:06] <Tom_itx> same animal
[22:32:09] <Tom_itx> but newer
[22:32:09] <rue_house> know lik to windows driver?
[22:32:14] <rue_house> ah
[22:32:18] <Tom_itx> FLIP
[22:32:24] <rue_house> Mircom is using it
[22:32:33] <rue_house> for their sercurrity access panels
[22:32:41] <Tom_itx> isp
[22:32:44] <Tom_itx> or usb
[22:32:47] <Tom_itx> access
[22:32:51] <rue_house> I was happy to see a major commercial project with an avr under the hood
[22:33:09] <rue_house> they populated the jtag port too
[22:33:32] <rue_house> flip is programmer?
[22:33:44] <rue_house> man I'm still half asleep
[22:33:50] <Tom_itx> flip is a program
[22:33:53] <Tom_itx> like DFU
[22:34:08] <rue_house> oh right
[22:34:19] <rue_house> what did I use it for...
[22:34:28] <Tom_itx> doesn't give you access to the fuses though
[22:34:33] <Tom_itx> it uses the bootloader
[22:34:39] <rue_house> no, I dont want to program it
[22:35:06] <Tom_itx> what then?
[22:35:15] <rue_house> there must be a generic usb to serial emultor, they didn't put the right windows drivers for the usbtoserial emulation on the disk
[22:35:35] <rue_house> its a securrity panel, I'm using it, not reprogramming it :)
[22:35:39] <Tom_itx> dean has a serial emulator
[22:36:10] <rue_house> yea, I need an .inf file for making widnwos understand its just usb2serial
[22:36:24] <Tom_itx> umm
[22:36:40] <Tom_itx> i'm not sure
[22:40:22] <MarkX> anyone know if visual studio plugins work with atmel studio?
[22:40:59] <Tom_itx> maybe under 6.x but i'm not sure
[22:41:15] <Tom_itx> since it uses visual studio
[22:41:37] <MarkX> yea i'm on 6.1
[22:41:55] <MarkX> the collapser is ticking me off so i'm going to try and install a better plugin for it