#avr | Logs for 2014-03-07

Back
[00:13:48] <megal0maniac_afk> Hmmm... That's a little better
[00:14:13] <megal0maniac_afk> Jordan_U: It is the frequency of your AVR in Hz. E.g. 16000000UL = 16 million = 16MHz
[04:21:52] <guanche> I'm finding so difficult to use an hdd motor as encoder, while it seemed a simple task
[04:22:27] <guanche> I wonder if when using proper rotary encoders, a timeout is implemented to reset the direction of the encoder?
[04:23:00] <guanche> otherwise you'd keep seeing signals 90 degrees appart with no real notion of direction
[06:03:45] <Lambda-Aurigae> guanche, rotary encoders and motors are totally different...even harddrive motors..
[06:04:16] <guanche> I thougth some did output a 90 degree signal
[06:04:23] <guanche> never used one, though
[06:04:39] <Lambda-Aurigae> a rotary encoder puts out 2 signals, out of phase from each other.l
[06:04:48] <Lambda-Aurigae> http://www.hobbytronics.co.uk/rotary-encoder-tutorial
[06:05:14] <Lambda-Aurigae> you can tell which direction it turns by comparing the signals and the way they change.
[06:06:10] <Lambda-Aurigae> a harddrive motor will have several windings that will put out pulses in sequence when spun but you have to spin it pretty fast to get them...with that you could determine speed and direction also.
[06:06:12] <guanche> sure, by sticking to rising or falling edge of one
[06:06:30] <guanche> the problem I'm having I'm found out really is with the circuit
[06:06:42] <guanche> even touching the motor causes interrupts
[06:07:37] <guanche> though I approached the wrong way from the begining
[06:07:41] <Lambda-Aurigae> sounds like poor design
[06:08:02] <guanche> I think I'm simply gonna go and use the timer for signaling, and the main event loop to process
[06:08:47] <Lambda-Aurigae> and you don't care about falling edge on a rotary encoder...just when A goes from 0 to 1 you read B...if B is 0 then you have a pulse in one direction and if B is 1 then you have a pulse in the other direction.
[06:09:58] <Lambda-Aurigae> I steal them out of old car radios all the time for spin dials in my projects.
[06:24:52] <guanche> http://s12.postimg.org/ri923eum3/shot.png
[06:25:10] <guanche> that's the circuit I'm using, but I'm now reading on hysteresis
[06:26:37] <naquad> /usr/bin/avr-ld: cannot find crttn2313a.o: No such file or directory - what? 0_0 avr-gcc version 4.8.2
[06:52:37] <Lambda-Aurigae> https://bugzilla.redhat.com/show_bug.cgi?id=972384
[07:06:41] <naquad> Lambda-Aurigae, argh! and what should i do? i don't have windows to use avr studio :(
[08:50:15] <DanFrederiksen> naquad, wake up and get windows
[08:50:45] <DanFrederiksen> nix is for idiots
[08:57:46] <OndraSter> lol
[09:02:05] <blathijs> Anyone here ever tried to get the return address from the stack inside a regular GCC function?
[09:02:42] <blathijs> I've tried using __builtin_return_address as well as dumping the SP to SP+10, but neither of them give an address I can correlate with my disassembler output...
[09:06:44] <Mike8748> ok, i would use some help... im trying to use Dragon to flash atmega32u4 (on arduino leonardo board), but arduino keeps jumping to bootloader any time i use ISP (cant even read signature)
[09:07:19] <Mike8748> i suppose it has something to do with capacitors on reset line... but not sure
[09:07:42] <Mike8748> uh... wrong... there are no caps on reset line
[09:10:18] <blathijs> Mike8748: During ISP, the board must be kept in reset. I suppose the reset line should be connected to your dragon through the ISP header and the dragon should drive the reset line low
[09:11:31] <Mike8748> it is
[09:12:01] <Mike8748> i just connected dragon isp to ICSP on arduino board
[09:12:15] <Mike8748> when i do that with older arduinos (atmega328 based) it works
[09:12:48] <Mike8748> now with leonardo (mega32u4 based) the target just resets and goes to bootloader immediately
[09:13:39] <Mike8748> and im using about 20cm cable, so that should not be problem
[09:17:27] <blathijs> Mike8748: You could check with a multimeter wether the dragon keeps the reset pin low and if that low extends all the way to the 32u4 reset pin?
[09:36:01] <Mike8748> ok... problem solved by making new ISP cable
[09:40:02] <blathijs> Mike8748: Cool
[10:14:35] <blathijs> FYI, found the problem with the return addresses on the stack, they were using word addresses, not byte addresses
[10:14:54] <blathijs> And I was confused by tail recursion at first :-)
[11:07:25] <chansdad> hello all ...
[11:07:58] <chansdad> just researching - what are some alternatives to nordic 24L01
[11:10:56] <eroomde> hi, i'm looking for the atmel reference that maps assembler to machine code, and presumably generally describes the architecture of instructions. I've found the info in the avr-as documentation, but the official atmel reference would be useful. I couldn't find it after 10 mins of looking on their site - my google fu might be letting me down
[11:11:33] <tzanger> there really aren't any alternatives to it. it's very very inexpensive
[11:22:10] <DieKartoffel> Hey guys, I am currently fooling around with an atmega1280 and trying to get the Interrupt on Timer2 working. I enabled the Global Interrupt Flag and also the Overflow Interrupt. It seems like the Timer is working because I am displaying the TCNT2 Value on LEDs (and they are turning on and off as crazy). The Problem is that the ISR is not called. Any ideas what I may have forgotten?
[11:25:26] <synic> pastebin your code?
[11:27:21] <DieKartoffel> http://pastebin.com/mPpExCjV
[11:45:05] <Casper> I don't know much assembly, but shouln't it be rjmp?
[11:47:02] <DieKartoffel> I tried both
[11:50:12] <Casper> what about setting the DDRD as output?
[11:50:56] <DieKartoffel> yeah you are right, i forgot that. still doesn't solve my problem :/
[11:51:25] <Casper> you tried?
[11:51:45] <DieKartoffel> yep
[11:53:37] <Casper> no idea then
[11:56:21] <sirnarwhal> Are there any secrets to getting FLIP to work?
[12:24:54] <DieKartoffel> Now I am a little bit confused. According to the Manual (http://www.atmel.com/Images/doc2549.pdf Page 105) every Interrupt Vector consists of 2 Bytes. I disassembled a working Example File and every Interrupt Vector in there has a size of 4 Bytes. Can anyone explain this?
[12:48:32] <Casper> DieKartoffel: did they said 2 bytes or 2 words?
[12:50:36] <DieKartoffel> Hmm it doesn't say that. I least I can't find anything.
[13:10:06] <hotch> I can't seem to figure out if the ATtiny85 has the ability for UART/serial communication? No reference in the data sheet ..
[13:12:58] <RikusW> hotch: its got USI or you can bitbang
[13:13:17] <hotch> awesome, thanks RikusW I just found some code, for softuart
[13:13:19] <hotch> :P
[13:13:34] <RikusW> USI is semi soft uart
[13:13:49] <RikusW> hw assisted..
[13:39:51] <hotch> hw assisted?
[13:42:29] <RikusW> read the USI docs
[13:42:40] <RikusW> its in the t85 ds
[13:45:56] <hotch> ah ok, reading now. thanks RikusW.
[13:47:24] <RikusW> hotch: there are datasheets on using USI on atmel.com
[13:47:29] <RikusW> *appnotes
[13:47:38] <hotch> awesome.
[14:04:36] <hotch> Is there a path that needs to be defined for avr-gcc? All files are in the same dir: "avr-gcc -Wall -Os -DF_CPU=8000000 -mmcu=attiny85 -c main.c uart.c -o main.o softuart.o". But I get an error cannot find file uart.c
[14:22:48] * megal0maniac waves at RikusW
[14:23:03] <RikusW> hi megal0maniac
[14:25:05] * RikusW got http://en.wikipedia.org/wiki/Baboon_spider in a jar
[14:25:53] <megal0maniac> Why? :P
[14:26:05] <RikusW> it came into the house
[14:26:08] <megal0maniac> Had some rain spiders here a while ago
[14:26:13] <megal0maniac> So you punished it? :D
[14:26:23] <RikusW> I did put it outside after a few days
[14:26:30] <RikusW> it was back by evening...
[14:26:38] <megal0maniac> Ah, too bad
[14:26:44] <megal0maniac> Was going to ask you to mail it to me
[14:26:49] <RikusW> seems it likes to be fed moths
[14:26:59] <RikusW> or maybe its the rainy weather
[14:31:12] <hotch> awesome
[15:13:13] <Timmy> I want to connect a switch key to one of the pins of the microcontroler. the distance between the micro and the switch key is about 6 Meter and I'm afraied it gets noise. how can I reduce this noise ?
[15:24:55] <myself> Timmy: use twisted-pair wire, connect a small capacitor between the leads at each end..
[15:26:46] <Timmy> myself: how much should the capacity of the capacitors be?
[15:27:09] <myself> dunno :P
[15:29:05] <Timmy> :'(
[15:35:30] <myself> a few nF, try?
[15:36:45] <Timmy> myself: well, actually noises from different sources have needs different capacitors to be filtered!
[15:37:06] <myself> then you know more about this than I do, what are you asking for?
[15:40:38] <Timmy> I'm going to design a home security alarm board
[15:41:04] <Timmy> magnet sensors and other sensors may be placed in different areas of the house
[15:41:40] <Timmy> and there may be long distance between the mcu and magnets
[15:41:54] <myself> umm
[15:48:20] <Timmy> myself: probably using an opamp may solve the problem
[15:48:34] <Timmy> though it may be overkill
[15:50:48] <myself> no, I think you want to look at something like OpenAccessControl and figure out why their port buildouts are as complex as they are
[18:49:14] <Lambda-Aurigae> naquad, use atmel's avr-gcc and toolchain.
[18:49:38] <Lambda-Aurigae> naquad, or patch yours.
[23:03:58] <mdszy> I am officially in love with AVR.
[23:18:35] <hackvana> He is folks. He's so over MSP430...
[23:19:26] <Casper> mdszy: they are nice and cute
[23:19:38] <mdszy> hackvana knows what's up.
[23:21:07] <mdszy> just got myself a Teensy++ 2.0 today, so glad I did.
[23:22:50] <MrM0bius> no love for themsp430?
[23:23:04] <mdszy> oh heck no.
[23:24:33] <mdszy> The MSP430 just enraged me to no end.
[23:24:52] <MrM0bius> too hard to figure out?
[23:24:53] <mdszy> Since 1) The community and availiablilty (or lack thereof) of tutorials is totally abysmal
[23:25:05] <mdszy> 2) I have absolutely NO use for the low-power bullcrap that is its whole selling point.
[23:25:39] <MrM0bius> ya low power is not a selling point for most people
[23:26:00] <MrM0bius> but the community is probably the biggest selling point. it is great.
[23:26:26] <mdszy> I'm pretty sure the fact that I found an AMAZING timer tutorial for AVR within my first googling sells me on it more than MSP430
[23:27:05] <MrM0bius> did you look at the john davies book?
[23:27:41] <mdszy> no.
[23:28:22] <MrM0bius> that is all you need. it is about 400 pages of tutorials and explains everything in detail. its really easy fr beginners.
[23:28:54] <mdszy> Why would I read a 400 page book if I can look up tutorials and documentation for the AVR that are much better than that for the MSP430?
[23:29:25] <MrM0bius> why would you waste time looking up different avr tutorials when you can just download one file and find out everything you wil ever need to know?
[23:29:47] <mdszy> because I just bought an AVR micro and plan on using it now.
[23:29:53] <MrM0bius> you dont have to read the whole book. just flip to the part on timers if that is what you need and its right there.
[23:30:25] <MrM0bius> thats a good answer. you will probably be happy with avr. im just saying the msp430 community isreally good and there is no shortage of tutorials.