#avr | Logs for 2014-06-05

Back
[00:11:11] <N1njaneer> There we go.
[00:11:45] <N1njaneer> I kept forgetting to log back in here :)
[00:12:08] * Casper slaps N1njaneer a few times
[00:12:12] <Casper> bad bad bad
[00:12:24] <N1njaneer> Doh!
[00:12:28] <N1njaneer> How are you Casper?
[00:12:43] <Casper> too awake, you?
[00:13:15] <N1njaneer> Same. Here at the office at 1am as we're wrapping up a board run. AVRs on them, of course.
[00:13:47] <umquant> N1njaneer: what do the boards do if you don't mind me asking?
[00:14:00] <N1njaneer> High power infrared data emitters.
[00:14:47] <umquant> Wow sounds cool. Did you write the firmware? Or design the board..or both lol
[00:14:54] <N1njaneer> Yes. :D
[00:15:12] <N1njaneer> Ran a different design yesterday that had three seperate AVRs on it.
[00:15:47] <N1njaneer> AVR all over. And 1500 more boards just showed up yesterday.
[00:16:00] <N1njaneer> Busy busy!
[00:16:06] <Casper> "lucky"
[00:16:12] <Casper> at work, I'm out of work this week
[00:16:26] <Casper> nite
[00:44:47] <zaidp> /msg NickServ identify 1qazxsw23edc
[00:51:33] <LoRez> zaidp: might wanna change that.
[00:53:58] <mog> hi, i have been working on a totp security token with an atmega328p as the mcu
[00:54:16] <mog> I was wondering what I could do to secure the 10 byte secret that sits on it
[00:54:24] <mog> i see i can disable reset, spi and debug wire
[00:54:40] <mog> but i figured those can be reset back with a high voltage programmer
[00:55:22] <mog> my other thought was to use the bootloader to delete the secret from the flash and only store it in sram
[00:55:24] <LoRez> don't store the secret in eeprom but in the flash, don't use a bootloader
[00:55:52] <mog> but i saw that people could reset the chip and dump the sram
[00:55:56] <LoRez> then mark it run-only
[00:56:25] <mog> LoRez, the token is designed such that the user can reset the device easily themselves
[00:56:36] <mog> requiring a spi programmer would make that more difficult
[00:58:44] <zaidp> yes, changed...
[02:29:31] <N1njaneer> blah
[02:29:52] <N1njaneer> Internet went out here for about two hours :(
[02:31:03] <N1njaneer> Darn, umquant is gone
[06:01:22] <superware> VCC should never directly connect to a digital input pin, right? must go through a resistor?
[06:07:17] <ivanshmakov> superware: It’s not “must,” but rather a very strong “should.” Consider that you accidentally configure that pin as output, and set it low.
[06:21:34] <Valen> there are few reasons not to do so
[06:23:02] <superware> I see. is it a good idea to pull-up a digital input, and use a push button to connect it (when pressed) to ground?
[06:24:42] <Lambda_Aurigae> yes
[06:24:58] <Lambda_Aurigae> that way you don't have a floating input if you just put the switch between the pin and gnd.
[06:25:50] <Lambda_Aurigae> you could invert it too and use a pulldown to gnd and switch to VCC
[06:27:18] <Lambda_Aurigae> also putting a small capacitor across the switch and a small resistor in line with the switch is a good thing too..gives you a little current protection and debouncing.
[06:31:16] <superware> thanks
[06:31:40] <Lambda_Aurigae> http://cq.cx/interface.pl
[06:31:44] <Lambda_Aurigae> good read.
[06:36:00] <Undertasker> Use an resistor and a capacitor in series accross the switch, never a capacitor alone.
[06:36:32] <Lambda_Aurigae> yeah....otherwise you get a nice snap in the switch..hehe
[06:36:41] <Undertasker> It will give a high current at the moment the switch is closed, and sooner or later damage it.
[06:36:52] <Lambda_Aurigae> http://neo.dmcs.pl/tm/pdf/MIC.pdf another good read even though they do icky pic micros.
[06:41:43] <bitd> Ewww pic <.<
[06:42:04] <twnqx> or no resistor and no capacitor and software debounce!
[06:42:11] <bitd> lol.
[06:42:25] <bitd> Software debounce is good if you run out of hardware.
[06:42:29] <bitd> Which is... never? >.>
[06:42:44] <twnqx> or you are cheap :P
[06:43:03] <bitd> True, true :P
[06:45:09] <Lambda_Aurigae> if you run out of hardware you need to go dumpster diving more.
[06:45:29] <bitd> No more dumpster diving for me >.>
[06:45:38] <bitd> Got my ass chased of the property not a week ago.
[06:46:16] <Lambda_Aurigae> I get piles of stuff from when we toss out old copiers and printers at work.
[06:46:23] <bitd> They throw it away, yet they dont want me to pick it up.
[06:46:35] <Lambda_Aurigae> you should probably ask first...
[06:46:46] <bitd> Tried that.
[06:46:57] <Lambda_Aurigae> then go on sunday morning at 5am.
[06:47:06] <bitd> Haha, good point.
[06:58:54] <Undertasker> Wear a badge from Greenpeace, and tell them that you collect electronic waste to make sure it gets recycled properly.
[07:03:19] <bitd> I'll just park the van, smack it full, and spin them tires >.>
[07:13:26] <Tom_itx> that's why you got chased
[07:13:39] <Tom_itx> you need more stealthy approach
[07:33:39] <Roter> Hey guys, i wanted to ask: I want to buy a 3.3V atmega MCU, the atmega328P looks like the thing i want. In the datasheet it says the power supply is: 1.8 - 5.5 V. So i can i just use it constantly at 3.3V right?
[07:35:28] <Lambda_Aurigae> correct
[07:35:35] <Lambda_Aurigae> watch clock speed though..
[07:36:45] <Lambda_Aurigae> according to the datasheet you can't run over 10MHz at 3.3V
[07:38:39] <superware> internal is 8MHz
[07:39:02] <Roter> Oh, thanks, didnt even see that!
[07:39:20] <Lambda_Aurigae> first page of the datasheet.
[07:39:26] <Lambda_Aurigae> read that dang datasheet.
[07:39:46] <Lambda_Aurigae> pretty much everything you need to know about that chip is in that one pdf.
[07:40:06] <Roter> yeah, thats why i read it before buying now :)
[07:40:21] <Lambda_Aurigae> unlike pic microcontrollers where they have 20 documents to dig through.
[07:42:56] * Tom_itx has 10 printed books on the 68332 and 2 'pink' books still
[07:43:27] <Lambda_Aurigae> pink books?
[07:43:35] <Tom_itx> for the 68hc11
[07:43:48] <Lambda_Aurigae> wtf? pink is for girls and girls don't do electronics!!!
[07:43:50] <Tom_itx> they were referred to as the 'pink' books
[07:47:33] <Lambda_Aurigae> I have the TTL
[07:47:36] <Lambda_Aurigae> grr.
[07:47:43] <Lambda_Aurigae> I have the TTL Data Book here somewhere.
[07:48:02] <Lambda_Aurigae> nice blue book of everything TTL,,,circa 1980...basically all the 74xx series.
[07:48:49] <Lambda_Aurigae> oooo..found a scanned copy online!
[07:48:52] <Tom_itx> yeah i finally got rid of those
[07:48:55] <Lambda_Aurigae> http://www.isegi.unl.pt/docentes/vlobo/escola_naval/SistemasDigitais/TTL_Logic_databook_TexasInstruments.pdf
[07:51:07] <Lambda_Aurigae> http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&ved=0CDMQFjAC&url=http%3A%2F%2Fcenters.njit.edu%2Fecelab%2Fmanuals%2Felectrical-engineering%2Ffed-101%2FMotorolaTTL-Manual.pdf&ei=oGKQU7-dKoWtyATR3oJY&usg=AFQjCNH-H85vyAKau7iE-xiT0wpxbF83oQ&bvm=bv.68235269,d.aWw&cad=rja
[07:51:15] <Lambda_Aurigae> hmm.
[07:51:32] <Lambda_Aurigae> http://centers.njit.edu/ecelab/manuals/electrical-engineering/fed-101/MotorolaTTL-Manual.pdf
[07:51:36] <Lambda_Aurigae> that's better.
[07:51:43] <Lambda_Aurigae> and a real searchable pdf too.
[07:53:08] <Lambda_Aurigae> Tom_itx, you ever have the TTL Cookbook?
[07:53:21] <Tom_itx> at one point i did
[07:53:41] <Lambda_Aurigae> ftp://apollo.ssl.berkeley.edu/pub/cinema/04.%20Science/TTL%20Cookbook_0672210355.pdf
[07:53:49] <Lambda_Aurigae> someone did scan and ocr on it.
[07:53:53] <Thrashbarg> \o/
[07:54:30] <Lambda_Aurigae> so many logic and interfacing questions could be answered if more people read the old manuals.
[07:54:53] <Thrashbarg> eeeew! But it's OLD! And old is useless!
[07:54:55] * Thrashbarg ducks
[07:55:23] <Tom_itx> i could say that about the young
[07:55:33] <Thrashbarg> ^ yes
[07:56:56] <Lambda_Aurigae> old, yes...but venerable.
[07:57:01] <Lambda_Aurigae> and still very much useful.
[07:57:10] <Lambda_Aurigae> specially for people interfacing to the real world.
[07:57:23] <Thrashbarg> what's that?
[07:57:33] <Tom_itx> the voltages are getting lower but the principles remain
[07:59:28] <Lambda_Aurigae> just looked and I still have my old TTL CookBook.
[07:59:34] <Lambda_Aurigae> but having the digital version is nice too.
[08:00:12] <Thrashbarg> I've got a Mullard "Reference Manual of Transistor Circuits" from 1961
[08:01:20] <Thrashbarg> interesting read... I think it might touch on silicon diodes but everything else deals with germanium
[08:02:16] <Lambda_Aurigae> another good book there.
[08:02:44] <Lambda_Aurigae> kids these days just jump in and expect to plug the modules together and drag and drop their program bits together and make it work.
[08:08:15] <twnqx> but but... ttl is dead! it's cmos everywhere!
[08:08:52] <Lambda_Aurigae> http://www.ebook3000.com/CMOS-Cookbook_98737.html
[08:09:30] <Lambda_Aurigae> better?
[08:09:36] <twnqx> and now for DTL!
[08:09:42] <twnqx> and then ECL!
[08:09:49] <Lambda_Aurigae> RTL dangit!
[08:09:58] <twnqx> uh
[08:10:10] <twnqx> well, ok
[08:10:22] <twnqx> that too :P though i prefer dtl :P
[08:11:09] <Lambda_Aurigae> but RTL is older!
[08:12:24] <Lambda_Aurigae> and was used on the apollo and earlier space systems!
[08:12:42] <mog> i asked this late last night but i thought id ask again now that more people are probably up
[08:12:46] <mog> hi, i have been working on a totp security token with an atmega328p as the mcu
[08:12:49] <mog> I was wondering what I could do to secure the 10 byte secret that sits on it
[08:12:54] <mog> i see i can disable reset, spi and debug wire
[08:12:58] <mog> but i figured those can be reset back with a high voltage programmer
[08:13:04] <mog> my other thought was to use the bootloader to delete the secret from the flash and only store it in sram
[08:13:08] <Lambda_Aurigae> not if you are going to store it in eeprom.
[08:13:08] <mog> but i saw that people could reset the chip and dump the sram
[08:13:21] <Lambda_Aurigae> you can read protect the flash though.
[08:13:58] <mog> if i read protect the flash , can i still overwrite via a bootloader?
[08:14:01] <Lambda_Aurigae> so the only way to read the flash is from within the program on the flash itself.
[08:14:36] <Lambda_Aurigae> not sure on that one...let's look in ye olde datasheet.
[08:16:05] <Lambda_Aurigae> on the atmega1284p, it is possible to set it up so that will work.
[08:16:29] <Lambda_Aurigae> would have to look at the atmega328p datasheet to see if it supports such...
[08:16:37] <Lambda_Aurigae> but it is under the memory programming section.
[08:17:46] <Lambda_Aurigae> in the section about lock bits.
[08:17:56] <Lambda_Aurigae> specifically the boot lock bits.
[08:18:42] <mog> if i set lock bits whats to stop someone from overwriting them? also can i check those lock bits are set from application and boot loader?
[08:19:22] <Lambda_Aurigae> only way to change the lock bits is to erase the chip.
[08:19:39] <mog> thats what i thought i just wanted to be sure
[08:19:49] <Lambda_Aurigae> did you actually read the datasheet?
[08:19:59] <Lambda_Aurigae> says so right in the first paragraph of the lock bits section!
[08:20:31] <mog> i have, im sorry, just been nervous about this and wanted to hear someone say it i guess
[08:20:41] <mog> thank you for your patience
[08:20:50] <Lambda_Aurigae> the datasheet is your bible.
[08:22:17] <Lambda_Aurigae> and, yes, you can read the lock byte just like reading the fuse bytes from within the program.
[08:23:39] <Lambda_Aurigae> although I don't think the avr-libc implements it directly so you would have to do it manually.
[08:25:27] <Lambda_Aurigae> hmm..it seems it does....tis just in avr/boot.h
[08:25:43] <Lambda_Aurigae> GET_LOCK_BITS
[08:25:51] <mog> thanks
[08:26:00] <Lambda_Aurigae> http://www.nongnu.org/avr-libc/user-manual/group__avr__boot.html
[08:27:46] <twnqx> yes, RTL is older, but consumes more static power!
[08:27:47] <Lambda_Aurigae> it seems you can even write to the boot lock bits from the bootloader to lock a chip down hard.
[08:28:18] <Lambda_Aurigae> twnqx, yeah, consumes more power and is slower I think.
[08:28:20] <mog> hmm that i think is exactly what i need
[08:28:39] <twnqx> i wanted to rebuild the 6510 with DTL at some point
[08:28:46] <twnqx> discreet, obviously
[08:29:11] <twnqx> but even with pretty generous currents i did not get it reasonable fast enough :P
[08:29:14] <Lambda_Aurigae> twnqx, 6510? like the mos6510? the processor used in the C64?
[08:29:17] <twnqx> yes.
[08:29:38] <Lambda_Aurigae> that would be a massive bit of kit.
[08:29:41] <twnqx> i do have a working 2bit cascadable ALI though
[08:29:54] <twnqx> which fits the usual 100x160 cards :D
[08:29:57] <twnqx> ALU*
[08:34:40] <twnqx> wow
[08:34:47] <Lambda_Aurigae> huh?
[08:34:52] <twnqx> eagle's print to pdf is broken, always prints only 1 page :(
[08:34:56] <Lambda_Aurigae> hehe.
[08:35:05] <Lambda_Aurigae> never tried to print more than one page from there.
[08:35:37] <twnqx> ah. it just didn't remember me selectign a different path. i was blindly openening the same old file over and over :S
[08:35:46] <Lambda_Aurigae> oops.
[08:36:04] <Lambda_Aurigae> love the old scifi movies.
[08:36:10] <twnqx> too bad one can't print schematic and board at once
[08:36:10] <Lambda_Aurigae> rewatching the Alien saga.
[08:37:13] <Lambda_Aurigae> sitting here at home with a thick blankey and my pillow and a nasty respiratory infection.
[08:37:57] <twnqx> http://digadd.de/2bitalu.pdf that's how far i got :D
[08:38:06] <twnqx> one board, and the spice simulatin took ages
[09:07:39] <Undertasker> Lambda_Aurigae, me too.
[09:08:10] <Lambda_Aurigae> but are you watching the original Alien?
[09:09:16] <Undertasker> No, hearing an audiobook. "The long earth" from Terry Pratchett and Stephen Baxter
[09:09:46] <Lambda_Aurigae> I'm not an audiobook fan..I prefer to read...and not a Pratchett fan either.
[09:10:25] <Undertasker> It's untypical for Terry Pratchet. More real science fiction.
[09:10:38] <Lambda_Aurigae> Baxter is good though.
[09:11:44] <Undertasker> Reminds me to Philip José Farmers "Riverworld"
[09:11:56] <Lambda_Aurigae> that was a good series.
[09:12:01] <Lambda_Aurigae> too bad they fucked the movie.
[09:12:22] <Undertasker> Not to speak of the TV series.
[09:12:33] <Lambda_Aurigae> there was a tv series?
[09:12:50] <Undertasker> Canceled after one episode. We were lucky.
[09:14:39] <Undertasker> The long earth has also something from Larry Nivens "Ringworld"
[09:15:07] <Undertasker> And "World of Tiers"
[09:16:01] <Lambda_Aurigae> never heard of world of tiers.
[09:16:56] <Undertasker> https://en.wikipedia.org/wiki/World_of_Tiers
[09:17:09] <Undertasker> You should read it sometimes. It's great.
[09:17:24] <Lambda_Aurigae> will add it to my list.
[09:17:28] <Undertasker> Much better than Riverworld
[09:17:30] <Lambda_Aurigae> reading the Darkover series right now.
[09:18:11] <Undertasker> I don't like Marion Zimmer Bradley so much.
[09:18:48] <Lambda_Aurigae> she is kind of a hard read at times.
[09:20:45] <Undertasker> Do you know the Amber Chronicles from Roger Zelazny?
[09:20:51] <Lambda_Aurigae> yup
[09:20:54] <Lambda_Aurigae> read them years ago.
[09:21:12] <Undertasker> I must have read them five or six times over the years.
[09:21:27] <Lambda_Aurigae> I'm the same way with series like Dune
[09:21:39] <Lambda_Aurigae> and have read The Stand at least half a dozen times since I was 12.
[09:21:46] <Lambda_Aurigae> or 14...or whenever it came out.
[09:22:27] <Undertasker> I really love the first Dune book, but the ones that came after it not so much.
[09:23:47] <Undertasker> I like Stepehn King when he is writing horror, but when he's trying SF, it usually goes down the drain.
[09:24:03] <Lambda_Aurigae> The Stand is my favorite book of all time.
[09:25:57] <Undertasker> One onf mine is "Time Storm" from Gordon R. Dickson
[10:26:02] <gcanada> hello
[10:26:25] <gcanada> i am having this problem when i try to program my atmega256rfr2 xplained pro
[10:26:39] <gcanada> avrdude: usbdev_open(): WARNING: failed to set configuration 1: could not set config 1: Device or resource busy
[10:27:28] <gcanada> avrdude: usbdev_open(): WARNING: failed to set configuration 1: could not set config 1: Device or resource busy
[10:27:32] <gcanada> ups
[10:27:50] <gcanada> sudo avrdude -c xplainedpro -p m256rfr2 -P usb -B 2
[10:27:58] <gcanada> this is the command that i use
[10:29:08] <gcanada> anybody knows what happen¿? it seem that the board is being programmed properly but then, when i try to "make login", i cannot open any usb device because it sais that the board is not in any usb device
[10:29:09] <gcanada> :/
[10:33:23] <Undertasker> What device do you see in /dev ?
[10:33:55] <gcanada> gcanada@gcanada:~/workspace/DTLS/contikidtls/projects/hello-world$ lsusb
[10:33:55] <gcanada> Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
[10:33:55] <gcanada> Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
[10:33:55] <gcanada> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[10:33:55] <gcanada> Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[10:33:55] <gcanada> Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[10:33:56] <gcanada> Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
[10:33:56] <gcanada> Bus 001 Device 011: ID 03eb:2111 Atmel Corp.
[10:33:57] <gcanada> Bus 002 Device 003: ID 0bda:0181 Realtek Semiconductor Corp.
[10:34:09] <gcanada> it seems to be at the /dev/ttyUSB0
[10:34:26] <Undertasker> Could be
[10:35:23] <gcanada> i have tried but typing " make login ACM=0 ...ACM=1....ACM=2 and so on
[10:35:26] <Undertasker> try specifying the port as /dev/ttyUSB0
[10:36:03] <gcanada> gcanada@gcanada:~/workspace/DTLS/contikidtls/projects/hello-world$ sudo avrdude -c xplainedpro -p m256rfr2 -P usb0 -B 2
[10:36:03] <gcanada> avrdude: usbdev_open(): WARNING: failed to set configuration 1: could not set config 1: Device or resource busy
[10:36:04] <Undertasker> sudo avrdude -c xplainedpro -p m256rfr2 -P /dev/ttyUSB0 -B 2
[10:36:19] <gcanada> it says that the port must begin with USB
[10:36:25] <gcanada> so i used USB0
[10:36:27] <gcanada> and the same
[10:36:43] <gcanada> so i think that it is at USB0
[10:36:58] <malinus> gcanada, try without the -P usb
[10:37:07] <malinus> that works for me
[10:37:29] <malinus> with the MkII copy, but still
[10:38:14] <gcanada> the same :( it seems to program the xplained pro properly ( but with the warning)
[10:38:20] <gcanada> but then i cannot do a make login
[10:38:29] <gcanada> /dev/ttyUSB0: No such file or directory
[10:38:47] <Undertasker> try ttyACM0
[10:39:44] <gcanada> avrdude: jtag3_open_common(): JTAGICE3/EDBG port names must start with "usb"
[10:40:02] <Undertasker> damned
[10:40:25] <gcanada> xD
[10:40:28] <gcanada> thanks anyway
[10:40:33] <gcanada> i continue trying
[10:41:02] <Undertasker> What exactly does make login do?
[10:42:08] <gcanada> see the output of the program at the terminal
[10:42:28] <Undertasker> Then try to connect manually
[10:43:08] <gcanada> i have tried by cutecom
[10:43:26] <gcanada> but "couldnt open /dev/ttyUSB0"
[10:45:03] <gcanada> somebody is telling me that maybe the xplained pro dont have a USB-Serial Port conversor
[10:45:15] <gcanada> that maybe it just works by a USB adapter
[10:47:07] <Undertasker> Is it the ATmega256RFR2-XPRO?
[10:48:23] <Undertasker> Atmel says it has a CDC port.
[10:48:55] <gcanada> yes it is
[10:49:01] <Undertasker> Linux sometimes has problems with USB combo devices
[10:49:28] <Undertasker> did you try sudo make login?
[10:50:13] <gcanada> i tried yes
[10:50:15] <gcanada> but no way
[10:51:35] <Undertasker> what does ls -l /dev/ttyUSB? give?
[10:54:25] <gcanada> gcanada@gcanada:~/workspace/DTLS/contikidtls/projects/hello-world$ ls -l /dev/ttyUSB
[10:54:25] <gcanada> ls: no se puede acceder a /dev/ttyUSB: No existe el archivo o el directorio
[10:54:35] <gcanada> with USB0 the same
[10:54:39] <Undertasker> Well, there's your problem
[10:54:57] <Undertasker> try ls -l /dev/ttyACM?
[10:56:30] <gcanada> gcanada@gcanada:~/workspace/DTLS/contikidtls/projects/hello-world$ ls -l /dev/ttyACM0
[10:56:30] <gcanada> crw-rw---- 1 root dialout 166, 0 jun 5 17:19 /dev/ttyACM0
[10:56:37] <gcanada> what this means?
[10:57:05] <gcanada> disconecting the xplained pro i get nothing
[10:57:19] <gcanada> with it connected, crw-rw---- 1 root dialout 166, 0 jun 5 17:19 /dev/ttyACM0
[10:57:54] <Undertasker> That your virtual com port is at /dev/ttyACM0, and that the owner is root, and that it belongs to the group dialout.
[10:58:23] <Undertasker> What's the usual baud rate?
[10:59:39] <gcanada> 112500 i guess
[10:59:42] <gcanada> for the make login
[11:01:43] <Undertasker> try screen /dev/ttyACM0 115200
[11:03:17] <gcanada> i am trying with cutecom
[11:03:21] <gcanada> i can open the port
[11:03:31] <gcanada> but no output
[11:03:35] <gcanada> let me check a pair of things
[11:03:39] <gcanada> really thanks for the help
[11:03:39] <gcanada> !
[15:55:47] <Jartza> Kev: yes, I'm doing my own "modem"
[15:56:15] <Jartza> I want easy way of transferring data from different devices to attiny without extensive hardware :)
[15:56:32] <Jartza> I figured out most of the devices have headphone-plug
[15:56:41] <Jartza> like cellphones, tablets, laptops etc....
[15:58:14] <Kev> okay :)
[15:59:18] <Jartza> that way I just need a headphone-jack, few resistors and capacitors :)
[15:59:24] <Jartza> and it's going to be only one-way
[16:00:17] <Jartza> Program: 414 bytes (5.1% Full)
[16:00:19] <Jartza> :)
[16:00:58] <Jartza> my testing code, which just listens to modem and echoes all data back through rs232 (that's also tx only :D)
[16:05:53] <Jartza> I rewrote it and rethought the modulation, now it's working quite nicely on average of 3333bps on attiny85@8MHz
[16:06:58] <Jartza> depends of the data, if it's only 0's it's 4000bps and only 1's it's 2666bps :)
[16:07:14] <Jartza> and if sending "010101010101010101010...." it's 3333bps
[16:08:14] <Jartza> of course it still needs some kind of error correction as it's only one-way
[16:08:27] <Jartza> there's no way the sender knows if the data was ok
[16:08:52] <ColdKeyboard> Can someone give me a hand how to rotate/swap bits in lower nibble? I would like to replace bit places of LSB and MSB
[16:10:21] <N1njaneer> Jartza: I just did a bi-phase mark receiver a while back that works similarly - data decoding of audio-based signaling.
[16:10:34] <N1njaneer> ColdKeyboard: Swap both completely?
[16:10:57] <Jartza> N1njaneer: sure, I guess there's a lot of different implementations around :)
[16:11:13] <Jartza> I also found a lot of implementations for PIC, lot of implementations for atmegas...
[16:11:27] <Jartza> I just thought they looked too complicated :D
[16:11:39] <N1njaneer> ColdKeyboard: Something like x = (x >> 4) | (x << 4)?
[16:11:51] <ColdKeyboard> I wired my LED's in wrong order so now my bit number 3 is on bit number 0, bit number 2 is on bit number 1
[16:11:58] <N1njaneer> Jartza: I needed to use bi-phase mark since it was decoding an established format. :)
[16:12:06] <ColdKeyboard> I just need lower nibble swapped, upper nibble is ok
[16:12:19] <N1njaneer> Oh you mean bit-swapping inside of that, gotcha.
[16:12:24] <Jartza> N1njaneer: :) I had no restrictions as I have to code the sending end too :D
[16:12:29] <N1njaneer> Well, question is do you favor speed or size?
[16:13:10] <ColdKeyboard> Well, perhaps speed...
[16:13:15] <N1njaneer> The fastest way to do it is probably with a 16-entry look-up table that remaps the bits, or else you can do some bit shifting and slicing.
[16:14:36] <Jartza> but my current implementation works more nicely than I thought
[16:14:58] <N1njaneer> Jartza: Definately useful when you can implement both ends!
[16:15:07] <Jartza> yep
[16:15:40] <Jartza> I didn't have to start demodulating anything existing, but I could just make a cruelly simple solution
[16:15:56] <Jartza> actually the receiving end is just a pin change interrupt with 15 lines of C
[16:17:33] <ColdKeyboard> N1njaneer: I did some 4 line byte slicing... it seems to be workin. :)
[16:17:41] <N1njaneer> Yeah, same with mine - pin change and I use a counter to look at time elapsed in order to self-clock the reception
[16:18:54] <N1njaneer> ColdKeyboard: Awesome! Whatever works! I've used the table lookups for quick remappings and reprocessings in the past where fastest speed is required and where size wasn't critical - definately useful if you have to swizzle data lines and are having to move a fair bit of data through the system, etc.
[16:18:55] <Kev> Jartza, how do you identify the actual frequency of the sound ?
[16:19:04] <Jartza> I don't
[16:19:19] <Jartza> and I'm not interested in that either :)
[16:19:32] <Kev> how does it work then ?
[16:19:45] <Jartza> it's like morse code
[16:19:48] <Jartza> short and long pulses
[16:19:56] <ColdKeyboard> N1njaneer: Well I'm using some mcu where both speed and size is important but in the end, I will need some more space later on and for now speed is more than enough. :)
[16:20:02] <ColdKeyboard> Thanks for the help! :)
[16:20:07] <Jartza> I just use timer to calculate the pulse length
[16:20:33] <Jartza> so the time between rising and falling edge
[16:20:33] <Jartza> dead simple
[16:21:22] <Kev> eh
[16:21:56] <Kev> i thought you where working with sounds like an actual modem
[16:22:08] <Jartza> hmm
[16:22:32] <Jartza> well, it sure is sound
[16:22:40] <Jartza> sounds bad imo :D
[16:23:12] <Jartza> but hey, sound is "pulses" isn't it? :)
[16:23:22] <Jartza> or waves.
[16:23:48] <Kev> sound's an actual sine-ish wave, but you seem to be working with a ttl signal with "rising and falling edges"
[16:23:58] <Jartza> I guess the closest analogy could be "FM"
[16:24:36] <Kev> and i'm not sure how a cellphone can output a ttl signal on the jack
[16:24:40] <N1njaneer> I do similar to pick out bi-phase mark -- uses an elastic window to count the longest and shortest intervals between transitions, thereby establishing an average value to compare against to be able to see if the received bit was a 1 or a 0. :)
[16:24:54] <Jartza> cool
[16:25:02] <Jartza> sounds sort of like the same
[16:26:20] <Jartza> Kev: of course cell phone doesn't output ttl signal
[16:26:24] <N1njaneer> You can resolve audio signals in to TTL with a simple comparator. Cleans them right up :)
[16:26:45] <Jartza> or even simpler :)
[16:26:49] <Jartza> like I did
[16:26:58] <Jartza> I'm using PB5... so it's the reset-pin
[16:27:21] <N1njaneer> My application needs to receive single ended OR differential audio signaling (balanced) so needed to be more robust.
[16:28:25] <Jartza> I just run the audio signal through an electrolytic capacitor which is then connected to voltage divider...
[16:28:40] <Jartza> negative lead to audio input
[16:28:42] <Jartza> :)
[16:29:57] <Jartza> so when audio signal is negative ("below zero") it charges the capacitor, and when the audio signal is positive, it "boosts" the voltage divider voltage enough to go higher to trigger TTL :)
[16:31:16] <Jartza> I actually even tried, the data can also be compressed to mp3
[16:31:22] <Jartza> using lame preset "voice", so 56kbps/mono
[16:32:23] <Jartza> my first attempt actually used analog comparator, but the later one uses this more simple solution
[16:32:35] <Kev> ok, i was expecting an op amp with a zero crossing detector of sorts
[16:32:59] <Kev> measuring time between crosses in order to get the frequency
[16:33:10] <Jartza> this is waaaaay simpler
[16:33:30] <Kev> yeah
[16:33:54] <Jartza> mainly because I know nothing about modulations nor electronics ;)
[16:34:32] <Jartza> I started the whole embedded & electronics -hobby like umm... 4 months ago
[16:34:44] <Kev> i did something even more complicated (and slower) a while back with two cheapo chinese radios and two raspis
[16:34:57] <Jartza> well I've done coding on embedded arm, but then I didn't have to care about electronics-part at all
[16:35:12] <Kev> coded bits using 3 differents sounds
[16:35:37] <Kev> and cleaned it up with ffts
[16:35:42] <Jartza> sounds like one of my first tries
[16:36:02] <N1njaneer> Sounds like basically FSK in concept :)
[16:36:06] <Jartza> I tried encoding bits "pairs" with 5 different frequencies
[16:36:17] <Jartza> and syncing to frequency change
[16:36:18] <Kev> worked great for telemetry over relatively long distance for relatively cheap
[16:37:00] <Jartza> but then I opted for something really really simple, as the distance is usually short (maybe a meter?) and there's not much interference in the connection
[16:37:11] <Jartza> and it's definately not a phone line quality :)
[16:37:58] <Jartza> I'm pretty sure someone else has already implemented something similar I did, but for me this whole thing is a learning process... especially from electronics
[16:38:25] <Jartza> I'll receive my first scope ever (cheap'n'crappy chinese) within 2 weeks, so I can see how terrible the signal actually looks in the attiny pin
[16:38:34] <Jartza> I might then rethink the whole idea, if it looks baaaaaad
[16:38:46] <N1njaneer> Best way to learn is to do!
[16:38:50] <Jartza> yep
[16:39:04] <Jartza> I'm a doer ;)
[16:40:12] <N1njaneer> I also managed to save having to use an external $400 piece of gear with every one of these new boards by putting $5 worth of parts on it in about a square inch of board space, so that's also useful :D
[16:41:36] <Kev> eh
[16:41:41] <N1njaneer> Also https://www.dropbox.com/s/yq6ymvsw0o9nlzc/ProductionHelper.jpg
[16:42:08] <N1njaneer> Had help on the production floor last night :D
[16:42:16] <Jartza> :D
[16:42:22] <Jartza> cute
[16:42:48] <Jartza> well for me this is more or less just propellerhead prototyping
[16:42:50] <N1njaneer> He's around the office for the next month or two still - bottle fed every few hours, but likes exploring :D
[16:43:06] <aandrew> those look like contac machines
[16:43:06] <Jartza> in my day-job someone else [tm] takes care of the hardware
[16:43:13] <aandrew> N1njaneer: I have kids too
[16:43:34] <N1njaneer> aandrew: Woo! :D
[16:44:11] <N1njaneer> Yeah, one of the pick and places in the background, conveyors, then Taji the goat is on top of our 5-zone reflow oven
[16:44:58] <lubskogreg> hi
[16:44:59] <aandrew> I have the hardened rails of two contac machines and all the air and steppers in my garage at home
[16:45:05] <Jartza> https://www.dropbox.com/s/pk2syajhv7k8lf6/VID_20140605_003158.mp4
[16:45:06] <N1njaneer> Still runs on Windows 3.1, but it's an oven - don't really need much more control of it!
[16:45:08] <aandrew> we just decomissioned 3 of them. two went to scrap the third was sold
[16:45:13] <Jartza> that's the speed of the modem :)
[16:45:28] <aandrew> I wanted to keep the actual tables but I had no room for them
[16:45:33] <Jartza> (audio is fed from ipad)
[16:45:37] <lubskogreg> could anyone help me with this line of code ?
[16:45:41] <lubskogreg> CLKPR=(1<<CLKPCE);
[16:45:46] <N1njaneer> Jartza: Nice! That's awesome!!
[16:45:46] <lubskogreg> what does it exactly mean
[16:45:48] <lubskogreg> ?
[16:46:11] <Jartza> And my first attiny-project was actually to play with el cheapo LCD :)
[16:46:12] <N1njaneer> lubskogreg: CLKPR is being set with a single bit at bit position "CLKPCE"
[16:46:13] <Jartza> https://www.youtube.com/watch?v=7rMJPgWqLus
[16:46:28] <aandrew> lubskogreg: take it apart
[16:46:34] <aandrew> 1 << some_number
[16:46:36] <aandrew> what does that do
[16:46:48] <Jartza> actually that LCD is tiny, 44mm x 22mm
[16:46:51] <N1njaneer> lubskogreg: The datasheet for the micro you are using will tell you what those two macro'd numbers are.
[16:47:08] <lubskogreg> what if CLKPCE is equal 0x0
[16:47:15] <aandrew> lubskogreg: what is 1 << 0
[16:47:15] <lubskogreg> what will be the result of this ?
[16:47:37] <lubskogreg> CLKPR=0x1
[16:47:38] <lubskogreg> ?
[16:47:40] <aandrew> write a little c test program: int main(void) { printf("1 << 0 is %d\n", 1 << 0); return 0; }
[16:47:58] <aandrew> gcc -o x x.c && ./x
[16:48:24] <aandrew> (don't use test as the filename, there is a shell builtin called test, that caused me no end of grief when I was learning)
[16:48:38] <N1njaneer> lubskogreg: Yes, bit-shifts that are zero will just be bypassed out by the compiler.
[16:48:42] <Jartza> I like the attiny85 :)
[16:48:50] <Jartza> it's so minimalistic
[16:49:03] <aandrew> well they're not bypassed out, they're computed correctly. all constants are precomputed
[16:49:06] <Jartza> sort of "back to the basics" like in the good old days
[16:49:31] <aandrew> 1 << constant is precomputed at compile time. 1 << variable is turned into whatever your processor's left-shift instruction is
[16:50:06] <N1njaneer> aandrew: Yes of course, but I was giving the simple explantion.
[16:50:10] <N1njaneer> explanation
[16:50:47] <N1njaneer> It's a shame that the AVR doesn't have a barrel-shifter, though. It's actually faster to do a multiply by a power of two rather than a progressive set of left shifts. :(
[16:51:22] <lubskogreg> CLKPR=(1<<CLKPCE); if this is used to set the highest bit to "1" and the rest to zero, so does it assume that CLKPCE=0x7
[16:51:23] <lubskogreg> ?
[16:51:37] <aandrew> it isn't assuming anything
[16:51:46] <aandrew> CLKPR and CLKPE are macros defined in a header file you are including
[16:52:14] <lubskogreg> hmm, didn`t look there
[16:52:18] <lubskogreg> thanks for the tip
[16:52:34] <lubskogreg> sorry for being such a newbie :D
[16:52:52] <aandrew> no problem, we love to help newbies who aren't making nuisances of themselves
[16:52:58] <aandrew> you're not making a nuisance of yourself
[16:53:09] <Jartza> I also bought some attiny84's and atmega 328's but haven't even tried them yet
[16:53:31] <Jartza> I guess that you could do a lot with 328
[16:53:59] <Jartza> because you can do a lot with t85 :)
[16:54:22] <lubskogreg> well im starting from the end side of learning. I found a project, than ill try to understand it , and ill probably the elements to actually build and programm it
[16:54:24] <lubskogreg> thanks guys
[16:56:19] <aandrew> I like those kinds of newbies
[16:56:59] <N1njaneer> They ask constructive questions :D
[16:57:23] <Jartza> well, I count myself also to be an avr-newbie :)
[16:57:25] <N1njaneer> Jartza: The 328 is very nice because of the peripherals that some of the Tiny's don't have
[16:57:27] <aandrew> well they're not entitled
[16:57:35] <N1njaneer> aandrew: hear hear :)
[16:57:43] <aandrew> they're like "I can't figure this out" and they don't get indignant when you ask them to think
[16:57:51] <aandrew> they think and even if they get the wrong answer it's ok, they're learning
[16:57:59] <aandrew> I can tutor people like that forever
[16:58:15] <N1njaneer> Same here :D
[16:58:36] <N1njaneer> Is why I like hanging out on here, though it's been a long while since I've been logged in. I missed my AVR peeps :D
[16:58:46] <Jartza> I actually had an avr-"workshop" as tutor today for my colleagues :D
[16:58:54] <Jartza> with my "many months of avr experience"
[17:00:03] <Jartza> but it was quite nice as we started from the real beginning and people made the same mistakes as I did when I started (knowing almost nothing about electronics)
[17:00:26] <Jartza> they all got their leds flashing and they got their buttons to switch the led on and off with debouncing
[17:00:26] <N1njaneer> Mistakes are good to make - better teachers than success right out of the gate.
[17:00:29] <Jartza> :D
[17:01:34] <Jartza> but first of course, they tried button without pulldown-resistor... and after I told them what I've learned about pull-ups and -downs, they struggled with the debounce
[17:01:46] <Jartza> but I guess everybody learned something, by making mistakes
[17:02:22] <Jartza> that's why I also bought 100 t85's when I started - no need to be afraid to blow few up
[17:02:51] <N1njaneer> Jartza: I always like external pull-X's where possible. Did you know that you can enable internal pull-ups on the AVRs as well to save the external resistor if necessary?
[17:03:01] <Jartza> yes
[17:03:36] <Jartza> but as we learned the real basics, I thought it would be best to use external resistor
[17:03:41] <N1njaneer> I like the external ones, but sometimes I'm doing board designs where I literally can't even squeeze an extra 0402 10K in :D
[17:03:45] <N1njaneer> Absolutely.
[17:03:50] <Jartza> as all of the chips might not have internal resistors
[17:03:58] <N1njaneer> All of the AVRs do.
[17:04:15] <Jartza> ok
[17:04:38] <N1njaneer> If that helps :D
[17:04:44] <Jartza> well it's good to know :)
[17:06:10] <Jartza> learning new things is always fun
[17:06:22] <Jartza> the whole "trip to avr-world" has been fun
[17:06:29] <Jartza> and learning some electronics
[17:06:35] <N1njaneer> AVR is a great platform to learn on.
[17:06:46] <Jartza> I was actually quite amazed that I got my modem working in just 3 days
[17:06:56] <N1njaneer> Well thought out design, extremely good development tools, and Atmel's support is exceedingly excelltn.
[17:06:58] <N1njaneer> excellent.
[17:07:59] <Jartza> yep, I read quite a lot before buing any components and I found so much info about avr's that I thought I can't go wrong
[17:08:10] <Jartza> and I wanted some change from the arm-world
[17:08:27] <Jartza> in my day job it's arm, arm, arm, arm (and a leg)
[17:08:35] <Jartza> ;)
[17:10:40] <myself> arm, imx, superh, arm, pic, arm...
[17:11:16] <myself> $dayjob is no fun :p
[17:12:42] <Jartza> well... we also have imx and omap and cortex...
[17:12:46] <Jartza> they're all arm :)
[17:13:03] <N1njaneer> Atmel has also very well integrated ARM development in to the whole AVR Studio platform and tools, so they are really unifying things amazingly well - pick the device that best fits your needs.
[17:13:23] <Jartza> might be, I haven't used the avr studio
[17:13:44] <Jartza> doesn't matter, I'm more of an command-line-guy anyway :)
[17:13:49] <Jartza> (and I'm using mac)
[17:13:54] <Jartza> & linux
[17:14:28] <N1njaneer> AVR Studio is absolutely amazing in v6 -- Atmel's weak point previously was the build environment and tools, and they've turned that around fantasticall in recent years, including all of the support libraries and over 20,000 examples for every peripheral on every device they produce.
[17:15:38] <N1njaneer> It's unfortunate that AVR Studio is built on top of Visual Studio's IDE being only Windows-centric, but it's a great IDE. I suffered Eclipse for YEARS on multiple different processors and never want to touch it again. AVR Studio compiles, uploads, and JTAG debugs perfectly every single time, bar none thus far. It's refreshing when tools work how they're actually supposed to work.
[17:16:05] <N1njaneer> And can't beat 100% free
[17:17:46] <Jartza> sound good, but I have no windows :)
[17:17:52] <N1njaneer> Especially when doing ARM development of anything complex. You just start a new project, and boom - compiles and uploads and runs first shot. I dinked around trying to get gcc to build an ARM project correctly under Eclipse and gave up after two days of trying, and was on the verge of dropping some serious coin on someone else's commercial toolchain right before Atmel launched AS6 and fixed all
[17:17:52] <N1njaneer> of that :D
[17:18:09] <N1njaneer> Jartza: VM's are cheap these days
[17:18:13] <Jartza> only 2 macs. of course I could run windows under parallels, if I had a license :)
[17:18:31] <N1njaneer> XP licenses are a dime a dozen these days and will run it just fine.
[17:18:56] <Jartza> I didn't know you can still get XP license .)
[17:19:00] <N1njaneer> I actually keep a VM around for running some of the older Xilinx toolchains that will NOT install under Win7. And target parts they have dropped from the newer tool chains.
[17:19:34] <Jartza> it's been so long since I actually used windows that I don't feel quite at home with it
[17:19:52] <N1njaneer> Jartza: you can find tons of official copies on eBay for cheap if you want a legitimate license
[17:20:14] <Jartza> I'd prefer a legitimate license as this is my companys machine
[17:20:22] <N1njaneer> Easy enough to do.
[17:20:48] <Jartza> and company policy is strict no for non-legitimate sw
[17:20:52] <Jartza> which I can understand
[17:21:06] <N1njaneer> AVRStudio uses gcc in the back-end for everything. Just marries on the wonders of niceness that are MS's Visual Studio IDE for code and project management
[17:21:30] <Jartza> I might check it out at some point
[17:21:37] <Jartza> if my projects get bigger :)
[17:21:37] <N1njaneer> Helpful since I use Visual Studio for OS app development, so it's the same IDE for both.
[17:21:50] <Jartza> I use Qt Creator :)
[17:21:54] <N1njaneer> Also useful for full source debugging via JTAG
[17:22:15] <Jartza> and Green Hills fusching-ugly-piece-of-crap
[17:22:16] <Jartza> :D
[17:22:54] <Jartza> jtag doesn't help much with t85, does it? :)
[17:23:30] <N1njaneer> The smaller parts don't have JTAG, but most do have Single Wire Debug
[17:23:51] <Jartza> oh, ok
[17:23:57] <Jartza> I've missed that from data sheet
[17:24:04] <N1njaneer> I very rarely use JTAG for AVR stuff because I can generally debug just fine without it, but you absolutely want/need JTAG for Atmel ARM stuff
[17:24:13] <Jartza> sure
[17:24:22] <Jartza> for arm I use jtag daily
[17:25:09] <Jartza> hmmh.. error correction could triple/quarduple my modem code :)
[17:25:17] <N1njaneer> I just started writing an ARM emulator to get a better handle in the lower level aspects of the architecture :)
[17:25:38] <Jartza> but the speed is already much faster than I originally hoped for (I was aiming for ballpark figure around 300 to 600bps)
[17:26:01] <N1njaneer> Nice!!
[17:26:13] <Jartza> so maybe I'll just go for some kind of packets with interleaved resend and simple crc calculation
[17:26:39] <Jartza> for example 8 byte packets, with 1 byte for packet number, 1 byte for 8-bit crc
[17:26:53] <N1njaneer> See if you can find a really tiny implementation of Reed Solomon forward-error correction :D
[17:26:58] <Jartza> then send packets like 1, 2, 3, 4, 1r, 5, 2r, 6, 3r, 7....
[17:27:08] <Jartza> r being the resend
[17:27:29] <Jartza> that would still leave me around 1500bps real speed
[17:27:49] <Jartza> which is more than enough as the purpose is to fill eeprom with new data :)
[17:27:54] <Jartza> so, 512 bytes
[17:28:47] <Jartza> N1njaneer: I actually looked already, but didn't find any simple enough
[17:28:58] <Jartza> crc8 is just a few bytes, and speed is not important here
[17:29:13] <N1njaneer> True true
[17:29:34] <Jartza> with interleaving the packets like I described, I still can survive from error bursts up to 4 packets long (32 bytes)
[17:31:08] <aandrew> I just use avr-gcc and the shell. I can't stand IDEs
[17:31:24] <aandrew> I just wish there was a good PSoC command line solution. compiling is fine, it's just arm-gcc but the schematics/etc are all gui
[17:31:48] <N1njaneer> aandrew: How large are the projects you work on?
[17:32:10] <aandrew> N1njaneer: depends on the project.
[17:32:32] <aandrew> some are tiny little things, others are quite large (multiple processors and boards, ethernet, fpga, etc.)
[17:32:37] <aandrew> hard to give you a good answer
[17:33:44] <N1njaneer> When I get to projects that have several dozen or several hundred files I find the IDE immensely useful. :)
[17:34:54] <Jartza> http://cdn.kone.com/www.kone.ae/en/Images/kone-ksp858-factsheet.pdf
[17:35:02] <N1njaneer> Especially doing source-stepping debug.
[17:35:07] <Jartza> that's what I've been working on for last year-and-a-half :)
[17:35:08] <Jordan_U> N1njaneer: Have you seen worked on AVR projects with several dozen or several hundred files?
[17:35:15] <Jartza> (and still do, for the next sw-version)
[17:35:23] <aandrew> N1njaneer: not me, I find the IDE just gets in the way
[17:35:50] <aandrew> now I do seem to spend about half my time in vim and the other half of my time in sublime text whcih is a damn good GUI text editor
[17:36:16] <aandrew> wow very nice
[17:39:50] <N1njaneer> Jordan_U: Our AVR projects are usually several dozen files at the upper end, but ARM stuff can easily get much higher than that, and I routinely write OS-level projects that are +500 source files, so a good IDE is invaluable for getting my work done quickly.
[17:40:27] <aandrew> yes I don't often get that big, but I find even with linux based OS stuff I'll use the gui text editor but not an IDE
[17:41:01] <N1njaneer> Best to find what works most easily for what you need to do. If CLI is easier, go that. If you need to manage hundreds upon hundreds of C++ classes, IDEs with auto-completion are very very useful.
[17:43:51] <Jartza> Totals grouped by language (dominant language first):
[17:43:51] <Jartza> ansic: 63 (100.00%)
[17:43:53] <Jartza> :)
[17:43:57] <Jartza> that's my modem
[17:44:02] <N1njaneer> Nice!
[17:44:03] <malinus> emacs auto-completion works just fine
[17:44:50] <Jartza> I actually would like to opensource or GPL that modem source, but as I made it on my work-time and not my freetime, I still have to get clearance from my company first
[17:45:12] <Jartza> and they are sometimes real strict about what can be released and what "might be needed in future project"
[17:45:18] <N1njaneer> I have a ton of code I'd like to do the same with - general problem is finding the time to sit down and document it so it's useful to others
[17:45:38] <Jartza> this is also documented
[17:46:07] <Jartza> :)
[17:46:16] <Jartza> it's so simple that it's easy to document
[17:46:44] <Jartza> and I also have simple python to create the audio, 28 lines of python
[17:46:51] <N1njaneer> Jartza: Yeah, unfortunatly our stuff is quite a bit larger. :(
[17:46:54] <Jartza> (just pipe it to aplay :D)
[17:47:22] <Jartza> N1njaneer: yeah... I have lot of other stuff too, but for attiny I think quite many are using that as a hobby-chip
[17:47:30] <N1njaneer> Indeed!
[17:47:47] <Jartza> and someone else might also have a need to transfer data to attiny cheaply
[17:48:05] <Jartza> with this the only thing needed is a headphone jack, few capacitors and resistors
[17:48:21] <Jartza> costs around one euro or so
[17:50:48] <malinus> N1njaneer, free software that isn't documented is still more useful than any kind of non-free software.
[17:50:48] <Jartza> also I wanted the modem audio to be able to be converted to mp3
[17:51:09] <Jartza> as I could just take my mp3-player with me and store some data-files in it :)
[17:51:20] <N1njaneer> malinus: Yes, but in this case these things are frameworks, so they need some example and documentation on how to use them :D
[17:51:34] <Jartza> and this works, with quite low quality even
[17:52:56] <malinus> N1njaneer, not necessary. It's a good thing, sure. But the fact that your source isn't well-documented shouldn't hold you back fro releasing it under a free license
[17:53:56] <Jartza> N1njaneer: yeah, I'm more of thinking releasing small useful bits here and there
[17:54:16] <Jartza> I'm just hoping that the company doesn't find a need for a modem :D
[17:54:37] <Jartza> or that big need, that the source couldn't be GPL'ed
[17:54:42] <N1njaneer> Well we have a super-excellent cross-platform OpenGL-hosted GUI framework that compiles to Windows, Linux, and OS X, but we really need to find the time to sit down and further the documentation.
[17:54:43] <Jartza> or even double-licensed
[17:54:55] <Jartza> GPL or Commercial if you need it for commercial purposes
[17:55:17] <Jartza> N1njaneer: sounds great!
[17:55:30] <Jartza> and I understand that it's big :)
[17:55:47] <Jartza> anything cross-platform and GUI-framework means it's big.
[17:55:57] <N1njaneer> We have several pieces of commercial software that use it as the front end, and there's even a game up on Steam that uses it.
[17:56:19] <N1njaneer> The cross-platform part of it is actually only a couple files - maybe a half-dozen - that handle the platform specifics. Everythign else is abstracted out.
[18:02:02] <Jartza> cool
[18:02:16] <N1njaneer> There's a windows, osx, and linux folder that holds the system-specfic binding info for each
[18:03:26] <Jartza> uhh
[18:03:32] <Jartza> I should be asleep already :)
[18:04:02] <N1njaneer> https://www.dropbox.com/s/x11rmf4txe1kah0/DS3LiveExample.png is an example of the visual interface appearance
[18:04:19] <Jartza> I just got too excited about my latest incarnation of the modem :)
[18:04:52] <N1njaneer> Other example http://www.chromacove.com/images/CCDesigner/CCD3.jpg :D
[18:04:54] <Jartza> especially the mp3 encoding
[18:05:35] <Jartza> N1njaneer: cool :)
[18:05:53] <N1njaneer> Happy to share! And thanks for showing us your modem stuff!! :D
[18:06:31] <Jartza> I'm a bit amazed that this mp3-version works
[18:06:45] <Jartza> most of the time the signal looks ok: https://www.dropbox.com/s/hxnjwbjxpdcoveb/Screenshot%202014-06-06%2001.48.40.png
[18:07:11] <Jartza> but after a while it starts to look like this: https://www.dropbox.com/s/tpr2i5me7gsbrem/Screenshot%202014-06-06%2001.49.05.png
[18:07:14] <Jartza> :D
[18:07:22] <Jartza> and then gets back to normal
[18:07:27] <Jartza> but stil, zero errors :o
[18:08:01] <N1njaneer> I would guess moreso becasue the spacings of the zero-point crossings are really the majorly important parts :)
[18:08:19] <Jartza> yep
[18:08:59] <Jartza> so I guess my "backyard logic" was quite good when I did the third implementation of the modem :)
[18:09:09] <Jartza> the 2 previous were too complicated and hard to get working right
[18:09:14] <Jartza> and also much much slower
[18:09:19] <N1njaneer> KISS principle at work!
[18:09:35] <Jartza> the first working version was around 125bps :D
[18:11:59] <Jartza> altghough the sound of the first modem-try was quite nice, sort of like... pacman :D
[18:12:08] <Jartza> the latest implementation sounds like a dentist drill
[18:14:18] <ac_slater> hey guys, anyone here into USB HID stuff?
[18:14:44] <Jartza> anyway, I'm off to sleep... g'nights
[18:15:09] <N1njaneer> ac_slater: Have done a bunch of HID. What's up?
[18:16:12] <ac_slater> N1njaneer: so, I basically have a little atmega16u2 that came with some firmware to "type out" characters via HID. ie - a website with a delay to give a typewriter effect. I dont know enough about scancodes, etc to know how make some switches do things like media play/pause.
[18:16:47] <ac_slater> the device is seriously just an atmega16u2 with 3 keyboard keys.
[18:17:15] <N1njaneer> Sounds about right
[18:17:52] <N1njaneer> You can look up the keyboard scancodes to see which are associated with play/pause and simply swap them in to the code
[18:18:02] <ac_slater> so, I mean, is there any special I need to know for media keys? I found some definitions for these that map to 0xBB for Play/Pause... but is there a certain state the protocol needs to be put in for things like this?
[18:18:32] <ac_slater> ie - shift state, or control state
[18:18:34] <ac_slater> ,etc
[18:19:15] <N1njaneer> Both of those are more specific aspects than the microcontroller portion specifically. You probably want to go to USB.org and pull the standards documents specific to keyboard HID
[18:19:48] <ac_slater> N1njaneer: good point. I was given some source that is completely undocumented, etc. Not even sure where to begin identifying some spec version
[18:20:14] <N1njaneer> I have only done generic HID data exchange that doesn't associate as a peripheral type category, so you'd need the specs for the keyboard HID to know what to do on that layer. Should be pretty simple.
[18:21:26] <ac_slater> I see. thanks mate!
[18:27:33] <ac_slater> ha, "simple" ;)
[18:34:21] <ac_slater> N1njaneer: so I'm a bit stuck, I have no idea how to proceed to actually figure out the specs of the HID stuff the uC supports. Is it a matter of choice of the dude that made the board, or is it a limitation of the chip?
[18:42:38] <N1njaneer> Sorry, phonecalls here.
[18:43:10] <N1njaneer> No, HID and all USB stuff is a function of the bytes that go through the USB peripheral - not hardware restricted.
[18:43:38] <N1njaneer> The uC doesn't support HID, it supports USB. HID is layered on top of USB as a higher level portion of the protocol. Make sense?
[18:44:06] <N1njaneer> Kind of like how something can support Ethernet, or it can support HTTP. HTTP is a protocol that sits on TCP that sits on IP that sits on Ethernet.
[18:44:39] <N1njaneer> Keyboard sits on HID that sits on USB
[18:45:12] <ac_slater> gotcha. I understand protocols, I just wasnt sure if HID was baked in at all
[18:57:51] <ac_slater> N1njaneer: most of the time you read about these uC's have HID support ... instead of USB support.
[18:58:21] <ac_slater> actually, it usually says "USB HID" ... to an outsider that might seem like 1 baked in feature
[19:09:42] <N1njaneer> Yeah, not the case on the AVR implementation
[19:10:17] <N1njaneer> Some micros may, but I've usually just seen generic device or host USB controllers usually since it gives the most flexibility.
[19:11:56] <ac_slater> interesting stuff. By the way, changing a keycode from 0x18 ('O') to 0xBB ('media play/pause') didnt work. So it must be some state thing or some special case.
[19:12:48] <ac_slater> ie - making one of my IOs trigger the 0xBB byte to be sent via HID didnt do anything.
[19:13:47] <N1njaneer> Again, I would pull the Keyboard Class HID spec from usb.org to look :)
[19:14:33] <ac_slater> yea looking at it now, thanks mate
[19:16:43] <N1njaneer> Sure!
[21:02:30] <aandrew> that is odd, the first thing I'd look at is project-specified #defines that perhaps aren't making it inot the makefile
[21:02:49] <aandrew> if you pastebin the exact error (just the output of "make" after a "make clean") it would help a lot
[21:02:53] <ac_slater> apparently only F_CPU. Since I'm pretty much a newbie with avr stuff, I'm curious what I should do
[21:02:59] <aandrew> oh
[21:03:12] <aandrew> that's easy, add a -DF_CPU=8000000 (or whatever) to your Makefile
[21:03:16] <ac_slater> I was given some sources files and an AVR studio project file
[21:03:45] <ac_slater> right. Alright cool. I wasnt sure if this was defined multiple times in different scenarios. But yea, thanks mate
[21:04:01] <aandrew> I usually define it in the toplevel header file but your project might not have one
[21:04:54] <ac_slater> yea I see in the project file. The code didnt come with a makefile so I'll just copy the compiler args from the project.
[21:05:00] <ac_slater> yea sadly it doesnt
[21:06:42] <ac_slater> sweet I got it
[22:00:04] -rajaniemi.freenode.net:#avr- [freenode-info] help freenode weed out clonebots -- please register your IRC nick and auto-identify: http://freenode.net/faq.shtml#nicksetup
[22:14:53] <N1njaneer> Quiet night
[22:18:09] <Tom_itx> BOO!
[22:19:33] * N1njaneer scared
[22:24:06] <Casper> trying to figure out why I don't balance by like 100$ on my credit card...
[22:24:16] <Casper> it look like refund really cause headache
[22:24:26] <Tom_itx> new math?
[22:24:42] <Casper> I pay my card regularly (like weekly)
[22:24:45] * N1njaneer whistes as he punches Casper's credit card number in to an card reader and buys beer for the channel.
[22:24:52] <Casper> but refund can take a week to appear
[22:24:53] <N1njaneer> +whilstles innocently
[22:25:05] <N1njaneer> +whistles innocently
[22:25:09] <N1njaneer> Wow so can't type tonight
[22:25:25] <Tom_itx> have another beer
[22:25:45] <N1njaneer> I can't have another beer without having had an initial beer
[22:25:53] <Casper> and of course, the nice csv format can't be downloaded past 61 days
[22:36:54] <aandrew> hm, beer would be good
[22:37:10] <N1njaneer> So I was bored and just did a calculation
[22:37:54] <N1njaneer> If you want perspective on how large a 64-bit address space is, it's roughly equivalen to covering the entire surface area of the earth with laptop keyboard keys - about 0.21" square inches each.
[22:40:01] <Valen> nice
[22:40:38] <aandrew> haha
[22:41:04] <Valen> whats that work out to for ipv6 then?
[22:41:37] <LoRez> you stuff all those keys onto each key I think
[22:41:43] <Dagger> infinite IPs per laptop key
[22:41:43] <N1njaneer> ipv6 is 128-bit, so a lot more :D
[22:41:57] <Dagger> for values of "infinite" bounded by heat dissipation
[22:41:59] <N1njaneer> Well, 64-bits worth of address space per key :D
[22:42:39] <N1njaneer> A calculation I did a while ago that put things in perspective...
[22:42:44] <N1njaneer> If someone wants to make a guess.
[22:42:47] <LoRez> yeah, so the quantity of keys you just spread across the earth should be sitting on each of those keys
[22:42:54] <N1njaneer> Exactly.
[22:43:02] <N1njaneer> So RGB truecolor pixels
[22:43:18] <N1njaneer> 24-bits per pixel, 8-bit RGB values for each
[22:43:40] <N1njaneer> Each pixel can have 16.7M possible values
[22:44:10] <N1njaneer> Take a guess at how many true-color pixels you'd need to represent a unique combination for every ATOM in the observable universe.
[22:44:24] <Valen> thats quite useful really, I like that, 64 bits is a laptop key over the whole planet, 128 bit is splitting each key up to do that
[22:44:32] <Valen> N1njaneer: not all that many
[22:44:57] <N1njaneer> Valen: Hazard a guess?
[22:45:11] <Valen> I'm going to guess around 640x480?
[22:45:22] <N1njaneer> Way high
[22:45:34] <N1njaneer> Astronomically way high, in fact :D
[22:45:48] * Valen is a space scientist and a computer guy
[22:45:54] <Valen> I feel i have let many sides down
[22:46:04] <Valen> but I was trying to guess without doing maths ;->
[22:46:15] <N1njaneer> Nah, I was dumbfounded when I worked it out.
[22:46:21] <N1njaneer> Another guess?
[22:46:23] <Valen> its going to be pretty small
[22:46:32] <Valen> there are what 10^100 atoms in the universe or so?
[22:46:46] <Dagger> like... 15?
[22:46:53] * Dagger did 100/7
[22:47:04] <N1njaneer> Dagger: Very close -- the answer is roughly 12
[22:47:26] <N1njaneer> ~288 bits is all you need for representing ~10^80 atoms
[22:48:00] * Valen proposes a new variable type
[22:48:02] <N1njaneer> Which is insane if you think about a 256-bit encryption key not being too far off
[22:48:21] <N1njaneer> Valen: CUID - Cosmologically Unique ID?
[22:48:26] <Valen> the "universal" int
[22:48:46] <Valen> guids are generally 128 bit aparently
[22:48:49] <N1njaneer> Plank Int's
[22:48:53] <N1njaneer> GUID usually are, yes
[22:49:12] <Valen> they really should be more like 288 bits then ;->
[22:49:12] <N1njaneer> And that's still an astronomically small chance of collissions if generated well
[22:49:43] <N1njaneer> MAC addresses usually factor in to the generation, since by their nature all correct MAC addresses are unique.
[22:49:59] <N1njaneer> But yeah, there's your maths for the day :D
[22:50:03] * Valen bets that he can generate a guid collision on his 3rd attempt at doing something important with a bank or taxation or something