#avr | Logs for 2012-06-21

Back
[01:47:23] <_droid> hi people, i want to write a little c program with an atmega644 where 2 switches are connected to it. these switches shifts an ouput port left and right perspectively
[01:47:51] <_droid> I tried something like this PORTA<<1 and PORTA>>1
[01:48:03] <_droid> but doesnt work can someone help me here?
[03:50:59] <theos> hi
[03:51:46] <theos> is it alright if i connect reset pin to an io pin while programming?
[04:01:31] <OndraSter> huh?
[04:01:56] <OndraSter> RST goes to RST
[04:02:04] <theos> :P
[04:03:03] <OndraSter> rephrase your question
[04:03:50] <cyanid3> im back.
[04:04:24] <theos> wb
[04:05:51] <theos> i am usin the same pin for reset and pin15.
[04:05:53] <theos> used jumpers. so the pin has only one function at one time
[04:06:52] <theos> rephrasing: the header disable pin15 when using as reset....
[04:07:17] <theos> so my question is invalid now :S
[04:13:04] <OndraSter> which chip?
[04:13:19] <OndraSter> because once you set RST pin as IO (with RSTDSBL fuse), you are screwed
[04:13:21] <OndraSter> HVPP
[04:23:01] <theos> OndraSter i think i am not able to explain it
[04:23:20] <OndraSter> yeah
[04:23:36] <theos> i am not using the 10 pin header. instead i am using my own header
[04:23:59] <theos> or whatever its called :/
[04:24:14] <theos> female header i guess
[04:24:36] <theos> connected the board to the programmer and its workign fine :D yay!
[05:03:10] * specing 's finals are _FINALLY_ over!
[05:07:22] <theos> :P
[05:07:27] <specing> Now I just have to clean my laptop, while it is in suspend mode ;)
[05:07:35] <specing> Its 34'C here
[05:08:02] <w|zzy> nice
[05:16:21] <theos> its 45C here
[05:20:51] <specing> theos: I have no idea what is preventing you from melting
[05:21:43] <theos> specing its common here :) i have seen 55C in my life too. people claim they have experienced above that too. :P
[05:22:12] <specing> Is that open-air temperature or that in shade?
[05:22:27] <theos> under direct sunlight
[05:22:31] <specing> Ah
[05:22:37] <specing> Then its similar here I guess
[05:22:56] <specing> I almost died on my trip home
[05:23:03] <specing> s/trip/way
[05:23:09] <theos> shade is almost the same
[05:23:09] <theos> hot winds everywhere
[05:24:08] <w|zzy> dry or humid?
[05:24:15] <w|zzy> love dry heat!
[05:26:24] <specing> w|zzy: You love heat? Are you a reptile? :)
[05:26:52] <theos> >.>
[05:26:54] <theos> <theos> my room has around 27C :D
[05:28:18] <theos> any good assembler under linux? accept avra
[05:31:20] <Fleck> can i use two analog ins to have 20bit adc?
[05:31:43] <theos> any good assembler under linux? accept avra
[05:35:24] <specing> theos: gas
[05:35:49] <theos> ?
[05:36:16] <specing> part of binutils, the thing that assembles gcc output
[05:36:25] <theos> ah nice
[05:36:49] <theos> is it good?
[05:37:07] <specing> LOOOOOOOOOOOOOOOOOOOOOOOL
[05:37:21] <theos> gas...
[05:37:28] <lifeeth> :)
[05:37:34] <theos> ... ok
[05:37:37] <specing> theos: You are talking about _the_ assembler that is in use for 20 years now, on >10 architectures
[05:37:57] <theos> never heard of "gas" specing :P
[05:38:54] <specing> What are these h4xx0rz constantly banging the ssh port on my server
[05:39:25] <specing> I have recorded over 25000 login attempts from a single IP and they still haven't found the password
[05:39:36] <specing> what a pity.
[05:39:41] <desaster> specing: check out my project https://code.google.com/p/kippo/
[05:40:01] <specing> Thats sweet
[05:40:12] <OndraSter> Fleck, no
[05:42:03] <theos> were you talking about gnu as?
[05:42:04] <Fleck> makes sense, thx OndraSterver
[05:43:11] <specing> theos: SHERLOCK DETECTED
[05:43:16] <w|zzy> specing: only dry heat
[05:43:44] <theos> specing :D
[05:47:07] <specing> desaster: Looks nice
[05:54:37] <specing> desaster: log grep: http://pastie.org/private/t7n0ctvcrag3kik8m18tg (left is how many times)
[06:34:11] <OndraSter> Fleck, it is just easier to grab some external 20bit ADC :)
[06:35:11] <Fleck> OndraSterver do you know some 16bit with SPI?
[06:35:52] <OndraSter> look on ADI's website
[06:37:29] <Fleck> k
[10:14:09] <OndraSter> to all aussies: http://9gag.com/gag/4552456
[10:14:09] <OndraSter> :D
[11:41:38] <SuperMiguel> what does DDRD means in DDRD |= (1<<PB5);
[11:43:34] <Steffanx> Data Direction Register D SuperMiguel
[11:46:19] <theos> DDRx are defined in .inc files. along with everything else
[12:12:35] <SuperMiguel> Steffanx: theBear but how do i know which register i need to use depending on the Pin?
[12:28:26] <Steffanx> SuperMiguel you know which port the pin is part of so … DDRx where x is the the port name/character
[12:30:05] <SuperMiguel> Steffanx: ya but DDRD |= (1<<PB5); D != B
[12:31:57] <RikusW> SuperMiguel: effectively PB5 == PD5 ;)
[12:32:19] <RikusW> #define PB5 5 and #define PD5 5
[12:32:27] <Steffanx> What Rikusw said
[12:32:40] <RikusW> and you should actually use DDD5 not PD5
[12:32:49] <Steffanx> DDR5 i guess?
[12:33:03] <Steffanx> And it doesn't matter imho :P
[12:33:22] <RikusW> no DDD5
[12:33:26] <RikusW> or DDB5
[12:33:36] <Steffanx> Whoa :P
[12:33:36] <RikusW> or just (1<<5)
[12:33:39] <Steffanx> Ugly
[12:33:44] <Steffanx> or pd5 :P
[12:33:50] <Steffanx> As that's the pin name
[12:33:54] <RikusW> or simply 0x20
[12:34:06] <Steffanx> or just PD5
[12:34:43] <RikusW> its actually PORTD7 PIND7 DDD7 PD7 is an abbreviation
[12:35:15] <RikusW> thats how it is in the atmel XML files anyways ;)
[12:35:27] <Steffanx> I don't care about the export files :)
[12:35:34] <Steffanx> *xml files
[12:35:48] <RikusW> I guess its permissible to use plain hex for PORT values
[12:36:02] <RikusW> but NOT for other registers....
[12:36:19] <RikusW> it will break portability sooner or later
[12:36:46] <RikusW> Steffanx: you mean the rcf files ? :-P
[12:37:24] <Steffanx> rcf what?
[12:37:49] <RikusW> my rcf parts files...
[12:38:10] <RikusW> R config files :)
[12:38:16] <Steffanx> oh, i don't use your tool
[12:38:36] <RikusW> too much trouble compiling it I guess ?
[12:38:48] <Steffanx> Not using AVR at all lately
[12:39:12] <RikusW> but you still hang around here ;)
[12:39:19] <Steffanx> That's not allowed?
[12:39:29] <RikusW> of course it is
[12:39:40] <Steffanx> ok
[12:40:27] <RikusW> there is more electronics stuff discussed around here than in ##electronics :-P
[12:40:49] <Steffanx> So how are your projects going?
[12:42:00] <RikusW> been a bit busy lately
[12:42:01] <SuperMiguel> RikusW: PB5 == PD5 depending on the chip right?
[12:42:18] <RikusW> SuperMiguel: no, its always defined as 5
[12:42:27] <SuperMiguel> RikusW: how about 4?
[12:42:38] <RikusW> but some chips don't have PORTD or B...
[12:42:43] <RikusW> same thing
[12:43:03] <SuperMiguel> RikusW: well like in here : http://www.jassper.com/images/MEGA1280.jpg PB5 is different from PD5
[12:43:17] <SuperMiguel> pin 24 vs pin 48
[12:43:30] <RikusW> the actual pin doesn't matter
[12:43:38] <RikusW> the bit location in the register does
[12:44:27] <RikusW> Steffanx: still need to complete the break detection part in my dW uart code, and the PC side of the SW isn't even started yet
[12:45:18] <RikusW> Steffanx: been messing around with a ROM based 2way 66-88MHz radio, I intend to replace it with a m8
[12:45:23] <SuperMiguel> RikusW: ya but if i want to set pin 24 high instead of 48? would i do DDRD |= (1<<PB5) instead of DDRD |= (1<<PD5)
[12:45:55] <RikusW> on what avr is that ?
[12:45:57] <OndraSter> no
[12:45:59] <OndraSter> DDRD is still DDRD
[12:47:35] <RikusW> Steffanx: I already connected it to my U2S board for testing, and used my debug module so I didn't even need to upload the FW to the AVR I just put my "FW" PORT = x; code in Visual Studio, it works quite well if speed isn't an issue.
[12:48:23] <RikusW> SuperMiguel: the DDR registers is DataDirectionRegister (1==out), you need to use PORT to set it high or low
[12:48:43] <RikusW> when DDR=0 and PORT=1 you have activated the internal pullup
[12:49:46] <RikusW> SuperMiguel: you'll use DDRB |= ....
[12:52:09] <SuperMiguel> is the register assigment in the data sheet?
[12:52:20] <SuperMiguel> like PA1? will be DDRA?
[12:52:24] <OndraSter> ye
[12:52:32] <OndraSter> PortA 1 is bit 2 in DDRA
[12:53:36] <RikusW> OndraSter bit 1 counting from 0
[12:53:44] <OndraSter> okay
[12:53:49] <OndraSter> second bit :)
[12:55:41] <RikusW> SuperMiguel: its usually near the end of the datasheet
[13:14:15] <SuperMiguel> RikusW: where are they here? http://www.atmel.com/Images/doc8271.pdf
[13:14:24] <SuperMiguel> can't find where do show that
[13:14:43] <RikusW> SuperMiguel: what AVR do you have ?
[13:15:07] <OndraSter> SuperMiguel, page 94
[13:15:27] <RikusW> a m168 ?
[13:16:00] <SuperMiguel> RikusW: i was looking for the 328p just as example
[13:16:12] <OndraSter> SuperMiguel, page 94
[13:16:18] <SuperMiguel> OndraSter: looking
[13:16:27] <RikusW> have a look at the Register Summary chapter
[13:16:43] <OndraSter> that too
[13:17:14] <RikusW> same at p94 ;)
[13:18:07] * RikusW just learned there is a PUD bit...
[13:19:40] <RikusW> but the default value seems to be 1 instead of 0 indicated by the ds...
[13:20:18] <SuperMiguel> RikusW: pinA is not described there?
[13:20:31] <RikusW> m328 don't have PORTA
[13:20:43] <RikusW> only B C D
[13:21:16] <OndraSter> http://clip2net.com/s/23qVi
[13:21:18] <OndraSter> pud is 0
[13:21:50] <RikusW> well I never changed it on m32u2 and the pullups does work
[13:21:57] <OndraSter> yes
[13:22:02] <OndraSter> disabled=0
[13:22:06] <OndraSter> => enabled
[13:23:04] <RikusW> ah
[13:26:13] <SuperMiguel> RikusW: but by looking at that i see that PORTB == DDRB PORTC == DDRC PORTD == DDRD i can't see where PORTB == DDRD :(
[13:28:03] <RikusW> PORTB != DDRD
[13:28:28] <RikusW> and PORTD != DDRD either...
[13:28:46] <RikusW> PORTD DDRD and PIND go as a group controlling the port
[13:33:21] <SuperMiguel> RikusW: how is PORTB5 == PORTD5 :(
[13:37:25] <RikusW> ITS NOT!!!
[13:37:33] <RikusW> err
[13:37:44] <RikusW> but both are defined as 5
[13:38:29] <RikusW> but its better to use PORTD5 with PORTD and not mix up stuff
[19:40:23] <inflex> the other big advantage is that if for some bizzare reason they ever change things around, your code will be still very portable.
[19:57:37] <chupas> ok!
[20:11:26] <SuperMiguel> whats the best way to program avrs on a mac?
[20:11:57] <jnh> SuperMiguel: I use CrossPack from objective development
[20:12:26] <jnh> SuperMiguel: http://www.obdev.at/products/crosspack/index.html
[20:12:31] <SuperMiguel> http://www.obdev.at/products/crosspack/index.html
[20:12:33] <SuperMiguel> gotcha
[20:12:38] <SuperMiguel> let me check them out
[20:12:48] <jnh> it's just all the compilers and avrdude and stuff.
[20:13:09] <SuperMiguel> jnh: u can link them into eclipse right? and write and compile in eclipse?
[20:13:14] <SuperMiguel> arduino has something like that
[20:13:49] <jnh> Yes, I think there is an avr plugin for eclipse.
[20:14:27] <jnh> Personally, I stick with vim and I stole the Makefile from LUFA, which pretty much covers everything you'd need.
[20:20:48] <SuperMiguel> jnh: LUFA?
[20:30:57] <w|zzy> SuperMiguel: LUFA is a lightweight usb framework for AVRs
[20:30:58] <w|zzy> http://www.fourwalledcubicle.com/LUFA.php
[20:31:09] <w|zzy> It was created by ourvery own abcminuser
[20:31:36] <SuperMiguel> w|zzy: ohh i remember u telling me about it long time ago :P
[20:31:42] <w|zzy> Cool :)
[23:57:18] <SuperMiguel> learning java worth it for EE? CE?