#avr | Logs for 2013-10-05

Back
[08:23:39] <sjokkis> Ugh. I've got a function here that takes an array (uint8_t*) and the length of the array (uint8_t). in it i need to loop over the array and pass a pointer to the i-th element to another function, so that function can write to it. what's the right way to do that?
[08:23:53] <sjokkis> the second function expects a uint8_t*
[08:26:08] <antto> func2(&ptr[i]) perhaps?
[08:26:22] <antto> or ptr+i
[08:27:01] <sjokkis> that's what i thought too...
[08:28:38] <antto> you could also do ptr+i*sizeof(...)
[08:29:27] <sjokkis> antto: this is what i'm trying to do http://pastebin.com/Bbqy8fV9
[08:29:50] <sjokkis> antto: it only works if data_in is NULL, otherwise it never reaches line 15
[08:30:09] <sjokkis> data_in passed to spi_transfer_block
[08:30:16] <sjokkis> spi_transfer works great either way
[08:30:23] <sjokkis> used by itself
[08:38:24] <sjokkis> oh wait, it works if i replace the input argument to spi_transfer with NULL, however, if i'm trying to do (data_in + i) where data_in *is* NULL, that might not work so great
[08:38:52] <sjokkis> what's the natural way to deal with that? it should be perfectly valid to pass NULL as data_in
[08:42:33] <Tom_itx> or 0xFF
[08:42:43] <sjokkis> what
[08:43:04] <Tom_itx> usually dummy bytes are 0xFF
[08:43:49] <sjokkis> if i was transmitting dummy bytes sure, but here i'm ignoring returned bytes
[08:43:53] <sjokkis> or not receiving any at all
[08:44:52] <sjokkis> Tom_itx: i'm not sure i follow what you're suggesting
[08:45:53] <Tom_itx> any way to tell what is actually getting transferred?
[08:45:58] <Tom_itx> logic analizer etc
[08:46:13] * Tom_itx hugs his Saleae
[09:50:02] <sjokkis> When a pin change interrupt triggers, there's as far as I can tell no register I can use to check which pin triggered the interrupt. Is it considered safe to just check the pins, or can those have changed again by the time my ISR is run?
[10:09:47] <Tom_itx> on pin change you need to check the pins in the interrupt
[10:35:38] <sjokkis> Tom_itx: you mean read PORTB or whatever?
[10:53:47] <Tom_itx> yeah
[10:59:26] <sjokkis> thanks
[11:17:19] <MarkX> ping abcminiuser
[11:17:28] <abcminiuser> Pong
[14:15:13] <MarkX> quick question
[14:15:42] <MarkX> if i have a couple of .c and .h files that i use for a variety of projects, what is a good way to use them without having to copy them into each new project?
[14:16:01] <Tom_itx> include the path they're in
[14:16:41] <MarkX> oh so just make a new folder away from the project folders and include it in?
[15:00:49] <pingo> why is there no 1wire humidity sensor :/
[15:02:49] <DagoRed> make one.
[15:03:00] <pingo> :D
[15:04:59] <MarkX> https://www.sparkfun.com/products/10167
[15:05:03] <MarkX> isn't that 1 wire?
[15:05:16] <MarkX> or do you mean physically 1 wire?
[15:06:23] <pingo> I mean the 1wire protocol
[15:12:32] <pingo> http://rants.dyer.com.hk/rpi/humidity_1w.html
[17:15:11] <sjokkis> weirdness. my uart doesn't print total garbage, but it prints the wrong letter
[17:15:16] <sjokkis> even using atmel example code
[17:15:39] <sjokkis> shouldn't the uart implementation in asf "just work"?
[17:22:29] <Casper> sjokkis: internal RC?
[17:22:37] <sjokkis> Casper: RC?
[17:22:44] <Casper> internal oscillator
[17:22:59] <sjokkis> oh, right. i'm not sure, actually. i'm using the xplained a1 card
[17:23:10] <Casper> internal RC can be off by 10%
[17:23:30] <sjokkis> i'll check if this card uses its own rc
[17:23:35] <Casper> under some circumstance, it can still validate as "valid" character, but in reality is wrong
[17:23:47] <Casper> an oscilloscope can show you if it is
[17:23:53] <sjokkis> can the internal rc really vary that much? i didn't know that
[17:31:37] <Tom_itx> sjokkis, stop bits or parity wrong?
[17:31:53] <Tom_itx> that would show up on an analizer right away
[17:32:14] * megal0maniac_afk hugs his Saleae
[17:32:26] * Tom_itx hugs his Saleae as well
[17:33:26] <sjokkis> doesn't seem to be wrong, no
[17:35:27] <sjokkis> i'm not entirely sure if this is trying to initialize usart or uart
[17:35:35] <sjokkis> too much high level for my brain
[17:38:33] <sjokkis> hm yeah it's usart
[17:38:35] <sjokkis> that might be it
[17:39:16] <sjokkis> or not. i dunno. no clock pin in db9 that i know
[17:39:48] <sjokkis> weird that the asf functions aren't working. the whole point to them is that things just work
[17:40:13] <sjokkis> hey abcminiuser, have you used the asf functions for setting up uart on xmega?
[17:40:28] <abcminiuser> At some point, yes
[17:40:37] <abcminiuser> But didn't write them, so don't start yelling at me
[17:41:43] <Tom_itx> hehe
[17:42:01] <Tom_itx> someone attack you about it already?
[17:43:20] <abcminiuser> Just guessing what will come next...
[17:50:39] <megal0maniac_afk> Your standard "It wasn't me!" protective disclaimer
[18:30:36] <sjokkis> I wasn't gonna yell, just ask for help :(
[18:30:41] <sjokkis> I guess he left. It's late here
[18:56:09] <MarkX> bleh
[18:56:15] <MarkX> in coming dumb question
[18:56:26] <sjokkis> oh great i've got my notepad prepped and ready
[18:57:48] <MarkX> i have x.h, x.c, and y.c.
[18:58:00] <MarkX> x.c has a uint8_t variable "message1". i need to utilize message1 in y.c
[18:58:02] <sjokkis> nice, descriptive names, all
[18:58:43] <MarkX> how do i go about doing that...
[18:59:33] <sjokkis> so x is a struct, and so is c?
[18:59:50] <sjokkis> or wait, what
[18:59:53] <MarkX> sorry those are file names
[18:59:55] <MarkX> like
[18:59:57] <sjokkis> oh
[19:00:08] <sjokkis> pastebin pls
[19:00:14] <MarkX> pastebin what?
[19:00:19] <sjokkis> pastebin that shit
[19:00:22] <MarkX> what shit
[19:00:26] <sjokkis> the files
[19:00:27] <MarkX> theres no physical code yet
[19:00:37] <sjokkis> i have no idea what sort of format they're in so how am i gonna give you a reasonable answer+
[19:00:59] <MarkX> nvm i'll just google >_>
[19:01:08] <sjokkis> i think you just want to use extern
[19:01:14] <sjokkis> but think twice before you do
[19:02:00] <sjokkis> if you just want to extend the scope of message1 to y.c as well, extern it
[19:04:39] <MarkX> okay cool
[20:00:17] <vsync_> hmmmh
[20:00:34] <vsync_> bit of an issue :\
[20:01:23] <vsync_> there was this some a123 puff over here... I'm having trouble choosing some batts for my portable music player-amp combo
[20:02:31] <vsync_> or well, not just a123, think all lifepo4's have a 3.3 V/cell nominal voltage, and the cutoff being as low as 2 V
[20:04:58] <vsync_> now i need to feed a 7805, and drawing ~700 mA out of it, so I can't have the voltage dropping that much. I guess 7805's had dropout on 1 A at 2 V or so
[20:05:47] <vsync_> guess I gotta go li-po then, cause I can get most of the juice out of them while still maintaining an acceptable voltage level... Or any other suggestions?
[20:25:50] <theBear> never use a linear reg on batteries, you doing it wrong
[20:30:03] <R0b0t1> lol
[20:38:52] <Casper> vsync_: all lithium batts have about the same cutoff voltage... but... go with a smps, not with a linear
[20:40:51] <vsync_> can do, but i'll be probably feeding the amp out of a diff line since it's the biggest current sink
[20:40:57] <vsync_> and no, they don't
[20:41:15] <vsync_> lipo's cutoffs are +3V
[20:42:02] <vsync_> not much juice coming out of them anymore at even 3.3 or so
[20:56:35] <Casper> now it's time for you to decide... 1 cell or 2 cells... or more :D
[21:01:32] <vsync_> well i guess the only option really is to go 2s lipo
[21:01:40] <vsync_> cause 3.5V lipo is quite empty tbh
[21:01:43] <vsync_> per cell
[21:02:13] <vsync_> :(
[21:06:09] <Casper> or just go with 1 cell and use a boost converter
[21:06:20] <Casper> or use 2 cells and use a buck converter :D
[21:16:22] <eadthem> ok i like the topic
[21:16:39] <eadthem> i think #c++ needs it as well :p
[21:16:54] <eadthem> has anyone gotten avrstudio 6.x working in wine
[21:17:08] <eadthem> namely the visual studio enviroment that is bugging out
[21:17:25] <eadthem> or what is avalable for linux
[21:17:47] <eadthem> i would greatly preffer something that can simulate a avr chip
[21:29:32] <Casper> eadthem: I killed wine from my system
[21:29:50] <Casper> why not vmware and win7?
[21:29:51] <eadthem> ive nearly masterd it
[21:29:59] <eadthem> i might vmware and windows xp
[21:30:09] <eadthem> but im not wasteing money on windows 7
[21:30:15] <Casper> just use an activator
[21:30:30] <eadthem> ya well i have xp licensese
[21:31:24] <Casper> you know
[21:31:34] <Casper> it's depressing to see how easy it is to pirate windows...
[21:31:46] <Casper> compared on how annoying it is to get a legal one
[21:33:16] <Casper> today I did installed 3 legal win7
[21:33:23] <Casper> had to call that fucking robot 2 times...
[21:36:14] <eadthem> ya think ile stick home on a vm
[21:36:28] <eadthem> throw it 3 gigs of ram it will run ok
[21:36:50] <eadthem> probably 40GB hdd space
[21:37:11] <eadthem> mmm i could give it 8GB ram but it wont use it :p
[21:37:59] <Casper> you know... with the legal way.... enter the 25 digits key... half the time there is a B or 8 that is wrong somewhere...
[21:38:32] <Casper> then 1 time on 4 you have to call ms, give the 46 digits, that they don't ask you anything about, then give you back the 46 new digits...
[21:38:46] <Casper> all that when I could have used an activator and 3 clicks...
[21:42:33] <eadthem> bull i have to relog to become a vbox user
[21:46:23] <Casper> wb
[21:47:05] <eadthem> o ya btw my opinions of wine are visable on http://final.servegame.com/desktop.png
[21:47:52] <Casper> mirc on wine?
[21:48:20] <eadthem> and altho it dosnt show up pandoraclient on wine
[21:48:26] <eadthem> and teamspeak on wine
[21:48:52] <eadthem> as well as the assortment of MMOs and etc :p
[21:48:58] <Casper> ok
[21:49:16] <eadthem> if you keep it up to date it dose well
[21:49:17] <Casper> 32 or 64 bits os?
[21:49:21] <eadthem> if you let it get old it sucks
[21:49:32] <eadthem> 64bit with 32 and 64bit wines
[21:49:55] <Casper> ok
[21:50:05] <eadthem> that said it fails at avrstudio :p
[21:51:58] <eadthem> OOO lol now thats a idea
[21:52:05] <eadthem> i have suse 64 with 16GB ram
[21:52:19] <eadthem> i can run xp IN ram :p
[21:52:36] <eadthem> might acctualy be fast for once