#avr | Logs for 2013-07-08

Back
[03:43:57] <braincracker> h
[03:44:17] <braincracker> which is the current best arm motherboard that runs linux ?
[03:44:32] <braincracker> i'd like a pc with 1W power consumption
[03:46:10] <Tom_itx> w
[03:46:14] <R0b0t1> This is a funny channel to ask in then
[03:46:19] <braincracker> hehe
[03:46:21] <R0b0t1> I might point you toward the beagle bone black.
[03:46:29] <braincracker> should i take this to #arm?
[03:46:31] <R0b0t1> Not sure about power consumption but it's pretty cool.
[03:46:39] <R0b0t1> Not sure if ##arm exists.
[03:46:43] <twnqx> you know why almost all of the cheap arm boards suck?
[03:46:45] <Tom_itx> bbb
[03:46:49] <twnqx> none have dual hdmi out :(
[03:47:11] <braincracker> #arm and ##arm is very small chan ;/
[03:47:24] <braincracker> :(
[03:47:31] <braincracker> twnqx <= how about dvi-d ?
[03:47:44] <twnqx> didn't see a single one like that
[03:48:10] <braincracker> so simple rgb ?
[03:48:15] <braincracker> i don't want hdmi
[03:48:23] <twnqx> hdmi+vga
[03:48:28] <twnqx> hdmi is the smae as dvi
[03:48:33] <twnqx> just without audio
[03:49:30] <Tom_itx> ##stm32
[03:50:41] <R0b0t1> In ##stm32, you will have the pleasure of being trolled by dongs
[03:51:43] <Tom_itx> haven't been there in a long time
[03:52:00] <Tom_itx> there's another one but i can't remember it
[03:52:31] <bitd> lol, dongs still around?
[03:52:32] <braincracker> beagle bone black vs. Raspberry Pi ?
[03:52:49] <bitd> Legendary troll status for him.
[03:54:54] <twnqx> i seriously doubt any of those will make you happy if you compare to a pc
[03:55:03] <Tom_itx> #edev http://www.elinux.org
[03:55:05] <Tom_itx> that was it
[03:55:06] <twnqx> but maybe my requirements are just different :P
[03:55:13] <braincracker> http://www.ehow.com/about_6543761_hdmi-vs_-dvi_d-cable.html
[03:55:16] <braincracker> ;/
[03:55:28] <R0b0t1> bbb is better in that it was really meant for hardware interface
[03:55:30] <braincracker> don't you hate speakers in display devices?
[03:55:32] <twnqx> i have enough cables with hdmi on one end and dvi on the other
[03:55:33] <R0b0t1> rpi was meant as a shitty computer
[03:55:53] <twnqx> working in both directions
[03:56:15] <twnqx> and no, i don't mind speakers in my display. i am happy to have one
[04:22:39] <braincracker> i was suggested this on #osdev http://pandaboard.org/ http://www.omappedia.com/wiki/File:PandaBoard_Setup.png
[04:38:16] <Gumboot> braincracker: I think you might want #arm-netbook.
[04:40:16] <braincracker> http://itgcreativeblog1.blogspot.hu/2012/10/arm-netbook.html
[04:40:21] <braincracker> wow looks nice
[04:42:12] <Gumboot> I'm using a cubieboard, right now. I've a couple of cubieboard2s on their way.
[04:46:14] <braincracker> hmm, ddr3
[04:47:23] <BJfreeman> I use the allwinnerchips A13
[04:54:06] <Roklobsta> dance dance revolution 3?
[04:55:31] <BJfreeman> http://en.wikipedia.org/wiki/DDR3_SDRAM
[06:42:05] <braincracker> Raspberry Pi - Quake 3 demo http://www.youtube.com/watch?v=e_mDuJuvZjI
[06:42:17] <braincracker> Raspberry Pi Connected To Mini Composite Monitor http://www.youtube.com/watch?v=IFJ1YjEiZEg < more fun than any gameboy if you are going to a trip :)
[06:42:23] <braincracker> the pi has a video out too for connection to tv http://www.youtube.com/watch?v=Tbk_Z_8macI
[06:42:25] <braincracker> ;/
[08:45:31] <scipy53> Hey guys, quick question. I am trying to send integers over the UART, but the avr receives them as ASCII characters. Is there an easy way to convert them to their integer representations?
[08:47:13] <tzanger> scipy53: what do you mean? you can send binary data over a UART just fine
[08:48:05] <tzanger> i.e. 0x30 0x31 will be received as 0x30 0x31; that can be "01" if you are interpreting it as ASCII characters, or either 12592 or 12337 depending on your endianness
[08:51:11] <scipy53> Well, ok so I am sending data from a raspberry pi over its uart
[08:51:34] <scipy53> So I do port.write() with the serial.py library
[08:52:45] <scipy53> Actually wait, I have an idea. Will be back :)
[09:12:39] <tzanger> oh, so port.write() is maybe translating it
[09:44:00] <scipy53> ya
[09:44:35] <scipy53> Say in my code I have an array like uint8_t array[3]
[09:44:49] <scipy53> So each element of the array has an integer
[09:45:02] <scipy53> how do I convert that array to simply one integer?
[09:45:13] <scipy53> Say I have 3,2,4,6 in my array
[09:45:25] <scipy53> I want 3246 as a standalone integer to work with
[09:45:47] <braincracker> loop through, multiply and add ?
[09:46:05] <braincracker> no magic way
[09:47:11] <scipy53> Ok, as long as there isn't a magic way
[09:47:56] <braincracker> you probably know how to iterate
[09:50:24] <scipy53> yep
[09:50:40] <scipy53> i just thought there might be a simple way
[10:06:53] <specing> scipy53: and there is
[10:07:09] <scipy53> specing, ?
[10:07:17] <specing> scipy53: 1) you don't have 4 elements in a 3 element array
[10:07:37] <scipy53> sorry, that was just an example
[10:07:43] <scipy53> forgot about that
[10:07:43] <specing> scipy53: 2) you can access them directly by making the thing a union (though the order is implementation specific)
[10:07:52] <specing> union {
[10:07:53] <scipy53> hmm
[10:08:00] <specing> u8 arr[4];
[10:08:06] <specing> u32 direct;
[10:08:07] <specing> };
[10:08:20] <scipy53> looks interesting! will try it soon
[10:08:22] <scipy53> ty
[10:24:46] <RikusW> http://web.media.mit.edu/~raskar/cornar/
[11:05:45] <braincracker> uint32_t asdf; asdf = array[0] + array[1] * 10 + array[2] * 100;
[11:05:51] <braincracker> simple enough?
[11:09:43] <specing> I thought he needed a base 256 merge, not a base 10 one.
[11:12:06] <braincracker> i have no idea what he is up to then
[11:13:04] <braincracker> union works fine until endianness changes
[11:13:36] <specing> endianness doesen't change
[11:13:42] <specing> it is the compiler that does
[11:13:43] <braincracker> hopefully
[11:13:50] <specing> hence implementation-specific
[11:13:53] <braincracker> who uses mac anyway
[11:14:18] <specing> What does mac have to do with this?
[11:15:48] <braincracker> http://en.wikipedia.org/wiki/Big_endian
[11:15:55] <braincracker> get confused
[11:18:37] <specing> braincracker: bid endian is the natural encoding, not sure why I would get confused by that
[11:19:29] <tzanger> there's nothing natural about big endian, at least if you're coming from x86. :-)
[11:19:35] <braincracker> Well-known processor architectures that use the little-endian format include x86 (including x86-64), 6502 (including 65802, 65C816), Z80 (including Z180, eZ80 etc.), MCS-48, 8051, DEC Alpha, Altera Nios II, Atmel AVR, SuperH, VAX, and, largely, PDP-11.
[11:19:36] <tzanger> typically anything sent between devices is in network order, which is big endian
[11:19:40] <braincracker> ;>
[11:19:59] <twnqx> anything that doesn't have the lowest bits at the lowest address is pretty unnatural to me
[11:20:12] <tzanger> twnqx: that's how I see it myself
[11:20:30] <specing> braincracker: AVR is not little endian
[11:20:51] <braincracker> oh fuck i need to rewrite all my codes
[11:22:47] <specing> twnqx: Not sure how you deal with real life where everyone tells you the most significant digit first
[11:23:19] <twnqx> how do the two relate?
[11:24:10] <specing> we humans are essentially base 10 machines
[11:24:50] <twnqx> taught to be, but yes
[11:25:56] <twnqx> did you know that our western number writing system stems from arabic
[11:26:02] <twnqx> where it it written from right to left
[11:26:07] <twnqx> thus lowest digit first?
[11:27:55] <twnqx> so we actually write it in the opposite direction it was originally intended
[11:28:11] <twnqx> which becomes obvious in subtraction/addition, where we work the unusual right-to-left
[11:28:35] <twnqx> so i'd rather say that our way of writing numbers is unnatural.
[11:41:52] <BJfreeman> we should all go back to a abacus
[11:42:21] <braincracker> twnqx <= but you usually feel comfortable about reading a number from top
[11:42:34] <braincracker> so from left to right in this case
[11:43:03] <twnqx> it's just training and being used to
[11:43:22] <twnqx> doesn't change the fact that every calculation you do you do from right to left
[11:43:54] <twnqx> which is opposite to every other writing we do
[11:44:58] <braincracker> let's write numbers reversed then, and read numbers from right to left ;)
[11:45:20] <twnqx> that would make no sense
[11:45:42] <braincracker> :( use a mirror?
[11:46:05] <twnqx> accept it as brain cracked
[11:46:06] <braincracker> but that would require symmetric numbers ;<
[11:46:52] <braincracker> i know, don't write numbers
[11:47:05] <braincracker> put proper amount of dots there ........
[11:48:22] <braincracker> BJfreeman <= ah the abacus
[11:54:43] <braincracker> http://en.wikipedia.org/wiki/Abacus oh cool take a look at this creature http://en.wikipedia.org/wiki/File:Quipu.png
[11:56:23] <braincracker> http://en.wikipedia.org/wiki/Quipu
[11:56:51] <braincracker> The cords contained numeric and other values encoded by knots in a base ten positional system
[11:56:53] <braincracker> ^^
[11:57:47] <braincracker> LSB or MSB? :(
[11:59:45] <braincracker> "Digits in the "ones" position are represented by long knots (e.g., 4 is a knot with four turns). Because of the way the knots are tied, the digit 1 cannot be shown this way and is represented in this position by a figure-of-eight knot."
[12:00:02] <braincracker> ohh, they figured this out thousands of years ago
[12:46:05] <cart_man> Is there some way i can search for a irc channel?
[12:46:56] <vectory_> yes
[12:47:07] <vectory_> assk in #help
[12:47:10] <vectory_> ask*
[12:47:21] <vectory_> or helpdesk or what its called
[12:47:31] <vectory_> theres a bot for that
[12:48:11] <cart_man> Nice.. thanks
[12:56:09] <vectory_> was that sarcasm?
[12:57:46] <BJfreeman> my IRC client as a channel list search
[12:59:48] <antto> /list is part of the irc protocol
[13:08:49] <scipy53> is there any reason why the usart might skip a byte in the same spot consistently?
[13:09:01] <twnqx> no
[13:09:31] <scipy53> For example, if I have the string 563x6 coming through, it consistently skips the x value in my code
[13:10:00] <twnqx> personally, i would blame the code
[13:10:05] <antto> +1
[13:10:08] <twnqx> all weirdnesses of uarts i found have been code issues
[13:10:10] <scipy53> but if i swap my code for just an infinite loop where it reads the incoming byte, and transmits it, then the byte is there
[13:10:41] <antto> inspect your code
[13:11:11] <scipy53> i tried quite a bit
[13:11:14] <scipy53> cant figure it out
[13:11:19] <scipy53> can i paste it here?
[13:11:32] <antto> not if it's too many lines
[13:11:33] <twnqx> you can put it on a pastebin
[13:11:38] <twnqx> and paste a link here
[13:11:38] <antto> use pastebin
[13:11:40] <scipy53> oh ok, sure
[13:13:51] <scipy53> http://pastebin.com/J814GFyS
[13:14:04] <scipy53> so my incoming data packet looks something like this:
[13:15:08] <scipy53> t x d* r so "t" signifies the start of the data packet, x the number of "d"s and "r" signifies the end
[13:15:22] <scipy53> for ex. t289r
[13:16:14] <scipy53> I can verify that the incoming data is just fine if I remove all the code in my main method, and replace it with two lines to echo whatever is coming in to the usart
[13:16:33] <scipy53> and I can verify that the loop in the main method counts the correct number of times based on my "x" value
[13:17:28] <twnqx> uint8_t heading_digitArray[heading_length];
[13:17:35] <twnqx> NEVER use that in C
[13:17:43] <twnqx> never do dynamic sized arrays-
[13:17:46] <twnqx> ever.
[13:18:02] <RikusW> antto: /msg alis help
[13:18:13] <antto> RikusW what for?
[13:18:17] <scipy53> it's dynamic? I set it once twnqx
[13:18:20] <RikusW> listing channels
[13:18:28] <twnqx> you set it right before
[13:18:33] <antto> RikusW i don't need to list channels
[13:18:40] <twnqx> C does not support variable length arrays.
[13:19:25] <twnqx> also, the paste is complete, since rec is not defined on outermost level
[13:19:51] <twnqx> incomplete*
[13:19:51] <twnqx> and you do not read it before.
[13:19:51] <twnqx> read the uart / set rec
[13:19:58] <scipy53> twnqx, Sorry, you're right, I tried to simplify the code for you all. My mistake, I'll do this right. One moment.
[13:20:17] <twnqx> char heading_length = USART_Receive();
[13:20:17] <twnqx> uint8_t heading_digitArray[heading_length];
[13:20:17] <twnqx> does not work, either way.
[13:20:30] <twnqx> make that a fixed maximum size array
[13:20:57] <twnqx> (not that it matters, since you don't write to it, but i guess you will want to)
[13:21:21] <scipy53> ok, thanks
[13:23:44] <scipy53> twnqx, http://pastebin.com/YPRHGy8m
[13:24:18] <scipy53> That should be much more representative of my code. I tested it, and it works. Still same problem though of skipping bytes in between the first "d" and the "r"
[13:25:45] <scipy53> Thanks so much for your help
[13:26:16] <twnqx> hm
[13:26:29] <twnqx> that's just me, but you could have a timing problem
[13:26:49] <twnqx> since you might have to wait so long for the tx buffer getting ready that you just lose the byte
[13:27:03] <scipy53> I tried to get rid of the tx buffer
[13:27:09] <scipy53> so no sending to the tx
[13:27:29] <scipy53> but still same problem. that's why i was storing them in an array, and printing them later
[13:27:38] <twnqx> if (rec == 't') {
[13:27:38] <twnqx> USART_tx_string("start\r\n");
[13:27:40] <twnqx> just this
[13:27:52] <twnqx> you will block for 7 bytes transmit
[13:28:15] <twnqx> if the other side sends anything during this, you might lose stuff
[13:28:32] <scipy53> i see
[13:28:53] <scipy53> but i thought stuff gets stored in an rx buffer
[13:28:55] <twnqx> so unless the other end waits for the start\r\n before sending the numbers
[13:28:57] <twnqx> you will have problems
[13:28:58] <scipy53> why would it get lost
[13:29:04] <twnqx> it's 2 bytes long
[13:29:13] <twnqx> the buffer
[13:29:29] <scipy53> i see
[13:29:35] <scipy53> well, you are absolutely right
[13:29:43] <scipy53> i commented out that silly start
[13:29:47] <scipy53> and it works great now
[13:30:00] <twnqx> i'm afraid you will want to look interrupt handlers and asynchronous communication
[13:30:23] <scipy53> i am going to make my uart stuff interrupt driven
[13:30:27] <scipy53> for sure
[13:30:56] <twnqx> on this low level of µC programming, understanding the timing really matters
[13:31:16] <twnqx> and you can't really simulate it as soon as it comes to external events
[13:31:48] <scipy53> i am beginning to see this more and more
[13:32:00] <scipy53> so what do you suggest?
[13:32:17] <scipy53> would making everything interrupt driven be a good solution?
[13:32:34] <twnqx> it would solve this particular problem
[13:32:55] <scipy53> yes, ok
[13:32:59] <twnqx> but your "protocol" implementation is generally unable to recover from transmission errors, you should consider changing the complete loop
[13:33:29] <scipy53> yes, i will
[13:33:34] <scipy53> i was just testing stuff
[13:33:57] <twnqx> while while (1) { rec = receive(); switch (rec) { case 't': start; break; case '0': case '1': ... case '9': <number>; break; case 'r': abortorend(); break; default: wtf(); }
[13:35:30] <twnqx> -CFLAGS=-mcpu=tc1796 -Os -nostdlib -nostartfiles
[13:35:30] <twnqx> +CFLAGS=-mcpu=tc1796 -Os -nostdlib -nostartfiles -Wa,-adhlns=$(<:.c=.lst)
[13:35:38] * twnqx wonders what that makefile change does
[13:36:00] <twnqx> i guess it produces disassemblies ...
[13:36:17] <scipy53> is the CFLAGS stuff for me too?
[13:36:21] <twnqx> no
[13:36:43] <scipy53> oh ok, cool, was a bit confused
[13:36:51] <scipy53> but thanks, your implementation is much cleaner
[13:37:41] <twnqx> you will probably wrap a state machine inside
[13:39:00] <twnqx> hm. my code has a "goto moo;". i am not amused...
[13:39:07] <twnqx> guess i was only testing, too
[13:39:13] <antto> hahah
[13:42:31] <twnqx> [~/can/avr]>git cherry-pick 0f8a12e
[13:42:32] <twnqx> error: could not apply 0f8a12e... flash: recognize more chips
[13:42:33] <twnqx> sigh.
[13:44:00] <twnqx> touching code after some months of doing other stuff feels weird
[13:48:01] <scipy53> how would i transmit a 16 bit integer (uint16_t) over the usart? Would I create a high and low byte?
[13:48:13] <braincracker> twnqx <= why? you have better solutions? ;)
[13:49:15] <twnqx> excuse me a moment, my pc is confusing me
[13:52:03] <twnqx> .... and with this i am back to a problem i was staring at some time ago.
[14:00:17] <vectory> scipy53: the tx or rx register is only 8bit wide iirc. high and lo byte indeed
[14:18:16] <BJfreeman> scipy53 you can use << 8 to break down on integer to bytes
[14:20:36] <twnqx> ... i'd rather use & 0xff and >> 8...
[14:26:53] <Snii> Hi, If I set a pin interrupt and put my 328p to sleep, will it have to be set back to sleep with sleep_mode() after the interrupt routine runs, or will it go back automatically?
[14:53:30] <braincracker> i smell insanely intensive c0d1ng around here
[14:53:45] <braincracker> all those flipped bits
[15:05:21] <scipy53> vectory, BJfreeman, I am trying that: http://pastebin.com/pPi7EhSm Must be doing something wrong?
[15:08:28] <scipy53> I don't expect to see the numbers, because they seem probably are converted to their ascii equivalents when transmitted?
[15:10:07] <scipy53> I see data coming, but there's nothing inside the "-" "-"
[15:11:59] <scipy53> maybe its working, but not transmitting correctly? hmm
[15:25:49] <BJfreeman> ah you want it to be readable use sprintf()
[15:30:24] <scipy53> BJfreeman, sprintf? Will that send data over the usart? Never seen that before - then again, I am very new to this.
[15:38:42] <scipy53> BJfreeman, Figured it out! Awesome, thank you soo much!
[16:09:59] <BJfreeman> could have used itoa() but that is so plain
[16:37:48] * megal0maniac has successfully added a 5dbi antenna to a pocket router :)
[16:37:59] <megal0maniac> Can you tell I'm on holiday?
[16:52:34] <twnqx> megal0maniac: i don't see a difference to every day
[16:52:39] <twnqx> except you chatting less
[16:53:26] <megal0maniac> I've been away
[16:55:19] <RikusW> Dexter 802 is out :)
[16:56:26] <megal0maniac> I stopped liking Dexter. Finished S4 and that's it
[16:58:28] <RikusW> https://www.youtube.com/watch?v=pbxArVCsKho
[17:07:02] <vectory> ti y2313 has an analogue compare module, having AINx configured as low output should be the same as input without pull up connected to gnd right?
[17:08:36] <RikusW> not quite
[17:08:56] <RikusW> input without pullup is floating...
[17:09:10] <RikusW> even static will change the voltage on it..
[17:11:03] <vectory> its not floating when on ext. gnd
[17:11:43] <vectory> that is, if gnd and an input between -1 and +1 volt, i.e. from a microphone, should work as input to the AComp
[17:15:41] <vectory> RikusW: btw, i use connectbot for ssh to a server wbere i run irssi, since you asked
[17:16:13] <RikusW> ah
[17:16:41] <vectory> and the salesperson made an argument for core i3, because it has more power. or g643 instead of g2020
[17:17:02] <vectory> 643 *iirc*
[17:18:12] <RikusW> afaik g2020 is newer than g643
[17:18:35] <RikusW> i3220 is only slightly better than g2020 and much more expensive
[17:18:45] <RikusW> (its got 4 hyperthreads...)
[17:18:48] <megal0maniac> vectory: Me too :)
[17:19:13] <megal0maniac> (My irc setup)
[17:19:33] <vectory> megal0maniac: barely enough for irc -_-
[17:19:41] <megal0maniac> Although I'm usually using PuTTY
[17:20:05] <megal0maniac> I quite like it. Seems to beat most GUI options I've tried
[17:20:25] <vectory> its the only i know, even
[17:20:34] <megal0maniac> You aren't missing out
[17:20:49] <megal0maniac> Except my server is ARM based :D
[17:21:12] <vectory> though, putty's console is still sub avarage
[17:21:42] * megal0maniac shrugs
[17:38:47] <megal0maniac> Goodnight :)
[17:39:32] <Tom_itx> vectory what do you want from a console?
[17:40:32] <vectory> hmmm, i dont remember the flaws exactly. only text selection that was wonky
[17:43:40] <Tom_itx> trying to decide on a router here
[17:43:51] <Tom_itx> http://abottlerocket.net/2013/04/ubiquiti-edgerouter-lite-review/
[17:44:07] <Tom_itx> i hear good things about that except it's hard to configure
[17:47:26] <megal0maniac_afk> TP Link everything!
[17:48:03] <megal0maniac_afk> The f**king gender on this SMA jack is wrong. Only realised now that I've installed it :(
[17:49:24] <Tom_itx> woops
[17:50:19] <megal0maniac_afk> Tom_itx: The mikrotik stuff is also supposed to be great, and very customisable. What are you using it for?
[17:51:19] <Tom_itx> home
[17:51:28] <Tom_itx> but i'm sick of off the shelf crap
[17:51:55] <Tom_itx> need a couple port fwds and that's about it really
[17:52:39] <megal0maniac_afk> Then it sounds like off the shelf crap is exactly what you need
[17:52:46] <Tom_itx> i'm already using their wifi thingy and like it so i figured their edgemax must be ok
[17:53:28] <megal0maniac_afk> Ubiquity is good quality, as is Mikrotik
[17:53:57] <Tom_itx> i wonder which is easier to configure
[17:54:01] <megal0maniac_afk> Personally I'd just get something TP-Link because you can stick OpenWRT on it and do anything and everything. And the hardware hasn't let me down yet
[17:54:08] <megal0maniac_afk> Probably Mikrotik
[17:54:27] <megal0maniac_afk> Although it's not that big a deal. You only have to do it once
[18:02:43] <megal0maniac_afk> What is the standard with SMA anyway? It seems as though the bulkhead should be female, but it isn't like that on my router
[18:02:59] <megal0maniac_afk> To the point where I can't find a male bulkhead anywhere
[18:22:37] <RikusW> megal0maniac_afk: I've seen the same thing, the router is the wrong way round
[18:22:53] <RikusW> normally the signal source is on the female SMA
[18:23:14] <RikusW> (The Billion router also got a male SMA)
[18:23:33] <RikusW> maybe you can put it a teeny bit of wire
[18:23:39] <RikusW> *in