#avr | Logs for 2015-06-08

Back
[03:47:20] <Tom_itx> hackvana?
[05:32:41] * LeoNerd idly wonders why an "empty" AVR program still wants 270 bytes of flash...
[05:38:06] <twnqx> interrupt handler table + chip init?
[05:38:12] <twnqx> though 270 sounds pretty large
[05:38:41] <LeoNerd> Ah; turns out I also had my base OS 'main()' linked in ;)
[05:38:45] <twnqx> i have smaller ones :P
[05:38:49] <LeoNerd> Which is the entire task-based scheduler
[05:39:11] <twnqx> just wanted to say, the smallest i have here is 222 bytes
[05:39:16] <twnqx> already as .hex, not binary
[05:39:39] <twnqx> int main (void) {
[05:39:39] <twnqx> DDRB=0x01;
[05:39:39] <twnqx> while (1) {
[05:39:39] <twnqx> PORTB ^= 0x01;
[05:39:39] <twnqx> _delay_ms (10);
[05:39:40] <twnqx> }
[05:39:42] <twnqx> }
[05:39:44] <twnqx> :P
[05:40:03] <LeoNerd> Ohsure.. but that's not a coöperative preëmptable multitasking OS scheduler ;)
[05:40:09] * LeoNerd needs to add timers sometime
[06:11:15] <hackvana> Tom_itx: A little bird tells me your webserver is serving up an "Arduino_bare_min",
[06:16:52] <Tom_itx> ok?
[07:02:57] <kdehl> So, when making a simple bit-banging programmer you ought to use resistors on all the pins because once the controller is rebooted it might output data on its connected pins that is different from what the programmer outputs at the same time. That is you output 1 and 0 at the same time, which means you short + and -, and hence you short the circuit. Is this a correct understanding of what's going on?
[07:03:43] <LeoNerd> Yeah; that's reasonable
[07:03:53] <kdehl> Alright.
[07:03:55] <LeoNerd> I tend to put 220R
[07:04:05] <kdehl> Okay.
[07:04:15] <kdehl> Larger values means the signal travels slower, am I right?
[07:04:19] <LeoNerd> 5V across 220R is just over 10mA; so well within the limits of both sides
[07:04:27] <kdehl> Right.
[07:04:55] <LeoNerd> Yah; if you consider the stray capacitance of the target pins on the far side of those resistors, you have in effect an RC filter that smooths out the sharp digital signal
[07:04:56] <kdehl> If I'd use higher values it would take some time for the voltage to build up over the resistor, if I understand it correctly.
[07:05:07] <LeoNerd> Especially on things like a clock line, you want to keep that quite small
[07:05:12] <kdehl> Right.
[07:05:34] <kdehl> But 220Ω is reasonable, you say.
[07:06:00] <LeoNerd> Indeed.. especially as we tend to be talking maybe tens of pF at most
[07:06:10] <Lambda_Aurigae> 220ohms or 330ohms works well...
[07:06:23] <LeoNerd> 220R * 10pF => 2.2 nanoseconds
[07:06:26] <kdehl> I wonder how fast you can tick with that kind of resister. I guess it would create problems if you'd connect it directly to a 20 MHz oscillator.
[07:06:28] <Lambda_Aurigae> I like to use a 74ls125 or 74ls244
[07:06:29] <kdehl> Ah.
[07:06:35] <LeoNerd> So unlikely to notice that even up at 10MHz
[07:07:01] <kdehl> LeoNerd: Alright.
[07:07:08] <kdehl> Lambda_Aurigae: How does those help?
[07:07:10] <kdehl> *do
[07:07:36] <Lambda_Aurigae> watch your parallel port's capabilities too...some don't have a real strong drive chip so the max current can be a bit whimpy on newer ones.
[07:07:45] <Lambda_Aurigae> kdehl, is a buffer chip.
[07:07:54] <Lambda_Aurigae> which also allows you to drive longer lines.
[07:08:25] <kdehl> Actually I'm using a Raspberry Pi and its GPIO pins.
[07:08:35] <Lambda_Aurigae> oh.
[07:08:42] <Lambda_Aurigae> then I would definitely use a buffer chip.
[07:08:48] <kdehl> I can't remember now, but I think up to 17 mA was okay per pin.
[07:08:53] <kdehl> Right.
[07:08:57] <Lambda_Aurigae> that rPI gpio port can be a bit picky.
[07:08:58] <kdehl> And up to 50 in total?
[07:09:07] <kdehl> Yeah, I've heard.
[07:09:31] <Lambda_Aurigae> I don't hook any unknowns to my rPI gpio...I always use some kind of buffer chip that I have tested thoroughly.
[07:09:36] <kdehl> It works without the resistors. :) But maybe not for too long... hrm...
[07:09:42] <kdehl> Right.
[07:10:12] <LeoNerd> Incidentally: Why bother? You can buy selfcontained AVR burners on USB for like... $4 or something silly.
[07:10:17] <kdehl> Hm. I actually do have both '244s and '125s...
[07:10:30] <Lambda_Aurigae> LeoNerd, usbasp programmers...eewwwwww..
[07:10:32] <Lambda_Aurigae> hehe
[07:10:41] <LeoNerd> Lambda_Aurigae: Howso?
[07:10:56] <Lambda_Aurigae> well, I have several computers here that usbasp won't work on.
[07:10:59] <kdehl> Yeah, actually, the problem was that it was a weekend and there was no stores open. And I really, really wanted those AVRs programmed. :)
[07:11:02] <Lambda_Aurigae> that v-usb doesn't work with actually.
[07:11:03] <LeoNerd> I find mine is physically convenient (because I have it on a USB extension cable); software convenient (because avrdude JustWorks)
[07:11:18] <twnqx> you get 4$ programmers with 16u2...
[07:11:23] <LeoNerd> Yah, that also
[07:11:27] <Lambda_Aurigae> oh..haven't seen those twnqx
[07:11:34] <kdehl> 16u2?
[07:11:35] <Lambda_Aurigae> all the cheapy ones I've seen are v-usb based.
[07:11:48] * Lambda_Aurigae pats his parallel port programmer.
[07:11:54] <twnqx> smallest of the hardware usb ones
[07:11:54] <Lambda_Aurigae> been using it for many many years.
[07:11:58] <LeoNerd> They probably were a few years ago. Now the {16,32}U{2,4} are becoming quite cheap commodity
[07:12:04] <Lambda_Aurigae> still works,,,and works well.
[07:12:15] <LeoNerd> I don't think I own a computer with a parallel port
[07:12:21] <twnqx> i do \o
[07:12:25] <LeoNerd> So I'd have to get a USB-1284 bridge anyway ;)
[07:12:26] <Lambda_Aurigae> and, yes, my new computer(1 year old) has both parallel and serial ports.
[07:12:28] <twnqx> i just doesn't have an OS installed
[07:12:34] <twnqx> it*
[07:12:42] <Lambda_Aurigae> usb-1284 bridge won't work...you can't access individual pins.
[07:12:53] <twnqx> and i have no idea if it would be a good idea to use a pentium mmx 233 for anytign reasonable :D
[07:12:54] <LeoNerd> These days I just USB everything. Gonna get me a ~10 port powered USB hub for my lab
[07:12:58] <Lambda_Aurigae> would need to have a pci parallel port card.
[07:13:03] <twnqx> pcie*
[07:13:08] <Lambda_Aurigae> that works too.
[07:13:16] <twnqx> who has still PCI... that's SO last decade
[07:13:26] <Lambda_Aurigae> I have several computers with pci in it.
[07:13:41] <Lambda_Aurigae> hell, I have a pile of P-4 machines with linux on them that work just fine.
[07:13:41] <LeoNerd> Scope, PSU, Salaea, AVR burner, Bus Pirate, Maverick, ... that's 6 ports of tooling *before* I get down to having one or two FTDI- or 32U4 target boards to work on as well
[07:13:48] <Lambda_Aurigae> both desktops and laptops.
[07:14:08] <Lambda_Aurigae> perfect for doing microcontroller work too.
[07:14:30] <Lambda_Aurigae> ok..time to head for worky.
[10:04:37] <hypermagic> hi
[10:05:35] <Lambda_Aurigae> no, and you can't make me!
[10:23:47] <LeoNerd> OHOHOH! My Rigol has shipped :)
[10:24:05] <Casper> which one?
[10:25:37] <LeoNerd> DS1054Z. Nothing toooo fancy
[10:28:01] <Casper> you'll like it
[10:28:17] <Casper> I have the ds1104z and I LOVE it
[10:28:22] <LeoNerd> I do hope so. I did spent a while watching lots of reviews.
[10:28:42] <Casper> the only thing is... I wish active probes was cheaper, so does current probes
[10:28:44] <LeoNerd> Ahyes; that's the 100MHz version of basically the same thing isn't it? I decided I didn't need the extra BW for over double the cost.
[10:28:52] <LeoNerd> Hah yes- thos ecurrent probes... £3k??
[10:32:36] <Casper> yeah $$$$$
[10:32:44] <Casper> check those active probes...
[10:33:30] <LeoNerd> Oh... and you have to use their PSU for them, which is another £1k
[10:34:29] <hypermagic> make one then :P
[10:35:07] <hypermagic> dc current meter : shunt resistor, or hall sensor, or current servo coil
[10:35:22] <hypermagic> ac current meter : current transformer
[10:36:05] <LeoNerd> For "inline" current measurement I'd likely just take one of the MAX or INA differential currentsense amp chips and a resistor, and make a little probe
[10:36:24] <hypermagic> sounds fine
[10:36:33] <hypermagic> $20
[10:36:48] * LeoNerd already has a few INA219 breakouts...
[10:37:02] <LeoNerd> Those are the fancy I2C ones with builtin ADC for doing bus/shunt voltage measurement
[10:37:07] <hypermagic> then some time and deadbug soldreing
[10:37:31] <LeoNerd> Yeah.. INA219 comes in SOT-23-8 package. Tiiiiiny little thing
[10:37:46] <LeoNerd> The 1208 shunt resistor is bigger :)
[14:00:12] <Tom_itx> hackvana, those files ok?
[14:52:41] <hetii> Hi :)
[15:06:46] <hetii> any clue how to decode infared signal from tv remote controler, its a samsung bn59-01178b
[15:07:34] <N1njaneer> Use a standard Vishay receiver and tie to the RX input on the micro. The receiver will do all the heavy lifting for you.
[15:07:41] <N1njaneer> Very very simple.
[15:07:48] <hetii> Vishay receiver?
[15:08:11] <N1njaneer> Look for the all-in-one IR recivers, Vishay is one of the biggest manufacturers.
[15:08:30] <osteri> hetii: some android phones can act as a remote controller, samsung S4 for e.g.
[15:08:31] <N1njaneer> 3-pin devices, power, GND, RX signal as TTL out. That's it. Maybe a 0.1uf cap on the power pins.
[15:08:33] <hetii> I plug tfms5360 like reciver into int0
[15:08:54] <N1njaneer> Just plug it in to the UART
[15:09:16] <N1njaneer> The Vishay's will automatically decode the carrier straight in to standard async serial, usually at about 2400 baud
[15:09:37] <hetii> osteri: the point is that I want to use non used keys to control additional devices around tv
[15:10:02] <hetii> N1njaneer: ok but I really want to try to do it without this Vishay's device
[15:10:25] <hetii> at the end will use v-usb to act as a hid device for android platform
[15:10:56] <N1njaneer> Not sure why. An inexpensive part eliminates the optical filtering, the bandpass filtering, the AGC, and all manner of false triggering.
[15:11:44] <N1njaneer> hetii: http://www.vishay.com/docs/82489/tsop322.pdf
[15:11:58] <N1njaneer> Too bad you're not here - I have about 100 of them in a tube here right now :)
[15:12:24] <N1njaneer> $1.33/ea USD at quantity 1
[15:13:24] <osteri> you could build IR-receiver with phototransistor as well...
[15:13:32] <hetii> N1njaneer: Mine looks like http://mailing.tipa.eu/fotocache/bigorig/01710063.jpg
[15:13:55] <hetii> I have receiver, the point is to decode signal from it
[15:14:09] <N1njaneer> osteri: Not easily as you have to do a lot of analog processing to get reliability from it.
[15:14:30] <osteri> N1njaneer: yes you can, I've done it :>
[15:14:31] <N1njaneer> hetii: Oh, okay. Probably the same deal as the Vishay. what's the part numbeR?
[15:14:45] <N1njaneer> osteri: How much range do you get?
[15:15:40] <osteri> about 10 cm
[15:15:57] <hetii> N1njaneer:TFM 5360
[15:16:05] <osteri> doesn't matter if he only wants to know what the remote controller is sending
[15:16:36] <N1njaneer> osteri: Yes, so not very far comparatively. :)
[15:17:03] <N1njaneer> The Vishay parts will easily receive in excess of 10m without much difficulty. So depends on your application.
[15:17:20] <N1njaneer> Some of the things we do we go in excess of 50m reliabily. They are nice parts.
[15:17:34] <osteri> Actually I did the data transfer with red light, but IR works fine with the particular phototransistor
[15:17:40] <hetii> I have also others receivers but as I said I need to know how to decode singal from my remote controler
[15:18:13] <N1njaneer> hetii: This part is identical to the Vishay devices I was suggesting. This can be hooked straight to the RX pin of your UART.
[15:18:37] <hetii> and ?
[15:18:51] <N1njaneer> Then you just read the data from the remote as sequences of bytes. That's it.
[15:19:11] <N1njaneer> You'll have brief pauses between bursts of bytes to know where to frame the data.
[15:19:56] <N1njaneer> If you have a logic analyzer on hand, just clamp it directly on to the part and point the IR remote at it and read the bytes so you can know what you are expecting and confirm the baud rate. It should be 2400 for typical IR remotes.
[15:20:11] <N1njaneer> Very very simple :)
[15:20:37] <hetii> No, I forgot to take one with me :( just pl2303 as a usb-to-serial converter
[15:20:44] <hetii> and atmega8
[15:29:32] <theBear> you know what else you can clamp and point ir remote at so it reads teh bytes ??? ... MY MUM !!!!! bwaajajajajah
[15:30:54] <hetii> ?
[15:32:13] <sebus> picking up rc5 is easy
[15:34:17] <hetii> sure but I don`t to use any additional controler
[15:34:25] <sebus> decoder above hooked up to int and timer for about 440us as far as I remember.
[15:35:03] <sebus> there was also a program on pc to decode/encode IR rc5 using basic serial / usb to serial
[15:36:39] <sebus> you could view data and use it somewhere else. It was somewhat good for sniffing other IR RC.
[15:39:42] <hetii> maybe there is some library for avr to decode infared protocols?
[15:40:37] <sebus> yep, there are
[15:40:48] <sebus> but maaan, philips standard is so easy...
[15:41:11] <hetii> gosh :... Why you force soemthing that I don`t need it :P
[15:41:39] <sebus> http://hobby.abxyz.bplaced.net/index.php?pid=3&aid=16 heres something i found with some source code
[15:42:36] <hetii> seba bardziej : http://www.elektroda.pl/rtvforum/viewtopic.php?t=2977239&mark=topic&sid=c70dce9162da796a1c3fc41c59b231b8
[15:43:10] <sebus> może być :D
[15:43:28] <theBear> pretty sure one of the earliest atmel appnotes got background/general info and their classic asm + C reference implementations and snippets in it, and one of the stock/included avr-libc official examples is rc5 something basic example implementation too
[15:43:35] <hetii> thas the point not works :)
[15:44:03] <sebus> I remember I had problems with some IR
[15:44:09] <sebus> timing issue was problem
[15:44:37] <theBear> i probly one project sideways with one of those memories, but whatever the two are they bothwork for millinos of people over probly more than a decade
[15:45:14] <N1njaneer> Are you done with the IR decode yet? It shouldn't have taken longer than we've been having this discussion to do what you were wanting to. :)
[15:45:28] <sebus> N1njaneer++
[15:45:45] * N1njaneer feels incremented by one!
[15:46:33] * theBear pokes N1njaneer "meh, doesn't feel any different to me
[15:46:36] <theBear> "
[15:47:41] <hetii> N1njaneer: no
[15:48:18] * sebus facepalm... Just tried to compile assembly code for z80 in atmel studio. lol
[15:48:34] <N1njaneer> Sebus: Don't do that, it might catch fire.
[15:48:52] <sebus> it crashed with tons of errors
[15:53:47] <N1njaneer> Mmm, running production on the new pick and place again today. Like so much butter. :D
[15:55:56] <hetii> ok will try build: maybe will help me decode my signalhttp://www.stevenhale.co.uk/main/2013/07/making-a-soundcard-logic-analyser/
[15:57:18] <sebus> hetii Have you got LPT/centronics?
[15:57:37] <hetii> no
[15:57:47] <sebus> too bad... http://www.hansotten.com/index.php?page=logic-analyzer :P
[15:58:06] <hetii> yep
[16:15:51] <Jartza> N1njaneer: saw pick'n'place live today
[16:16:05] <Jartza> visited electronics factory today in estonia
[16:16:30] <Jartza> and dropped 200 displays and pcbs there too :)
[16:16:54] <Jartza> tagsu production starts thursday :)
[16:17:14] <Jartza> ...finally
[16:17:32] <Jartza> it's been an educating project
[16:19:06] <Jartza> my first ever "real" electronics project
[16:21:33] <Jartza> never thought it would end up in production
[16:22:15] <Jartza> real meaning something else than flashing led or push button :)
[16:28:50] <N1njaneer> Jartza: Cool! :)
[16:28:57] <N1njaneer> Want to see video of ours running?
[16:29:13] <LeoNerd> Show-off :P
[16:29:40] <N1njaneer> Eh, sharing the geekery :D
[16:44:44] <hetii> I found http://www.mikrocontroller.net/articles/IRMP#IRMP_-_Infrarot-Multiprotokoll-Decoder as I grab data by my soundcard it seams that is a format called: samsung32
[16:45:53] <hetii> and the waveform is similart to this one: http://witec.pl/avr-atmega-pl/12-avr-ir-dekoder-do-pilota-samsung
[16:49:19] <Lambda_Aurigae> hetii, there are several ways to do IR decoding. The easiest is to use the decoder modules. The limitation on those is they tend to be narrow band. 40KHz, 38KHz, etc...and will only work with a limited number of remotes that work in the particular carrier frequency range.
[16:50:08] <Lambda_Aurigae> the other way is to actually do the decoding of the carrier, either in software or by building your own hardware. I have seen it done both in software on an avr,,which sucks a lot of processor time,,and by using a PLL chip.
[16:50:35] <N1njaneer> Though the IR bandpass carrier is rather forgiving. 1Khz or so off may reduce range slightly but will still work.
[16:51:48] <Lambda_Aurigae> N1njaneer, yeah...and I've seen some that can handle 38, 36, and 40 KHz from a single 38KHz module but the 36 and 40 tend to be very limited range as you said.
[16:52:10] <Lambda_Aurigae> ok..time to head home soon..laters.
[19:12:16] <LoRez> Tom_itx: yeah, this thing is oddly blown up it seems. works under windows, doesn't under linux.
[19:20:37] <LoRez> rewriting the firmware fixed it.
[19:27:03] <Tom_itx> odd
[19:27:32] <Tom_itx> working under linux now too?
[19:29:41] <LoRez> I don't have windows to check there. My friend checked it on his windows machine the other day, so I assumed it would work for me. dfu-programmer to the rescue...
[19:30:33] <LoRez> ¯_(ツ)_/¯
[19:30:40] <Tom_itx> it should unless your jungo driver is screwed up
[19:30:47] <FL4SHK> You're missing a \
[19:30:50] <LoRez> ¯\_(ツ)_/¯
[19:30:55] <FL4SHK> Yeah there you go
[19:30:56] <LoRez> yeah, had to escape it apparently.
[19:30:59] <FL4SHK> Oh wow
[19:31:07] <LoRez> irssi alias I _just_ set up.
[19:31:22] <FL4SHK> Oh I see
[19:31:33] <FL4SHK> Man I need to start making some of those (though I use Weechat)
[19:31:54] <LoRez> I forgot about the stupid button next to the USB port. had to unscrew the case to push it to reprogram it.
[19:32:21] <Tom_itx> stick a paperclip in it
[19:32:44] <LoRez> seems fine now though. had it plugged into a 'duino that was connected to an LED module and afterwards it just wouldn't play.
[19:32:59] <LoRez> I'd have to find a paperclip then
[19:33:36] <Lambda_Aurigae> ardweeny infection!
[19:33:44] <Lambda_Aurigae> it's like aids for microcontrollers!
[19:33:51] <FL4SHK> rude
[23:25:38] <hackvana> Tom_itx: Yeah they're fine. Just wondering what the license is.
[23:26:49] <hackvana> (For hackvana the extensions need to be renamed though: http://tinymicros.com/wiki/Protel_Gerber_Layer_Names)