#avr | Logs for 2013-05-17

Back
[00:33:07] <Xark> dunz0r: It makes the compiler "extra stupid" (e.g., "load from x, store to x, load again from x" etc.).
[00:48:45] <GuShH> Xark: I'd say less convoluted for human readability purposes instead :p
[00:54:11] <Xark> Same thing. :)
[01:05:49] <GuShH> amee2husky: http://i.imgur.com/dct3Sjj.jpg
[02:26:12] <vectory_> just to see if i understood it, using an rc filter on fixed freq pwm signal will not produce a smooth analogue signal, but one with discrete steps, yes?
[02:27:01] <vectory_> i expect there is a way to convert to smooth analogue, as its done in calss-d amps
[02:27:08] <vectory_> class-d, even
[02:38:26] <Fleck> hey, how do you use latches, I tried CD74HCT259, kinda not bad, but I have to use 6 AVR pins to control 8-Bit latch
[02:38:33] <Fleck> small gain imo :)
[02:38:52] <Fleck> *avr io lines
[02:41:25] <vectory_> Fleck: to use it with a shift register needs only what, three i/o pins. one for IN on the shiftreg, one for the clock on the shiftreg and one enable / chip select on the latch
[02:42:05] <Fleck> ohh, shift registers - unknown to me, cool, will go learn! :) thx vectory_
[02:42:18] <vectory_> oth you can possibly select 4 different latches, with only two more lines in your setup
[02:42:42] <vectory_> and a 2 to 4 decoder :X
[02:44:16] <Fleck> neet to look at old mobos, maybe some shift regs are there...?!?
[02:51:33] <Xark> Fleck: Maybe _really_ old ones. :)
[02:54:12] <Fleck> Xark: yep, have 486 mobos here - many... )
[02:54:22] <Fleck> Socket 7 :)
[02:54:55] <Fleck> ohh, those are pentiums, not 486
[03:04:00] <vectory_> RikusW: hey, your doing a gps module, right? when your done i expect a write up like this, too :) http://www.holmea.demon.co.uk/GPS/Main.htm#
[03:04:16] <RikusW> heh
[03:04:40] <RikusW> I'm not doing it _that_ low level ;)
[04:08:00] <twnqx> thetruthisoutthe: still says "water clear" for the LED you linked
[04:11:21] <OndraSter__> http://s3-ec.buzzfed.com/static/enhanced/webdr03/2013/5/16/10/enhanced-buzz-26452-1368715544-1.jpg
[04:11:22] <OndraSter__> :D
[04:11:27] <OndraSter__> hackvana will like it
[04:12:15] <hackvana> Poms will believe anything.
[04:12:26] <hackvana> Including that Fosters is beer.
[04:12:44] <OndraSter__> it came from this
[04:12:44] <OndraSter__> http://www.buzzfeed.com/daves4/hardest-parts-about-living-in-new-zealand
[04:18:19] <twnqx> hackvana: come over to germany, holsten is here brewing fosters in license
[04:18:31] <twnqx> totally different from the australian crap :S
[04:19:07] <twnqx> (i had an australian fosters in dubai... boy, that was bad)
[04:19:26] <hackvana> Yeah, almost as bad as the big americans
[04:22:06] <OndraSter__> that's why I am worried to go to the USA
[04:22:08] <OndraSter__> beer!
[04:23:25] <twnqx> that's the only reason? :P
[04:23:43] <OndraSter__> :)
[04:28:53] * amee2husky slurps GuShH's nose :D
[04:42:17] <thetruthisoutthe> twnqx<= datasheet states colormixing capabilities,... and since the size is 1.6mm, RGB are pretty close.
[04:42:43] <thetruthisoutthe> less than 1mm apart
[04:45:13] <Tom_itx> http://www.electronicproducts.com/Passive_Components/Magnetics_Inductors_Transformers/Magnetic_vortex_antennas_may_aid_wireless_transmission.aspx
[04:45:31] <RikusW> vectory_: NextTask in that article is way worse than using goto :-P
[04:46:07] <vectory_> RikusW: i didnt read it that intensively. just scrolled to the pretty pictures :)
[04:46:57] <vectory_> and the part where it says he had been playing with fpga implementations of software synth <something i dont know> for 4 years
[04:47:20] <RikusW> just use fine
[04:47:22] <RikusW> find
[04:48:16] <vectory_> "I've been building experimental fractional-N synthesizers" that O_o
[04:50:25] <vectory_> goto isnt that bad. if you write asm you have jmps all over the place, too
[04:50:46] <vectory_> noone complaining about jmps, demanding calls instead
[04:51:10] <twnqx> i had enough gotos in my basic programming days
[04:52:20] <vectory_> and it horrible indeed, i take it. wrote my first programm in VB :)
[06:08:21] <Fleck> vectory_:, Xark: after searching for few hrs, I found this: http://pdf1.alldatasheet.com/datasheet-pdf/view/15371/PHILIPS/74F166.html and http://pdf1.alldatasheet.com/datasheet-pdf/view/15360/PHILIPS/74F138.html
[06:15:58] <beaky> hello
[06:16:28] <beaky> when I try to run my program in the simuator, the simulator/debugger thingy crashes. why is that? :(
[06:27:21] <twnqx> lol
[06:27:25] <twnqx> sorry :/
[06:27:50] <beaky> I've read my code many times over, and I'm sure I'm not doing anything illegal: http://ideone.com/HgOzAw
[06:28:06] <beaky> I am targeting an ATmega16
[06:28:15] <beaky> and I doulble-checkd my compiler and debugger settings
[06:28:26] <twnqx> wow, that's an interesting approach
[06:29:54] <twnqx> anyway, first of all, regardless if your program is correct or not, the simulator/Debugger shouldn't crash
[06:30:18] <beaky> right I'll try reinstalling avr studio 4
[06:31:38] <beaky> or maybe my code/data is too big?
[06:32:31] <beaky> but it's binary size is smaller than an older version that worked perfectly
[06:32:32] <twnqx> maybe try as 6?
[06:32:49] <beaky> right I think I'll try the newer atmel studio
[06:33:07] <beaky> but when I run my code on that, the debugger doesn't respond :(
[06:33:17] <twnqx> oh.
[06:33:25] <twnqx> well, i never used the debugger :/
[06:33:33] <twnqx> or emulator, or AS :X
[06:33:40] <beaky> how do you guys make sure your code is correct?
[06:33:52] <twnqx> put it in the chip, run it
[06:33:59] <Fleck> we test it :)
[06:34:08] <twnqx> debug via LEDs or rs232
[06:34:10] <beaky> ah; I wish I had a chip, board, and programmer handy atm :(
[06:34:12] <kobsu> or mock the registers and write unit test
[06:34:30] <twnqx> i wish that would work
[06:34:52] <twnqx> oh how i loved the sudden out-of-sequence transmissions on CAN once the packet rate jumped...
[06:35:43] <beaky> or maybe I am doing something magical in my code that works on conventional platforms but is evil to do on the avr?
[06:37:21] <twnqx> except that your array_size uses a concept i haven't seen before
[06:37:46] <twnqx> but *a and the usuak a[0] should be identical
[06:38:56] <beaky> yeah a decomposes to ptr to a[0] in expressions
[06:39:55] <twnqx> your data structures are too complicated to follow immediately, but i guess i grasped the concept - i don't see anything that shouldn't work
[06:40:22] <megal0maniac> Quick suggestions for achieving this? "I want to use the .red light. contact closure output from a broadcast mixer to interact with a PC.s video output. Basically the PC screen changes to an .ON-AIR. image when the contact closes and then goes back to what it was doing once the contact opens again"
[06:40:51] <megal0maniac> s/./"
[06:45:38] <megal0maniac> Considered attiny with vusb, or parallel port. But not sure what to do on the application side
[06:45:43] <megal0maniac> (On the PC_
[06:45:44] <megal0maniac> )
[07:03:28] <beaky> how do I save power on my avr?
[07:06:08] <Horologium> turn it off when not in use.
[07:06:36] <Horologium> beyond that, it all depends on what you are doing with it...
[07:06:50] <Horologium> you can put it into one of a couple of different low power modes when it's not doing things.
[07:06:52] <twnqx> beaky: in your particular case
[07:06:56] <twnqx> #include <avr/sleep.h>
[07:07:12] <twnqx> somewhere during init
[07:07:14] <twnqx> set_sleep_mode (SLEEP_MODE_IDLE);
[07:07:20] <twnqx> in your mainloop
[07:07:26] <twnqx> while (1)
[07:07:26] <twnqx> sleep_mode ();
[07:07:30] <twnqx> or the for loop you use.
[07:07:34] <beaky> ah thanks :D
[07:07:45] <beaky> won't that shut down the io too?
[07:07:56] <twnqx> no, it shuts down the cpu sore
[07:08:07] <twnqx> don't go beyond idle, or the timer interrupts won't wake it up :P
[07:08:14] <twnqx> cpu core*
[07:08:23] <beaky> ah that's genius!
[07:08:37] <beaky> I thought I would need to play with watchdog timers
[07:10:31] <twnqx> you want to read on the various sleep modes and the active parts of the chip during them
[07:14:18] <tzanger> yep, sleep mode is awesome
[07:14:36] <tzanger> what's even more awesome is that pin detect is asynchronous so it will wake you up even if the I/O clock is stopped
[07:15:35] <twnqx> you mean external interrupts?
[07:15:51] <tzanger> no, pin change interrupts
[07:15:58] <tzanger> external interrupts need i/o clock, they're synchronous
[07:16:15] <twnqx> uh... then that probably differs between chips
[07:16:23] <tzanger> yes, I expect it does. I'm on attiny13a
[07:17:30] <beaky> what is the biggest avr I can buy?
[07:17:32] <tzanger> INT0 only fors for level detect in power down
[07:17:49] <twnqx> some avr32 :P
[07:17:59] <beaky> are there ones with enough pins to control my 1024-led LED cube?
[07:18:01] <beaky> :D
[07:18:14] <twnqx> if you multiplex, yes
[07:18:19] <beaky> ah what's a multiplex
[07:18:24] <twnqx> 1024 is a weird number, btw
[07:18:34] <twnqx> can't be a cube :P
[07:18:35] <beaky> yeah it's made up :D
[07:18:48] <twnqx> i am considering a 4096 LEDs one
[07:18:51] <twnqx> 8x8x8
[07:23:02] <twnqx> hackvana: can you have PCBs made with a transparent solder stop? :>
[07:24:58] <tzanger> that is a *pile* of LEDs
[07:25:28] <twnqx> 1.5 reels :P
[07:25:52] <twnqx> just not sure how to solder that
[07:25:59] <twnqx> transparent pcbs would be cool
[07:26:23] <twnqx> but getting them in 2mm wide stripes...
[07:34:23] <RikusW> OndraSter__: someone stole you xboard name... http://www.southtrader.co.za/shop/xboard-v2-a-bridge-between-home-and-internet-arduino-compatible/
[07:35:53] <beaky> how do I change the clock speed of my avr?
[07:36:18] <twnqx> parts by using the prescaler fuses
[07:36:27] <twnqx> parts by supplying an external clock
[07:36:58] <beaky> ah
[07:39:36] <beaky> what is the best frequency for my ATmega16?
[07:39:52] <beaky> I think 1MHz would be good enough for my purposes
[07:40:30] <OndraSter__> RikusW, AWW
[07:40:32] <OndraSter__> that hurts
[07:40:47] <RikusW> you were first :-D
[07:41:08] <OndraSter__> I wanted to change the name anyway
[07:41:13] <OndraSter__> something that isn't TM or R-ed
[07:52:25] <Kev-> Anyone got clever tips on how to cut these damn things cleanly? http://www.ebay.com/itm/5Pcs-2-54mm-2-x-40-Pin-Double-Row-Female-Pin-Header-/140780836520?pt=LH_DefaultDomain_0&hash=item20c73116a8
[07:58:09] <RikusW> Kev-: you'll have to pull out two pins first
[07:58:25] <RikusW> and use a utility knife
[07:58:40] <RikusW> I did split a 2x5 that way, but its effort
[07:59:07] <RikusW> so you'll lose 2 pins unfortunately
[08:02:17] <tzanger> Kev-: a cut-off wheel in a dremel works wonders
[08:02:37] <tzanger> btu yes you will always lose two pins or end up with "questionable" two pins
[08:06:33] <edmont> hi
[08:06:55] <edmont> is it not posible to perform a software reset in atmega128rfa1?
[08:08:52] <twnqx> jmp 0
[08:08:53] <twnqx> :>
[08:09:14] <edmont> twnqx: i want to switch to the bootloader
[08:13:15] <OndraSter__> turn on watchdog
[08:13:20] <OndraSter__> and "forget" to reset it :)
[08:14:37] <edmont> hehe, that was my idea
[08:16:08] <tzanger> you can also turn the reset pin into an output and drive it low
[08:18:11] <OndraSter__> tzanger, not really
[08:18:17] <OndraSter__> you'd have to have second pin controlling the reset
[08:18:27] <OndraSter__> you can't "turn reset into output"
[08:18:33] <OndraSter__> if you mean RSTDSBL fuse
[08:18:38] <OndraSter__> it will be output/input forever
[08:18:42] <OndraSter__> resetting won't work
[08:21:37] <tzanger> OndraSter__: no, I mean setting the reset io pin to an output and driving it low. it works, at least on attiny13a
[08:21:44] <tzanger> i.e. do not disable rstdsbl
[08:21:48] <OndraSter__> huh
[08:21:52] <tzanger> if you do disable it then it's just an i/o and you can't reset
[08:21:52] <OndraSter__> you can set it as an output?!
[08:22:24] <OndraSter__> maybe some tiny speciality
[08:22:24] <tzanger> I have to test it again, before I was disabling the reset function I was getting goofiness because of it
[08:22:27] <OndraSter__> I don't remember it being possible
[08:22:28] <tzanger> perhaps yes
[08:30:29] <beaky> Alright my code is finally working and runs perfectly in the simulator :D how do I get it into my chip?
[08:30:52] <OndraSter__> what programmer and OS?
[08:31:25] <beaky> I am using atmel studio 6 on windows xp
[08:31:40] <OndraSter__> and programmer?
[08:31:47] <beaky> I am the programmer :D
[08:31:56] <OndraSter__> the device you want to use to programm your chip with
[08:32:03] <beaky> ah; I don't have one of those :(
[08:32:35] <beaky> damn
[08:33:04] <twnqx> Oo
[08:33:04] <Valen> what is the chip?
[08:34:01] <beaky> it is an ATmega16(l)
[08:34:35] * beaky is new to avr
[08:35:02] <Valen> is it on some kind of breakout board?
[08:35:13] <beaky> yes it is on a breadboard
[08:35:40] * beaky googles for "breakout board"
[08:35:42] <beaky> ah no
[08:36:07] <beaky> it's just stuck on a breadboard (that I also picked up from the store)
[08:36:08] <twnqx> well, you can build the simplest of programmers with a parallel port and some passive components
[08:37:10] <beaky> so there are 3 special pins with which I can hook my atmega up to a PC?
[08:37:31] <twnqx> four, if you include ground
[08:37:38] <twnqx> or is it even 5
[08:37:43] <twnqx> reset, miso, mosi, clk, gnd
[08:37:46] <beaky> ah
[08:37:58] <twnqx> sclk* or whatever it is called
[08:39:40] <Badaboom> + - Clock Miso Mosi Rst
[08:40:47] <Badaboom> beaky: im no expert tho
[08:40:58] <Badaboom> by a long shot
[08:41:54] <Valen> stupid internets
[08:41:56] * twnqx wonders what this adapter he is looking at is
[08:42:39] <beaky> programming a chip is so complicated :( I'm used to programming being as easy as typing make :D
[08:42:49] <twnqx> it is
[08:42:55] <twnqx> i type "make program" for that
[08:43:02] <twnqx> :P
[08:43:12] <OndraSter__> beaky, complicated?
[08:43:13] <tzanger> it's very easy. you have sck, miso, mosi and reset. you use avrdude and away you go
[08:43:15] <OndraSter__> hook the programmer to the chip
[08:43:16] <OndraSter__> yep
[08:43:25] <beaky> now I have to worry about crazy acronyms such as PIN0, +GND, Vss, TIN, and I must be careful not to short my connections and overvolt them :D
[08:44:39] <beaky> I guess I must build one of those parallel port thingies and hook them up to my PC with a USB to parallel serial adaptor
[08:45:36] <OndraSter__> usb to parallel serial? :D
[08:45:51] <twnqx> if you don't have a parallel port
[08:46:03] <twnqx> just go straight for a usb to ISP adapter
[08:46:25] * beaky uses some modern laptop that is too thin to have a parallel female thing
[08:46:36] <beaky> ah
[08:46:51] <twnqx> there are hundreds of programmers for ISP out there
[08:46:59] <theBear> usb parports don't work like real ones
[08:47:05] <twnqx> that too
[08:47:13] <theBear> he's got a programmer, but he won't tell us what it is
[08:47:45] <beaky> It's a USB thingy; I thought a programmer was a different beast with those parallel hooks
[08:48:22] <theBear> see :)
[08:49:59] <theBear> also won't say where it came from or what he actually asked to buy , which would both be good indicators of what it was
[08:50:03] <thetruthisoutthe> what makes a `static void' function not work defined as `void'?
[08:50:45] <twnqx> a header file where it is not defined as void?
[08:51:21] <thetruthisoutthe> i mean compile, but not work
[08:51:31] <twnqx> err
[08:51:32] <thetruthisoutthe> doing something weird
[08:51:38] <twnqx> what you show code
[08:51:49] <beaky> alright my avr came from a store called Greens Digital Electronics LLC
[08:51:54] <twnqx> and/or explain how you make it work
[08:53:16] <theBear> wow obscure ! you in bahrain ?
[08:54:47] <beaky> http://www.yellowpages-uae.com/profile/dubai/greens-digital-electronics-l-l-c-/66180.yp
[08:55:29] <thetruthisoutthe> twnqx<= having a hard time figuring out what is going on right now, no idea
[08:56:13] <theBear> yeah, that doesn't really tell us what the programmer is, what does lsusb say about it ?
[08:56:32] <theBear> oh, you got a stupid os... what does taskmanager call it ?
[08:56:36] <thetruthisoutthe> if i have function name collision then gcc should warn me
[08:56:54] <twnqx> *should* :P
[08:57:09] <beaky> http://extremeelectronics.co.in/software/extreme-burner-avr-1-3-beta-test/ this is my programmer software
[08:57:42] <twnqx> and the hardware?
[08:58:14] <thetruthisoutthe> atmega168pa
[08:58:29] <beaky> http://www.atmel.com/devices/atmega16.aspx the ATMEGA16L-8PU variant
[08:58:34] <theBear> http://www.fischl.de/usbasp/ your programmer look like that ?
[08:58:38] <twnqx> no, the programmer harware...
[08:58:57] <theBear> EXACTLY like that
[08:59:06] <beaky> yes
[08:59:09] <thetruthisoutthe> beaky<= still don't know what programmer you have?
[08:59:21] <beaky> it looks like that and for some reason it has an atmega8 on it
[08:59:41] <twnqx> sounds right
[09:00:16] <beaky> maybe I need to setup my mcu first somehow before I can use a USB programmer
[09:00:34] <beaky> or maybe my chip is dead :D
[09:00:46] <twnqx> nah, you need to connect your mega8 to the programmer :P
[09:01:21] <thetruthisoutthe> twnqx<= can it be avrdude's fault failing to write flash above 8k ?
[09:01:41] <twnqx> only if your chip has less
[09:01:47] <thetruthisoutthe> 16k
[09:01:49] <twnqx> i wrote my 30kB programs alright :P
[09:01:49] <theBear> the plot thickens ofcourse .... hours last night didn't get any of this info out of him, but he insists it can program someone elses chips, but he got 3 new ones it won't program, course we couldn't even consider that until we had this info
[09:02:15] <thetruthisoutthe> but apparently avrdude fails in reading eeprom too
[09:02:34] <thetruthisoutthe> it usually writes random nonsense counter values when i program
[09:02:38] <twnqx> there was something about avrdude and 168ps...
[09:02:41] <twnqx> pas*
[09:02:46] <theBear> beaky, how do you connect your chip to that programmer ?
[09:02:51] <twnqx> can't remember where i saw it somewhere this week
[09:03:56] <beaky> there's a socket on the board and you can press the chip into it and lower some handle so it sticks
[09:04:50] <theBear> beaky, so you saying it's NOT that board
[09:05:14] <beaky> yeah, but it's almost similar
[09:05:29] <theBear> half the pcbs on the planet are 'similar' !
[09:05:39] <theBear> twnqx, see ? like getting blood from a stone
[09:10:44] <beaky> alright I found the solution to my problem :D
[09:11:29] <beaky> I need to use one of these first: http://www.atmel.com/tools/AVRISPMKII.aspx to load some special bootloader thing to my avr, then I can use the usb programmer :D
[09:11:47] <theBear> no, you don't ! that's why there's already a chip on there
[09:12:13] <Valen> beaky: might I suggest taking a photo of whatever it is you are trying to do?
[09:12:41] <Kev-> yay, got a package from oshpark
[09:12:45] <Kev-> http://imgur.com/Uu6E7p6
[09:12:53] <Kev-> Apparently black is the new purple
[09:13:29] <Valen> gold plated too?
[09:13:41] <Kev-> Isn't it always from oshpark?
[09:14:01] <Valen> never used it
[09:20:04] <Badaboom> mmmm, bacon and eggs:)
[09:21:00] <RikusW> http://www.goodluckbuy.com/iphone-4-outlook-defibrillator-self-defense-tools.html
[09:22:16] <theBear> i wonder if they understand that stungun and defibrillator are different things
[09:22:32] <Badaboom> lol,, look alike iphone thatll get ya going,, litteraly
[09:23:04] <RikusW> well you might need a defibrillator after using that phone :-P
[09:23:09] <Badaboom> lol
[09:23:28] <theBear> YOU might... bears got unatturally resiliant hearts
[09:23:32] <Badaboom> can ya feel me now?
[09:24:05] <theBear> nah, you too far away
[09:24:16] <Badaboom> lol
[09:36:54] <Badaboom> Hmm,, do i work on the code or do i work on the schematic
[09:41:25] <Badaboom> or
[09:41:35] <Badaboom> do i Leave the Gun and Take the Cannoli?
[09:42:55] <theBear> mmm cannolia
[09:43:04] <Badaboom> huh?
[09:43:18] <Badaboom> lol
[09:43:21] <Badaboom> Hungry?
[09:43:51] <theBear> desperately, you know how to cook beans on their own ?
[09:44:11] <Badaboom> ya put them in a pot
[09:44:16] <Badaboom> or pan
[09:44:55] <Badaboom> how the hell do you afford internet but now food?,,lol
[09:46:00] <theBear> i owe money on the net too
[09:46:09] <theBear> but that's once a month, food runs out twice a month
[09:46:09] <Badaboom> lol..man
[09:46:24] <theBear> course if i don't have the net i can't put money on my card or pay my bills
[09:46:28] <Badaboom> they don't have any food banks there?
[09:46:46] <theBear> kinda, but i can't go till the 10th
[09:47:03] <Badaboom> ahh
[09:47:38] <Badaboom> my father helped build a homeless shelter here localy and it has a food bank attached to it
[09:47:53] <theBear> yeah, we don't got anything like that
[09:47:54] <Badaboom> Hes a civil engineer
[09:48:09] <megal0maniac> theBear: Where are you?
[09:48:13] <theBear> there's a soup kitchen once a week, but to get the bus there costs more than that much soup
[09:48:15] <theBear> west of australia
[09:48:32] <megal0maniac> Ah
[09:48:52] <Badaboom> hmm
[09:50:39] <Badaboom> west of ausi?
[10:16:44] <raden> I have a company that wants me to change the password codes on a microcontroller .... can someone explain to me the following code ?
[10:16:46] <raden> http://pastebin.com/rtktCpEi
[10:18:48] <vectory_> do we get payed then?
[10:19:32] <theBear> i worked it out, but vectory has a good point
[10:19:37] <vectory_> best answer gets ten bitcoin ;)
[10:19:44] <raden> lol
[10:20:02] <raden> does bitcoin really exist ?
[10:20:38] <raden> ten bitcoin is like ten cents LOL
[10:20:57] <Dagger2> it's more like $1100
[10:20:59] <raden> id be happy to pay though
[10:21:12] <raden> oh crap i have it backwards LOL
[10:21:15] <theBear> i'd be happy with 20 or 30 bits of spaghetti
[10:21:22] <theBear> any lower bids ?
[10:21:25] <raden> why would a bit coin be worth so much
[10:21:41] <theBear> like any currency, it has a value
[10:21:46] <raden> seriously i just want to get this crap outta our lab
[10:21:50] <thetruthisoutthe> is it a problem if i do a tight loop in my code? will that affect the interrupt triggering negatively?
[10:21:56] <raden> this company had some dude from spain write the code
[10:22:21] <theBear> it's not rocket science, i only glanced at it for 30 seconds before it became clear
[10:22:21] <raden> And i dont quiete understand how that section all relates
[10:22:25] <theBear> and i don't even have a lab
[10:22:46] <theBear> it does kinda look like an abstract way to define a password, but i dunno what the rest of the code looks like
[10:22:55] <raden> whats clave , clave1 , clave2
[10:23:02] <theBear> variables
[10:23:12] <twnqx> probably look up the meaning in a spanish dictionary
[10:23:18] <raden> why not just make the password one variable ?
[10:23:18] <theBear> it's also pretty well commented
[10:23:24] <theBear> i didn't write it
[10:23:36] <twnqx> no arbitrary access to eeproms
[10:23:53] <theBear> ahh, that'd do it
[10:24:11] <thetruthisoutthe> do { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { keyinbuffer=key_in_tx_key_buffer(); } } while (keyinbuffer);
[10:24:22] <raden> http://pastebin.com/dXtfLcuW
[10:24:24] <raden> full code
[10:24:37] <raden> twnqx, ?
[10:25:21] <beaky> that's a lot of code
[10:25:35] <raden> thats only one part
[10:25:37] <raden> of 3
[10:28:06] <thetruthisoutthe> i don't see much code there, only redundant code
[10:29:06] <raden> redundant to say the least
[10:29:15] <raden> I have never seen so much done to store a simple password
[10:31:33] <raden> and i had to make that code run off the internal clock as well
[10:31:54] <raden> Xtal with 20 Mhz crystal times out at about 1 second every 8 seconds
[10:35:10] <john-f> looks to be splitting up the password, so it is harder to find in a eeprom dump?
[10:38:38] <beaky> http://ideone.com/LsxZ7a lines 50-72: anyone know of a way to eliminate the redundancy in those functions?
[10:39:45] <thetruthisoutthe> raden<= there is a thing called prescaler
[10:39:46] <twnqx> make another tables, one or zero for each light, and use a function that takes the vaue as paramater instead of set and reset
[10:41:39] <beaky> aha
[10:43:26] <theBear> that table a bit further down looks hopelessly redundant too
[10:44:01] <thetruthisoutthe> something is just not right with this atmega168pa
[10:44:07] <theBear> i bet rue would say somethign about state machines
[10:44:25] <beaky> I did use a state machine earlier, that turned out to be 900 lines long
[10:44:32] <beaky> ... wanna see it? :D
[10:44:33] <twnqx> what
[10:44:35] <theBear> err, you did it wrong
[10:44:38] <twnqx> indeed
[10:44:39] <beaky> ah
[10:45:03] <beaky> http://ideone.com/3Wo6iR
[10:45:36] <theBear> good god !
[10:46:06] <beaky> it works perfectly though
[10:46:58] <raden> lol
[10:47:16] <beaky> I am a beginner
[10:47:16] <theBear> however you do it, the first thing is to identify the possible different states you can need, and off the top of my head, it's maybe 4 + blinking orange, maybe more like 8 if you got turning arrows
[10:47:24] <thetruthisoutthe> make verify
[10:47:25] <thetruthisoutthe> avrdude: current erase-rewrite cycle count is 117442304 (if being tracked)
[10:47:35] <thetruthisoutthe> avrdude: current erase-rewrite cycle count is 100665088 (if being tracked)
[10:47:49] <thetruthisoutthe> 2 verifies in a row!
[10:48:32] <thetruthisoutthe> what is the latest avrdude now?
[10:48:37] <theBear> consider in a simple 2 way set of lights, that you only have 2 states if you ignore blinking orange
[10:48:51] <beaky> alright I have like 36 states: green, blink_on_1, blink_off_1, blink_on_2, blink_on_2, blink_on_3, blink_off_3, amber, red... for just one phase
[10:49:10] <theBear> but that's hopelessly redundant
[10:49:16] <beaky> ah
[10:49:25] <theBear> and blinking should be considered as one state
[10:50:30] <theBear> and if two different lights always display the same thing, they should be treated as a single light
[10:50:48] <raden> what does this do ? eeprom_write_word ( (uint16_t *) 3, clave );
[10:51:06] <beaky> my professor said that each blink should be a different state, since each blink would have a different output string, and having a single blinking state would conflate those
[10:51:27] <beaky> and also it is more easy to verify correctness
[10:52:42] <specing> raden: look at the disassembly
[10:52:49] <beaky> but yeah it makes programs look ridiculously redundant
[10:52:55] <raden> specing, ?
[10:52:58] <theBear> not just look that way
[10:53:15] <theBear> is normalisation really that hard for normal people to understand ?
[10:53:23] <thetruthisoutthe> theBear<= looks like raden wants to buy you food for this week ?
[10:53:33] <raden> lol
[10:53:45] <theBear> heh, looks like he shouldn't have his job, whatever it is
[10:54:00] <raden> This is not my Job !!!
[10:54:05] <raden> Im fixing this BS
[10:54:06] <twnqx> i know a guy who does vector graphics for international pizza orders :3
[10:54:09] <raden> so we can get this outta here
[10:54:25] <theBear> it's at your workplace, you're being paid for it, it's your job
[10:54:35] <tzanger> raden: how are you trying to fix it if you don't understand the concepts behind the function names?
[10:54:40] <raden> I dont have a work place
[10:54:43] <tzanger> or are you asing what the (uint16_t *) part is?
[10:54:44] <raden> I own the workplace
[10:55:20] * specing recommends reading the K&R
[10:55:42] <RikusW> beaky wins the prize for the longest led blinking program :-D
[10:55:47] <theBear> hehehe
[10:55:51] <tzanger> haha
[10:55:51] <beaky> hah
[10:56:22] <thetruthisoutthe> uh beaky 'static volatile enum states'
[10:56:58] <beaky> ?
[10:57:11] <theBear> i haven't done a traffic light thing since my first year of highschool, but i see it taking maybe 10 lines
[10:57:24] <specing> OMFG what is that monster program?
[10:57:26] <thetruthisoutthe> ahh, beaky you know how they write windows
[10:57:29] <theBear> actually that was more complex, it involved sensors so it worked like a real traffic light setup
[10:57:40] <thetruthisoutthe> http://ideone.com/3Wo6iR <<<
[10:58:06] <specing> omfg
[10:58:08] <beaky> I wanna refactor my code to be designed right
[10:58:15] <specing> beaky: DELETE IT
[10:58:21] <twnqx> lol
[10:58:22] <specing> RIGHT NOW
[10:58:22] <beaky> and make it dynamic so it has sensors to react to traffic
[10:58:30] <beaky> I did; that is an old version of the code
[10:58:35] <theBear> you tend to amplify congestion if you just go on flat timing, for example real lights will tend not to change if noone wants to go the other way, tho if there is a main road involved they tend to favour idling on the main road
[10:59:04] <beaky> the current version is this one: http://ideone.com/OYzGCl
[10:59:08] <thetruthisoutthe> static const volatile uint32_t ticks :)
[10:59:12] <thetruthisoutthe> like this
[10:59:22] <twnqx> > const volatile?
[10:59:28] <beaky> const volatile, oops that is a typo
[11:00:59] <RikusW> beaky: {&PORTB, _BV(PB1)},
[11:01:41] <beaky> is tha a bad thing?
[11:01:55] <thetruthisoutthe> beaky<= #define magic
[11:01:58] <RikusW> I'd put _BV in the struct init part
[11:01:59] <thetruthisoutthe> magic static const volatile uint32_t ticks = (1e-3 * (((double) F_CPU / 8.0) / ((double) TCNT0_MAX))) + 0.5;
[11:02:02] <thetruthisoutthe> :)
[11:02:35] <twnqx> thetruthisoutthe: __attribute__ ((unused))
[11:03:11] <thetruthisoutthe> that does not work for urls btw :(
[11:06:10] <Badabooma> anyone know in eagle if you can just add a part to a library without adding it in the schematic view?
[11:06:18] <thetruthisoutthe> #define magic
[11:06:18] <thetruthisoutthe> magic void clear_tx_key_buffer()
[11:07:49] <twnqx> what
[11:07:56] <twnqx> to the library?
[11:08:36] <theBear> you can add a part to the library and never use it anywhere, but i don't think that's what you meant to ask
[11:17:26] <Badabooma> twnqx: yes
[11:17:50] <twnqx> then what theBear said applies, and i dont even understand your question
[11:18:34] <Badabooma> I just want to select it when im in the board menu but i think you have to add it to both areas to make it function as a part
[11:18:35] <theBear> i'd have to say that most of the several thousand parts in the library have never been used by most eagle users
[11:18:55] <theBear> and there ya go, completely different to the question that was asked
[11:18:59] <twnqx> i don't use the eagle preshipped libraries at all...
[11:19:22] <theBear> how you gonna use something in the board view only ? you can't define connections in board view, only route them
[11:19:23] <Badabooma> theBear: exact question
[11:19:43] <twnqx> theBear: i have laymarks and logos like those :P
[11:19:43] <Badabooma> I said Can u add it without adding it to the schematic view
[11:19:46] <twnqx> layer marks*
[11:19:52] <twnqx> sure you can
[11:20:00] <twnqx> you just can connect it.
[11:20:06] <twnqx> can't
[11:20:28] <twnqx> or, well, you can even then
[11:20:31] <theBear> you said add a part to the library, the library is a library, it's not a schematic or a board
[11:20:42] <Badabooma> theBear: i dont use eagle in the schematic view
[11:20:50] <Badabooma> I make boards the old fashioned way,,,,,..... Without autorout
[11:20:58] <theBear> autoroute has nothing to do with it
[11:21:16] <twnqx> well, you should
[11:21:27] <Badabooma> theBear: if you go to add to the library it opens up the >>>>> Schematic<<<< View
[11:21:28] <twnqx> using the schematic at least makes sure you don't error
[11:22:05] <Badabooma> twnqx: i know this but i just like doing it that way
[11:22:17] <twnqx> eagle isn't meant to be used like that
[11:22:21] <theBear> the interface used to edit the library has nothing to do with how you use the library
[11:22:24] <twnqx> use a software that is
[11:22:33] <Badabooma> twnqx: it is if you want it to
[11:22:45] <Badabooma> ive done it that way for years
[11:22:53] <theBear> you can't change the intention of software just by using it in a way that it wasn't intended to be used
[11:23:02] <theBear> that's simple english comprehension right there
[11:23:17] <twnqx> moot and futile discussion, i'm out
[11:23:53] <Badabooma> eagle can be used as a board editor alone
[11:24:07] <Badabooma> its actually fantastic that way
[11:24:17] <theBear> even if that is so, it doesn't change the way the software was designed to be used
[11:24:44] <Badabooma> i didnt ask how it was designed,,just if there was a way it could be added like that
[11:24:45] <beaky> what is eagle?
[11:24:55] <twnqx> a pcb layout software
[11:24:59] <Badabooma> i know how it was designed
[11:25:50] <theBear> sigh, you said it is meant to be used in a given way if you use it that way, that is simply wrong :)
[11:26:31] <theBear> that's like saying a car is designed to be driven backwards just because you decide to drive one backwards, it doesn't mean it was meant to be used that way
[11:26:36] <Badabooma> <Badabooma> anyone know in eagle if you can just add a part to a library without adding it in the schematic view?
[11:26:53] <twnqx> theBear: leave him be
[11:26:57] <Badabooma> where did you extract that??
[11:26:59] <twnqx> pointless
[11:27:01] <theBear> yeah, that's probably best
[11:27:22] <Badabooma> ie: you dont know the answer,, maybe say idk
[11:27:37] <twnqx> Badabooma: sure you can add it to the library.
[11:27:44] <theBear> i said the answer, you just didn't like it
[11:27:54] <Badabooma> sigh
[11:28:12] <twnqx> Badabooma: nobody has any idea how you can afterwards use it the way you want, though. simple as that.
[11:28:42] <Badabooma> I guess ill just add it to the board and leave this for another day
[11:34:29] <Badabooma> aha,, once you add it,, it opens the board view:)
[11:34:59] <Badabooma> so it never adds to the library as a schematic view,, interesting
[11:35:35] <Badabooma> lemme correct that,, when you add it as a package that is
[11:42:30] <Chillance> so, the ATXmega128A4U comes without a bootloader from factory.. anyone here know a firmware that can enable in-programing over USB, so I can program it once with a separate programmer, and then over the USB?
[11:47:43] <Tom_itx> LUFA
[11:48:45] <Tom_itx> Chillance, http://www.fourwalledcubicle.com/LUFA.php
[12:58:20] <thetruthisoutthe> do you think i expect too much from my atmel mcu when i inserted this for debug? http://pastebin.com/Q6uTEeYs
[12:58:34] <thetruthisoutthe> it works on 8MHz now
[12:59:35] <thetruthisoutthe> it would only store uint8_t values in an array
[13:01:03] <thetruthisoutthe> will it help if i add a 24MHz XTAL to boost it ?
[13:06:42] <beaky> is it a good idea to initialize file-level arrays of structs?
[13:06:46] <beaky> at file-level
[13:06:48] <thetruthisoutthe> oh sry, the pointer increments are 16 bit
[13:59:35] <thetruthisoutthe> i have removed an unused function from my code and it works again
[14:03:47] <cart_man> rik
[14:07:37] <raden> Anyone looking for any coding work ?
[14:08:20] <beaky> hello
[14:08:51] <beaky> How do you guys ensure that your avr apps run in realtime?
[14:10:00] <beaky> my traffic light transitions are way more than a single instruction, so even with a precise timer interrrupt thingy, my timings are a tiny bit off :(
[14:10:21] <beaky> so I guess the solution is to make it a single instruction? :D
[14:11:13] <inkjetunito> beaky: are you using arduino or what?
[14:12:25] <beaky> I am using a plain ATmega16 on my own breadboard
[14:13:24] <twnqx> you can't make it single instruction.
[14:13:26] <inkjetunito> i suppose the timings are very little off, then
[14:13:40] <twnqx> and the few µs don't matter
[14:14:05] <beaky> so the only solution is to crank my ATmega16 from 1MHz all the way to 25MHz?
[14:15:18] <tzanger> you have a finite and unchangable number of clocks to execute an instruction. if you need more instructions, you must reduce the time between clock cycles
[14:15:21] <tzanger> there's no way around that
[14:17:39] <beaky> my data section of my proram is full of ".word 0xff ;??????"
[14:17:45] <beaky> what are those?
[14:22:34] <beaky> is it a good idea to compile my programs with -O3?
[14:23:22] <tzanger> beaky: I almost always get best results with -Os, both from a speed perspective as well as a space perspective
[14:33:13] <beaky> http://ideone.com/rY0udk how do I get the same effect of this program, but under 100 LOC?
[14:33:40] <vectory_> beaky: data gets written to flash, and flash can only be programmed after chip erase, which sets everything to one, so essentially, you save some time programming, if, and that i dont know, avrdude is clever enough to even notice
[14:33:43] <Tom_itx> write more efficiently
[14:33:53] <thetruthisoutthe> beaky<= just disable the clkdiv/8 and you already have 8MHz with internal RC oscilaltor :)
[14:34:19] <vectory_> beaky: oth, it could be anything from where i stand :X
[14:35:30] <beaky> ah
[14:35:46] <beaky> alright I will disable the /8 clkdiv
[14:35:49] <thetruthisoutthe> beaky<= Internal Calibrated RC Oscillator Operating Modes CKSEL3..0 0b0100 > 8MHz
[14:36:26] <thetruthisoutthe> you need to set fuses, but if you turn off reset, you will not be able to program it with spi anymore
[14:41:02] <thetruthisoutthe> beaky<= not sure your device will operate above 16MHz btw... it is out-of-specs
[14:41:28] <thetruthisoutthe> you may try connecting a quartz oscillator of your choice
[15:37:55] * amee2husky idly ruffles GuShH's tail :3
[15:45:41] <DrLuke> get a room
[15:47:41] <ferdna> guys planning on getting an LED backlight LCD for my laptop...
[15:48:30] <ferdna> i will need to convert AC to DC, right?
[15:48:37] <ferdna> any small circuit or recomendations?
[15:48:37] <Roklobsta> aren't they all LED now?
[15:48:44] <ferdna> idk
[15:48:49] <ferdna> mine still not
[15:48:57] <Roklobsta> my 3yo lappy has LED
[15:49:23] <Roklobsta> it burned my retinas when i first turned it on
[15:49:50] <thetruthisoutthe> leds will not burn retinas, only lasers
[15:50:38] <thetruthisoutthe> (though 3-10W leds might have 50x higher surface light flux than the sun)
[15:59:51] <cart_man> Guys what do you see is going to happen in this piece of code ? http://bpaste.net/show/1jnJv3vNCf6KwtCLu4Wi/
[16:00:09] <cart_man> Wil the WHILE break if PINC5 is LOW or HIGH?
[16:01:50] <Roklobsta> LOW
[16:03:28] <cart_man> So if a PIN = bit_is_clear(PINC,1) then it means its HIGH?
[16:04:35] <cart_man> I thought its going to remain in the LOOP while the PINC1 is LOW
[16:04:44] <cart_man> cause while its not HIGH LOOP
[16:04:56] <cart_man> dammit Im sleep deprived
[16:45:46] <chickensk> hi
[16:46:47] <chickensk> i would like to use addressed uart connection. how do i configure device address?
[16:48:10] <chickensk> datasheet writes that 9th bit could contain 1 to read address number in other 8 bits.
[16:48:34] <chickensk> but to what the uart reciever should compare it ?
[16:50:07] <specing> address
[16:51:10] <RikusW> ah MPCM mode
[16:52:04] <RikusW> seems UCSRnA = address ?
[16:53:06] <RikusW> err
[16:53:29] <theBear> sounds complicated... usually for serial bus stuff i just make up an arbitrary protocol.. if you only need a few bits per 'message' you can use the remaining bits as an address and still use nice standard 8n1
[16:53:56] <theBear> or you can use a whole byte to 'address' a device then send whatever you want until the next address byte
[16:54:12] <theBear> or assume every alternate byte is data and every other byte is an address
[16:54:16] <theBear> there are a bunch of ways
[16:54:17] <RikusW> the MPCM bit in UCSRnA will cause the uart to ignore all 8 bit data and only receive 9 bits
[16:54:36] <theBear> interesting
[16:55:12] <theBear> i know it's different, but i always found 9bit mode 'messy' 'cos you gotta deal with that extra 1 bit that lands in a different registre
[16:56:31] <chickensk> so master MCU should send 9 byte data for addresses and 8 byte data as data ?
[16:56:53] <RikusW> 9 bits is for the address byte only
[16:57:09] <chickensk> or master mcu sends 9byte all the time, with 9th bit zero if it is data?
[16:57:33] <RikusW> I'd say 8bit data
[16:58:31] <chickensk> this is procedure in the Mega8 datasheet:
[16:58:32] <chickensk> 1. All Slave MCUs are in Multi-processor Communication mode (MPCM in UCSRA is set)
[16:58:32] <chickensk> 2. The Master MCU sends an address frame, and all slaves receive and read this frame. In
[16:58:32] <chickensk> the Slave MCUs, the RXC Flag in UCSRA will be set as normal
[16:58:32] <chickensk> 3. Each Slave MCU reads the UDR Register and determines if it has been selected. If so, it
[16:58:32] <chickensk> clears the MPCM bit in UCSRA, otherwise it waits for the next address byte and keeps
[16:58:33] <chickensk> the MPCM setting
[16:58:33] <chickensk> 4. The addressed MCU will receive all data frames until a new address frame is received.
[16:58:34] <chickensk> The other Slave MCUs, which still have the MPCM bit set, will ignore the data frames
[16:58:34] <chickensk> 5. When the last data frame is received by the addressed MCU, the addressed MCU sets
[16:58:35] <chickensk> the MPCM bit and waits for a new address frame from Master. The process then repeats
[16:58:35] <chickensk> from 2
[16:58:40] <theBear> don't paste like that !
[16:59:04] <chickensk> sorry. first time
[17:00:48] <chickensk> so i have to set global variable, that will contain address
[17:00:55] <theBear> that's a pretty clear description of that method tho... looks like it's saying 9bit for addressing and 8bit for the data, tho i'd have to look at the datasheet and check to be sure
[17:05:13] <chickensk> 9th bit should define, weather 8 bits are data or address
[17:45:47] <cart_man> Does anyone know if this is valid " if (bit_is_clear(PINC,2) == 1) "
[17:46:03] <cart_man> I want it to React if PINC2 is HIGH
[17:47:25] <cart_man> if I disappear its because my connection keeps on dropping
[17:49:17] <Hotroot> Thanks for the help up until now everyone, finally placed me order for a circuitry kit and two ATMega328p's =)
[17:49:38] <RikusW> cart_man: if(PINC & 0x04)
[17:49:49] <RikusW> or if(PINC & (1<<2))
[17:50:13] <RikusW> or if(PINC & (1<<PINC2))
[17:53:12] <thetruthisoutthe> hah interesting to see so many words in all lines on a channel
[18:02:13] <chickensk> or if(PINC & (1 << PC2))