#avr | Logs for 2014-08-21

Back
[03:14:45] <tomcruisemissile> whats best library to turn four pins of an ATmega328pu into a virtual mouse and keyboard? i need to pretend my computer has a human interfacing.
[03:25:26] <malinus> wow he left fast
[03:26:41] <Tom_itx> figure from the nick he was in a big hurry
[03:28:26] <malinus> haha actuallly laughed
[03:45:36] <antto> "click these banners, tom. if you stop - the computer will explode. muhahahaha"
[03:46:24] <antto> luckily, tom cruise always has an atmega328pu in his pocket!
[05:55:47] <WormFood> Hi jeremyabel and N1njaneer. Yeah, I was away from the computer, and just now noticed your messages. Looks like you got everything sorted out. I am here, just really slow ;)
[06:27:55] <Thrashbarg> usual chatter in here...
[06:36:54] <Lambda_Aurigae> morning all.
[10:25:26] <jeremyabel> hello avr folks. I have an arduino mega here, and I want to wipe the bootloader and program it normally via Atmel Studio
[10:25:45] <jeremyabel> every tutorial I can find is just about using arduino code in atmel studio
[10:25:55] <jeremyabel> I just want to use the arduino board as a programmer though, is all
[10:25:59] <jeremyabel> I left my MKII at home...
[10:26:22] <WormFood> jtag?
[10:26:40] <WormFood> It should be easy enough to program through the jtag port
[10:26:41] <jeremyabel> oh hey wormfood, I have your baud calculator chart up behind this chat as we speak :P
[10:26:46] <WormFood> :D
[10:26:58] <jeremyabel> I don't know anything about jtag, sadly, I was just hoping I coud use the USB port
[10:27:22] <jeremyabel> N1njaneer told me it would recognize as a STK500 or so, but it's not showing up in the tools list in Atmel Studio
[10:27:51] <WormFood> dunno
[10:28:11] <jeremyabel> back to google I go then!
[10:28:41] <WormFood> You know seeed studios? They make all kinds of stuff....I live right down the street from them. I'm hoping they can give me some parts to play with, that they can't sell
[10:28:49] <jeremyabel> oh rad
[10:28:55] <WormFood> I haven't touched an AVR in over 6 years
[10:29:12] <WormFood> I truly miss playing with my AVRs 'n stuff ;)
[10:29:18] <aandrew> WormFood: that's wild, I didn't know you were that close to seeed
[10:29:24] <jeremyabel> where are they located?
[10:29:27] <WormFood> they moved their offices last year
[10:29:46] <jeremyabel> says china
[10:29:51] <WormFood> and it just happens to be, at the opposite end of the street that I live on....if I take the subway there, it's longer than if I just walk there
[10:29:51] <jeremyabel> you're in china wormfood?
[10:29:56] <WormFood> 深圳中国
[10:29:59] <jeremyabel> crazhy
[10:30:00] <WormFood> yes, I'm in China
[10:30:29] <WormFood> If you look at the map of Shenzhen, I'm about a 5 minute walk from xili subway station...compare that to the map on seeed studio's pages
[10:30:43] <jeremyabel> ah
[10:31:07] <jeremyabel> how do you like china?
[10:31:09] <WormFood> when I left USA, I was actively working on an AVR project, that I'd like to complete (just because I started it)...it has a glitch, I can't seem to locate
[10:31:12] <WormFood> I love it here.
[10:31:15] <jeremyabel> :D
[10:31:18] <WormFood> I just got my Chinese business license.
[10:31:20] <jeremyabel> rad
[10:31:28] <jeremyabel> how long did it take you to learn the language?
[10:31:54] <jeremyabel> (your site says your name is Dave so I assume you're not native?)
[10:32:08] <WormFood> learning how to read/write takes less time and effort than learning how to speak
[10:32:15] <WormFood> these fuckin' tones, are what kill me
[10:32:43] <WormFood> "ma" can mean "hemp", "numb", "scold", "horse", "mother", or ask a question (sorta like a spoken question mark), all depending on the tone
[10:32:48] <jeremyabel> yeah I bet, my friend tried to teach me some words once and even though I thought I was pronouncing them correctly-ish
[10:32:57] <jeremyabel> she kept telling me the tone was wrong
[10:33:02] <WormFood> pronouncing most of the sounds are not that hard
[10:33:07] <WormFood> it's the tones that are a bitch
[10:33:28] <jeremyabel> back in college my chinese friend was on the phone with his parents once and kept saying what sounded like a chinese guy saying "nigga"
[10:33:42] <jeremyabel> can you shed some light on that one?
[10:33:44] <WormFood> they have 5 tones....a high tone, a falling tone, a rising tone, a falling-rising tone, and a neutral tone (that most people don't count as a tone, so most people say there are 4 tones)
[10:33:57] <WormFood> 呢个
[10:34:02] <WormFood> nega
[10:34:04] <jeremyabel> ah
[10:34:07] <jeremyabel> what's it mean?
[10:34:18] <WormFood> in english, it's the same as us saying "uuuummmm", when we don't know what to say
[10:34:29] <jeremyabel> ah yeah, I remember him saying that now
[10:34:32] <WormFood> it has no meaning, in that context
[10:34:38] <WormFood> it means "that"
[10:34:45] <jeremyabel> it was just really funny cause the black guy in the lab was just staring at him, wide-eyed :P
[10:34:45] <WormFood> but, not in that context
[10:34:50] <WormFood> hahaha
[10:35:05] <WormFood> and "don't have" sounds like "mayo"
[10:35:11] <jeremyabel> after he was done he was like "Joe, why did you say nigga to your mom sooooo many time?!?!"
[10:35:20] <WormFood> and "us" sounds like "women"
[10:35:26] <jeremyabel> crazy
[10:35:31] <WormFood> that is funny
[10:36:01] <WormFood> is your Chinese friend close by?
[10:36:13] <jeremyabel> no, this was back in college, like 5 years ago
[10:36:16] <WormFood> Wanna fuck with him? I know Chinese characters, that he can speak, but he does not know (most likely)
[10:36:19] <jeremyabel> he's in Seattle now, working for Microsoft
[10:36:26] <jeremyabel> and I'm in NYC
[10:36:35] <WormFood> I used to live across the street from Microsoft...I cracked their wifi password (passively)
[10:36:45] <WormFood> I used to live in high tech park
[10:36:52] <jeremyabel> hahaha, nice
[10:37:05] <jeremyabel> almost everyone from my robotics club lab works there now
[10:37:09] <WormFood> oh, and you know "bunnie" (Andrew Huang)? The guy that hacked the original xbox? I met him here once. Cool guy.
[10:37:19] <jeremyabel> oh rad
[10:37:21] <aandrew> redmond is a pretty place but it is very much like the company town
[10:37:24] <WormFood> google for "hua qiang bei"...this place is awesome.
[10:37:34] <WormFood> or "华强北" in Chinese
[10:37:43] <jeremyabel> oh yeah the electronics malls!
[10:37:51] <jeremyabel> super cool
[10:38:00] <jeremyabel> wish NYC chinatown had that sort of thing
[10:38:05] <jeremyabel> we had one store but it closed down last year
[10:38:19] <WormFood> most people that don't know Chinese, think all Chinese characters are pictograms; that is a picture of what it represents, but that is only true for a relatively small percentage of the characters.
[10:38:24] <jeremyabel> now it's all fake perfume and handbags for tourists and tshirts and ducks in the window
[10:38:48] <jeremyabel> WormFood: I can't believe anyone who's ever seen chinese lettering thinks that!
[10:38:53] <WormFood> characters like mountain 山, person 人, field 田 are pictograms...pretty easy to see....but most pictures are ideagrams
[10:39:07] <jeremyabel> cause I walk by blocks of it every day, and I can't imagine any of them being representative symbols!
[10:39:15] <WormFood> jeremyabel, try this. Randomly ask the people you know, what they know about Chinese characters.
[10:39:28] <jeremyabel> I'll do that at some point, for sure
[10:39:42] <WormFood> look at what I just typed....山人田 are all pictograms
[10:40:08] <jeremyabel> middle finger, arrow, window :P
[10:40:20] <twnqx> but aren't they combined at some point to form more complex words?
[10:40:33] <WormFood> most characters take 2 or more elements, to create an idea...like the character for "man", is a combination of the characters for field 田 and strength 力 to create the character 男
[10:40:40] <jeremyabel> huh, cool
[10:40:45] <WormFood> if there are 2 people working in a field, the man is the strong one.
[10:40:55] <jeremyabel> what if there are two men working in the field?
[10:40:58] <WormFood> so, it's an idea, most characters convey
[10:41:14] <WormFood> then you use the number 2, 二 or 两
[10:41:21] <twnqx> ni?
[10:41:28] <jeremyabel> what's up with chinese food resturants always being like "number one good luck bargain chinese food happy wok"
[10:41:32] <twnqx> oh wait, mixing up chinese and japanese >_>
[10:41:35] <WormFood> 二 is "2", where 两 is like "pair" or "double"
[10:41:55] <twnqx> the first two is trhe same in japanese :
[10:41:56] <twnqx> :P
[10:41:57] <WormFood> ni, without a tone mark, or any other context, would be "you" 你
[10:42:05] <twnqx> gah
[10:42:08] <twnqx> that tone mark thing
[10:42:12] <WormFood> yes, Japanese old characters, were "borrowed" from the Chinese
[10:42:23] <twnqx> is probably the most... difficult aspect of chinese
[10:42:27] <WormFood> I can read some Japanese, just because I know Chinese...not much, but some
[10:42:32] <WormFood> and here is something interesting
[10:42:43] <WormFood> some of those japanese changes, came back to China, in simplified characters
[10:42:51] <twnqx> i don't know any other language where the direction of the tone changes the meaning of the word
[10:43:12] <jeremyabel> there's others
[10:43:21] <jeremyabel> just not used much
[10:43:23] <jeremyabel> some in Africa
[10:43:37] <jeremyabel> various tribal languages
[10:43:52] <twnqx> in western languages it can change the interpretation of the whole sentence though
[10:44:03] <WormFood> anyways, the way the characters work, and the fact that the characters are not phonetic, like letters, you may hear a new word, and have no idea how to write it. Where in English, if you hear a new word, you can write down SOMETHING, that someone will understand, even if it's horribly wrong, as long as the sounds match the letters somewhat.
[10:44:05] <twnqx> as in conveying cnism
[10:44:19] <twnqx> cynism*
[10:44:27] <WormFood> we use tone to change to mean different things in English
[10:44:32] <twnqx> (a concept that for most chinese people i have met is difficult to grasp)
[10:44:33] <WormFood> You just never noticed it before
[10:44:47] <twnqx> mh
[10:45:03] <WormFood> think about how you would say, "That is a computer!", vs how you'd say "That is a computer?"
[10:45:07] <twnqx> given that english is only my second language and i never learned to pay attention...
[10:45:42] <twnqx> mh
[10:45:48] <WormFood> we (americans) typically give that last word on a question, a rising tone, while british english typically puts a falling tone on that last word.
[10:46:05] <WormFood> You don't notice it, if you're not looking for it.
[10:46:19] <twnqx> the american way hold up for german, too
[10:46:25] <twnqx> now that you mention it
[10:46:41] <twnqx> but it doesn't change the meaning of the word, just the sentence
[10:46:50] <twnqx> however you pronounce it, the word stays the word
[10:47:03] <WormFood> 肏 is a word, that every Chinese person knows, and can speak, but few know how to write. they usually write it as "操", because it has a similar sound (different tone)...and because they don't know the real character
[10:47:22] <WormFood> right, doesn't change the meaning of the word, but marks a sentence as a question, or statement.
[10:47:49] <WormFood> so, 肏 = 肉(meat) + 入 (enter)....anyone wanna take a guess as to what it means?
[10:47:50] <twnqx> but getting the precise intonation right for every single word sounds horribly difficult
[10:47:58] <twnqx> eating?
[10:48:13] <WormFood> you think most people wouldn't know the character for "eating"
[10:48:14] <WormFood> ?
[10:48:22] <twnqx> mh
[10:48:33] <WormFood> actually, there is no "ing" in Chinese...they have no suffixes...they use other characters to change the meaning
[10:48:39] <WormFood> it means "fuck"
[10:48:50] <twnqx> also makes sense
[10:48:57] <WormFood> now that is funny! enter + meat = fuck....hahahaha
[10:49:32] <twnqx> actually eat doesn't even make sense as meat traditionally was rare
[10:49:34] <WormFood> when my mom came to visit, we went to a place called "grass lake", and I told my mom, that if she said the wrong tone for "grass", it could end up sounding like "fuck lake"
[10:50:18] <twnqx> yeah... it makes it impossible for me to tell a taxi driver where i want to go
[10:50:31] <WormFood> and, it also ends up with phrases like "grass mud horse" which sounds like "f... your mother"
[10:50:31] <twnqx> without a chinese printed letter with the address :X
[10:51:04] <WormFood> I got into a taxi once, and he couldn't understand where I wanted to go, because I didn't have the right tone, so I drew the character with my finger, and he understood
[10:51:27] <twnqx> i know no chinese letters...
[10:51:30] <WormFood> Learning how to read is an incredibly useful skill
[10:51:33] <WormFood> there are no letters
[10:51:34] * twnqx is in shanghai right now
[10:51:37] <WormFood> they use characters
[10:51:40] <twnqx> well. symbols.
[10:51:40] <WormFood> really?
[10:51:44] <WormFood> I was just in Shanghai last week
[10:51:44] <twnqx> yes
[10:51:57] <twnqx> going to shenzhen day after tomorrow
[10:52:14] <twnqx> well, flying :P
[10:52:16] <WormFood> monday I go to 玉林, and wednesday I go to 长沙, and the monday after that, I go to 杭州
[10:52:27] <WormFood> I hope your arms don't get too tired ;)
[10:52:47] <WormFood> If you want to get together, and have lunch or something, and talk about geek stuff, give me a shout.
[10:53:33] <WormFood> I've actually been to more places in China, than I have in USA.
[10:53:58] <twnqx> i'll probably be at customer mon-wed, and leave for tokyo on thursaday
[10:54:09] <WormFood> I'll be gone on Monday
[10:54:21] <WormFood> going to yulin in guangxi
[10:54:39] <twnqx> wow, you're coming around in china
[10:54:49] * twnqx only has been in shenzhen and shanghai so far
[10:55:13] <WormFood> last week, I took a picture with someone. I showed the picture to my friends, and everyone except one or two, instantly recognized who I was with....a well known movie star from the 70s (still making movies today))
[10:55:29] <WormFood> those are the only 2 places?
[10:55:54] <WormFood> wow. I've been just about everywhere in China...even been to xinjiang 新疆
[10:56:10] <WormFood> been there several times...one time we drove there, from yunnan
[10:56:21] <WormFood> you may enjoy some of my pictures, http://gallery.china-dave.com/
[10:56:47] <WormFood> sichuang and yunnan were the best....freakin' awesome
[10:56:47] <twnqx> i've seen far more of the middle east than the far east
[10:56:57] <WormFood> sichuan*
[10:58:12] <WormFood> I found marijuana growing from between the cracks in a sidewalk, in yunnan
[10:58:32] <WormFood> GPS coordinates on the picture in my gallery ;)
[10:59:28] <twnqx> right... wanted to fix my gallery, now you reminded me :X
[11:00:51] <twnqx> your bad english pictures remind me of my customer
[11:01:08] <twnqx> who has english behavior guidelines on the visitor badge
[11:01:16] <twnqx> which is a plain lorem ipsum.
[11:01:26] <WormFood> hahaha
[11:01:39] <WormFood> I see stuff on people's walls, and it says "Sample Text"
[11:02:03] <twnqx> anyway, sleeptime here :) good night
[11:02:15] <WormFood> and the "spam please enter me" is one of my favorites
[11:02:24] <WormFood> ok twnqx, have a good night.
[11:02:49] <WormFood> and give me a shout, if you want to come visit after you arrive (assuming you have time). You can get my phone number from my web site http://www.shenzhencomputers.com/
[13:33:01] <Trieste> is there a website or something that would filter AVRs by my parameters (e.g. pin count, RAM...)?
[13:33:31] <Casper> atmel parametric table?
[13:35:45] <Trieste> Casper: where would I find one?
[13:36:05] <Casper> on atmel web site?
[13:36:16] <Casper> also.
[13:36:20] <Casper> digikey
[13:37:49] <Trieste> huh, turns out there's exactly what I had in mind on atmel.com
[13:37:56] <Trieste> thanks, and sorry for not checking first
[13:56:43] <sas> hey guys. i have set a pin as input but when it is not physical to GND or PWR it takes as input random states. Is it normal?
[14:00:23] <aandrew> yes, you're floating the pin which is frowned upon for several reasons
[14:01:02] <woodyj21> sas: use built in pullup resistor
[14:01:03] <aandrew> either enable the pin's built-in pull-up (most pins have them) or externally tie it to VDD or VSS through a 10k-ish resistor (actual value doesn't matter, anywhere from like 1k to 50k is fine)
[14:01:19] <woodyj21> like aandrew said
[14:02:13] <sas> and this resistor will be drawing power then right?
[14:02:29] <woodyj21> super tiny amount, but yes
[14:03:27] <sas> ~,5 ma
[14:04:46] <woodyj21> sounds about right, but I don't know for sure....
[14:05:08] <sas> so floating input is not allowed. Thanks guys :)
[14:07:14] <woodyj21> it's not that's it's not allowed, it just is almost always not a good idea
[14:07:56] <aandrew> way less than 5mA
[14:07:59] <aandrew> or even 0.5mA
[14:08:33] <aandrew> they're typically FET inputs which means floating gate; you spend a few pA charging up the gate capacitor and then it's practically nothing
[14:08:51] <aandrew> (there's some other leakage but nothing to concern anyone asking why the input's random without it)
[14:12:12] <sas> :) thanks a lot it works with internall pull up great
[14:21:27] <jeremyabel> well that only took me 4 hours...
[14:21:43] <jeremyabel> and recompiling avrdude on windows from source with some patch
[14:21:52] <jeremyabel> but yay now I can program the thing properly...
[15:30:51] <skroon> hi
[17:26:06] <jeremyabel> guys I'm stressing out over this USART stuff
[17:27:22] <jeremyabel> reading through example code, reading through arduino's hardware source code, not sure how to go about it. Like arduino gives me the serial terminal and I can get stuff back and send stuff out
[17:28:14] <jeremyabel> but I'm not sure how to do that with just a FTDI board and straight-up AVR
[17:32:04] <jeremyabel> and arduino's hardware source code uses this ringbuffer thing, and I'm not sure if I even need one of those, I just want to verify that my serial comms are working
[17:32:12] <jeremyabel> too much to think about
[17:33:32] <jeremyabel> and this realterm program is obtuse and complicated
[17:33:44] <jeremyabel> and I'm pretty sure buggy
[17:34:25] <jeremyabel> can't even figure out how to connect to my damn FTDI dongle
[17:43:16] <jeremyabel> also the arduino source uses sbi and cbi and atmel's datasheet code just sets stuff manually and I forget what sbi and cbi even mean cause I haven't written AVR code in like 6 years...
[17:49:20] <jeremyabel> oh god I guess sbi and cbi are like macros or something and are depricated?
[17:49:32] <jeremyabel> what is happening to my worrrrld
[17:57:26] <jeremyabel> oh god sbi is just dumb
[17:57:34] <jeremyabel> with the numbers
[18:00:32] <jeremyabel> https://lists.gnu.org/archive/html/avr-gcc-list/2005-01/msg00292.html
[18:00:43] <jeremyabel> screw you arduino source-code, with your red herrings
[18:18:25] <NicoHood> i have about 16bytes too less (you say less here?) at this line of code. but the functions above are all closed so they dont take any more ram, right? they dont have static variables. is there anything i could do to get more ram at this point? for example the var in line 95, will this get deleted or do i have to do this manualy? https://github.com/NicoHood/Hoodloader/blob/dev/Hoodloader.c#L201
[18:18:51] <jeremyabel> so you have 16 bytes over the limit in your code?
[18:18:58] <jeremyabel> that's 16 bytes too many, not too less
[18:19:44] <NicoHood> yeah, i need 16 more you could say
[18:19:53] <jeremyabel> gotcha
[18:19:54] <jeremyabel> let me seeeeeee
[18:19:57] <NicoHood> found this out by removing my global buffer down to this
[18:20:14] <jeremyabel> nice looking code though, well commented
[18:20:23] <NicoHood> really? :O
[18:20:29] <jeremyabel> sure
[18:20:36] <NicoHood> actually its a mess. the whole thing
[18:20:50] <jeremyabel> a commented mess though!
[18:20:52] <NicoHood> i have a global ram struct. because 500 bytes...
[18:21:01] <NicoHood> that sucks. but thx :)
[18:21:23] <NicoHood> and it seems this function call crashes my whole thing if it has not enough ram
[18:22:45] <jeremyabel> yeah I dunno, you could always argue that you don't NEED blinky TX / RX leds
[18:23:11] <NicoHood> sure. but this could save at max 1 byte
[18:23:51] <jeremyabel> **shrug** doesn't look like you're doing anything like, super wasteful
[18:24:00] <NicoHood> you might not see what is needed and what not. however i could maybe get about 6 bytes more
[18:24:12] <jeremyabel> yeah I mean I'm just glancing over it quickly
[18:24:26] <jeremyabel> if you need 16 bytes than you need 16 bytes, gotta find 'em somewhere!
[18:24:41] <NicoHood> i even rewrote the ringbuffer. i can get 3 bytes more i think, if i pass the pointer every time i call the ringbuff. but this takes more flash and looks ugly
[18:24:48] <jeremyabel> if the whole thing is a mess, maybe a refactor is in order?
[18:25:06] <NicoHood> rewriting the code?
[18:25:26] <NicoHood> this doesnt solve the 500 bytes limit :D
[18:26:06] <NicoHood> however: line 95: is this byte delected from ram if the function below (the if) finished? or do i have to delete this byte?
[18:26:33] <jeremyabel> i think it'll clear it itself
[18:26:57] <jeremyabel> you're not allocating memory for it explicitly; I don't know how this works in AVR-land, only in PC-land
[18:27:26] <jeremyabel> but in PC land that stuff gets cleaned up unless you explicitly allocate space for it and hold it there
[18:27:41] <NicoHood> damn
[18:27:55] <NicoHood> i think i have to use another trick then to free more memory
[18:28:03] <jeremyabel> does doing if ( LRingBuffer_GetCount... ) { } save anything?
[18:28:10] <jeremyabel> unless you use BufferCount later?
[18:28:31] <jeremyabel> which it doesn't seem like you do
[18:28:52] <jeremyabel> except in that if statement
[18:28:56] <NicoHood> line 110 i use the var
[18:29:06] <jeremyabel> yeah but you could just call the GetCount function again, yeah?
[18:29:31] <NicoHood> i could test this. you knwo i have no debugger, i tried over and over till i found out its about 16 bytes
[18:29:44] <NicoHood> i dont wanna try this again now :D
[18:29:51] <NicoHood> i am a big fucked up though ^^
[18:29:55] <jeremyabel> not sure what the difference between the memory for the result of that function, and the declared uint16_t, but, maybe?
[18:30:10] <NicoHood> yeah i will test this tomorrow
[18:30:43] <NicoHood> but i think i will reduce the isp buffer half. then i should have enough ram. even if i could get 16 bytes more free, its very critical
[18:30:50] <NicoHood> i want a bit more free
[18:31:21] <NicoHood> if the arduino team could add a 32u4 as usb chip... man that'd be mega awesome
[18:35:18] <NicoHood> is there a function like malloc that will allowcate me a memory piece, so i can use it not fragmented later. but if the ram is full it will use this memory too and will try to clean it as fast as possible? if you understand what i mean...
[18:35:50] <jeremyabel> no idea :/
[18:35:53] <NicoHood> kinda pre allowcate. to ensure the ram is not fragmented. i need 128 bytes / about 250 free
[18:36:00] <NicoHood> hzm okay
[18:36:09] <NicoHood> well. i will get this beast
[18:36:55] <NicoHood> other question: do i need to pull hardware SS LOW in slave mode? or does the pin just be input? because the hardware SS is not connected and i am wondering if i can still use it as slave