#avr | Logs for 2014-03-21

Back
[03:21:17] <megal0maniac_afk> Casper: Well, no, not internal crystals, but the oscillators in xmega for example are factory calibrated and very accurate
[03:22:17] <megal0maniac_afk> No need for a crystal with those, even at 32mhz
[04:35:05] <OndraSter> actaully the 2MHz and 32MHz oscillators are not that perfectly calibrated, but the 32kHz one is. And you can use DFLL to tune them :P
[04:37:06] <megal0maniac_afk> OndraSter: My point still stands :P
[04:37:08] <megal0maniac_afk> Kind of
[04:58:51] <OndraSter> the thing is
[04:58:58] <OndraSter> you can "overclock" the 32MHz
[04:59:02] <OndraSter> you even have to
[04:59:03] <OndraSter> for USB :P
[04:59:05] <OndraSter> to 48MHz
[04:59:20] <OndraSter> and then you can use for the internal clock either this one (and overclock the core) or the 2MHz one with PLL
[09:21:05] <wip> well finally it looks like it is impossible to make 12 unique and simultaneous frequency out of an atmega640 (featuring 12 pwm channels (6 timers (2x 8-bit, 4x 16-bit))
[09:21:49] <wip> i tried in CTC mode, fast pwm - the only solution is using the cpu (incrementing 12 vars and toggling pins)?!?
[09:26:45] <RikusW> or using 6 pwm and 6 bitbang
[09:44:44] * wip is looking google for bitbang / pwm
[09:59:47] <Casper> bah easy... put drill bits on a piece of wood, bang on them with an hammer. if you do it correctly it should go PWMing toward something, possibly with bullet speed!
[10:00:33] <Casper> as to make 12 frequency out of 6 timers.... probably not
[10:00:50] <Casper> unless you do it in software, but then the timing won't be precise
[10:01:41] <Casper> depending on the frequency, you may be able to get away by using a fast timer as a timebase, and count in software
[10:01:56] <Casper> but why 12 frequency?
[10:02:08] <Casper> it would be easier to use a better chip or use 2 avr
[10:07:33] <wip> i can get to 136us timebase before my usb disconnect, this gives me 7352hz
[10:07:55] <wip> but now my problem is the precision i can get out of this
[10:40:55] <wip> i made a post on the excellent forum: http://www.electro-tech-online.com/threads/12-simultaneous-unique-frequencies-pwm.140532/
[11:27:19] <wip> Casper: 12 frequency = 12 voices = 1 octave on my synth
[11:28:08] <wip> so you're recommandation is to use multiple atmega / attiny with a main atmega for usb communication and sending control to slave via SPI for example?
[11:36:08] <RikusW> that could work
[11:50:46] <RikusW> http://processhacker.sourceforge.net/
[12:10:04] <hetii_> Hi :)
[12:10:10] <N1njaneer> Hi there!
[12:10:36] <hetii_> I have a bit crazy idea :) How do you think, is it possible to using soundcard as a ISP programmer ?:)
[12:12:22] <N1njaneer> In theory you could do it (VEERRRRY slowly) however the main problem you will run in to is that many signal on the sound-card are usually AC-coupled, which you would have to defeat (if done in hardware) first.
[12:12:52] <N1njaneer> With a brand-new ISP programmer only costing about $30 that will run 100x faster I'm not sure it's worth trying to hack. :)
[12:13:50] <N1njaneer> You would also need at least three channels of output and one channel of input, and be able to handle them sample-syncronous. You might be able to talk to ISP at a couple thousand bits per second, but for any reasonably-sized AVR you will be waiting many, many minutes.
[12:14:21] <N1njaneer> It's an interesting idea and possibly doable, but I'm not sure why you'd want to. :)
[12:17:39] <hetii_> Ya i know its not a big deal to order it. But today i realize that i forgot my, from my parent house. Most of other ISP programmer use LPT/COM ports that are no longer in modern PC, thats why i consider to use a soundcard instead. For input i could use microphone channel for output stereo jack but then we will need one more signal.
[12:18:01] <hetii_> Maybe its possible to get it by contrioling amplitude
[12:18:42] <hetii_> of course such programmer will have just one purpose, to load bootloader or eg, usbasp :)
[12:18:48] <N1njaneer> You'd certainly have to spend a few days with an oscilliscope and such along with writing some pretty low-level software to drive the soundcard. If you've not done audio-device programming before it takes quite a bit to get a handle on, let alone work :)
[12:20:47] <hetii_> Other idea that i have and should be simples, is using a leds that you have on keyboard, its possible to control them from system :
[12:20:51] <hetii_> :)
[12:21:06] <N1njaneer> Depends on how much your time is worth.
[12:21:17] <N1njaneer> Other thing is that you need to have an input back from the chip as well.
[12:22:00] <hetii_> this can be done by capture some keyboard event
[12:22:21] <N1njaneer> If you don't mind it taking 30 minutes to load a few KB, sure.
[12:22:33] <N1njaneer> Again, depends on how much your time is worth.
[12:22:56] <N1njaneer> If you were on a desert island with no access to an ISP programmer ever, sure.
[12:23:25] <hetii_> hehe :) as said before its just an idea :)
[12:24:08] <N1njaneer> Doable yes? Practical no :)
[12:33:11] <hetii> yep, maybe will do it just for fun :)
[12:34:22] <hetii> Other wire that i can try for output is a RGB signal for LCD or by using 3 usb and control his power pin :)
[12:35:38] <N1njaneer> Have you done bit-bang SPI transactions before?
[12:36:42] <hetii_> not really, just play with some linux driver in my phone
[12:39:14] <N1njaneer> It might be a bit to take on, especially if you don't have an oscilliscope or logic analyzer avalaible.
[12:40:50] <hetii_> Yep i`m aware that :(
[12:41:39] <N1njaneer> You also have a quite a bit of low-level programming interface to wrangle, assuming everything else is working correctly. Doing code-load and fuse settings and similar is a bit complex on the AVR devices via SPI
[12:42:03] <N1njaneer> Again, $30 USB programmer will do everything you need and work every time. Then you can concentrate on making the AVR do something useful.
[12:43:10] <braincracker> hello my friends
[12:46:43] <hetii_> N1njaneer: well I don`t plan to discover circle form scratch, If I build successful the SPI bit banging layer then I can use other libraries/code that work on the top of it to play as programmer.
[12:46:52] <hetii_> Hello braincracker :)
[12:47:42] <hetii_> For eg: http://blog.vinu.co.in/2011/12/avr-programmer-programmer-using-pic-and.html
[12:51:15] <hetii> Also i found http://hackaday.com/2012/09/14/avr-programmer-made-without-a-programmer/
[12:51:45] <hetii> but its another subject :)
[13:00:35] <jadew> any idea if this is expensive or not? http://www.tme.eu/en/details/seno-3211/materials-for-pcb-production/
[13:00:54] <jadew> 90g
[13:22:16] <hetii> jadew: why not bay http://www.ebay.com/sch/i.html?_from=R40&_sacat=0&LH_BIN=1&_nkw=iron+chloride&_sop=15 ?
[13:22:57] <jadew> hetii, that's not for etching
[13:23:09] <jadew> it's for chemically tinning the board
[13:23:12] <hetii> ahh yep, just saw it now :)
[13:23:34] <braincracker> jadew well i would not buy these
[13:23:35] <jadew> got plenty of fecl around here :)
[13:23:43] <jadew> yeah, I don't think I'll buy it either
[13:23:47] <braincracker> i tried one but worth nothing
[13:23:58] <jadew> oh really? didn't work well?
[13:24:04] <braincracker> it just corrodes and erodes the pcb tracks
[13:24:10] <jadew> oh
[13:24:22] <jadew> I
[13:24:28] <braincracker> and layer is about 1 atom thick uf you get it right...
[13:24:37] <jadew> I'm also considering this: http://www.ebay.co.uk/itm/USO-PCB-Tinning-Brush-Solder-Tin-Plater-DIY-Professional-Tinner-for-PCBs-at-Home-/281068610616
[13:25:02] <braincracker> you are better off with a tin shower
[13:25:31] <jadew> braincracker, not sure I like the idea of filing solder on my desk
[13:25:55] <braincracker> yea for small boards you can do that
[13:25:58] <jadew> I'm sure some will remain on the desk and then rub on my hands
[13:26:00] <jadew> and it's not lead free
[13:26:41] <jadew> which is why I would prefer the brush, but I'd like one that would fit my iron
[13:26:42] <braincracker> oh, do you wear rubber gloves to touch any metal ?
[13:26:52] <braincracker> wait, rubber touches your skin!
[13:26:57] <jadew> well, I don't mind it when it's in a wire
[13:27:09] <jadew> but when it's fine dust it can enter the skin
[13:27:21] <braincracker> no
[13:27:37] <braincracker> soldering flux can be absorbed trough your skin though
[13:27:48] <jadew> good to know
[13:27:49] <tzanger> that is how I recharge my superpowers
[13:27:57] <jadew> lol tzanger
[13:28:01] <braincracker> tzanger ;)
[13:28:12] <braincracker> do you still have hair?
[13:28:28] <braincracker> i'm not saying you need any...
[13:28:31] <braincracker> just asking
[13:30:22] <tzanger> well I am losing it, but that's genetics
[13:30:26] <tzanger> my father and grandfather are bald
[13:33:16] <braincracker> it has been studied that lead and flux has something to do with it
[13:34:49] <tzanger> perhaps but I'm pretty sure that fucking Y chromosome has a lot more to do with it with me :-/
[13:41:50] <braincracker> so how would you go about gold plating? :) heat it to 1070C and dip in the board ?
[13:42:08] <braincracker> that would be real thick gold plating
[13:42:20] <braincracker> if the board don't melt
[13:43:49] <braincracker> silver only melts at 962C and much cheaper
[13:45:13] <braincracker> the modern 'gold platings" on current cheap chinese pcbs is a joke. a diy silver plating would last forever instead
[14:14:22] <wip> Apollo 11 had a 2.048 MHz CPU... and i am struggling with my 16mhz / 12 software pwm
[14:14:38] * wip is hiding himself
[14:15:02] <braincracker> feel ashamed
[14:15:16] <wip> yes i am
[14:15:24] <braincracker> try binary pwm ? :(
[14:16:34] <braincracker> http://hackaday.com/2011/07/22/using-binary-code-modulation-to-control-led-brightness/
[14:25:56] <tzanger> yeah I have project using that
[14:26:08] <tzanger> it's a nice way to pack a lot of time change into not very many interrupts
[14:41:17] <wip> but i wonder if it will have enough precision, let's say setting the frequency to 428.50hz and 420.50hz
[14:47:20] <braincracker> tried to figure out what are you talking about
[14:47:55] <braincracker> PWM is a pwm
[14:48:06] <braincracker> not PLL
[14:52:06] <wip> braincracker: only if you have the time to browse quickly my post about what i am trying to do and my current problem... http://www.electro-tech-online.com/threads/12-simultaneous-unique-frequencies-pwm.140532/
[14:54:22] <braincracker> what purpose?
[14:54:39] <braincracker> i can not think of any meaningful use
[14:55:38] <braincracker> by PWM you probably want to lower effective power, has not much to do with 428 or 420Hz pwm freq
[14:59:21] <wip> musical purpose, tuning is important in this case
[15:02:04] <braincracker> i tihnk you are on totally wrong track
[15:02:17] <braincracker> try any frequency and you'll see (hear) what i mean
[15:03:38] <tzanger> it's PWM, you will have to filter
[15:03:38] <braincracker> soundcard outputs at 44100Hz-192000Hz 16 bit-24 bit, compare this to 8 bit pwm & 440Hz square signal
[15:03:45] <tzanger> I've done wavetable synthesis along the same lines
[15:04:08] <tzanger> I wouldn't call it high fidelity but it can be pleasant
[15:04:16] <braincracker> chiptunes? :)
[15:04:21] <tzanger> yep
[15:04:38] <braincracker> i'm making that with old p3 now :(
[15:04:43] <braincracker> playing midi file
[15:04:50] <braincracker> but it sounds real
[15:05:02] <tzanger> actually wavetable synthesis is sample playing and using fixed point math to do the pitch varying/effects etc. this is something more like FM synthesis
[15:10:32] <wip> well let's say then it's for calibration / instrumentation purpose, i need 12 unique, simultaneous, precise (step of 8hz from 60hz to 600hz)
[15:11:11] <wip> sadly even if the datasheet tells me that i have 12 pwm channel (6 timers) i cannot use all channels for doing that
[15:11:29] <wip> sadly making this in software, not precise enough
[15:17:22] <jadew> why is it not precise enough
[15:17:29] <jadew> you should be able to do it in software
[15:18:12] <jadew> you can probably do it with only 1 timer
[15:21:42] <braincracker> wip<= then i'd create a sine generator, and PLL lock it with an avr :)
[15:22:04] <braincracker> that would be a nice calibrator
[15:27:09] <N1njaneer> Easier to do with an FPGA if you can use one.
[15:28:53] <N1njaneer> At least for multiple precision PWM outputs at multiple frequencies.
[15:29:37] <N1njaneer> You can also start with a slower external clock, then PLL it internally to a much higher frequency, then use that to drive your counters for the PWM comparators.
[15:36:01] <braincracker> :)
[15:36:35] <braincracker> customizable hardware pwming
[15:37:39] <N1njaneer> It works well, and clock-cycle accurate :)
[15:38:14] <N1njaneer> It's also amazing how much +/-50ppm temperature error can be in a particular clock part depending on how accurate you need to be.
[15:39:11] <N1njaneer> I had an application where I basically could breath on the clock crystal and watch the error term readily change
[15:39:16] <jadew> well, 50ppm is nothing in audio land
[15:39:20] <braincracker> let me guess, +-50ppm ? ;)
[15:39:43] <jadew> only audiophiles can hear a 50ppm
[15:39:46] <N1njaneer> Depends on your need for long/short term accuracy of course :)
[15:39:54] <braincracker> you cna't hear 50ppm
[15:40:19] <braincracker> only 4ppm signal calibrators hear 50ppm
[15:40:24] <jadew> audiophiles can, if the price is too low
[15:40:41] <N1njaneer> But this was for generating 38Khz exactly from an 8Mhz clock crystal that had to be perfectly phase-accurate over a 1 second interval. 50ppm would drift the waveform more than one-half cycle phase.
[15:41:29] <jadew> ptc heater?
[15:41:57] <braincracker> transistor heater, then atomic stabilizer
[15:42:01] <N1njaneer> Could have done an OXCO but I just closed the loop inside the FPGA by measuring and adjusting for the error term.
[15:42:16] <braincracker> then comes the electron-spin stabilizer
[15:42:26] <N1njaneer> Hence watching the error term change when breathing on the clock crystal to change the temp.
[15:43:03] <braincracker> you need an atomic structure echo canceler to achieve better than 4ppm accuracy
[15:43:12] <braincracker> so you can hear is nicer
[15:43:40] <jadew> what's an echo canceler?
[15:43:40] <N1njaneer> This wasn't for audio applications, though :)
[15:44:21] <N1njaneer> But it IS quite telling how far off the sample rate is for general consumer audio-cards, which is what necessitates clocking sync for doing digital audio in studio applications.
[15:44:29] <braincracker> jadew i was thinking about the quartz crystal's internal voids in structure that will cause frequency shift/instability
[15:44:43] <jadew> since we're on the topic of clocking, why are watches and RTC's driven by 38kHz crystals?
[15:44:52] <braincracker> and the surface machining quality plays a role in accuracy too
[15:45:05] <N1njaneer> 32.768 Khz is easy to divide down and takes very little power.
[15:45:19] <jadew> right 32.something
[15:45:25] <braincracker> jadew are they?
[15:45:31] <N1njaneer> 32768 is 15 bits :)
[15:45:42] <jadew> hah!
[15:45:43] <N1njaneer> Hence easy to work the binary math in the RTC
[15:45:48] <braincracker> i have a few rtc watch crystals from motherboards that do 32768Hz +-40ppm
[15:46:02] <jadew> now that makes sense
[15:46:14] <jadew> wonder how I didn't notice it
[15:47:13] <N1njaneer> +/-40ppm equals +/-3.456 seconds over 24 hours
[15:47:25] <braincracker> well what i tested is better than that
[15:47:28] <braincracker> but yes
[15:47:52] <braincracker> i only tried it at room temp.
[15:47:53] <N1njaneer> That's basically variance over the temperature range. Generally you will get less error, but that's the worst-case rating.
[15:49:39] <braincracker> express it in Hz too please and tell me you will "hear the difference" if you generate a tone with this.
[15:50:34] <N1njaneer> Even a modest OCXO will get down to more like +/-50ppb or lower, so +/-0.00432 seconds over the course of a day :)
[15:51:09] <N1njaneer> But yes, for audio applications and generating a tone that doesn't have respect to any other waveform you're generally quite good.
[15:51:36] <N1njaneer> For our application we had to generate 38 Khz carriers that were phase-matched between many dozens of devices there were not physically connected.
[15:51:56] <N1njaneer> So timing accuracy was important.
[15:52:32] <N1njaneer> So +/-40ppm = +/-0.00004 variance coefficient
[15:52:49] <braincracker> did you take into account the effect of the nearby blackholes?
[15:53:08] <N1njaneer> brain: That is left as an excercise for the reader.
[15:53:26] <braincracker> :) was it for extra points?
[15:53:30] <N1njaneer> If you need better than an OXCO, you just go to a rubidium clock and you're pretty much good to go!
[15:54:03] <braincracker> but blackholes alter spacetime :(
[15:54:26] <N1njaneer> Only when compared to an external frame of reference!
[15:55:07] <braincracker> you must be equal distance from the blackhole as the other device to be in same phase
[15:55:55] <braincracker> the device closer to the black hole will appear to be in slow motion by the farther one
[15:56:11] <myself> Or just use a radio sync signal.
[16:32:02] <phinxy> What should i buy if i want to toggle a 230V outlet with a pin?
[16:33:38] <LoRez> SSR
[16:34:47] <N1njaneer> Yup
[16:35:01] <N1njaneer> myself: They used GPS actualyl
[16:38:30] <N1njaneer> Typing too fast and distracted here. Our application used the 1 PPS output of the GPS in order to retrain the crystal oscillator's drift
[16:39:32] <braincracker> you remind me again of 3 works suspended :(
[16:39:40] <myself> yup, that works for most purposes.
[16:39:43] <braincracker> SSR
[16:40:23] <braincracker> oven controller, timer
[16:41:45] <braincracker> merry-go-round machine
[16:43:03] <Duality> any pointers on some advanced intterupt information, and perhaps on how to properly code for them ?
[16:46:28] <braincracker> Duality<= ?
[16:47:00] <Duality> braincracker: yes ?
[16:47:15] <braincracker> can't really interpret your question
[16:47:42] <braincracker> there is the interrupt vector table, you put your interrupt pointers there
[16:47:56] <braincracker> and then set up your interrupt you want to enable
[16:48:17] <guanche> my two cents is that he's asking how to deal than one at the same time as required per his application
[16:48:17] <braincracker> (this depends on device)
[16:48:33] <guanche> *with more than one interrupt at a time
[16:48:41] <Duality> pointers to information :)
[16:49:07] <braincracker> /topic
[16:49:11] <guanche> I normally translate my application to a state machine and use a timer
[16:49:12] <braincracker> a quickie :)
[16:49:19] <Duality> like I want to learn everything about them, I have lots of interupt code that sorta works, and I blame me not knowing how to properly code for them
[16:55:37] <N1njaneer> Duality: One thing you want to become intimately familiar with if you are using interrupts is understanding when, where, and why you need to use atomic sections. It is easily overlooked by many and will cause no shortage of frustration when trying to figure out why your code kind-of-mostly-works-with-non-repeatible-failures.
[16:55:52] <N1njaneer> Beyond that, interrupts are extremely straightforward in the AVR architecture.
[16:57:38] <N1njaneer> Also be aware of the pre/post-amble overheads the compiler will generate for your code - if you have a lot of interrupts firing very regularly, you will likely get better performance from fewer, infrequent interrupts and polling. The timer/state-machine that guanche mentioned is one perfectly valid way to do this.
[16:58:08] <N1njaneer> Hey, did beaky ever get his SMPS working?
[16:58:17] <guanche> depends on the application, sometimes other ways are better/needed
[16:58:51] <N1njaneer> Yes, it's all very application-dependent. It's best to understand the pros and cons of interrupts, so you can decide when and when not to use them.
[17:03:53] <guanche> for anything relevant you're gonna need a time-base, though
[17:04:46] <guanche> the good point on using a timer is that you can get advantage on the prescaler, and the frequency it fires, good for testing and getting up quickly
[17:07:27] <braincracker> https://31.media.tumblr.com/b13c4da8c1af1e604f1972f1f60820b8/tumblr_n2efqaAzCv1tq2pnlo1_500.png
[17:15:47] * megal0maniac_afk waves at N1njaneer
[17:16:17] <Duality> N1njaneer: i'll look into atomic :)
[17:16:56] * N1njaneer waves to megal0maniac_afk
[17:17:10] <megal0maniac_afk> Long time
[17:17:42] <N1njaneer> Indeed!
[17:21:43] <megal0maniac_afk> Got my hands on some UV eprom. And 8kbyte sram. And a bunch of other stuff that was being chucked out
[17:23:50] <N1njaneer> Nice!
[17:24:05] <N1njaneer> Time for dinner - may log on from home!
[17:24:29] <braincracker> build sram ssd!
[17:26:32] <megal0maniac_afk> Tests next weeks, then I play!
[17:29:16] <megal0maniac_afk> It's past midnight here. Night, all!
[17:32:16] <antto> what happens if i use too much variables.. more than there is RAM on the atmega?
[17:32:22] <antto> * too many
[17:35:10] <phinxy> antto, dunno. maybe the memory adress overflows to the beginning
[17:35:19] <antto> eek
[17:36:17] <antto> is there some tool or way to tell how much RAM my firmware would consume?
[17:46:16] <Fleck> anyone knows what the factory fuse settings for atmega2560?
[17:51:30] <Lambda_Aurigae> should be in the datasheet
[17:52:11] <braincracker> antto<= haha good question, been there
[17:52:13] <Lambda_Aurigae> as for the ram overflow, if heap(variables) meets stack then bad things can happen.
[17:52:26] <braincracker> address wrap? ;)
[17:52:30] <Lambda_Aurigae> avrsize should give you some indication of flash and ram size.
[17:52:31] <braincracker> and random things will happen
[17:53:11] <braincracker> antto<= i think you should count it
[17:53:22] <braincracker> and stay safe
[17:53:43] <antto> avrsize?
[17:53:47] <antto> k, imma check it
[17:53:48] <Lambda_Aurigae> avr-size
[17:53:56] <Lambda_Aurigae> avr-size test_uart.elf
[17:53:56] <Lambda_Aurigae> text data bss dec hex filename
[17:53:56] <Lambda_Aurigae> 764 24 69 857 359 test_uart.elf
[17:54:04] <braincracker> gcc will not forbid you to exceed memory size limit
[17:55:23] <antto> D:\TB-303\My_x0x\CPUMOD\FW>avr-size n0nx0x2.elf
[17:55:23] <antto> text data bss dec hex filename
[17:55:23] <antto> 67176 890 824 68890 10d1a n0nx0x2.elf
[17:56:38] <Lambda_Aurigae> http://stackoverflow.com/questions/16791311/how-to-interpret-avr32-size-output
[17:57:09] <Lambda_Aurigae> bah...nevermind that.
[17:57:13] <Lambda_Aurigae> it's not what I thought.
[17:58:52] <Lambda_Aurigae> avr-size -A -x test_uart.elf
[17:59:00] <Lambda_Aurigae> that gives some better info I think.
[18:00:13] <Lambda_Aurigae> but no matter what you read from the program with avr-size, there is ram usage it can't know about.
[18:00:26] <Lambda_Aurigae> because the stack is in ram, fills from top down...
[18:00:42] <braincracker> yes
[18:00:50] <braincracker> :)
[18:00:50] <antto> all i know is i don't use dynamic memory myself
[18:01:58] <braincracker> antto<= when i ran out of ram i only noticed things not working
[18:02:03] <antto> okay, then if i exceed the ram capacity - will i notice it immediately?
[18:02:10] <Lambda_Aurigae> http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=82203
[18:02:14] <Lambda_Aurigae> info on stack.
[18:02:14] <braincracker> and when i relocated some variables, or removed them, it suddenly was ok again
[18:02:17] <antto> ah, okay.. hopefully
[18:02:31] <braincracker> even had the thing do random things
[18:02:33] <Lambda_Aurigae> down in there is a link to a program called stackview that will give you some idea on stack usage from the .elf file.
[18:03:04] <braincracker> flashing leds unpredictably, sending out random chars on i2c
[18:03:04] <Lambda_Aurigae> what you will notice will depend on what is getting overwritten by what...all depends on your program.
[18:03:39] <antto> oh lord ;]
[18:03:39] <Lambda_Aurigae> if your heap overwrites your stack you could get bad return values from procedure calls or issues with ISR routines.
[18:04:04] <Lambda_Aurigae> if stack overwrites heap then you could end up with corrupted variables
[18:04:05] <braincracker> :)
[18:04:24] <braincracker> i think i created all possible failure modes
[18:04:38] <Lambda_Aurigae> hehe.
[18:05:01] <braincracker> then i noticed my ram is very full with stuff
[18:05:04] <Lambda_Aurigae> knew one guy who decided to clear out ram when his program started...and couldn't figure out why it went so kerflunky.
[18:05:15] <braincracker> changed tables from mem array to flash array
[18:05:24] <Lambda_Aurigae> he started at 0x0000 and started writing 0x00 to it all.
[18:05:40] <Lambda_Aurigae> and couldn't understand why it didn't work.
[18:06:11] <Lambda_Aurigae> with registers starting at 0x0000, he was overwriting those first and it had,,,issues...
[18:07:29] <braincracker> did you ever use flash chips with avr before ? you know they require wear leveling if you want to write them many
[18:08:30] <Lambda_Aurigae> yup.
[18:08:55] <Lambda_Aurigae> I mostly use eeproms and nvsrams
[18:08:56] <braincracker> what logic did you use?
[18:09:22] <Lambda_Aurigae> logic? I was playing with atmel's dataflash chips some years ago.
[18:09:40] <Lambda_Aurigae> never messed with the newer nand flash or anything like that.
[18:09:40] <braincracker> i mean for wera leveling
[18:09:46] <braincracker> or filesystem
[18:09:55] <Lambda_Aurigae> oh...I didn't do wear leveling myself.
[18:10:07] <Lambda_Aurigae> just sequential writes to the chips mostly.
[18:10:25] <braincracker> that is a kind of simple wear leveling too
[18:10:28] <Lambda_Aurigae> it takes a lot of writes to wear a flash chip out...10K or so.
[18:10:36] <braincracker> just write and roll
[18:10:37] <braincracker> :)
[18:10:43] <Lambda_Aurigae> 100k for eeprom usually.
[18:11:11] <Lambda_Aurigae> http://dangerousprototypes.com/2010/06/10/flash-destroyer-wrap-up/
[18:11:16] <braincracker> i will start developing some simple roll fs for flash chips
[18:11:23] <Lambda_Aurigae> they made something to actually test flash and see how long it took to kill it.
[18:11:47] <braincracker> unless flash chips disappear in a few month, and there will be memristor everywhere
[18:12:10] <braincracker> oh yea flash destroyer :)
[18:12:30] <braincracker> well i'll add badblocks too and some checksum
[18:12:42] <braincracker> ECC
[18:12:58] <braincracker> that is sdo much more fun that way
[18:13:04] <Lambda_Aurigae> I've been actually playing with usb drives and sd cards on microcontrollers lately.
[18:13:29] <braincracker> sd cards already contain a wear leveling
[18:13:33] <Lambda_Aurigae> those tend to have some wear leveling built in I think.
[18:13:46] <braincracker> you could use whatever fs on it
[18:13:53] <Lambda_Aurigae> I have probably 20 512MB usb drives.
[18:14:01] <braincracker> nice
[18:14:12] <braincracker> that is 10GB
[18:14:25] <braincracker> hook it up to an arm board and make a 10GB ssd
[18:14:48] <Lambda_Aurigae> yeah...raid 1+0 of tiny(haha) flash drives.
[18:14:51] <braincracker> (only the chips, not the controller crap)
[18:15:10] <braincracker> hm... raid ?
[18:15:17] <Lambda_Aurigae> yeah.
[18:15:31] <Lambda_Aurigae> redundant array of independent(or inexpensive) devices
[18:15:32] <braincracker> ssds only stripe
[18:15:40] <braincracker> and checksum
[18:15:51] <Lambda_Aurigae> do a mirrored stripe.
[18:15:54] <braincracker> industrial thinngs do ecc too
[18:16:01] <Lambda_Aurigae> which is 1+0 or raid 10 these days.
[18:16:38] <braincracker> but that costs 50% of your chips and is useless
[18:16:40] <Lambda_Aurigae> I have probably 8 160GB notebook harddrives.
[18:17:02] <braincracker> flash chip stripes will not die separately.
[18:17:07] <antto> maximum RAM usage ~2kB
[18:17:08] <antto> phew
[18:17:09] <braincracker> they will just wear out
[18:17:16] <antto> thanks
[18:17:23] <Lambda_Aurigae> I have no clue what I'll do with those flash drives.
[18:17:38] <braincracker> Lambda_Aurigae<= you have flash chips on them :)
[18:17:48] <braincracker> whatever
[18:17:50] <Lambda_Aurigae> itty bitty surface mount chips.
[18:17:57] <braincracker> bga ?
[18:18:10] <Lambda_Aurigae> no clue..haven't opened them up,,,probably not.
[18:18:17] <braincracker> how tiny ?:)
[18:18:20] <Lambda_Aurigae> but still, I hate working with surface mount stuff.
[18:18:23] <braincracker> i have a connector size 8GB
[18:18:28] <Lambda_Aurigae> if it's smaller than a dip package it's tiny to me.
[18:18:32] <braincracker> will not use those as parts often
[18:18:56] <Lambda_Aurigae> I have a bunch of microcontrollers that can play usb host or usb-otg and can read them.
[18:19:30] <Lambda_Aurigae> I have several teeny tiny flash drives of the 8 and 16 GB size that barely stick out of the usb connector...
[18:21:51] <braincracker> nah those are probably csp
[18:22:10] <braincracker> packageless dies bonded together, dipped in epoxy
[18:22:47] <braincracker> those are small
[18:22:51] <Lambda_Aurigae> yeah, probably.
[18:23:21] <braincracker> i did solder tiny bga ics, but i dislike them
[18:23:26] <Lambda_Aurigae> I have a bit of a problem with shaky hands due to nerve damage which makes working with surface mount stuff a pain for me.
[18:23:48] <braincracker> and they are unreliable, unless you solder them deadbug style with wires to each ball
[18:28:20] <Lambda_Aurigae> ever see the schmartboard bga boards?
[18:28:42] <braincracker> so, a flash chip is way much cooler than your hdds.
[18:28:50] <braincracker> it is just, the limited writes
[18:28:52] <braincracker> :/
[18:37:24] <Lambda_Aurigae> yeah.
[18:37:47] <Lambda_Aurigae> could go with non-moving magnetic storage.
[18:37:50] <Lambda_Aurigae> known as core memory!
[18:39:13] * braincracker wants 666 exacores in his computer for storage !
[18:39:49] <braincracker> but they say memristors are cool too
[18:39:52] <Lambda_Aurigae> http://dangerousprototypes.com/2014/03/21/hp-laserjet-4000-front-panel-with-bus-pirate/
[18:40:13] <Lambda_Aurigae> sweet...someone figured out the interface for the hp lj 4000 displays.
[18:40:15] <Lambda_Aurigae> I have a pile of them.
[18:40:21] <braincracker> :)
[18:40:25] <Lambda_Aurigae> keep ripping them off of old printers that are to be trashed.
[18:40:31] <braincracker> hax!
[18:43:11] <Lambda_Aurigae> looks like it's an SPI interface..sweet.
[18:43:51] <Lambda_Aurigae> I know what I'm playing with this weekend!
[18:44:23] <braincracker> i know what i would like to do weekend
[18:45:02] <braincracker> or who i'd play with
[18:45:05] <braincracker> ;>
[18:45:32] <Lambda_Aurigae> I got a wife...I get laid once a month whether I need it or not.
[18:45:35] <Lambda_Aurigae> usually.
[18:45:38] <Lambda_Aurigae> most of the time.
[18:46:00] <braincracker> you sound bored
[18:46:43] <Lambda_Aurigae> wacked out on drugs...the legal kind even.
[18:46:58] <Lambda_Aurigae> taking heavy doses of tramadol for injured shoulder.
[18:47:07] <braincracker> that made you marry ?
[18:47:17] <Lambda_Aurigae> no...that's making me loopy right now though.
[18:47:22] <Lambda_Aurigae> I've been married 3 times.
[18:47:25] <braincracker> oh
[18:47:28] <braincracker> 3x ?
[18:47:33] <braincracker> 1 is too much.
[18:47:43] <Lambda_Aurigae> first two were too much...current one is awesome.
[18:48:02] <Lambda_Aurigae> super awesome wifey.
[18:48:17] <braincracker> now imagine a guy who has 2 wifes
[18:48:26] <braincracker> (or more)
[18:48:28] <Lambda_Aurigae> hehe.
[18:48:44] <Lambda_Aurigae> don't think I could handle multiple wives...in fact, I'm sure I couldn't.
[18:49:30] <braincracker> yes, interrupts will take up time too
[18:49:32] <braincracker> :)
[18:50:03] <braincracker> or, be at 2 places at the same time
[18:50:22] <Lambda_Aurigae> worst part of having two wives,,,
[18:50:26] <Lambda_Aurigae> having two mother-n-laws!
[18:50:32] <braincracker> :(
[18:50:46] <braincracker> hell^2
[18:51:15] <braincracker> 3 = hell^3 it will be exponential
[18:52:26] <Lambda_Aurigae> my inlaws moved in with us last november.
[18:52:48] <braincracker> great!
[18:52:50] <Lambda_Aurigae> luckily for all they go south for the winter...gone 6 months out of the year.
[18:53:05] <Lambda_Aurigae> we are sectioning part of the house off as a separate apartment..
[18:53:17] <Lambda_Aurigae> gonna put in a bathroom and kitchen for them too.
[18:53:36] <Lambda_Aurigae> and a lock on the door between the two sections!
[18:53:47] <braincracker> :)
[18:54:03] <braincracker> aww the power of love and care
[18:54:24] <Lambda_Aurigae> yeah.
[18:54:35] <Lambda_Aurigae> wife loves her parents...and I couldn't care less.
[18:55:33] <Lambda_Aurigae> but at least they pay rent and are going to help pay for the remodeling.
[18:55:51] <Lambda_Aurigae> I get to do the work but they are paying for the materials.
[19:01:39] <braincracker> make the door electronically locked
[19:01:44] <braincracker> with time limit
[19:01:46] <braincracker> hahaha
[19:02:22] <braincracker> you know like wwhen bank can not be opened at weekend
[19:02:50] <Fleck> whats the bare minimum to run a atmega2560 ?
[19:03:06] <braincracker> i think a 3V battery
[19:03:56] <braincracker> a lizjium cell will work too
[19:04:00] <braincracker> lithium
[19:07:48] <Fleck> hmm, I am not able to programm atmega2560, it's new, so I wonder - if I am missing something
[19:08:15] <braincracker> yes, you need an isp connection
[19:09:07] <braincracker> a programmer, an avrdude, and transfer the compiled program to the device
[19:10:01] <Fleck> I have ISP connected
[19:10:31] <Fleck> chip enable programm error
[19:10:48] <braincracker> never seen that before
[19:10:54] <braincracker> do you have power supply too?
[19:11:05] <Fleck> yes
[19:11:17] <braincracker> set the device type ok?
[19:11:24] <Fleck> yep
[19:19:13] <Fleck> braincracker: well avrdude says avrdude: error: programm enable: target doesn't answer. 1
[19:20:05] <braincracker> that sounds like ahardware problem
[19:20:13] <braincracker> like plug in your programmer
[19:21:51] <Lambda_Aurigae> miso and mosi backwards?
[19:22:58] <Fleck> nope
[19:26:40] <braincracker> are aliens around?
[19:26:50] <Lambda_Aurigae> we are always around.
[19:31:09] <Fleck> maybe this atmega is dead?
[19:31:22] <Lambda_Aurigae> possibly.
[19:31:35] <Lambda_Aurigae> only way to know is try it on another programmer or try another chip on that one.
[19:32:11] <Fleck> programmer is ok, tried arduino mega 2560 ISP port, works ok!
[19:32:30] <Fleck> I wounder, maybe I am missing some components? like reset resistor or something
[19:32:54] <Lambda_Aurigae> reset pullup resistor is just to keep it from resetting during normal operation.
[19:33:10] <Fleck> ok
[19:33:31] <Lambda_Aurigae> if it is new from factory then it should be set for internal oscillator so you shouldn't need a crystal.
[19:34:07] <Fleck> yep, but I have also crystal
[19:34:53] <Lambda_Aurigae> and you have all the vcc and gnd pins connected up?
[19:35:07] <Fleck> not all, but they seem to be connected internally
[19:35:19] <Lambda_Aurigae> including the avcc and agnd?
[19:35:24] <Fleck> nope
[19:35:27] <Lambda_Aurigae> always best to connect all of them.
[19:36:41] <Lambda_Aurigae> I've seen AVRs have issues if the weren't all connected...datasheet even says to do so, including the AVCC and AGND.
[19:39:10] <Fleck> I used multimeter, they are connected internally, but ok, Ill try to connect them!
[19:41:25] <Lambda_Aurigae> I've never had a chip fail to program if I connected it properly.
[19:42:00] <Lambda_Aurigae> but I also use an old tried and true parallel port interfaced programmer.
[19:51:14] <Fleck> did not help :/
[19:52:58] <Lambda_Aurigae> atmega2560...surface mount chip...do you have some kind of solder bridge between the pads somewhere?
[19:53:07] <Lambda_Aurigae> sure all the pads are properly soldered down?
[19:53:38] <Fleck> yep, checked every single pin for shorts and for connection on chip
[19:54:29] <Fleck> too much heat is the only reason I can think of now...
[21:43:09] <rue_more> did you make the 2560 board or did you buy it?
[22:59:05] <Joel_re> hey, anyone around here interfaced with a sim900 gsm modem?
[22:59:10] <Joel_re> over serial ttl
[22:59:30] <rue_more> people keep asking that, but so far to date, nobody has
[22:59:47] <Casper> hmmm look like this current limiter MAY work...
[22:59:50] <Joel_re> hmm, hey rue
[23:00:10] <Joel_re> Im trying to figure why the modem keeps dumping 0xff
[23:00:22] <Joel_re> blocking my serial commands
[23:00:43] <rue_more> what baud are you using
[23:01:21] <Joel_re> 9600
[23:01:36] <rue_more> and what does it do when its budy and cant take anymore data from you
[23:01:38] <Joel_re> Im able to send it commands
[23:01:47] <rue_more> when its busy
[23:02:04] <rue_more> if you send it too much too fast, hows it gonna tell you its budy and to wait
[23:02:12] <Joel_re> hrm
[23:02:15] <rue_more> busy
[23:02:29] <Joel_re> so I should talk to it slower?
[23:02:47] <rue_more> maybe you need to work out how it says its busy or ready for more
[23:02:53] <rue_more> its called hand shaking
[23:03:01] <Joel_re> well from what Ive read
[23:03:07] <Joel_re> I just need to send it a A
[23:03:12] <rue_more> it can be done by hardware or by part of the data protocol
[23:03:19] <Joel_re> then it figures out the baud rate and then send commands
[23:03:26] <Joel_re> AT* commands
[23:03:37] <rue_more> and what if its not ready to recieve more data?
[23:03:59] <rue_more> what if it hasn't finished the last command but has to before it can recieve another
[23:04:13] <rue_more> ever heard of xon/xoff?
[23:05:50] <Joel_re> hrm
[23:05:52] <Joel_re> no
[23:06:08] <rue_more> look for information on how your gsm does flow control
[23:06:09] <Joel_re> well its not doing anything else
[23:06:22] <Joel_re> other than staying connected to the network
[23:06:27] <Joel_re> hrm
[23:07:33] <rue_more> are you recieving 0xff with or without recieve errors, if there is no start and stop bit, its just holding the line high
[23:08:41] <Joel_re> even if I dont send anything, its just spiting out 0xff 0xff 0xff
[23:09:04] <Joel_re> if Im able to squeeze an AT command in between those
[23:09:05] <Joel_re> it works
[23:16:45] <Joel_re> there is a start and stop bit
[23:23:22] <Casper> maybe you wronly initialised it?
[23:23:30] <Casper> also, check for framing error