#avr | Logs for 2016-01-27

Back
[01:03:17] <Deskwizard> N1njaneer: yeah, my idea almost worked ;) as you said... timing
[01:03:32] <Deskwizard> i was getting half of it before it bombed itself hehe
[01:18:07] <N1njaneer> Cool, keep going!
[02:04:29] <Deskwizard> N1njaneer: I conquer :)
[02:04:58] <Deskwizard> I even run the buttons and rotary encoder on the same timer :)
[02:05:18] <Deskwizard> since they're not use at the same time, they like each other
[02:05:23] <Deskwizard> finally god damn it!
[02:05:59] <Deskwizard> aight... 4 choices now... SPI, I2C, VUSB or sleep lol
[02:07:24] <Deskwizard> and Ive confirmed the issue with the usart baudrate is my math, passing the proper values directly works (obviously)
[02:16:11] <nuxil> what u making ?
[02:17:39] <Deskwizard> volume on rotary encoder, play, pause, etc on buttons, all those also on the remote, attiny4313 emulating usb keyboard
[02:17:43] <Deskwizard> at least thats the idea hehe
[02:18:11] <nuxil> :)
[02:19:07] <Deskwizard> all the basic inputs are working now, just gotta map events (and or make them hehe) and make those send keys once VUSB is up
[02:19:31] <Deskwizard> the "once" part is where its probably gonna get more painful.. usb descriptors are a pita
[02:20:24] <Deskwizard> also, if you ever play with VUSB, remember this: check the diodes before anything else if you're using that way of wiring it...
[02:20:43] <Deskwizard> you dont wanna know how long I spent to discover mine weren't right
[02:21:32] <nuxil> oh.
[02:21:38] <Deskwizard> why? because my programmer only do 5v and i didnt want to unplug it each time... trying to same 10 seconds, costs hours
[02:21:41] <Deskwizard> just remember hehe
[02:21:51] <Deskwizard> save*
[02:22:12] <Deskwizard> but once it detects and you see your name in lsusb, it all gets better :)
[02:25:05] <Deskwizard> wonder if I could hack those little bluetooth uart module to act as a keyboard instead...
[03:04:02] <nuxil> which bluetooth module?
[03:05:21] <nuxil> BTLC1000 ?
[03:05:23] <nuxil> :p
[04:19:56] <apo_> Damn
[04:20:13] <apo_> with the new 328PB my MIDI synth doesn't use all channels for sound generation anymore :(
[04:25:32] <nuxil> how come?
[05:01:16] <nikomo> this is kinda interesting, attiny85 has differential ADC pairs, two of them, but mega328 doesn't have any differential channels
[05:01:30] <nikomo> found something on the tiny that 328 can't do :P
[05:03:02] <LeoNerd> Some tiny chips support peripheral mapping. 328 does not
[05:03:54] <nikomo> it's almost like these chips are their own products, with their own features, instead of different versions of some old design from the 90s. lol
[05:04:46] <nikomo> Anyone here use Sublime Text for their C/C++ writing by the way? Looking for plugin suggestions, would be nice to get function autocompletion etc. for stuff like avr-libc functions etc.
[05:05:00] <nikomo> I've never written C/C++ with Sublime Text actually, so I have no idea what's out there
[05:06:57] <LeoNerd> I use vim; that autocompletes well enough for me
[05:15:36] <nuxil> im still trying to figure out how to get sertan frequenzes from an analog input :\ .. i found several Peak "to peak" examples tho. but thouse are of no use.
[05:29:53] <nuxil> http://www.instructables.com/id/Arduino-Guitar-Tuner/?ALLSTEPS
[05:30:15] <nuxil> i dont have a arduino. would it be possible to modify it for a atiny85 ??
[05:30:17] <nikomo> certain frequencies? like some sort of FFT output thing?
[05:30:35] <nuxil> nikomo, like a guitar tuner
[05:32:33] <nuxil> but i kind of dont get part of that code. example. imo this is wrong.
[05:32:55] <nuxil> .....
[05:32:56] <nuxil> void stringCheck(){
[05:32:56] <nuxil> if(frequency>70&frequency<90){
[05:33:02] <nuxil> isnt that if statement wong ?
[05:33:20] <nuxil> should it not be if(frequency>70 && frequency<90)
[05:33:29] <Flutterbat> maybe its bitwise and :P
[05:34:02] <nuxil> umm. ? you can do bolian check along with bitwise operation in same check ?
[05:34:07] <Flutterbat> but you are probably right && is what you would want there
[05:34:10] <nuxil> *same if statementy
[05:41:31] <nikomo> I don't even understand the basics for how that code is supposed to work, I need to do some reading
[05:48:46] <nuxil> i see float is used rather alot in that code. and iirc from what i am told. float sucks on ATtinyX and other C
[06:04:22] <nikomo> ah I kinda understand what he's doing in the code now
[06:08:58] <Lambda_Aurigae> float works just fine on avr...it is just considerably slower than integer math...and takes a lot more code space.
[06:09:19] <nikomo> what AVRs have hardware float?
[06:09:25] <Lambda_Aurigae> none
[06:09:29] <Lambda_Aurigae> but float can be done in software.
[06:09:39] <nikomo> well yeah, that's what the compiler does
[06:09:39] <Lambda_Aurigae> which means it's much larger and slower.
[06:10:49] <Lambda_Aurigae> I haven't tested it, but, I would say somewhere on the order of 1/10th the speed of integer math.
[06:10:59] <Lambda_Aurigae> and about 5 times the size most likely.
[06:30:17] <nuxil> hmmm i have a hard time understanding how that code would work if i replace it with a mic "for a acustic guitar".
[06:30:27] <nuxil> like.. how can it tell the difference between 2V input at 400HZ or 4V input at 200Hz
[06:35:33] <Flutterbat> nuxil: i dont know the code. but i dont understand what peak voltage has to do with frequency. you could simply measure the time when the wave passes from + to - or from peak to peak etc.
[06:39:28] <nuxil> Flutterbat, take my number. 2V ,, 400Hz and 4V 200Hz. if im reading this correct. the analoug bin take a range of voltate 0-> Vcc and split it up to 10 bits. so if you take thouse tho number it should give the same bit value in the adc ??
[06:41:04] <nuxil> or am i way out on the field with the cows now?
[06:41:51] <Flutterbat> nuxil: 5V will give you 0x50 4V:0x40 2V:0x20 (example values)
[06:42:29] <Flutterbat> in reality Vcc will give you 0x3FF iirc
[06:44:34] <nuxil> hmm.
[06:46:14] <Flutterbat> so all you need to do to get the frequency is look for peaks and measure the time delta
[06:46:43] <Flutterbat> probably easier said than done though, because the signal peaks will fluctuate :(
[06:47:02] <nuxil> yes they will
[06:47:51] <Flutterbat> thats why the 0 passthrough is so nice :>
[06:48:00] <Flutterbat> it will only fluctuate in t
[06:50:28] <nuxil> ok.. im gonna try something :)
[07:03:02] <rnd4230> hello
[07:03:07] <nuxil> hi
[07:03:11] <rnd4230> wondering if someone can help me
[07:03:31] <nuxil> that someone is most likely not me :p
[07:03:42] <Tom_itx> not if you don't ask
[07:03:51] <rnd4230> i had built two jdm programmers and both stopped identifiying the micro after a few uses
[07:04:02] <rnd4230> what could be the problem?
[07:04:25] <rnd4230> im hanging around without being able to program/erase my micro due this
[07:04:43] <rnd4230> where could i find a nice jdm programmer schem for 40 pin mics?
[07:05:10] <Tom_itx> jdm?
[07:05:20] <nuxil> jtac ?
[07:05:23] <nuxil> erm
[07:05:26] <Tom_itx> just died momentarily?
[07:06:02] <nuxil> fuse bits got screwed up ?
[07:06:07] <rnd4230> both two died at all
[07:06:24] <rnd4230> nuxil that's one of the things i was thinking about but
[07:06:40] <Tom_itx> bit banged programmer?
[07:06:50] <Tom_itx> <-- hates those
[07:06:52] <rnd4230> shouldn't it also stop running the program that it still has within?
[07:07:30] <nuxil> are you usin avr dude to transfere the program?
[07:08:10] <Flutterbat> that being said i dont really know how fft works. because with fft you would see a difference between a rectangular 400hz and a sine 400hz
[07:08:23] <rnd4230> well, im not using an avr chip, just tried to ask here, cause it was the only real-time place i found to do it, sorry
[07:09:11] <Tom_itx> pic programmer?
[07:09:27] <Tom_itx> arm programmer?
[07:09:27] <rnd4230> yeah im using a pic
[07:09:42] <Tom_itx> i'd just get an epic
[07:09:47] <nuxil> Flutterbat, was that for me ??
[07:09:55] <Flutterbat> yeah
[07:11:09] <nuxil> im gonna mess around with it later. found some more code example im looking at.
[07:11:19] <rnd4230> http://www.electronicecircuits.com/wp-content/uploads/2009/11/pic16f84-16f84a-16c84-16f628-programmer-circuit.jpg this was the last working circuit i've used
[07:11:27] <Flutterbat> i know fft and controlsystems stuff decently well, in theory, but ive zero clue how to implement those things
[07:12:08] <rnd4230> maybe you know about a simple and working anotherone? :)
[07:13:36] <nuxil> Flutterbat, seems like a nice challange this :p
[07:14:47] <nuxil> found some more exmples. still only peak to peak.. but i liked yoru idea about timing the peak values. and check the delta time.
[07:15:11] <Flutterbat> nuxil: well in theory your samplerate will determine the max detectable frequency. meaning sample rate/2 is the highest detectable frequency. Your signal will always be just a sum of sine waves
[07:16:14] <Flutterbat> so you could do a signalsweep with a prefilter, but that is obviously not a nice solution, but easily understandable. but ive no idea how to recreate such a filter in software
[07:16:16] <Tom_itx> rnd4230 some of the programmers work on 16f84 but not the "A" version as well
[07:16:31] <Tom_itx> aka newer chips
[07:17:01] <rnd4230> but it was working fine til yesterday
[07:17:04] <flyback> rnd4230, have you seen serprog ported to stm32 chips
[07:17:22] * Tom_itx smacks flyback with a canuck trout
[07:17:24] <flyback> which have enough +5 i/o to handle programming almost anything
[07:17:33] <flyback> BMCC
[07:18:17] <flyback> serprog turns it into a slave then the pc program flashrom can drive
[07:19:14] <flyback> Tom_itx, I still have a mediatek parallel flash programmer :P
[07:19:15] <nuxil> i suck so bad at C that i think that the 8K mem on my t85 isnt enough :p
[07:19:18] <rnd4230> thanks flyback having a look right now, but i doubt voltages for all the pins would be compatible with my pic
[07:19:44] <Flutterbat> tbf. sucking at c doenst really increase your mem needs.
[07:19:54] <nuxil> need something like 6 bandpass filters in software :p
[07:20:08] <flyback> https://github.com/dword1511/serprog-stm32vcp
[07:20:40] <flyback> he didn't do parallel programming in his port but should be addable
[07:20:49] <nuxil> Flutterbat, it sure does.. if you dont know if you should use a ref, pointer etc and instead create new vars for everythin :p
[07:21:04] <flyback> #flashrom also btw
[07:21:10] <rnd4230> thanks
[07:21:44] <flyback> im thinking of making it work with the stm32 m0 $7 discovery board, doesn't have usb but still I can use a usb to serial thing
[07:22:13] <Flutterbat> nuxil: mostly its data that is the flash limits bane. like 'and now lets add the ascii table with pixelmaps'...what do you mean it doesnt fit?!?!
[07:23:47] <nuxil> i didnt say it didnt fit. i said i think it will not fit with my coding skills :)
[07:24:20] <Flutterbat> have faith!
[07:24:36] <Flutterbat> and buy a number bigger :p
[07:24:57] <flyback> <flyback> http://www.instructables.com/id/Simple-JDM-PIC-Programmer/
[07:24:57] <flyback> <flyback> http://www.ebay.com/bhp/jdm-programme
[07:25:29] <flyback> http://forum.allaboutcircuits.com/threads/pic-programmer-jdm-2.13890/
[07:28:10] <flyback> what's the i/o voltages needed to program those
[07:28:52] <flyback> check here for some programmer sources also
[07:28:53] <flyback> http://www.lancos.com/prog.html
[07:32:19] <flyback> http://www.lancos.com/e2p/Jdm-v22.gif
[07:33:09] <flyback> hell if that's just a simple 5v i/o programmer you can probably get some cheap usb chip to do it
[08:01:44] <jben> Hi
[08:02:14] <jben> Do you have a lib for implementing a 1wire bus master on xmega?
[08:02:52] <jben> I don't want a polling implemntation or with delays, but one which is interput driven with a UART
[08:03:34] <LeoNerd> That might be tricky. With no dedicated hardware support, you're bitbanging it per bit
[08:03:46] <LeoNerd> That means 8 interrupt context switches and 8 returns, for every single byte you send
[08:03:57] <jben> Like the one provided in AVR318, but this is not for xmega, and the code is not free.
[08:04:32] <LeoNerd> 318.. isn't that I²C or do I misremember?
[08:04:43] <LeoNerd> Huh.. I have my numbers wrong
[08:05:21] <jben> LeoNerd: yes it is, but I prefer having 8 interrupts by byte than delays which are not reliable
[08:07:14] <jben> but if you have a cheap nice device which do the 1wire stuff, I will be happy to use it
[08:35:50] <twnqx> i met a guy recently
[08:36:03] <twnqx> who uses a dedicated tiny for SPI -> ws2812 translation
[08:36:10] <twnqx> guess you could do the same for 1wire :P
[08:36:50] <LeoNerd> Yah I was considering doing the same
[08:37:02] <LeoNerd> Or just giving up on WS2812 and using APA-102s instead :) Because those *are* SPI
[10:07:58] <nuxil> hmm the apa-102s seems to be superior to the ws2812
[10:08:32] <LeoNerd> Yup
[10:08:34] <LeoNerd> They're nice
[10:08:56] <LeoNerd> You talk real actual SPI to them; they have data and clock lines... and they PWM at a much faster rate, so you don't get motion flicker on moving displays
[10:09:21] <LeoNerd> The only downside is that you need a 4 wire bus between them (+ve, GND, DI, CI), rather than the 3 wires of WS2812
[10:09:54] <nuxil> oh nice. so in theroy you could drive them at any clock rate. vs the ws2812 that needs some 800khz or something.
[10:10:01] <LeoNerd> Yup
[10:10:15] <LeoNerd> And most notably, if you're doing what I'm doing (DMX512), you can be interrupted while talking
[10:10:34] <LeoNerd> My problem with DMX and WS2812 on the same chip is that I need fast UART response because DMX512 comes through at 250kBaud
[10:10:43] <LeoNerd> So if I use WS2812s all hell breaks loose there
[10:10:57] <LeoNerd> But with APA-102s, they are just SPI, so if I have to pause to service the UART for a moment, that's no problem
[10:11:33] <jben> I have another question, about C, and the optimization. If I declare a global variable (on the stack), and I never use it. Does the compiler drop it?
[10:11:57] <LeoNerd> Some might
[10:12:11] <LeoNerd> But I doubt most AVR compilers would notice... gcc-avr won't
[10:13:09] <jben> I use avr-gcc, so… I had to clean some code
[10:13:39] <nuxil> if youre left with unused variables. you havent cleaned enough :p
[10:14:06] <LeoNerd> I should get into the habit of using -ffunction-section more
[10:14:13] <LeoNerd> That'd reduce my image size as well
[10:14:34] <jben> nuxil: I know
[10:15:47] <nuxil> ok. i def want some apa strips now.
[10:16:04] <LeoNerd> Yup :)
[10:16:17] <LeoNerd> Though - be careful to check the model number carefully. There's APA-102 and APA-104
[10:16:56] <LeoNerd> The APA-102s are the nice SPI chips; the 104s are a clone of WS2812s
[10:17:46] <nuxil> looking for a place i can get it.
[10:18:36] <nuxil> oh. each led inverts the clock
[10:18:38] <LeoNerd> Adafruit sell them under the brand name of "dotPixels"
[10:18:49] <LeoNerd> Oh.. yes.. each LED's output is half a cycle latent
[10:18:56] <LeoNerd> That shouldn't make a difference
[10:19:21] <nuxil> guess not.
[10:19:38] <LeoNerd> It just means you have to output some extra clock transitions into the head of the chain, to ensure that the data sequence ripples down to the tail end completely
[10:19:45] <LeoNerd> These chips aren't quite like most SPI chips
[10:20:16] <LeoNerd> What happens is you talk to the head of the chain in SPI, and it remembers the first 32bits of data, at which point it then goes into a transparent latch mode, relaying out whatever you feed into it, into the next chip
[10:20:23] <LeoNerd> The next one then does the same for the next 32bits, and so on...
[10:20:34] <LeoNerd> So the first data word you send ends up controlling the *head* chip, not the tail one
[10:20:43] <nuxil> found some nice videos explaining it.
[10:20:58] <nuxil> https://www.youtube.com/watch?v=UYvC-hukz-0
[10:21:12] <nuxil> 2 videos.
[10:21:20] <LeoNerd> Most SPI chips (like SRs and whatever) will transparently shift bits in and out in a long chain, and when you release SS, all the chips will capture the final bits you clocked into them
[10:21:33] <LeoNerd> Meaning the first data you send out goes to the tail chip, and the latest data goes into the head chip
[10:22:08] <nuxil> :)
[10:22:43] <LeoNerd> Butyes, in summary: as long as the extra cost and need for two data lines doesn't bother you, I highly recommend these chips instead of WS2812s
[10:23:18] <LeoNerd> There's only one place I still use WS2812s now, and that's a single LED I have mounted on a contact probe, because I really don't want to send -two- data lines down that long handheld probe cable; and I'm driving it from an ATtiny13 and I don't have spare IO lines
[12:11:48] <Deskwizard> N1njaneer: I lied last night but I wasnt aware I was... the IR works with the button but the encoder, nope hehe
[12:15:48] <Deskwizard> had to play with the timer prescaler to get IR working, im sure thats the issue
[12:25:57] <Jartza> oh
[12:26:08] <Jartza> got yet another avr programmer :D
[12:28:52] <Deskwizard> hehehehe nice :)
[12:29:03] <Deskwizard> gonna make my own once I get this timer crap dealt with
[12:29:20] <Deskwizard> in therory I just have to do a bot of math
[12:29:23] <Deskwizard> bit*
[12:29:30] <Deskwizard> emphasis on "in theory" lol
[12:30:17] <Deskwizard> and "make one" is a bit of an overstatement :P modify existing one to my requirements would be more appropriate
[12:30:23] <Deskwizard> Jartza: which one did you get ?
[12:31:41] <Jartza> olimex avr-isp-mkii
[12:32:15] <Jartza> it's missing a case but otherwise seems to work
[12:32:25] <Deskwizard> olimex im sure it works fine then ;)
[12:32:35] <Deskwizard> have one of their boards hehe
[12:32:45] <Jartza> I think this is pretty old too, as it still has at90usb162
[12:32:52] <Jartza> iirc the later models has ATmega16U2
[12:33:23] <LeoNerd> Isn't the 16U2 semi-dead these days in favour of the 32U4 ?
[12:33:44] <Jartza> dunno
[12:34:10] <Jartza> for me, atmega is pretty much obsolete anyway
[12:34:26] <Jartza> I use either attiny. if tiny is not enough, then xmega or arm (mainly cortex m -series)
[12:34:28] <Deskwizard> LeoNerd: probably depends on how much memory you need, like attiny25/45/85
[12:34:45] <Jartza> just because xmegas are cheaper than megas, which is a bit strange to me
[12:34:58] <Deskwizard> Jartza: oh I didnt know that... never used xmegas
[12:35:00] <Jartza> if I need a lot of peripherals, then xmega :)
[12:35:00] <Deskwizard> nice?
[12:35:01] <LeoNerd> Deskwizard: well, the U2 vs U4 also
[12:35:10] <Deskwizard> LeoNerd: yeah you got the idea.
[12:35:17] <Deskwizard> oh, that I'm not aware
[12:35:34] <Deskwizard> ie. no idea of the difference, sorry i didnt notice that part
[12:35:43] <Jartza> http://www.mouser.fi/ProductDetail/Atmel/ATXMEGA32A4U-AU/?qs=sGAEpiMZZMvqv2n3s2xjsVQIURldyCCHkSSxd3wQs6I%3d
[12:35:47] <Deskwizard> ill just shut up and go back to my timer
[12:35:53] <Jartza> I like thos a4u xmegas
[12:36:30] <Jartza> usb, 5 usarts, 2 spi...
[12:36:37] <Deskwizard> nice !
[12:36:57] <Deskwizard> *puts on list for future *
[12:37:08] <Deskwizard> lets be honest here, im not quite there yet hehe
[12:37:36] <LeoNerd> Eh.. I dunno.I can't see a world in which XMEGA makes sense these days. XMEGA and AVR32 are both in the "dead zone" that no longer exists, now that STM32 and other ARM Cortex M0+ chips exist
[12:37:43] <LeoNerd> Tiny... Mega... STM32.
[12:37:49] <LeoNerd> there's not really a gap there any more
[12:40:59] <Deskwizard> I keep hearing about the STM32... why so much I wonder
[12:41:11] <Deskwizard> im curious :)
[12:54:12] <Jartza> LeoNerd: I agree on avr32. never liked it and no advantage over arm
[12:54:47] <Jartza> but xmega is still nice, easier to set up and get going than arm, but plenty of peripherals and features
[12:54:51] <aandrew> yeah avr32 never drew me
[12:54:53] <aandrew> I like the tinys though
[12:55:15] <Jartza> me too
[12:56:16] <Jartza> nobody knew I like tinys :D
[12:57:24] <inkjetunito> are you a tiny person?
[12:59:08] <Jartza> when it comes to microcontrollers, yes :)
[13:11:20] <LeoNerd> tinies are nice
[13:11:42] <LeoNerd> I sometimes use a tiny when I can't quite find a standard logic chip to do what I want even
[13:12:19] <LeoNerd> In bulk, the tiny84 comes at around the same price as many simple logic chips anyway, except that I can make it do whatever I want... subject to CPU speed :)
[13:12:37] <Jartza> yea
[13:12:54] <Jartza> and attiny5/10 are sot23-6 :)
[13:18:03] <Krampus> LeoNerd: the built-in oscillators are nice for that too.
[13:20:02] <Krampus> Anyone know how an AVR's SPI port can be misconfigured such that it'll add a "bonus runt pulse" to the end of every byte sent? I reckon I'm doing a really subtle stupid.
[13:42:50] <N1njaneer> Krampus: Are you enabling/disabling the SPI peripheral at all?
[13:49:26] <Krampus> N1njaneer: Only time I hit SPE and MSTR is during init.
[13:51:16] <N1njaneer> I have done extensive work with AVR SPI for many years, I can't remember ever seeing such a thing, but I wonder if some misconfiguration could cause it. Are you only seeing 8 clock cyclings and then a runt pulse on the MOSI, or... ?
[13:52:59] <N1njaneer> Important note with Atmel AVR SPI as Master, though -- you DO have to make sure the SS` pin is set as an OUTPUT explicitly, even if you are NOT using it as the chip select output. If it's left floating you can get a lot of weird behavior as it will abort SPI transactions if it reads low.
[13:53:22] <N1njaneer> Have had that creep up once or twice on me, and have fixed that in other people's designs as well. :)
[13:53:41] <Krampus> N1njaneer: let me toss a screenshot of the signals, much easier to explain. :)
[13:56:23] <Krampus> N1njaneer: http://i.imgur.com/qsiNmHr.png
[13:57:08] <Krampus> N1njaneer: I've ruled out the level shifting (going from 5V <-> 3.3V) by disconnecting everything back to the port.
[13:59:48] <N1njaneer> Krampus: That is definately a bit on the odd side. Since it's not a full-height pulse I am going to suspect that perhaps you are missing some decoupling capacitors (or need more) on the devices on your board.
[14:01:08] <N1njaneer> My first gut feeling is that it's a power issue, but hard to conjecture further without seeing the actual board and layout.
[14:01:57] <Krampus> N1njaneer: Yeah, that totally looks like some sort of induced noise, but I don't see anything obvious switching at the exact same time. The power rails don't droop at all, but sprinkling more caps around aren't going to hurt things.
[14:02:01] <N1njaneer> What you CAN potentially do is to add a delay loop between byte transmissions to the SPI data register and see how it stretches those pulses and where EXACTLY they are occuring.
[14:02:31] <N1njaneer> I generally go for at LEAST a 0.1uf on every power pin on every device. Better to have too many than not enough.
[14:02:57] <Krampus> N1njaneer: I'm using a teensy++ 2.0 board for the moment, though, and that dude was kind enough to already do that.
[14:03:35] <Krampus> N1njaneer: the stretching was my next step. Maybe I'm modifying the data before it's actually shifted.
[14:03:54] <N1njaneer> I see you are using a Saleae as well. I love their Logic-16 but it can also sometimes give some slightly questionable readings under certain circumstances.
[14:04:35] <cehteh> what happens when you reduce the clock?
[14:04:46] <N1njaneer> Couple thoughts --
[14:05:39] <N1njaneer> It DOES look like the Saleae is running in 3V mode, so assuming your board is as well, at least that setting is correct. You can run it in 3V or 5V mode for the logic and sometimes odd things can result if it's set incorrectly.
[14:06:24] <N1njaneer> Make sure it has a SOLID ground connection, or potentially connect additional grounds to it, and/or try tapping ground at a different location so you aren't potentially seeing fake "ground bounce"
[14:07:24] <N1njaneer> I wish Saleae had more ground pins on it. Professional-grade logic analyzers (like from HP/Agilent) often times will have a ground return PER SAMPLE LINE to ensure the cross-section of the current flowing loop is as small as is possible so you don't get weird impedence issues, etc.
[14:08:21] <N1njaneer> If you have a normal analog o'scope around I would hook up the O'scope and monitor the pin and make sure the runt pulses you are seeing are actually present and it isn't an artifact of the Saleae or how it's connected.
[14:08:43] <N1njaneer> There's nothing worst than chasing a problem which is induced entirely by the analyzer XD
[14:10:33] <N1njaneer> A while back I had an issue where we have a bunch of SPI lines busted out on a ribbon cable to a dev board and similar, rather than a proper rigid circuit boards. Because of the long'ish runs of the SPI lines, we would see single-bit upsets very infrequently and it was puzzling. In THAT case when clamping on the logic analyzer, it added JUST enough capacitance that the single bit blips disappeared
[14:10:33] <N1njaneer> and data flow was then correct. THAT was annoying!
[14:10:39] <Krampus> N1njaneer: I did; I got a Rigol "100mHz" scope on the bench next to it. :)
[14:10:54] <Krampus> N1njaneer: but those new saelae's do mixed signal reasonably well.
[14:11:44] <N1njaneer> The ultimate fix was to use an actual correct circuit board for the breakout rather than the ribbon cable, but there are cases where it can actually be helpful to add termination resistors to the data lines and/or small caps (couple pf) to the lines to help snub out ringing/reflections/bounce.
[14:11:59] <N1njaneer> Okay, good to double-check on all of that for sure.
[14:12:39] <N1njaneer> I would stretch your data bytes out and see if the pulses alter, and/or alter the fClk as cehteh suggested. Gather more data, see what changes.
[14:13:09] <N1njaneer> It's VERY odd that you are getting them at the end of every data transaction and no other lines appear to be changing, and you are transmitting all zeros
[14:13:16] <Deskwizard> yeah, I'm done. I'll never get it, I just have to assume that. thanks everyone for the help
[14:13:28] <Krampus> Added ~10usec after each access to read/write and those pulses aren't there anymore. Better go double-check how I think the "byte sent/received" bit is used. :)
[14:13:47] <N1njaneer> Are you doing anything else on the AVR synchronous with the start/end of data byte transmissions? What is the s
[14:14:09] <N1njaneer> +SPI target you are talking to? Could IT be thumping things per data-byte reception?
[14:14:32] <N1njaneer> Also, do the runt pulses disappear if you do the transaction with CS staying HIGH so the slave device doesn't read and react to the data?
[14:14:55] <N1njaneer> Deskwizard: How goes your IR reception quest?
[14:15:14] <Deskwizard> same as before, if something works, it breaks something else
[14:15:20] <Krampus> It's an il9341 LCD driver, the ones that PJRC sells on their site. That's a good point about having CS deasserted. I did disconnect MOSI and probe it to try to rule out the slave driving something.
[14:15:21] <N1njaneer> Krampus: Oh, good!
[14:15:33] <Krampus> N1njaneer: still doesn't turn on, but it looks better on the scope.
[14:16:07] <N1njaneer> If you are doing data transmissions (and not doing interrupts) I would stick this before each write -- while(!(SPSR & (1<<SPIF)));
[14:16:15] <Deskwizard> N1njaneer: I really thought I had it this time, but no
[14:16:51] <Krampus> N1njaneer: that's unfortunately what I was doing. :-/
[14:16:52] <N1njaneer> That will block the write until the transmission is finished, so if you put it BEFORE doing a "SPDR = data;" then it won't try to transmit until the register is empty
[14:17:17] <N1njaneer> What part is on that board?
[14:17:54] <Krampus> N1njaneer: at90usb1286, and if you pull an eratta warning of this I'm going to feel very foolish. :)
[14:18:20] <Deskwizard> WAIT
[14:18:26] <N1njaneer> There are a couple little gotchas with AVR SPI (at least as MASTER, Slave-mode is a whole other can of worms) but generally it's super simple to work with and is 100% reliable. I've just never seen what you are describing, so I'm especially curious on this.
[14:18:27] <Deskwizard> saleae on 3v ?
[14:18:32] <Deskwizard> real thing or clone ?
[14:18:49] <Krampus> Deskwizard: a Pro16, in red so it captures faster.
[14:18:58] <N1njaneer> at90USB1286, wow, haven't used one of those in years!
[14:18:58] <Deskwizard> aight, nevermind then ;)
[14:19:17] <Deskwizard> Krampus: I have a cheap clone and I had issues with it at 3v-ish ;)
[14:19:52] <Krampus> N1njaneer: I usually start with it if I'm just playing around with stuff. I have some atmega1284 / 644s for the finished toy.
[14:20:00] <Deskwizard> N1njaneer: would you mind elaborating on the SPI gotchas if you don't mind ?
[14:20:18] <Deskwizard> actually, nevermind... I'll ask when i get there
[14:20:23] <Krampus> N1njaneer: but yeah, SPI's been previously super easy and the other SPI device I had on the bus (diconnected now) worked fine.
[14:20:32] <Deskwizard> considering my usart isnt even working as it should either ... lol *sigh*
[14:21:05] <N1njaneer> Krampus: Yeah, nothing in the errata
[14:21:44] <N1njaneer> Can you disconnect the SPI slave devices entirely and monitor the lines and see if it changes? You want to make sure it's not something else in the circuit that's thumping it. I kind of highly doubt that it's the AVR itself.
[14:22:05] <twnqx> <jben> I have another question, about C, and the optimization. If I declare a global variable (on the stack), and I never use it. Does the compiler drop it?
[14:22:25] <Krampus> N1njaneer: it'd have to be something like "Reading SPDR too close to SPIF causes glitch" or something.
[14:22:25] <twnqx> with gcc, use -Wall, it will cry with "unused varieble"
[14:22:35] <twnqx> and globals are not on the stack in the first place :P
[14:23:41] <JesseG_Work> How do I read the register DFLLVAL.DIFF from my C code in Atmel Studio 7? The ATSAMD20E17 datasheet makes reference to it, and my IDE (AS7) auto-suggests some similar things like DFLLVAL.bit.DIFF and SYSCTRL_DFLLVAL_DIFF, but build always says Undeclared.
[14:24:07] <Krampus> N1njaneer: Of course, it's all on perfboard. :) I disconnected MOSI and probed it directly with the analyzer and still saw the glitch. I can try it with the other pins disconnected after I finish my current experiment, although I'm kind of skeptical that I'll see a difference.
[14:24:33] <N1njaneer> Krampus: Yeah, this is definately a weird one for sure.
[14:25:21] <Krampus> N1njaneer: I'm not doing anything super clever yet, so I'm still well in the realm of "you're doing it wrong!"
[14:26:01] <Deskwizard> Krampus: alright, we can share that territory :P
[14:26:09] * Deskwizard gives Krampus pointy hat
[14:26:49] <Krampus> Deskwizard: what I teach my dudes is "they shipped a hojillion of them; assume you're fucking up first."
[14:26:52] <N1njaneer> Krampus: I am going to suspect it's probably something in the circuit or the layout or devices or such. Also, are you specifically setting the MOSI pin as an OUTPUT on the device in the appropriate DDRx?
[14:27:09] <Krampus> N1njaneer: yep. MOSI, SCK, and SS are outputs.
[14:27:15] <N1njaneer> I am not 100% sure that SPI in Master mode does an override to the pin functions to FORCE it to output.
[14:27:34] <Krampus> N1njaneer: It does not, and it can kick the logic into slave mode if you didn't.
[14:27:37] <Deskwizard> Krampus: lol yep, similar to what I say "unless proven otherwise, you're doing it wrong"
[14:27:43] <JesseG_Work> Deskwizard, and "They shipped a hojillion of them with hardware bugs, check the errata :P"
[14:27:50] <Deskwizard> oh yeah effin errata
[14:27:56] <Deskwizard> I learned about that word the hard way lol
[14:28:00] <Krampus> Deskwizard: there are a surprisingly large number of people that don't get that.
[14:28:02] <N1njaneer> Krampus: Yes, that was the issue I was mentioning about SS output direction being explicitly set.
[14:28:12] <Krampus> JesseG_Work: shh! "Specification Update!"
[14:28:13] <Deskwizard> solution "go fuck yourself, use another pin" ty microchip lol
[14:28:23] <Deskwizard> Krampus: I agree, staggering amount
[14:28:43] <N1njaneer> I just wanted to ensure that you weren't leaving DDRx for MOSI set as an INPUT and then potentially thumping out high-impedence data pulses by the SPI bus toggling the pull-up and not the active drive :)
[14:28:51] <Krampus> Deskwizard: I can't see myself ever using a PIC again. AVRs are so much easier for me to deal with.
[14:29:00] <JesseG_Work> Krampus, oh yeah I forgot. "First we write the specification and feature set. Then, when people complain that it doesn't work, we build the hardware they most want, if we can."
[14:29:08] <Krampus> N1njaneer: O
[14:29:29] <Deskwizard> Krampus: I was forced to ;)
[14:29:35] <Deskwizard> N1njaneer: sanity check... lets say this is my ISR and T0 prescaler is 1024 -> http://pastebin.com/FtMeZu9A, if I change the prescaler to 64 instead, I'll have to count 16 overflows instead of one, right?
[14:29:39] <Krampus> N1njaneer: I'll double check of course, but I'm 99% sure I'm not doing that.
[14:29:57] <Krampus> N1njaneer: I've also been digging around to make sure none of the other threads are doing anything with it.
[14:30:35] <Deskwizard> Krampus: other treads? you're doing it wrong :P~
[14:31:09] <Deskwizard> but then again, so am I lol
[14:31:53] <Deskwizard> N1njaneer: 'cause if I can make the IR work at /64, in theory it should all work
[14:32:47] <Deskwizard> arff I forgot the defines... http://pastebin.com/PC6gAH0W here, I added them to the top
[14:34:03] <Krampus> Deskwizard: nah, there's good reason for them, although they don't interact much yet because debug.
[14:35:35] <Deskwizard> Krampus: basically my issue is this, rotary encoder and buttons debounce works at /64, IR works at /1024, and the encoder doesnt like /1024
[14:35:53] <Deskwizard> I tried adjusting OCR0B to a shorter top to compensate, same result
[14:36:48] <Deskwizard> tbh, I dont care what prescaler they use, as long as they use the same one :P
[14:37:27] <Deskwizard> but my multiple attemps at that failed... I thought my little T_Vall(x) thing would work as I saw something similar working elsewhere, but no candy
[14:38:10] <Deskwizard> I've been effin around at this for at least a week, I'm about to take the damn hammer to it.
[14:38:18] <Krampus> Deskwizard: IR = infrared? buttons and rotary encoder and IR are being driven by OCR0B?
[14:38:55] <Krampus> Deskwizard: I'm almost to Hasa Diga Ebowai with regard to my project too. The LCD flicking on is going to make my dang day.
[14:39:04] <Deskwizard> IR - infrared yes, button debounce and rotary encoder on TIMER0_COMPB_vect
[14:39:12] <N1njaneer> Deskwizard: Well, you might want to go off of some of the suggestions I gave last night on how to write a software UART :)
[14:39:13] <Deskwizard> Krampus: yeah I see what you mean hehe
[14:39:24] <Deskwizard> *growls
[14:39:54] <Deskwizard> N1njaneer: might as well use the hardware one, its not working anyway.
[14:40:24] <Krampus> "When AVR is getting you down and there's nobody else to blame, raise your middle finger to the sky and curse his rotten name!" :)
[14:40:46] <Deskwizard> indded
[14:40:49] <Krampus> Deskwizard: I'm convinced that my root cause will be delightfully enraging in its simplicity.
[14:41:05] <Deskwizard> Krampus: aint it always heheh
[14:41:20] <N1njaneer> Well, I have a deployed production design here on my desk that does data comm on the UART and IR reception via software UART and works great, so I can definately say it can be done with only a couple pages of code :)
[14:41:55] <Deskwizard> N1njaneer: "can be done" != "can be done by deskwizard" apparently :P
[14:41:59] <N1njaneer> I would post the code, but this is a client project so NDA's and all that :)
[14:42:13] <Deskwizard> you tease :P~
[14:42:26] <N1njaneer> Nah, just takes a bit of experience to dial it in. But it's a good project to get some solid practice on!
[14:42:43] <N1njaneer> But there are also a lot of examples of software UARTs out there, too, for AVR.
[14:42:50] <N1njaneer> And more modular ones that that.
[14:43:23] <Deskwizard> yeah I should just stop trying to be learn and not do anything right and use other peoples code...
[14:43:37] <Deskwizard> sorry...
[14:43:42] <N1njaneer> No
[14:43:53] <N1njaneer> The point is that you can look at other code as REFERENCE if you are clearly stuck.
[14:44:29] <Krampus> N1njaneer: With the caveat that you are going to feel even more lost when you realize "Wait, i'm doing the exact same thing!" :)
[14:44:59] <N1njaneer> I gave you the pseudocode explanation last night of how to do it. If you need more detailed a breakout, there is good reference code avaliable for it. I would give you what I have here, but it would take too long to strip down to be useful because it's a LOT more complicated than you need for your application.
[14:45:16] <N1njaneer> Krampus: Yes, but that exact thing cements in the idea that you UNDERSTAND what is going on. :)
[14:45:43] <N1njaneer> Because pretty much every software UART code core is the same, with some slight differences. And every part of it will make inherent sense once you get it working.
[14:45:52] <Krampus> Deskwizard: reading and learning from others example code is part of the process!
[14:46:07] <N1njaneer> Writing UARTs in FPGAs is pretty much the same, too - the VHDL looks pretty much identical :)
[14:46:58] <N1njaneer> I really need to find time to write an extensive AVR blog covering all of these kinds of topics. I've been thinking about doing a VIDEO blog and whiteboard stuff... Maybe that would be of interest to people./
[14:47:40] <Deskwizard> N1njaneer: I had something like that planned, but it implies having knowledge I clearly lack lol
[14:47:46] <Krampus> N1njaneer: my brother's suggested I start a video blog that's just him asking science questions and then I whiteboard the answer dumbed down for him. We'd call it "High Science" or some such.
[14:47:59] <Deskwizard> Krampus: I'd watch that hehe
[14:49:32] <Krampus> Deskwizard: "Alright, so let's say this blanket represents a reality with nothing in it..."
[14:49:51] <aandrew> Krampus: lol
[14:50:09] <Deskwizard> lmfao you making for of what little I know? :P~ jk
[14:50:13] <Deskwizard> fun*
[14:50:38] <Jartza> evening
[14:50:45] <Deskwizard> 0/ Jartza
[14:51:06] <Krampus> Deskwizard: "And then we throw the MAF from that car into the middle of it to represent a large mass, like the sun! And these ball bearings are planets."
[14:51:27] <Krampus> Deskwizard: and then it just kinda trails off into observations and non-sequitors.
[14:52:44] <Deskwizard> Krampus: I saw that somewhere like 10 yrs ago and it stuck... for car HP vs torque... HP is how fast you hit the wall, torque is how far you drag it back with ya
[14:53:22] <Deskwizard> alrigh getting back to what I have that works. a blinking led.
[14:53:28] <Krampus> Deskwizard: My project car is an old volvo that I reckon I can get to a couple hundred HP petty easily. :)
[14:54:36] <nuxil> what volvo ?
[14:54:40] <N1njaneer> Woo, my reworked stack 'o stencils is ready to be picked up tomorrow!
[14:54:56] <nuxil> you can trim the B2X engines verry much actually
[14:55:39] <Krampus> nuxil: '88 240 wagon.
[14:56:09] <nuxil> :)
[14:56:30] <Krampus> nuxil: it's got a B230 and is currently NA. Most of my work so far has been getting it as close to stock condition as possible (friend I bought it from didn't take great care of it).
[14:57:18] <nuxil> part for that car inst hard to find. atleast not here.
[14:57:40] <nuxil> *parts
[14:58:35] <nuxil> coolest car volvo ever made was the amazone :D
[15:03:55] <Jartza> it's without e, though :)
[15:04:01] <Jartza> I've owned volvo amazon :)
[15:05:47] <JesseG_Work> that is a nice looking car.
[15:10:24] <Jartza> amazon is very nice. but I also love Volvo PV
[15:13:50] <nuxil> PV :D thouse are nice too
[15:14:47] <Jartza> but the ultimately coolest volvo is "the saint"
[15:14:49] <Jartza> P1800
[15:15:07] <nuxil> altho on the volvo 240 series, i like the american front bette than the sweedish/europeian one.
[15:15:23] <Jartza> https://upload.wikimedia.org/wikipedia/en/9/97/1965VolvoP1800S.JPG
[15:15:34] <Jartza> thing of beauty
[15:16:06] <nuxil> i go for a more gentelman car like this .
[15:16:17] <nuxil> APA-102
[15:16:23] <nuxil> https://c1.staticflickr.com/9/8458/8033839381_0e17214d6a_b.jpg
[15:16:27] <nuxil> 164
[15:16:58] <nuxil> sorry for that apa post.. xchat sometimes dont clear the clipboard memory.
[15:17:03] <Jartza> in finland we call those very rectangular volvos "tractors"
[15:17:21] <Jartza> the saint was a gentleman :)
[15:17:21] <nuxil> same here :D
[15:17:38] <nuxil> in norway :)
[15:18:58] <Jartza> volvo c303 would be useful here on countryside :D
[15:19:18] <nuxil> hehe
[15:19:23] <Jartza> especially when it's snowing and no-one has plowed
[15:20:16] <Jartza> LOL
[15:20:19] <Jartza> "In the 1983 Paris-Dakar rally a Volvo C303 won the class for trucks under 10 tonnes"
[15:20:21] <nuxil> yea. but its a really ugly beast
[15:20:36] <Jartza> yeah. box. with wheels.
[15:20:51] <nuxil> it kind of looks russian :p
[15:20:58] <Jartza> yep
[15:21:35] <Jartza> actually most of the russian military trucks are prettier :D
[15:21:58] <nuxil> anything is :D
[15:22:13] <Jartza> like UAZ 452. it's kinda cute.
[15:22:33] <Jartza> ugly. but cutely ugly. not box-kind-of-ugly :D
[15:23:47] <nuxil> only russian car i would want is the lada niva
[15:24:19] <Jartza> yea. very nice :)
[15:25:07] <nuxil> btw. youre from findland ?
[15:25:42] <nuxil> do you speak sweedish? io seen many do.
[15:27:20] <Jartza> yea, from finland
[15:27:30] <Jartza> I understand swedish pretty well, I speak a bit worse
[15:27:41] <Jartza> mainly because when I don't use swedish that often
[15:28:02] <Jartza> mostly it's the vocabulary-thing, when I start speaking, I always just remember english words :D
[15:28:20] <nuxil> who needs sweedish anyway :p
[15:28:21] <nuxil> jk
[15:29:07] <inkjetunito> :o svensktalande bättre folk
[15:29:09] <Jartza> idk :)
[15:29:13] <Jartza> lol
[15:29:14] <nuxil> i understand them well. more than i do the danish. but finnish. its omg.
[15:29:38] <Jartza> well. finnish has nothing to do with either scandinavian languages, nor english
[15:29:43] <Jartza> nor german languages
[15:29:58] <nuxil> mix of ruski and sami ?
[15:30:14] <nuxil> *samisk
[15:30:24] <Jartza> not really
[15:30:29] <Jartza> nothing to do with russian either :D
[15:30:58] <nuxil> hehe
[15:31:30] <Jartza> uralic language.
[15:31:32] <Jartza> The Uralic languages with the most native speakers are Hungarian, Finnish, and Estonian, which are official languages of Hungary, Finland, and Estonia, respectively, and of the European Union. Other Uralic languages with significant numbers of speakers are Erzya, Moksha, Mari, Udmurt, and Komi.
[15:32:09] <Jartza> still, hungarian and finnish are waaaaaaaaaay different
[15:32:17] <Jartza> estonian and finnish are the closest "pair"
[15:32:36] <nuxil> well. atleat you have the brains to use a proper alphabet :p not like the russians who like to twist letters and such.. i woulder if the guy who suppose to give them a writeing whent to latin.. collected the alphabet. but droped it on his way home and could not remember the order of it :p
[15:34:19] <Jartza> heh
[15:35:09] <Jartza> well... the latin alphabet, as it's called, is derived from greek alphabets... :P
[15:35:20] <Jartza> so "we" could all be using the greek one too :)
[15:35:24] <inkjetunito> to speakers of germanic languages, finnish is like this: <Dynetrekk1> it's got 17 constructors but none of them take a pointer to a memory location as input
[15:35:52] <Jartza> ΤΙΔΑΣ ΑΜΥΝΤΑΣ
[15:36:14] <Jartza> inkjetunito: lol :)
[15:37:50] <Jartza> ...and the greek alphabet is derived from egyptian hieroglyphs. yes. really.
[15:38:01] <Jartza> I guess we were just lucky :)
[15:40:32] <Jartza> and actually cyrillic alphabets are more modern origin than latin
[15:41:20] <Jartza> cyrillic alphabets were developed in 9th century
[15:41:21] <nuxil> inkjetunito, in here we do C humore.. C dosent have constructors..
[15:41:22] <nuxil> jk
[15:42:14] <nuxil> Jartza, that late..
[15:43:29] <nuxil> iirc latin is something like over 2.5k years old.
[15:43:51] <nuxil> the alphabet
[15:44:46] <Jartza> yeah.
[15:45:16] <Jartza> cyrillic alphabet was developed by first bulgarian empire :)
[15:45:30] <Jartza> aren't we lucky we're not using armenian? :)
[15:45:32] <Jartza> Հայոց այբուբեն
[15:46:06] <nuxil> yiks.
[15:46:51] <JoeLlama> 私はあなたの中国語が好きじゃない
[15:48:09] <Jartza> :)
[15:48:29] <nuxil> ت
[15:49:02] <Jartza> yea. and then there are Han characters :)
[15:50:27] <Jartza> ...chinese, japanese, korean and vietnamese
[15:51:30] <nuxil> good thing we have unicode :p
[15:52:02] <nuxil> encodings can be a nightmare
[15:53:05] <nuxil> i spend countless hours with it once i wrote a rcon client. i banged my head so many times agains the desk. lol
[15:53:12] <Jartza> yea. chinese is easy, after learning about 40000 characters that mostly look almost the same you're able to read a newspaper :D
[15:53:34] <nuxil> lol
[15:55:10] <Jartza> then you can learn some more, to be able to read some real literature :D
[15:55:50] <nuxil> i think i just get a translated book :p
[15:55:53] <Jartza> and then there are people who try to say "it's easy, they are really pictures!"
[15:55:54] <Jartza> https://upload.wikimedia.org/wikipedia/commons/3/32/Evo-elephant.png
[15:55:58] <Jartza> and show pics like that.
[15:56:10] <Jartza> like that would help, really
[15:56:22] <nuxil> lol
[15:56:46] <nuxil> that was funny.. i would be more confused with a teaching like that
[15:56:50] <Jartza> "hmm... MAYBE the chinese just drew an elephant, rotated 90 degrees and then mutated it! yes!"
[15:57:32] <Jartza> or, maybe it's 4 handed ninja with breadbox as head!
[15:58:02] <Jartza> ...or a squid
[15:58:28] <Jartza> https://upload.wikimedia.org/wikipedia/commons/e/ec/Evo-r%C3%AC.svg
[15:58:29] <Jartza> or this?
[15:58:43] <Jartza> "if you stare into sun long enough, it starts to look like ladders"
[15:59:00] <nuxil> haha. seriously ??
[15:59:18] <nuxil> is that a symbol for the sun?
[15:59:31] <nuxil> cryptographic language :p
[16:00:20] <Jartza> yea
[16:00:43] <Jartza> or mountain
[16:00:44] <Jartza> https://upload.wikimedia.org/wikipedia/commons/7/7a/Evo-sh%C4%81n.svg
[16:01:15] <Jartza> to decrypt that, you need to know that the guy/girl who invented that 4000 years ago was staring at 3 mountains, instead of 1
[16:01:21] <Jartza> and not just counting poles
[16:01:32] <Jartza> nor trying to invent a fork
[16:01:42] <Jartza> well, the last one is pretty obvious, they never invented fork
[16:01:43] <Jartza> but anyway
[16:01:44] <Jartza> :D
[16:01:44] <nuxil> rofl
[16:02:36] <Jartza> if someone is EVER trying to teach me chinese characters using pictures like that, I'll hit him in the nose.
[16:02:42] <Jartza> and I'm not violent type
[16:04:14] <nuxil> i would just laugh and head on to something else :p
[16:04:21] <Jartza> heh, yea
[16:04:29] <Chillum> I have yet to meet a Chinese person who did not speak some English
[16:04:33] <Jartza> I would want to learn chinese, though :D
[16:04:51] <Chillum> in fact wherever I travel they seem to know English
[16:05:05] <Jartza> try chinese countryside
[16:05:06] <nuxil> Chillum, not the old ones.
[16:05:15] <Chillum> knowing Chinese would help reading datasheets though
[16:05:26] <nuxil> not from my experiance. or they are to stuborn to speak it
[16:05:30] <Chillum> nuxil: I don't hang out with old people
[16:06:38] <nuxil> Chillum, nor do i, but i seen some turists on cruise here in our fjords.
[16:07:37] <nuxil> we have some "small cruise" ships going up/down the fjord here in norway. and in the summer they are packed with turists from japan, china, and germany
[16:08:18] <nuxil> "hurtigruten" as we call it
[16:10:11] <Jartza> done that :)
[16:10:19] <Jartza> I mean, hurtigruten
[16:10:49] <nuxil> i take it maybe 3-5 times a year. it comes to the port on my island and head on to the nearest city. so its a nice way to get there. cos i can relax and it takes about the same time to drive to it.
[16:10:52] <Jartza> I also drove to fjords with Vespa :)
[16:11:21] <nuxil> vespa ? the moped ?
[16:11:30] <Jartza> 250cc
[16:11:38] <nuxil> nice :D
[16:11:50] <Jartza> I also drove 6 weeks around europe with it in 2008
[16:12:03] <nuxil> i want to do that
[16:12:05] <Jartza> http://eurovespa.wordpress.com/
[16:12:33] <Jartza> missing the last week of story, because I was heading home and I really didn't want to :)
[16:12:42] <Jartza> so didn't feel like writing
[16:13:46] <Jartza> I had no plan, I just bought Vespa, ferry ticket to germany and had 6 weeks of time
[16:15:08] <Jartza> of course the best way to read that bloh is to start from here https://eurovespa.wordpress.com/2008/07/09/uneventful-beginning/
[16:15:24] <Jartza> and then just click to the next post
[16:16:52] <nuxil> how much did you pay for the vespa?
[16:18:54] <Jartza> hmm. iirc it was about 6k€
[16:19:53] <nuxil> you bought it new?
[16:20:33] <nuxil> it looks so shiny in your pic :p
[16:22:24] <Jartza> yes, it was brand new
[16:23:13] <Jartza> I drove for 1000km in finland (in a week) before my trip, as the first service is in 1000km (basically oil + filter change)
[16:23:37] <Jartza> then I had it serviced in italy (5000km service)
[16:28:13] <Jartza> best trip ever
[16:28:47] <nuxil> i bet.
[16:28:52] <Jartza> we decided to go on another bike trip with my wife, when the kid is old enough to travel with ua on bike :)
[16:29:33] <Jartza> he's now 4, I guess next summer we can start practicing with smaller moped scooter
[16:30:14] <Jartza> and maybe when he is 6-7 or something like that we can go on another tour
[16:30:39] <Jartza> maybe not as spontaneous as that 2008 trip, but anyhow
[16:31:26] <nuxil> famely trip should be planned
[16:34:18] <Jartza> at least a bit :)
[16:40:54] <Jartza> funny thing in that blog, of course the peak in readers was when I was travelling, but after that there still seems to be average 20-30 readers a day
[16:41:16] <Jartza> so I've kept that blog alive, evem though it hasn't been updated
[16:42:41] <Jartza> few thousand a year is good enough reason for me :)
[17:04:01] <PinkTieGuy> Hey guys. I'm back :/. Still trying to prove that (a-b)^n >= a_n - nba^(n-1). Using the binomial theorem, I've got it so that I have (a-b)^n = a^n - nba^(n-1) + (n choose 2)a^(n-2)(-b)^2 + sum from k = 3 to infinity (n choose k)a^(n-k)(-b)^k. The questions ask to "argue that, provided |a-1| and |b| are small, the inequality holds. I'm not sure how to argue that...
[17:33:40] * Deskwizard waves hello
[17:34:11] <Deskwizard> can I have you guy's opinion on what little I have now? I want to know if I'm heading in the right direction this time ;)
[17:34:12] <Deskwizard> https://github.com/deskwizard/AVR_CodeReference
[17:34:32] <Deskwizard> any and every little comment welcome, not like it does much lmao
[17:41:30] <PinkTieGuy> Hey guys. I'm back :/. Still trying to prove that (a-b)^n >= a_n - nba^(n-1). Using the binomial theorem, I've got it so that I have (a-b)^n = a^n - nba^(n-1) + (n choose 2)a^(n-2)(-b)^2 + sum from k = 3 to infinity (n choose k)a^(n-k)(-b)^k. The questions ask to "argue that, provided |a-1| and |b| are small, the inequality holds. I'm not sure how to argue that...
[18:03:05] <N1njaneer> Deskwizard: Be aware that eventually your ms will roll over and you may get undesirable behavior. For stuff like this I generally prefer to deal with individual counters that can be reset after the interval I'm looking for has elapsed, etc
[18:04:01] <N1njaneer> i.e. register a bunch of counter variables with your timer, timer increases them, so then you go "If LEDCounter > 500ms then FlashLED(); LEDCounter = 0; "
[18:04:16] <N1njaneer> And you don't have to worry about ever-increasing counters that will eventually overflow.
[18:04:42] <Alex1992> Hi, I was hoping you guys could help me with interfacing with an ATMEGA16-16PU using the avr pocket programmer from sparkfun
[18:05:05] <Alex1992> I have successful programmed an ATMEGA32, but for some reason the ATMEGA16 doesn't work
[18:05:36] <Alex1992> I get an initialization failed, rc=-1 after i run "avrdude -c usbtiny -p16"
[18:06:07] <Alex1992> I put a space in between the -p and 16 in my command line
[18:06:27] <Alex1992> *m16
[18:07:39] <Alex1992> Any help would be greatly appreciated, they have the exact same pinouts, so I'm pretty perplexed as to why it isn't communicating correctly
[18:17:19] <N1njaneer> Make sure you are starting at the slowest clock speed with the programmer - 125Khz or less. ISP bus must be < 1/8 the clockspeed the device is running at :)
[18:17:31] <m3chanical> Is the chip right out of the box?
[18:18:47] <Alex1992> ok, is that the -b that does the clockspeed?
[18:18:56] <Alex1992> m3echanical: yes
[18:19:40] <m3chanical> okay. then the fuses should be fine. N1njaneer is probably right. too fast programmer speed makes things go wonky.
[18:20:56] <Alex1992> if i set the clock speed lower, but plan on using an external oscillator, is there any conflict there?
[18:21:26] <N1njaneer> No, just have to meet that maximum timing requirement for the ISP bus
[18:21:27] <m3chanical> not that i've encountered, but i'm not 100% certain. i attached a 16mhz crystal and kept the programmer at the same speed without issue
[18:21:52] <N1njaneer> Once you move the part to an 8Mhz or 16Mhz part you can bump the ISP speed up to 1Mhz or so, which makes programming images a LOT faster :)
[18:22:22] <N1njaneer> You can always run the ISP *slower*, just not FASTER than 1/8th the micro's speed
[18:23:12] <N1njaneer> Keep in mind the devices ship from Atmel set to the internal 1Mhz RC oscillator, so hence you have to use 125Khz or less the first time they are manipulated.
[18:23:29] <m3chanical> http://www.ladyada.net/learn/avr/avrdude.html Ctrl+F "AVR initialization failed" (no anchor link) suggests that the problem you're having is typically a wiring problem
[18:23:43] <N1njaneer> For production programming, for instance, we run our batch scripts that set the fuses at 125Khz, then bump the speed up to 1Mhz to load the firmware image and lock the device.
[18:24:04] <Alex1992> so the ISP is how I'm actually changing the flash memory right? so if i use a 14.7456 MHz then i can upload with 14.7456/6 MHz speed?
[18:24:21] <N1njaneer> 14.7456/8 speed
[18:24:26] <N1njaneer> Or less
[18:24:35] <Alex1992> yeah, sorry typo. Ok that makes sense!
[18:24:55] <N1njaneer> Typically you're probably not going to want to run the ISP over 1Mhz anyhow, especially if you are going through flying leads
[18:25:08] <Alex1992> and m3chanical, it shouldn't be a wiring thing, since it works perfectly fine with the atmega32
[18:25:29] <Alex1992> like i can run "avrdude -c usbtiny -p m32" and it works fine
[18:25:38] <m3chanical> oh oops. i missed that - sorry
[18:26:04] <Alex1992> no worries, so i set this ISP speed using the -b command right?
[18:26:51] <N1njaneer> I never use AVRDUDE so unfortunatly cannot tell you
[18:27:17] <m3chanical> i have an AVRDragon myself
[18:27:38] <Alex1992> ok, i found this equation for AVRdude "SPI clock frequency in KHz = 1000/(1.5+B) where B is the delay value."
[18:34:01] <Lambda_Aurigae> what programmer do you have?
[18:34:24] <Lambda_Aurigae> nevermind..just scrolled up.
[18:34:48] <Alex1992> yeah, i've tried to set the bitrate, but i still see the initialization failed message
[18:34:56] <m3chanical> Alex1992 , it looks like the CLI option you want is "-B" (capital b)
[18:35:18] <Alex1992> yeah, i accidentally did -b (baud) instead of -B (bit) the first time
[18:35:37] <Alex1992> but idk how to check if it actually changed anything
[18:35:40] <Lambda_Aurigae> it's a vusb based usbtiny programmer so may or may not support the -B option.
[18:35:46] <m3chanical> Looks like avrdude is default set to 4mhz. Do you know what the clock is on the atmega32 you have?
[18:35:51] <Lambda_Aurigae> depending on the version of firmware on it.
[18:36:20] <Alex1992> mech: uhhh, not off the top of my head, I'll check
[18:36:42] <Alex1992> 1Mhz
[18:37:40] <Lambda_Aurigae> the atmega16 is new and never been programmed before?
[18:37:42] <Alex1992> lambda: If i did a -b or -B but get the "initialization failed" message, does that mean it didn't change those values
[18:37:51] <Alex1992> lambda: brand new
[18:41:20] <Deskwizard> N1njaneer: thanks for the heads up :)
[18:41:24] <Lambda_Aurigae> in theory, if you use the same hardware setup as the atmega32,,,like, dropping it onto the same breadboard with everything else hooked up the same, it should work....so, sounds like a bad chip.
[18:41:31] <N1njaneer> Deskwizard: Mmm?
[18:41:45] <Deskwizard> <N1njaneer> Deskwizard: Be aware that eventually your ms will roll over and you may get undesirable behavior. For stuff like this I generally prefer to deal with individual counters that can be reset after the interval I'm looking for has elapsed, etc
[18:42:38] <Alex1992> lambda: I've put the atmega32 back in, and after all those changes it doesn't work now
[18:42:43] <Lambda_Aurigae> I would try feeding a 1MHz signal into the XTAL1 pin
[18:42:48] <Lambda_Aurigae> oh..
[18:42:50] <Lambda_Aurigae> hmmm.
[18:42:55] <Lambda_Aurigae> something ain't right then.
[18:43:08] <m3chanical> Alex1992 , which changes?
[18:43:09] <Alex1992> would you know how I can check what teh current baud and bit rate is
[18:43:27] <Alex1992> I can't talk with the chip anymore, get initialization failed message
[18:43:38] <m3chanical> from what I saw there's an avrdude rc file somewhere you can poke around in for defaults
[18:44:19] <Lambda_Aurigae> go back to what worked originally.
[18:44:23] <m3chanical> lambda is right, something isn't right. maybe try disconnecting/reconnecting the programmer?
[18:44:41] <Lambda_Aurigae> get a programmer that's not v-usb based.
[18:45:44] <m3chanical> hah. i really enjoy the avrdragon. i bricked it once because i was stupid (I think i shorted 5v on it) but was able to fix it with no problem. pretty cool little device
[18:46:01] <Lambda_Aurigae> I have a dragon...only use it for HV programming.
[18:46:15] <Lambda_Aurigae> I use my stk200 clone more than anything else.
[18:46:16] <m3chanical> what do you usually use?
[18:46:17] <Lambda_Aurigae> it just works.
[18:46:21] <m3chanical> ahh
[18:46:26] <Lambda_Aurigae> parallel port through a 74ls244 chip.
[18:46:44] <Alex1992> ok, so it turns out the atmega32 still works, I was just being monumentally dumb and shifted the pins over by one, so that two were hanging over the socket
[18:46:48] <Lambda_Aurigae> my first ever avr programmer from,,,15 years ago.
[18:47:07] <N1njaneer> $30 gets you an ATMEL-ICE that will do every flavor of connectivity for AVR and Atmel ARM parts :)
[18:47:13] <Lambda_Aurigae> when I'm working from a computer without the parallel port I use my tom-itx programmer.
[18:47:37] <Lambda_Aurigae> it does pdi, tip, and isp...but not HV programming.
[18:48:16] <JesseG_Work> And know what's funny? They got both programming ports in backwards in the atmel ice and rather than fixing it, or even putting a warning in the datasheet, they just shipped them with backwards cables :P
[18:49:09] <m3chanical> Alex1992 , lol oops :P
[18:50:22] <Alex1992> mech: haha, yeah not one of my finer moments, felt like it was shorting something too, was starting to get pretty hot
[18:51:52] <Lambda_Aurigae> avr chips are pretty tough. I've put them in backwards and had them get hot and still function afterwards.
[18:53:55] <m3chanical> breaking components is always a good learning experience anyway. not always a bad thing ^_^
[18:54:42] <Lambda_Aurigae> oh, I've let the magic blue smoke out of plenty of components over the years.
[18:55:26] <JesseG_Work> One time I ran 12v limited to 600mA into a port pin on some other micro. It did get hot, but the built in IO pin protection diode shunted the voltage onto the power pins, so it was running. And somehow it was shunt regulating the voltage to around 6v. I could not believe it but it still worked after that :D
[18:55:31] <N1njaneer> Lambda_Aurigae: Oooh! It comes in blue? :D
[18:55:47] <Alex1992> haha, those are reassuring sentiments
[18:55:56] <Lambda_Aurigae> yeah...feed 24V across a 74ls00 chip once or twice.
[18:55:56] <m3chanical> lol nice JesseG_Work
[18:56:18] <JesseG_Work> Lambda_Aurigae, twice on the same chip? lol
[18:56:23] <Lambda_Aurigae> current limiting,,,bah.
[18:56:37] <Lambda_Aurigae> JesseG_Work, yeah..first time the magic blue smoke comes out.
[18:56:48] <Lambda_Aurigae> second time it kinda glows a bit inside the hole made the first time.
[18:57:09] <JesseG_Work> Lambda_Aurigae, ahh yeah. Once the smoke has been liberated then the game goes on but the rules are different :P
[18:57:32] <Lambda_Aurigae> now,,,the fun one is the first generation 1GHz athlon chips.
[18:57:51] <Lambda_Aurigae> they will run for all of 6 seconds before exploding and letting out the magic smoke if you take the heatsink off.
[18:58:47] <Lambda_Aurigae> and they do explode...
[19:02:51] <m3chanical> that must be fun to watch
[19:05:20] <JesseG_Work> I heard about a guy running one without the heatsink and then reaching out to touch it to see if it was hot. Burned his finger print into the chip and cracked it, goes the story.
[19:08:48] <N1njaneer> I should immerse an Atmega in LN2 here and see how fast we can overclock it :D
[19:09:11] <N1njaneer> Last time I did that, though, the resonator on the board would halt when it got too cold, so I need to use a TTL clock source.
[19:10:51] <m3chanical> That would be pretty ridiculous. Where does one get LN2 (liquid nitrogen right?) from anyway?
[19:12:37] <N1njaneer> From the huge dewar that's sitting here in the shop :)
[19:13:04] <N1njaneer> You can source it from most any large gas distributor/welding supply place
[19:13:28] <Deskwizard> oh please god tell me im not that dumb... lmao
[19:14:21] <N1njaneer> LN2 is a by-product of fractional distillation, so the plants that bottle things like Argon, Nitrogen, CO2, etc produce hundreds of thousands of gallons of the stuff.
[19:14:34] <N1njaneer> I get it for around $0.70/L USD
[19:14:58] <N1njaneer> So it costs me roughly $30 to fill the 50L, and will last 3-4 months or more :)
[19:15:09] <N1njaneer> Great to make on-demand icecream with!
[19:15:53] <m3chanical> that's pretty great
[19:16:42] <N1njaneer> Great stuff.
[19:39:18] <m3chanical> Deskwizard, I tried to check out your github page that you linked but it looks like github is pretty jacked up atm, heh
[19:39:57] <Deskwizard> m3chanical no worries mate, you had good intentions hehehe
[19:41:34] <m3chanical> ^^ What are you writing?
[19:44:17] <Krampus> N1njaneer: alright, found one "goddamitsomuch." All the voltage rails are marked "Sweet evil jesus, don't even THINK of going higher than 3.3V on the I/O lines." I missed the "Oh, but like everything else? Power that shit at five volts." >.<
[19:44:26] <Krampus> "Thanks, Obama!"
[19:45:00] <N1njaneer> Clarify?
[19:45:12] <N1njaneer> Is the AVR running at 3.3V but other components are at 5V?
[19:46:06] <Krampus> N1njaneer: AVR @ 5V LM317 providing 3.3V. Level shifter between LCD and AVR.
[19:46:41] <N1njaneer> Okay.
[19:46:41] <Krampus> N1njaneer: so now the screen at least powers up and flickers like it's thinking about doing what I want. Still no pixels, but I reckon I probably hit the "right" command sequence earlier and then broke it chasing this ghost.
[19:46:58] <N1njaneer> Well sounds like progress :)
[19:47:25] <Krampus> N1njaneer: yep! Everything's coming up Milhouse.
[19:48:52] <Deskwizard> Krampus: congrats :)
[19:49:01] <Deskwizard> did it feel as good as you thought it would ? :P
[19:49:12] <Krampus> Deskwizard: no, because I don't got no dots!
[19:49:34] <Krampus> Deskwizard: Now I start the "unwinding of desparate measures" to try to go back to where I was when i ran against the wall.
[19:49:46] <Deskwizard> Krampus: yeah I know the feeling
[19:49:52] * Deskwizard hands Krampus army helmet
[19:49:54] <Deskwizard> there, it helps
[19:49:54] <Deskwizard> lol
[19:50:07] * Krampus needs to reorganize his project and put it into git.
[19:50:37] * N1njaneer posts the obligatory SMT line helper picture! https://www.dropbox.com/s/yq6ymvsw0o9nlzc/ProductionHelper.jpg
[19:51:04] <m3chanical> oh my. that's adorable
[19:51:17] <N1njaneer> Thanks! I wish he was still that tiny now :D
[19:58:30] <Krampus> N1njaneer: "Alright, says here that in case of problems, the first thing I should do is check the status of 'g_oat?'"
[19:58:57] <m3chanical> instruction 0xFEED
[19:59:24] <N1njaneer> Totally!
[20:00:10] <Krampus> N1njaneer: Now, without detracting from how awesome of a shot that is, petting zoo class animals don't seem like they'd make for good technicians.
[20:01:25] <N1njaneer> It was fun having baby pygmy goats running about here at the shop for a few months. Bottle-raised them so they need fed every few hours and such. They are curious about pretty much everything.
[20:01:49] <Krampus> This answers no questions but instead creates more.
[20:02:15] <Krampus> Number of goats, pygmy or otherwise, that have infiltrated our lab: 0.
[20:02:18] <Krampus> unless you count this one guy.
[20:02:22] <N1njaneer> They are good technicians when it comes to sorting out the best strands of hay and wire
[20:02:58] <Krampus> don't they tend to poop everywhere?
[20:03:07] <Krampus> or can they be housebroken.
[20:05:24] <N1njaneer> They'll use a litterbox far faster than a puppy will.
[20:05:29] <N1njaneer> +learn to use
[20:06:10] <N1njaneer> When they are bottle-fed they don't make much poop. Once they are 2-3 months old you generally move them outside. But they're actually very good. :)
[20:06:30] <m3chanical> that's pretty awesome. how big do they get? i mean, regardless i don't think my city apartment management would allow me to obtain and raise a goat.
[20:09:06] <julius> hi
[20:09:14] <m3chanical> hello julius
[20:09:59] <julius> when avcc is the reference voltage for the adc, does that mean that 0v is 0b, and 5v is 65xxx ?
[20:10:04] <N1njaneer> m3chanical: They get to about a medium-sized lab when fully grown :)
[20:10:27] <N1njaneer> m3chanical: Need to have a minimum of 2-3 though as they are social animals.
[20:10:34] <m3chanical> ahh
[20:10:48] <m3chanical> that's awesome ^^
[20:10:53] <N1njaneer> m3chanical: https://www.youtube.com/watch?v=PeZtoQfDo8M is pretty much full grown. Silver one in the video is the one from the picture :)
[20:11:21] <N1njaneer> Video is a bunch of cool slow-motion stuff we shot with them in the park in November. Make sure to watch in HD :D
[20:11:59] <m3chanical> haha their names are adorable
[20:12:24] <N1njaneer> Thanks!
[20:12:36] <N1njaneer> We have another baby goat on the way here, hopefully in the next few weeks :)
[20:12:52] <m3chanical> i'm pretty sure this is the most adorable thing i've ever seen
[20:12:57] <N1njaneer> D'aww :D
[20:13:37] <N1njaneer> Weather has been pretty bleh lately, so looking forward to it being spring again to go out and keep shooting more high-speed goat action. :)
[20:14:11] <julius> N1njaneer, do they come when you call them?
[20:15:32] <N1njaneer> Generally, though they are kind of like a cross between a dog and a cat. Much the cat where they will choose to ignore you.
[20:15:53] <N1njaneer> But when hiking they stay RIGHT with you - they are amazing hiking companions. We don't even keep them clipped. :)
[20:15:57] <julius> so no paper in the morning to bed?
[20:16:21] <julius> the slow mo parts are really amazing
[20:16:40] <N1njaneer> Thanks! It was cool to realize they close their eyes right before they impact when headbutting!
[20:17:27] <N1njaneer> We're looking forward to getting more slow-mo stuff with a bit nicer color - it's a bit bleak and barren in the winter!
[20:17:59] <julius> oh yes it is
[20:18:12] <julius> just got me a daylight lamp with 10.000lux
[20:18:45] <N1njaneer> I need a faster cine-prime lens for the camera.
[20:19:09] <N1njaneer> That being said, we actually shot that entire video right at sunset and it came out a lot better than I would have expected for low light!
[20:19:56] <julius> it does look bright for that time
[20:21:13] <N1njaneer> Fast lens and a speed-booster
[20:21:31] <N1njaneer> I need a bit wider, though.
[20:22:07] <N1njaneer> I *think* we shot all of that slow-mo at 120fps because of the light. Can go to 240fps without losing the resolution but it would have started getting too grainy
[20:22:44] <N1njaneer> We have also put a GoPro on Poptart when hiking, so it's a POV over his shoulder :D
[22:36:28] <Deskwizard> :) I have basic hw usart and sw tx uart :)
[22:36:45] <Deskwizard> multiple baud rates
[22:42:42] <Deskwizard> using 'U' as test char and the logic analyser, its just too easy... i wish i thought of that before lol