#avr | Logs for 2014-01-15

Back
[00:00:08] <clixxIO> its almost if you have a hammer you would get laughed off the construction site
[00:00:14] <Casper> they built my cousin's house with a compressor, a circular saw... and some battery chargers
[00:00:36] <clixxIO> a hammer is just used to tap wood into place
[00:00:45] <Casper> yeah
[00:00:58] <Casper> but I still made some nice timelapse video of when they built it
[00:01:09] <clixxIO> and drills are no longer round, they are sockets
[00:01:33] <clixxIO> drills have quick change heads on them
[00:02:06] <clixxIO> I could go on and on.. I work on a tool website
[00:02:48] <Casper> http://www.youtube.com/watch?v=8lzHSkXstRk <===
[00:02:56] <clixxIO> yeah most tools are air-powered, that's right
[00:03:29] <Casper> I need a better one way valve on my air compressor....
[00:03:35] <Casper> it started to make some noise... :(
[00:09:52] <clixxIO> I'm guessing but square nails would be no harder to use in a nail-gun
[00:10:06] <clixxIO> and might not come out as easily as round nails
[00:11:04] <Casper> the real issue with the nail for air guns is they are too small
[00:12:13] <clixxIO> aha
[00:12:40] <Casper> you know... you take a 4" nail and bend it by hand... not normal
[00:13:33] <Casper> also, no spiral nails for air gun
[00:14:32] <Roklobsta> who is trying to push square pegs into round holes?
[00:15:39] <Casper> must be flyback
[00:23:16] <clixxIO> gotta run
[00:29:07] <w|zzy> exercise time!
[00:55:43] <rue_house> anyone have avr functions or macros they would like to share with the world?
[01:07:40] <rue_bed> how about with the channel?
[01:08:15] <rue_bed> / for linear remapping of number ranges, see arduino map()
[01:08:15] <rue_bed> // think of a line, between Il,Ol and Ih,Oh, this solves the y for given x position
[01:08:15] <rue_bed> #define RangeRemap(v,Il,Ih,Ol,Oh) (((((v)-(Il))*((Oh)-(Ol)))/((Ih)-(Il)))+(Ol))
[01:10:41] <rue_bed> no?
[01:10:44] <rue_bed> #define NOP() asm volatile ("nop"::)
[03:51:47] <angs> does Atmel provide eagle CAD library of the chips on somewhere?
[03:52:08] <w|zzy> try element14
[03:53:20] * twnqx does all cad libraries hiself
[03:53:49] <twnqx> many of the available ones are meant for reflow soldering, not for hand soldering
[03:54:23] <twnqx> which makes it unnecessarily difficult
[03:59:32] <angs> I use the library from element14 but pin layout is wrong for the chip that I am going to use. I wonder if atmel provides its own libraries
[04:03:08] <twnqx> not that i would be aware of
[04:04:01] <angs> thanks
[04:28:42] <DanFrederiksen> twnqx, use solder paste and hot air gun. quite elegant
[04:29:35] <DanFrederiksen> a soldering iron is quite primitive
[04:31:46] <twnqx> everybody has their preferences
[04:32:11] <twnqx> as long as 0.4mm or csp are not a problem i'll not switch
[04:32:17] <twnqx> 0.4mm pitch*
[05:02:59] <moemoe> angs: Using foreign libs is always prone to failure. I usually take datasheets and create at least the footprint for myself, and never ever use libs found "somewhere" in the internet.
[05:03:46] <moemoe> Even 0.125mm vs 0.127 can make a huge difference if your part has enough pins, an I've had enough of these failures.
[08:02:19] <Tom_L> http://www.electronicproducts.com/Digital_ICs/Microprocessors_Microcontrollers_DSPs/Electronic_chips_so_flexible_they_can_be_wrapped_around_a_human_hair.aspx
[09:36:15] <moemoe> I thought PullUps stay enabled during power save modes? But after set_sleep_mode(SLEEP_MODE_PWR_DOWN); sleep_mode(); I don't have any voltage left on that pin?
[09:42:09] <moemoe> Ah, Talking about tiny2313a, but can't find any really information about this in the datasheet
[09:42:32] <moemoe> except that they propose enabling them during power save modes to prevent ports from floating
[11:45:09] <TLoFP> hi guys, I have been reading about DMA's on the AVR XMegas, I find this topic/function fascinating. Since I am new to micro controllers I would like to check my understanding of DMA's against your knowledge.
[11:46:03] <TLoFP> Is it true that I could implement a DMA channel to move bytes from the SPI bus to a UART without CPU involvment? that is: I can hardcore an asm loop of nops into the CPU core and bytes would still be transfered from SPI to UART as they come in?
[15:35:35] <avrlol> this might be a dumb question, but i'm using this macro #define SETBITS(x,y) ((x) |= (y)) to set bits in a uint8_t variable, and it doesnt seem to be working..
[15:38:55] <avrlol> wait im retarded
[15:40:10] <avrlol> i sometimes fool myself into thinking the leftmost bit is bit 0
[15:42:50] <ambro718> no such thing as the leftmost bit
[15:43:03] <ambro718> bits can only be low or high
[15:43:38] <avrlol> i think you know what i mean.
[15:44:25] <ambro718> I suppose you see some bits on the left and some on the right, but there's no obvious reason to see it in any particular way ;)
[15:44:48] <avrlol> well, there is.
[15:45:03] <ambro718> and this is?
[15:45:07] <avrlol> if you write a byte out on paper, as a normal human being, there is a right and left side to it
[15:45:38] <ambro718> that's just because most humans prefer writing numbers in big endian
[15:46:29] <avrlol> right.. that's one reason. you're backing me up, you know.
[15:49:42] <Tom_itx> avrlol, http://tom-itx.dyndns.org:81/~webpage/avr/c_bits/bits_index.php
[15:49:57] <Tom_itx> look near the bottom
[15:51:06] <ambro718> meh, why use those macros, common bit ops are easily recognized
[16:48:36] <avrlol> ambro718: the fact that << is called LEFT shift, should tell you that it's shifting a bit to the left
[16:49:00] <avrlol> i honestly don't know why you're arguing over the term "leftmost bit"
[16:49:40] <ambro718> Am I, or are you? ;)
[16:50:30] <avrlol> good one
[17:47:22] <carabia> i swear to god thus fucking cat will be thrown on to the frying pan if it eats one more cable
[17:48:05] <carabia> this*. this has been the third usb cable it hss eaten
[17:48:36] <carabia> i nevrr liked cats snd this lil fuck was forced upon me
[17:49:02] <carabia> and touchscreens suck. just wanted to share.
[17:53:52] <carabia> right now im having an extension cord beside my bed... ill run another cord and tape that up on the wall and use my usb adapters out of that one
[17:54:27] <carabia> and leave the nightlamp on the floor socket
[17:55:37] <carabia> cause the cat has been nibbling on that too... but now it it wants to eat something it will have to go for the lamp mains cable
[17:56:48] <carabia> and someday when i come home ill find the cat either dead or not having the guts to eat a single wire again
[17:56:58] <carabia> natural selection
[18:13:37] <N2TOH> rabbits are more distructive then cats
[18:57:14] <mike_papa> hello. I have a problem with internal 1.1 V reference for ADC in ATmega168pa. I did ADMUX = 206 (0b11001110) which sets REF1..0 to 11 = internal 1.1V, and MUX3..0 to 1110 which supposed to be 1.1 V. I should get 1023 result, and I get... ca 148-150. AVCC is 5v, and AREF has 100nF to GND. Any ideas what's wrong? Same equipment setup with AVCC as reference, and MUX3..0 set to external sensor works
[18:57:14] <mike_papa> fine.
[18:58:24] <mike_papa> Actually I've wanted to use internal temp sensor, but as I had results of 70, I decided to check if 1.1V to 1.1V will work.
[19:04:30] <mike_papa> Converting internal 1.1V with AVCC reference gives me 220. That seems about right. 1.1V is 22% of 5V, so 220 out of 1023 is close enough. Seems like my internal 1.1V as reference doesn't work. :(
[19:46:01] <N2TOH> amee2k, you still doing your radio shows? why not consider using your RPi as an FM transmitter, or even SW
[19:46:33] <N2TOH> dare I ask in here what the RPi room is called?
[20:10:16] <Kaak> Anyone ever experience apparently-not-running code on an atmega328p that otherwise programs/reads signatures/fuses?
[20:11:33] <Kaak> Avrdude happily programs it, and I've checked the clock settings a million time... But no IO, so peripherals, ect.
[20:14:46] <Tom_itx> gawd everybody is soooo impatient tonight
[20:15:43] <Epsilon-Auriga_> he was here for over 4 minutes!
[20:16:08] <Epsilon-Auriga_> actually, for over 6 minutes!
[20:16:54] <Tom_itx> tried to help someone in another channel and they disappeared too
[20:29:14] <mike_papa> Ok. I have found out, that when I set REFS1..0 to 01 I get AVCC on reference (which is correct), and if I set it to 11 I get 4.38V, which is wrong, as I should get 1.1V. Where 4.38V may come from, and why it isn't 1.1V internal reference?
[20:34:12] <Tom_itx> do you have an external capacitor on the aref pin?
[20:35:16] <Tom_itx> 11 - Internal 1.1V Voltage Reference with external capacitor at AREF pin
[20:36:27] <mike_papa> Tom_itx: Thanks, I actually found a reason. I guess it's too late, and I messed up AVCC pin with AREF. So I connected 5V to AREF, and cap to AVCC. I knew it's something trival, but I didn't expect it to be so stupid.
[20:37:10] <Tom_itx> you could cut the trace and jumper it
[20:38:07] <mike_papa> It's on development board, so it's no problem :)
[20:41:46] <mike_papa> Ok. good night everyone.
[22:29:08] <rue_house> who has a usefull code snippet to share with the channel?
[22:29:17] <rue_house> if you dont share, you get kicked...
[22:29:34] <rue_house> damn, I lost mine
[22:29:44] * rue_house kicks rue_house from #avr
[22:29:45] <Casper> kick yourself first :D
[22:30:35] <rue_house> #define SetBit(BIT, PORT) (PORT |= (1<<BIT))
[22:30:37] <rue_house> there is mine!
[22:31:00] <rue_house> Casper, cmon, paste a usefull generic code snippet
[22:31:11] <rue_house> 1-3 lines
[22:31:19] <Tom_itx> _bv()
[22:31:35] <Casper> #define F_CPU 16000000ul
[22:31:39] <rue_house> ok
[22:32:04] <rue_house> tom, wanna phrase that as a one line use example?
[22:32:15] <Tom_itx> no
[22:32:19] <Tom_itx> i don't use it
[22:32:29] <rue_house> what do you use?
[22:32:46] <Tom_itx> setbit clearbit or 1<<bit
[22:33:05] <rue_house> cmon, find and copy-paste us
[22:33:16] <Tom_itx> what for?
[22:33:19] <Casper> rue_house: what about posting macro pic of something instead? :D
[22:33:20] <Tom_itx> you know it already
[22:33:40] <rue_house> I do, I want to try to push some knowledge around in here
[22:33:53] <rue_house> Casper, no PIC stuff, thats for other channels
[22:34:03] <Casper> pic as photo
[22:34:15] <rue_house> na, no PIC stuff
[22:34:16] <rue_house> :)
[22:34:32] <Casper> what about pic of cute cat?
[22:34:45] <rue_house> amee2k, how about you, whats a code line your always copy+paste+mauling ?
[22:34:51] <Tom_itx> then answer specific noob questions when they arrise
[22:35:14] <rue_house> I'm not here then
[22:35:25] <Tom_itx> u should be
[22:35:34] <rue_house> Brando753, hey you!
[22:35:59] <rue_house> district, hey
[22:36:09] <rue_house> dunz0r, your usually alive,
[22:36:16] <rue_house> Fleck, who are you?
[22:36:22] <Tom_itx> ldi r16, (1<<JTD)
[22:36:24] <Tom_itx> out MCUCR, r16
[22:36:26] <Tom_itx> out MCUCR, r16
[22:36:31] <Tom_itx> will disable jtag
[22:36:39] <rue_house> !sweet!
[22:36:43] <Casper> rue_house: now, it's your turn
[22:36:57] <rue_house> #define NOP() asm volatile ("nop"::)
[22:39:34] <rue_house> #define JTAGOFF() asm volatile("ldi r16, (1<<JTD); out MCUCR, r16; out MCUCR, r16"::)
[22:39:37] <rue_house> er, hmm
[22:41:26] <rue_house> #define JTAGOFF() asm volatile("ldi r16, (1<<JTD)\n\t" " out MCUCR, r16\n\t" "out MCUCR, r16"::)
[22:41:30] <rue_house> that might work
[22:41:39] <rue_house> anyone have an example of inline assembler?
[22:41:44] <rue_house> diametric, ?
[22:41:50] <rue_house> maqr, ?
[22:41:55] <rue_house> N2TOH, ?
[22:47:04] <rue_house> GargantuaSauce, how about you?
[22:47:16] <rue_house> LoRez, I know your alive...
[22:47:32] <GargantuaSauce> i have not had the displeasure of writing avr assembly
[22:48:54] <rue_house> GargantuaSauce, nono, any avr code
[22:49:05] <rue_house> somethin you use a lot of find usefull
[22:49:31] <rue_house> bsdfox, how about you
[22:49:47] * rue_house hounds the fox...
[22:49:49] <GargantuaSauce> ISR(__vector_default){ while(1); }
[22:49:55] <rue_house> hahah
[22:50:07] <rue_house> I didn't know you could define it!
[22:50:17] <rue_house> I know that by defult its main()
[22:50:23] <GargantuaSauce> no, it's not
[22:50:33] <rue_house> yea, look at an assembly dump
[22:50:44] <rue_house> I was like WTF!?
[22:50:57] <rue_house> it should be a rti;
[22:54:25] <rue_house> GargantuaSauce, you want me to proove?
[22:54:55] <rue_house> 00000000 <__vectors>:
[22:54:55] <rue_house> 0: 0c 94 2a 00 jmp 0x54 ; 0x54 <__ctors_end>
[22:54:55] <rue_house> 4: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
[22:55:08] <rue_house> 0000008e <__bad_interrupt>:
[22:55:08] <rue_house> 8e: 0c 94 00 00 jmp 0 ; 0x0 <__vectors>
[22:55:19] <rue_house> 00000054 <__ctors_end>:
[22:55:19] <rue_house> 54: 11 24 eor r1, r1
[22:55:19] <rue_house> ...
[22:55:36] <GargantuaSauce> that's not main()
[22:55:37] <rue_house> 00000060 <__do_copy_data>:
[22:55:37] <rue_house> 60: 10 e0 ldi r17, 0x00 ; 0...
[22:55:38] <GargantuaSauce> that's the start
[22:55:42] <rue_house> yea
[22:55:45] <rue_house> thats a reboot
[22:55:56] <GargantuaSauce> saying it is main() is strictly incorrect though
[22:56:08] <rue_house> vector 0x0 is a boot
[22:56:40] <rue_house> its effectivly main()
[22:56:47] <rue_house> cause its gonna get there in a few cycles
[22:57:21] <rue_house> BusError_, your alive aren't you
[22:57:49] <rue_house> abcminiuser, whats one of your most usefull, reused lines of code?
[22:58:24] <rue_house> awozniak, how about you?
[22:58:37] <rue_house> hackvana, ?
[23:00:06] <hackvana> Hi!
[23:04:52] <rue_house> hackvana, would you please share a favorite or usefull line of avr code with us?
[23:04:59] <rue_house> (or I'll kick you :) )
[23:05:19] <hackvana> Been several years since I programmed any AVR
[23:05:25] <hackvana> But I'll give you a nice Python one.
[23:05:27] <rue_house> yaya, whatever
[23:05:36] <rue_house> nono, make it from an avr program
[23:05:47] <rue_house> something template maybe?
[23:05:51] <rue_house> 1-3 lines
[23:05:57] <rue_house> anything, dosn't matter
[23:08:30] <hackvana> // This program has one bug: It doesn't work.
[23:08:41] <rue_house> hah! excellent!
[23:09:34] <rue_house> ho hum, this interrogation is done.
[23:10:20] <hackvana> Whew! I didn't expect the Spanish Inquisition!
[23:10:52] <N2TOH> EH?
[23:13:35] <hackvana> http://knowyourmeme.com/memes/nobody-expects-the-spanish-inquisition
[23:25:35] <rue_house> NEBODY EXPECTS TEH SPANISH INQUISITION!
[23:25:41] <rue_house> (sorry, I was late on that one)
[23:35:41] <GargantuaSauce> yeah, 43 years
[23:42:09] <jerkey> http://reboots.g-cipher.net/time/