#avr | Logs for 2014-04-17

Back
[01:16:14] <rue_more> https://www.youtube.com/watch?v=sjMhJxS96Lk
[01:16:16] <rue_more> :)
[01:16:19] <rue_more> avrs rock
[01:20:59] <Xark> rue_more: Nice! Is that a 644 or 1284 AVR?
[01:21:10] <rue_more> 32 :)
[01:21:19] <rue_more> but its overkill
[01:21:27] <rue_more> the code only runs 8 channels
[01:21:36] <rue_more> but with 24000 count resolution
[01:22:05] <Xark> Hmm, 32? As in AVR32?
[01:23:31] <rue_more> mega32
[01:23:43] <Xark> Ahh, OK. :)
[01:24:13] <rue_more> I think am m8 would do
[01:24:51] <Xark> How about Tiny4313 :)
[01:25:41] <Xark> I guess you might need a 16-bit timer...
[01:25:54] <rue_more> 1 8 bit, 1 16 bit
[01:26:39] <Xark> Yeah. Lack of a 16-bit timer is a bummer for me not using a few tiny chips, when otherwise I could.
[01:57:20] <anton02> what do you think of using this as a wheel encoder? I could draw some stripes on a wheel with a black marker and count the number of stripes being passed to determine speed http://www.robotgear.com.au/Product.aspx/Details/271-Sharp-IR-Distance-Sensor-GP2Y0A21YK0F-GP2D12-10-80cm
[01:59:21] <jacekowski> unlikely to work
[01:59:33] <anton02> jacekowski: how come?
[01:59:41] <jacekowski> it's a distance sensor
[01:59:52] <jacekowski> wheel will still be the same distance away from it
[02:00:29] <jacekowski> and it looks like it works just as well for black and white surface
[02:00:30] <anton02> yeah but it gives varying voltages depending on how far an object is away
[02:01:39] <anton02> grey and white mind you
[02:04:37] <anton02> jacekowski: why would you want a servo wheel to have encoder stripes? it's not necessary since servos are stepper motors is it? http://littlebirdelectronics.com.au/products/solarbotics-sw-r-red-servo-wheel-with-encoder-stripes-silicone-tires
[02:15:27] <anton02> Casper: are most hobby servos optical or stepper?
[05:28:54] <dgriffi> I'm using a USBtiny with avrdude, and I started to get errors like this a few minutes ago: http://pastebin.com/aLYGgSR5
[05:29:15] <dgriffi> I checked all the connections and they're good. What happened?
[05:32:41] <dgriffi> so... yanked the crystal and it works.
[05:32:46] <dgriffi> put the crystal back... it works.
[05:32:49] * dgriffi scratches head
[05:42:55] <Lambda_Aurigae> dgriffi, doing it on a solderless breadboard?
[05:43:24] <Lambda_Aurigae> if so, there's the issue...specially if the board is old.
[05:43:59] <Lambda_Aurigae> poor connection on some of the pins,,,in your case the crystal pins,,,can cause all kinds of hickups and problems.
[05:44:46] <Lambda_Aurigae> while I love solderless breadboards myself, I have encountered such things in the past.
[05:51:04] <dgriffi> Lambda_Aurigae: brand new board
[05:51:18] <dgriffi> breadboard, that is
[05:51:18] <Lambda_Aurigae> still can be poor connection.
[05:51:25] * dgriffi shrugs
[05:51:51] <Lambda_Aurigae> not uncommon, from the super cheap ones to the expensive as hell ones...
[05:54:06] <Valen> crystals are fussy, there is lots of stray capacatance and things in them
[05:54:12] <Valen> in solderless breadboards
[05:54:17] <Lambda_Aurigae> yup.
[05:54:45] <Lambda_Aurigae> often do I get microcontrollers to run with crystals without the capacitors in place on soldreless breadboards.
[05:55:52] <dgriffi> can someone suggest a good speaker for AVR sound output tinkering?
[05:56:05] <Lambda_Aurigae> depends on the kind of sound you want.
[05:56:08] <dgriffi> I picked up this: http://www.radioshack.com/product/index.jsp?productId=2062402
[05:56:13] <Lambda_Aurigae> yank one out of an old junk radio.
[05:56:17] <Lambda_Aurigae> or get a piezo speaker.
[05:56:30] <Lambda_Aurigae> so, that is a piezo speaker.
[05:56:38] <Lambda_Aurigae> sound will be kinda tinny but it will make sound.
[05:57:08] <dgriffi> that's all I'm after for now
[05:57:10] <Lambda_Aurigae> I would recommend using an amp of some sort or at least a transistor between the AVR and the speaker.
[05:57:46] <Lambda_Aurigae> don't have to for a piezo as they draw so little current.
[05:57:52] <Lambda_Aurigae> but if you use a real speaker, definitely do so.
[06:01:10] <dgriffi> Lambda_Aurigae: would this speaker be adequate to function as a tone-dialer?
[06:02:48] <Lambda_Aurigae> no clue...might need an amp for generating DTMF
[06:02:59] <Lambda_Aurigae> not just for the generation but for getting enough volume.
[06:06:11] <dgriffi> I think I scared off Lambda_Aurigae by mentioning blueboxes
[06:06:20] <Lambda_Aurigae> nope.
[06:06:25] <Lambda_Aurigae> it's just a tone dialer
[06:06:39] <Lambda_Aurigae> if you had said that it would have made things simpler than using some code name for it.
[06:06:54] <Valen> if its an avr making the sound, then the speaker probably isn't going to matter much
[06:07:49] <dgriffi> sorry.. I figured you knew what blueboxes are/were
[06:08:04] <Lambda_Aurigae> I never was into phone hacking.
[06:09:16] <dgriffi> there are patches to Asterisk that allow blueboxes to work
[06:09:48] <Lambda_Aurigae> never got asterisk to work either...but only installed it once to futz around way back when it was new.
[06:10:09] <Lambda_Aurigae> phones could vanish from the face of the earth and it wouldn't bother me one bit.
[06:10:55] <dgriffi> I get a kick out of playing with obsolete equipment
[06:11:07] <Lambda_Aurigae> so do I.
[06:11:19] <Lambda_Aurigae> I just have little to no use for phones myself...
[06:11:28] <Lambda_Aurigae> I have a problem talking to someone if I can't see them...
[06:12:27] <Lambda_Aurigae> me and my tendency toward autism and all that.
[06:14:48] * dgriffi has a real diagnosis of aspergers
[06:15:30] <Lambda_Aurigae> I have a real diagnosis of rating very high on the autistic spectrum....was diagnosed as an adult...I had to fight it as a kid as they didn't know much about it back then..
[06:16:23] <Lambda_Aurigae> when I was in school I got diagnosed with a plethora of things, including ADD, epilepsy, being too smart for my own good, and boredom...
[06:17:19] <dgriffi> when I was a kid, I never heard of aspergers
[06:17:41] <dgriffi> made high school hellish
[06:17:53] <Lambda_Aurigae> I spent a lot of time in the principals offices and the psychologists offices.
[06:18:06] <Lambda_Aurigae> they never knew what my problem was.
[06:18:22] <dgriffi> yep
[06:18:32] <Lambda_Aurigae> best thing I ever did was join the military...gave me some structure for a few years to get my head on straight.
[06:19:01] <dgriffi> sometimes I wish I went into the military
[06:20:45] <dgriffi> Lambda_Aurigae: how did autism+military work out?
[06:20:47] <Lambda_Aurigae> I got into military intel and actually had a challenge for a change.
[06:20:57] <Lambda_Aurigae> it worked well for me,,,the structure.
[06:21:38] <Lambda_Aurigae> I wouldn't say I'm autistic,,,more borderline...as I said, I was diagnosed as being high on the spectrum..
[06:22:22] <Lambda_Aurigae> two of my wife's best friends,,and my wife,,are autism specialists and they tested me without me knowing, which is the best way to do the tests.
[06:23:13] <dgriffi> my stepmother was the one who figured out what was up with me
[06:23:46] <dgriffi> she does similar work as your wife and her friends
[06:50:45] <w|zzy> Lambda_Aurigae: tried it
[08:19:51] <megal0maniac_afk> Aspergers is no longer a thing
[08:20:11] <megal0maniac_afk> Now you're somewhere on the "autistic spectrum"
[09:33:16] <dxtr> Wouldn't it be neat to have a JVM on AVR?
[09:33:47] <dxtr> I don't know what it would be useful for but it would be quite cool nontheless
[09:40:00] <anton02> what parts should i search for if im looking for something that will let me attach a servo to the front wheel of a tri-wheel RC car and the single front wheel steers the car?
[14:29:39] <megal0maniac_afk> RikusW: Hi :)
[14:29:47] <RikusW> hi
[14:29:59] <megal0maniac_afk> Gaanit?
[14:30:13] <RikusW> Doing ok, how are you ?
[14:30:29] <megal0maniac_afk> Tired. Mad week, but good otherwise
[14:30:54] <megal0maniac_afk> Trying to rig up the xboard to read a parallel eprom
[14:31:23] <RikusW> thats more wires than hvpp ;)
[14:31:42] <megal0maniac_afk> 16bit address, 8bit data. It's a mess :P
[14:32:30] * RikusW has been working on a 300m section of fencing this afternoon
[14:32:38] <megal0maniac_afk> Ooh, fun
[14:33:00] <RikusW> did about 100 wire ties to the fence posts using 2mm wire
[14:33:25] <megal0maniac_afk> :/
[14:33:46] <megal0maniac_afk> Back on the farm, then?
[14:33:55] <megal0maniac_afk> I assume so by your gprs ip :)
[14:34:00] <RikusW> new barbed wire isn't so much fun when you get pricked and scratched...
[14:34:03] <RikusW> yep
[14:34:18] <RikusW> and trust me, one wrong move and there is blood
[14:35:20] <megal0maniac_afk> Today I saw a house in town with cemented broken bottles into the top of the wall. Probably more effective than barbed wire :)
[14:36:43] <RikusW> probably
[14:36:50] <RikusW> the fence is for cattle only
[14:37:06] <RikusW> you can easily enough get through it
[14:37:08] <megal0maniac> Not many cows in the cbd :)
[14:37:24] <RikusW> s/many/any ?
[14:37:35] * megal0maniac shrugs
[14:38:31] * RikusW got some horses too
[14:38:47] <RikusW> about 50....
[14:40:35] <megal0maniac> I have 2 dogs :P
[14:41:29] <RikusW> We have like 10 border collies
[14:41:50] <RikusW> and around 500 cows
[14:43:03] <megal0maniac> Haha! Farm life...
[14:44:01] <megal0maniac> Can hexrays do anything with compiled 8051 code?
[14:44:12] <RikusW> IDA can
[14:44:20] <megal0maniac> Cool
[14:44:23] <RikusW> iirc hexrays is for x86 only
[14:44:35] <megal0maniac> Now I just need to somehow get this output into a binary dump
[14:44:39] <RikusW> you'll have to learn 8051 asm
[14:45:09] <megal0maniac> Nooo!
[14:45:10] <tzanger> 8051 asm... /me shudders
[14:45:18] <megal0maniac> You can't make me!
[14:45:49] <RikusW> I did a 8051 asm/disasm, never completed it though, but it was nearly done
[14:46:08] <RikusW> I moved to pic for a little while and then AVR :)
[14:46:20] <megal0maniac> Wise man
[14:46:37] <RikusW> megal0maniac: just make sure the address lines are connected correctly, else you'll have a big mess
[14:46:51] <megal0maniac> This is the firmware for an old 8051 uC. Want to see what's inside
[14:47:01] <megal0maniac> RikusW: Yip, I've double checked that :P
[14:50:33] <megal0maniac> Sigh
[14:50:39] <megal0maniac> PuTTY can't do this
[14:50:44] <megal0maniac> It tries but no
[14:50:51] <RikusW> write an app
[14:51:16] <megal0maniac> There's definitely a way in Linux. I'm not writing an app now :P
[14:51:20] <RikusW> or pipe it straight from the com port to a file
[14:51:38] <megal0maniac> cat? echo?
[14:51:47] <RikusW> cat
[15:38:18] <megal0maniac> Meh. Time to give up
[15:41:30] <dgriffi> is there a one-page comparison grid of the various atmega series?
[15:57:26] <myself> and a pony
[15:57:34] <myself> I would like a one-page AVR comparison grid, and a pony.
[16:00:42] * megal0maniac presents myself with a pony
[16:03:56] <clOI> do you know if HD44780 compatible LCD controller need a delay between data characters? I really don't know if it is an HD44780 or something compatible.
[16:04:31] <clOI> If i send my data with 1 MHz everything works. But if I use 8 MHz I get weird characters.
[16:05:23] <clOI> I have used simavr to generate a trace file. The (working) 1MHz version: http://hastebin.com/vojimeceya.vcd and here the (non-working) 8MHz version: http://hastebin.com/sedumorago.vcd
[16:05:42] <clOI> Here is a (simplified) code of what should happen: http://hastebin.com/kodobofoca.c
[16:06:02] <clOI> If I add a delay after every character (data, not command) of about 30us the LCD works.
[16:06:19] <megal0maniac> clOI: The datasheet will tell you this
[16:16:48] <clOI> I don't see anything in the datasheet ( http://pdf.datasheetarchive.com/indexerfiles/Datasheet-049/DSA00101898.pdf ) my LCD is a DisplayTech 162
[16:17:55] <clOI> do you have any idea how to find the problem? I have verified the voltage == 5V; but don't know what else I can do to debug this.
[18:13:55] <anton02_> can you connect a usb mouse to avR?
[18:14:37] <megal0maniac> anton02_: You can connect a usb mouse to a kettle if you really want
[18:14:52] <megal0maniac> Have you tried googling "usb mouse avr"?
[18:15:40] <Lambda_Aurigae> generally you would need an USB host to connect a usb mouse..
[18:15:44] <anton02_> megal0maniac: it's just that all the tutorials ive looked at about connecting a mouse encoder to robot say to use a ps/2 mouse
[18:15:55] <Lambda_Aurigae> however, I did once see a bitbanged usb host for avr some several years ago.
[18:16:08] <Lambda_Aurigae> ps/2 is easiest...it's a slow serial protocol.
[18:16:25] <megal0maniac> anton02_: There's a good reason for that
[18:16:36] <Lambda_Aurigae> usb host is a bit more difficult....you might could use a USB AVR if it had USB-OTG capability.
[18:16:45] <megal0maniac> But that's serious overkill
[18:16:54] <Lambda_Aurigae> if you want cheap but functional rotary encoders,,
[18:17:06] <Lambda_Aurigae> go to an auto junkyard.
[18:17:09] <megal0maniac> "using a non-USB mouse cable would be practical whereas doing so on a USB mouse is 100-fold more complex"
[18:17:14] <Lambda_Aurigae> spinning knobs from car radios.
[18:17:39] <Lambda_Aurigae> the kind that turn and turn and don't have a stop are just rotary encoders...they work great.
[18:18:22] <anton02_> you would think i could just remove the encoder part of the usb mouse and use it without the complicated HID stuff
[18:18:37] <Lambda_Aurigae> yeah, you can.
[18:18:53] <megal0maniac> Are you talking about the scrollwheel?
[18:19:04] <Lambda_Aurigae> can use the optical encoder.
[18:19:12] <Lambda_Aurigae> it's just a low resolution camera.
[18:19:18] <megal0maniac> They generally do. Hence my asking
[18:19:24] <megal0maniac> Whoops
[18:19:45] <megal0maniac> The scrollwheel i mean. They also use optics
[18:19:47] <anton02_> yeah the web wheel
[18:20:05] <Lambda_Aurigae> go grab an older ball mouse...it has 2 identical encoders in it.
[18:20:07] <megal0maniac> There is no rotary encoder in a mouse
[18:20:19] <megal0maniac> Usually
[18:20:29] <megal0maniac> I haven't opened every mouse
[18:20:34] <anton02_> i was going to even use the wheel itself as the front tire of the car
[18:21:01] <Lambda_Aurigae> http://all-avr.blogspot.com/2011/05/optical-mouse-sensor.html
[18:21:16] <megal0maniac> You can still do that, but you'll need to place the transmitter and receiver on either side of the wheel
[18:21:49] <Lambda_Aurigae> http://blog.jgc.org/2012/09/conversion-of-cheap-optical-mouse-to.html
[18:22:20] <anton02_> I think maybe i can just use this with my uno http://www.kevindemarco.com/2014/01/02/arduino-uno-as-a-usb-hid-interface/
[18:22:49] <Lambda_Aurigae> umm
[18:22:50] <Lambda_Aurigae> not.
[18:22:58] <Lambda_Aurigae> that is turning the arduino into a usb mouse
[18:23:03] <Lambda_Aurigae> not using a usb mouse with the ardweeny
[18:23:23] <Lambda_Aurigae> aud, really, it's not mouse but keyboard
[18:23:31] <anton02_> oh okay
[18:23:33] <Lambda_Aurigae> so, using the ardweeny as a usb keyboard.
[18:24:13] <Lambda_Aurigae> what you need is for the avr to be a host, not a device.
[18:25:10] <anton02_> i wonder if it's possible to use the uno's usb port as a host interface
[18:25:14] <megal0maniac> No
[18:25:20] <Lambda_Aurigae> it is not.
[18:25:26] <Lambda_Aurigae> look at the datasheet for your avr.
[18:26:50] <Lambda_Aurigae> the only mega avr series that has otg is the at90usb1287 and at90usb647 chips
[18:26:55] <anton02_> teensy 2 apparently supports it and i should have one of those lying around
[18:28:04] <Lambda_Aurigae> umm.
[18:28:09] <Lambda_Aurigae> I don't see how it could...
[18:28:16] <Lambda_Aurigae> the teensy++2.0 will
[18:28:19] <Lambda_Aurigae> but not the teensy2.0
[18:28:38] <Lambda_Aurigae> hmm...even the teensy++2.0 won't though...wrong chip.
[18:28:57] <anton02_> "The Teensy 2 and Teensy++2 support it natively, are much smaller then an UNO and less expensive. http://www.pjrc.com/teensy/index.html. They are fully Arduino compatible and come with a large number of examples, including for USB host mode."
[18:29:17] <Lambda_Aurigae> according to atmel they don't support host mode...
[18:30:04] <megal0maniac> anton02_: The word "host" doesn't even appear in that page
[18:30:16] <megal0maniac> I don't know where you get your information from...
[18:30:18] <Lambda_Aurigae> what page are you getting that from?
[18:30:38] <anton02_> http://forum.arduino.cc/index.php/topic,139293.0.html
[18:30:40] <Lambda_Aurigae> because those chips, atmega32u4 and at90usb1286 do not support usb host.
[18:31:12] <Lambda_Aurigae> that's not from the teensy page..
[18:31:25] <Lambda_Aurigae> that's from some ardweeny page and they have no clue what they are talking about.
[18:31:28] <Lambda_Aurigae> look at the DATASHEET!
[18:32:04] <megal0maniac> All this aside from the fact that you're MASSIVELY over-complicating this by using USB
[18:32:08] <megal0maniac> So don't
[18:32:08] <anton02_> if i do get my hands on an avr that supports usb host, would doing this be a pretty easy task?
[18:32:13] <megal0maniac> NO
[18:32:21] <Lambda_Aurigae> easy task? not.
[18:32:24] <Lambda_Aurigae> doable? yes.
[18:34:02] <anton02_> with a ps/2 mouse could i just use the mouse harness to get connectivity happening or would i have to pull the whole mouse apart?
[18:34:14] <megal0maniac> anton02_: "all the tutorials ive looked at about connecting a mouse encoder to robot say to use a ps/2 mouse" & "ps/2 is easiest" & "a USB mouse is 100-fold more complex"
[18:34:43] <anton02_> i wonder if you could just usb a usb -> ps/2 adapter lol
[18:34:51] <megal0maniac> -.-
[18:35:32] <Lambda_Aurigae> if your mouse supports dual-mode usb and ps/2 like some logictec ones did, yeah, put the adapter on it and use it in ps/2 mode.
[18:36:30] <Lambda_Aurigae> don't know that I've seen an adapter that puts a usb mouse on a ps/2 port though.
[18:38:12] <Lambda_Aurigae> I see lots of little adapters to do that but as I recall they only worked for certain mice and were a dumb adapter.
[19:10:54] <dgriffi> can I get some advice on 4x4 key matrix reading? I want to be able to tell if two keys are pressed at once.
[19:14:29] <uhsf> I'm also trying to figure out how to scan i/o pins on a ATmega32U4 breakout board for a 4x4 key matrix.
[19:15:13] <Lambda_Aurigae> simple 4x4 is easy...reading multiple keys is more difficult and requires diodes in the circuit I do believe.
[19:15:43] <uhsf> this page gave me the most relevant information yet: http://blog.komar.be/how-to-make-a-keyboard-the-matrix/
[19:17:23] <uhsf> I would like to avoid one diode per key but it seems to be the best solution.
[19:17:29] <Lambda_Aurigae> http://pcbheaven.com/wikipages/How_Key_Matrices_Works/
[19:18:52] <Lambda_Aurigae> by doing multiple scans in different directions it is possible to do it without the diodes but complicates the heck out of the software.
[19:20:42] <Lambda_Aurigae> if you limit to just 2 keys then it can be done without the diodes.
[19:31:51] <dgriffi> yeah.. I'm trying to avoid diodes too because I want to be able to use pre-made keypads
[19:32:16] <dgriffi> combos of only two keys are sufficient for my project
[19:37:56] <Lambda_Aurigae> then you just use the scan and read method..
[19:37:59] <Lambda_Aurigae> rows and columns.
[19:38:06] <Lambda_Aurigae> turn on one row at a time and read the columns.
[19:38:29] <Lambda_Aurigae> keep scanning through the rows and reading columns.
[19:40:03] <uhsf> I would like to see code for this using C and LUFA. I can only find examples for arduino.
[19:40:31] <Lambda_Aurigae> well, lufa has nothing to do with it.
[19:40:41] <Lambda_Aurigae> lufa is the usb interface.
[19:41:55] <Lambda_Aurigae> if you have 8 i/o pins....you designate 4 for rows, 4 for columns...turn the rows to outputs, columns to inputs.
[19:42:10] <Lambda_Aurigae> turn on row0, read column pins.
[19:42:21] <Lambda_Aurigae> turn row0 off and row1 on...read column pins
[19:42:23] <Lambda_Aurigae> etc etc.
[19:42:26] <Lambda_Aurigae> one row at a time.
[19:42:43] <Lambda_Aurigae> any column pins that show 1 will be pressed buttons.
[20:49:20] <anton02_> when you think about it therefore there's actually quite a large library of games available to you to be played with just an intel hd 4600
[20:49:40] <anton02_> wrong channel
[20:53:24] <twnqx> but my current favourite game doesn't pan out on that!
[21:05:35] <anton02_> i wonder if its possible to run a usb mouse thats capable of serial mode with a ps/2 adapter to run in serial mode without a ps/2 adapter
[21:06:03] <anton02_> also, i wonder how you check if your usb mouse is capable of serial mode
[23:04:02] <dgriffi> can someone suggest a graphical avr simulator for linux that actually works?
[23:04:37] <Casper> just use the real thing
[23:04:43] <Casper> simulators are all junk
[23:09:01] <dgriffi> Casper: have you used any lately?
[23:10:09] <Casper> no
[23:10:13] <Casper> too limited, too bugged
[23:58:46] <anton02_> pls resopnd