#avr | Logs for 2016-09-26

Back
[04:41:31] <Levitator> Excuse me, homies. When using inline GNU asm, how to you declare variables which are both input and output? Or do you simply declare them as output?
[04:44:10] <Levitator> Ah. You use the "+" modifier instead of "=".
[04:59:39] <Levitator> What? Why is this compiling when I've put an invalid opcode in it?
[04:59:52] <Levitator> I can type total nonsense, and it just goes "Ok!".
[05:02:22] <Emil> twnqx: the fast charge is negotiated
[05:02:40] <Emil> with just plain old voltage dividers you can make it take 2A MAX
[05:04:06] <Emil> Levitator: Do you compile with -Wall -Werror?
[05:04:34] <Levitator> Ah. I needed to call the function because it was getting pruned by the linker prior to assembly.
[05:04:41] <Levitator> Strange.
[05:04:54] <Emil> twnqx: but the fast charge is poropietari, I have been thinking about reversing it, though
[05:13:32] <twnqx> there two things
[05:13:34] <twnqx> or three
[05:13:52] <twnqx> usb battery charging standard, signaled by shorting D+ and D-
[05:15:00] <twnqx> samsung adaptive fast charge, complex signalling, starts with 9V/xA, falls back to 5V/yA after some time
[05:15:55] <twnqx> qualcomm (I think) fast charge with yet another standard
[05:16:12] <twnqx> oh, and then there's USB 3.1 type C charging
[05:16:21] <twnqx> which goes up to 20V/5A by negotiation
[05:16:59] <twnqx> (yey, 100W, powering a laptop through a USB cable :D)
[05:18:03] <twnqx> i think qualcomm's is called quick charge though
[05:18:13] <twnqx> didn't bother to look up the details
[05:18:55] <twnqx> why to i run into such piles of things i didn't want to know whenever i try to look up a simple detail...
[05:23:24] <twnqx> https://www.maximintegrated.com/en/app-notes/index.mvp/id/5801 is a nice resource for charging schemes :)
[05:25:03] <twnqx> i might simply build a usb connector (a plug
[05:25:25] <twnqx> A plug + A socket) that emulates the charger on the 2.1A port of the power brick
[05:25:32] <twnqx> or fully build it into a cable
[07:21:50] <Levitator> I just spent several hours slowly figuring out that just because the LAS instruction appears in Atmel's "8-bit AVR Instruction Set" doesn't mean that it's in all of their 8-bit mcus.
[07:22:34] <Levitator> But that's because I had to learn GNU inline assembler first.
[07:22:58] <Levitator> Pain in the ass.
[07:24:37] <Lambda_Aurigae> I would think LAS is available in all but the smallest ATTINY chips.
[07:25:08] <Levitator> Do you see it here? http://elecfreaks.com/store/download/mega328.pdf
[07:25:10] <Levitator> I don't.
[07:25:27] <Levitator> Also, linker keeps saying "invalid opcode" for the MCU.
[07:25:35] <Lambda_Aurigae> didn't say it was.
[07:25:38] <Lambda_Aurigae> just thought it was.
[07:25:58] <Levitator> Just wanted to make sure I wasn't missing something obvious, as I seem to do.
[07:27:25] <Lambda_Aurigae> those might only be on the USB chips.
[07:28:36] <Levitator> Some AVRs have integrated USB?
[07:28:42] <theBear> the umm, i wanna say it's not "compiling" just kinda translating, but this modern-tech variables and friendly names and crap in asm land still kinda baffles and makes me a bit uneasy, fortunately i don't use it at the moment. sp o gppd
[07:29:12] <Lambda_Aurigae> hmm..not seeing them on USB chips either.
[07:29:15] <Lambda_Aurigae> Levitator, yes, some do.
[07:29:17] <theBear> yeah, atmega??U? ones all do, and a couple other sub-series/model-no-sets i think
[07:29:21] <Levitator> Interesting.
[07:29:34] <Lambda_Aurigae> am looking at the atmega32u2 datasheet right now.
[07:30:11] <Lambda_Aurigae> aahh..xmega instructions.
[07:30:32] <theBear> personally my only one is a mega32u4 on whatever convenient board the local place had cheap (just cos they don't carry many models including any usb at that time not-already-on-a-dirtcheap-board (generaelly with at least a usb socket and tiny reg and crystal maybe built in for free
[07:31:11] <Lambda_Aurigae> only available on new xmega core...second revision AU, B, and C parts.
[07:31:28] <Lambda_Aurigae> https://en.wikipedia.org/wiki/Atmel_AVR_instruction_set
[07:54:01] <Levitator> I love it when I'm eating, and I accidentally let go of the salt shaker, flinging it into my food and spattering it all over myself.
[07:55:01] <Levitator> Probably a race condition in my brain thanks to whatever jackass does the programming on those.
[08:11:05] <theBear> heh, i think i finally broke mine just enough that the brain ain't never gonna race again, even if i tell it to (with my riding/breaking crop of course :] )
[08:48:52] <_ami_> bulk end points are not allowed on a low speed usb device?
[08:49:00] <LeoNerd> Correct
[08:49:07] <_ami_> usb 2-1.8.1: config 1 interface 0 altsetting 0 endpoint 0x1 is Bulk; changing to Interrupt -- i get this warnings
[08:49:27] <LeoNerd> Yeah, there's quite a lot of things that lowspeed isn't allowed to d
[08:49:27] <LeoNerd> do
[09:08:35] <Lambda_Aurigae> _ami_, technically usb-CDC isn't allowed on usb low speed devices either but everybody broke that spec and patches were put out for all the major OSs to support it.
[09:11:04] <theBear> Levitator, heh whatever lights yer candle... tho i think most people, definately myself, put downthe salt/pepper dispensey whavtevers while eating, cos ya know we too western to get away with chopsticks every night (welll i sure am, lwast in thistown ":)and they callled knife AND fork, and h olding bot in one hand if they fti well, not great\
[09:12:16] <Levitator> I must have chopsticks for sushi, because a fork just seems wrong. Chopsticks drive me crazy for everything else.
[09:16:21] <carabia_> chopsticks are for zipperheads
[09:17:17] <carabia> chinks... gooks...!
[09:18:05] <Lambda_Aurigae> chopsticks are only good if you sharpen them and use them as skewers.
[09:18:23] <Lambda_Aurigae> and sushi should not be eaten...it should be cooked...or used as bait.
[09:19:24] <carabia> agreed
[09:20:10] <Lambda_Aurigae> I only eat two kinds of seafood.
[09:20:12] <Lambda_Aurigae> shark
[09:20:13] <Lambda_Aurigae> and
[09:20:19] <Lambda_Aurigae> tuna from its natural habitat
[09:20:24] <Lambda_Aurigae> (In a can in oil!)
[09:20:50] <carabia> there's plenty "sushi" for people to be eaten found from well-soaked crab traps
[09:21:07] <carabia> fresh tuna is actually way better than its canned counterpart
[09:21:18] <Lambda_Aurigae> naaa,
[09:21:22] <Lambda_Aurigae> well, maybe
[09:21:28] <Lambda_Aurigae> but, most tuna is in a can
[09:21:36] <Lambda_Aurigae> and that stuff canned in water is too fishy for me.
[09:21:42] <Lambda_Aurigae> fish can't taste fishy or forget it.
[09:21:44] <carabia> when i've got the $$ i like buying tuna steaks and serving them with wasabi, it's quite good actually
[09:21:55] <Lambda_Aurigae> the oil at least sucks a lot of the fishy taste out.
[09:22:00] <Lambda_Aurigae> not a wasabi fan here.
[09:22:08] <Lambda_Aurigae> I'm more USA deep south cooking.
[09:22:10] <Lambda_Aurigae> fry it!
[09:22:15] <Lambda_Aurigae> batter dip and fry
[09:22:19] <carabia> well, i like the occasional jambalaya too you know.
[09:22:20] <Lambda_Aurigae> and/or serve with gravy.
[09:22:27] <carabia> and its semi fishy!
[09:22:29] <Lambda_Aurigae> that's cajun..
[09:22:34] <Lambda_Aurigae> not southern.
[09:22:37] <carabia> creole innit
[09:22:43] <Lambda_Aurigae> damned frogs invading the USA.
[09:23:00] <carabia> Hahaha
[09:23:02] <Lambda_Aurigae> creole, cajun, same smell different finger.
[09:23:52] <Lambda_Aurigae> ok. off to worky.
[09:23:55] <carabia> whatever. it's served in the south.
[09:23:59] <Lambda_Aurigae> well, at work...off to do something.
[09:24:12] <carabia> you americans are a funky bunch anyway
[09:24:24] <carabia> i'd vote for trump in a heartbeat
[09:24:44] <carabia> given i was a gringo
[09:31:55] <theBear> you sir, are a afool :) i grew up eating fish as it was cleaned and/or filleted, for MANY years before i ever heard of japan or some of their lovely food bits...and worms/non-swimmers for fresh water/crappy sctreams and cute whitebaits work better anyway, mauybe some burley to relaly rub it in how yer goin t here drop of what goop you got hidden for this kinda thing
[09:33:21] <theBear> ironically those cute scale-model whitebaits you get cheap at the store to replace raw fish as bait, onlt taste good to us for eating after they been fryed (all in one piece, easy-as-balls, and cookerer :)
[09:33:44] <theBear> them little tinyskulls and skellingtons just kinda dissover away
[09:34:04] <theBear> chomp chomp mmmmmm nod 'delicious'
[09:34:29] <aandrew> heh
[09:34:50] <aandrew> I love me some smoked sprats
[09:35:08] <aandrew> and yes, if you catch minnows and fry them whole in some oil it's amazing
[09:35:10] <carabia> better fried
[10:00:07] <Levitator> Don't eat fresh raw fish. You will get worms swimming around in your eyeball. Or worse.
[10:00:18] <Levitator> Sushi fish is frozen first to kill the parasites.
[10:00:54] <Levitator> This software will never be done. NEEDS MOAR INTERLUPS.
[10:02:15] <theBear> no i wont chief wackyhorse, you thinkni wild land animals, kangaroos fer example, my god even farmed certified from yer favourte butcher is hard to swallow if yer ever shot/butchered any wild or even many farmed ones and seen all up in tehre
[10:03:24] <Levitator> "Per Food and Drug Administration regulations, raw fish served in the United States must be frozen prior to serving in order to kill parasites" https://en.wikipedia.org/wiki/Sushi
[10:03:27] <theBear> also, i already got worse, and it ain't gettin better, so ya know, next time if you trying to convince me something non-fictional, pick another threat-of-results to help it stick :)
[10:04:37] <theBear> err, that doesn't kill most (any?) nasties that like living in said dead flesh does it ? and i don't care what those asshats do wiht theirfishes, assuming wiki can be trusted on that one, cos these are my fishes and server not there :)
[10:04:54] <rue_house> if sushi suddently became fatal, 2/3 of the human race would die
[10:05:09] <rue_house> everything is being replaced with a sushi store
[10:05:12] <Levitator> It's not sushi that's dangerous, it's fresh raw fish.
[10:05:29] <Levitator> Which is why sushi is frozen first, and not fished straight out of the water.
[10:06:38] <Levitator> theBear: In case you don't know how to check citations, so it's not what Wikipedia says, but rather the New York Times.
[10:07:39] <_ami_> can i have two interrupt endpoints (in and out) with same end point number?
[10:08:02] <_ami_> it seems to be allowed.
[10:08:45] <Levitator> _ami_: What is that supposed to mean? Interrupt endpoints are fixed by the hardware, unless you are using some library that abstracts it.
[10:10:11] <theBear> i do, even know how to click links and open browsers, heck, i can make brioche and eggs florentine and crepe suzette with just my bare hands and a little heat somehwere, m,aybe a shiny round metal dish for the double-boiler, BUT right now i doing none of those thigns :)
[10:10:46] <theBear> Levitator, you sure it's frozen outside of us food admin law zone ?
[10:11:18] <Levitator> I'm not sure that it's frozen, but it's suppose to be, which is the point of warning you about something that's dangerous.
[10:11:58] <Levitator> If the idea of having maggots eating your brain from the inside appeals to you, then by all means.
[10:12:31] <_ami_> Levitator: i think it depends upon the interface/endpoint descriptor ? btw, http://pastebin.com/dSNW5s4Z
[10:13:11] <Levitator> OH, you're talking about USB.
[10:13:16] <theBear> and if it was even REMOTELY common to find parasites, particularly ones you can't just not-notice for years if you don't look, i would be jam packed with the fuckers, cos like i say, i been consistantly eating the stuff as soon as first few minutes out of the ocean and off a hook, thru to i dunno,much later times when they stilll not seen cold letalone a freezer, at least several times a year, some years a
[10:13:17] <theBear> LOT more, since i was toddlering
[10:14:04] <Levitator> Well, it's good that the brain damage hasn't impaired your grammar or punctuation at all.
[10:14:05] <_ami_> Levitator: yup, usb
[10:15:07] <_ami_> i was wondering on why same endpoint 1 was allowed for both in and out endpoints.
[10:15:24] <Levitator> Only AVR USB I have used is via the Arduino USB bridge which, as far as I know, is transparent and inaccessible from within the device.
[10:15:26] <skz81> <theBear> Levitator, you sure it's frozen outside of us food admin law zone ? >> just check, it is in European Union too, (seems to be depending on fish specy)
[10:15:27] <_ami_> is there any perfomance gain if i use two different endpoint numbers?
[10:16:11] <theBear> heh, spend a few years stunned by the painkillers and similar purposed crap you gotta take at least daily just so you can barely cope with the massive and unending effing pain enough to be half-awake and sometimes able to think quite clearly, rather than feeling like yer trying to read a book of workout some complex logistic deal while a bucnh of hen-night drunk ladies are making noise behind yer, even
[10:16:11] <theBear> being eaten alive from the middle of yer head out, starts to sound attractive so long as yer dead after it done
[10:19:19] * _ami_ checks my keyboard endpoints - different end points for IN and out
[10:19:28] <theBear> Levitator, human mind is quite wonderful and amazing in some ways like your comment there... i bet i could still do college-professor grade grammar/spellcheck of essays or something during that3-4 week period when the eyedropper accidentally gave me WAAAAY toomuch lsd and i couldn't get a whole sentence out in a sane order without stuttering or generally effing it up., to the extent i was thinking hmmm, i
[10:19:29] <theBear> hope i ain't broke me liek this forever, it's a nightmare, can barely express this single thought to anyone else with uselss mouth not talking right for me...
[10:20:03] <_ami_> ah, both are IN
[10:20:47] <theBear> hmmmm.... so among other similar possibles, my recent musings if maybe my health that much worse than usual cos of some parasitey dude holdin my ass back, suddenly doesn't sound nearly as unlikelyas i thought
[11:24:16] <carabia> theBear: are you sure you're not on a chronic lsd trip?
[11:25:10] <carabia> and Levitator needs more pills so he won't end up in the ol' collar
[11:25:38] <Levitator> I'm not a chains and leather kind of guy, really.
[11:26:01] <carabia> you can't say for certain before you lay off the pills
[11:26:09] <carabia> and it's not really chains and leather.
[11:26:36] <carabia> it's more like, hemp and so on.
[11:26:56] <theBear> i'm sure that i been thru lsd related err, situations known for potentially being a bit more permanent than you might have intended, many times over many years now, but i don't think i'm smart enough (specially assuming that were the case) to so completely create all the imaginary bits i see aroound me now, and fool myself that i had recovered and was ya know, not just saying random noises or rocking back
[11:26:56] <theBear> and forth hugging my legs in a paddedd room right now :)
[11:27:27] <theBear> wtf is a ol' collar ? the little white thing ?
[11:27:52] <carabia> context and google are your friends in this one
[11:28:50] <carabia> theBear: in fact i'm a reflection of the bad lsd trip you had
[11:29:20] <theBear> probly, but coming to grips with it likely i ain't in a mood to click/lookup anything thisvevening is something might be you pairs friend here :)
[11:30:03] <carabia> irc and everyone else are most likely reflections of the better trips you had. I should know, as i'm just a figment of your imagination.
[11:30:59] <theBear> hmm, ok, if you wonder why you just got cold, you are now a town/region of watchacallit, transylvania, somewhere that zone, cos if i imagined you, i KNOW that's a place name, and a gothic oldbricks kinda euro one at htat... so err, sorry if yer miss having a body and mind and fingersand stuffs:)
[11:31:06] <carabia> perhaps irc is that special place your mind wanders into when it encounters something truly sinister and goes into full denial (of the padded room, and the rocking back-and-forth)
[11:32:42] <theBear> and i feel they all inherantly good, and that they can't really go bad, even in the face of things that would cause a psychotic break out of pure shock/inability to comprehend that quickly when you were sober or had a couple beers maybe, somehow they make everything all rose-colouredi feel
[11:32:43] <carabia> and all this because of a mere eyedropper and your unsteady hands. Kids, don't do drugs.
[11:35:42] <theBear> not mine, a guy who has often been mistaken for me over the years called errrm, Ivan which is a cool name i think, and he was rock solid, it what the very much alive and crowdey dancefloor surrounding the pair of us to avoid the EXTREMELY grumpy and heavy duty "securiy" staff the venue came with that night... to the extent you'd be peeing in a stall for a moments privacy, literally, not for nautghties, and
[11:35:43] <theBear> the door would kick open after a brief few words warning you to stand back and that you been more than 30 seconds or something just silly, and ongoing thru most of the night
[11:36:11] <theBear> also, don't do drugs, you don't wanna ends up like me, and most people are worse than that !
[11:36:59] <bss36504> Reading messages from theBear makes my brain hurt :P
[11:38:02] <carabia> he's clearly applyin the tried-and-true "troll" method, of either placing commas every two words or then not doing any breaks at all at length
[11:38:26] <theBear> yeah sorry, worse thna usual today and it a rare indulge-myself for a change, but i'm gone *poof* click outsky\
[11:38:42] <bss36504> It's like reading something written by a drunk Christopher Walken
[11:38:55] <carabia> also throw in a few spelling and grammar errors along with obviously erroneous logic, to boot
[11:39:06] <bss36504> somehow simultaneously halting and overly flowing
[11:39:17] <bss36504> I mean it in good fun though :)
[11:39:26] <carabia> bss36504: Haha exactly!
[11:39:35] <carabia> https://www.youtube.com/watch?v=s6LAS5T4FN8 one of walken's best, imo
[11:39:50] <carabia> Though, arguably, this makes a whole lot more sense than theBear
[11:56:54] <Levitator> What the hell kind of movie is this?
[11:57:34] <Levitator> Looks like something that Tarantino would crap out after bing-eating in Tijuana.
[12:12:19] <carabia> it's a better movie than what tarantino's done in quite some time
[12:12:59] <carabia> he's just their murica's most celebrated director no matter what kind of shit he spews out. I don't know, is it his name that's cool or?
[12:13:02] <carabia> -their
[12:13:03] <Levitator> I once made a better movie than Tarantino by knocking my webcam over and filming my desk for two hours.
[12:13:36] <Levitator> I call him Retardantino.
[12:16:00] <bss36504> Hey, Tarantino made some pretty great movies.
[12:17:29] <Levitator> It's a lot of hyper-cynical shock drama with sophomoric writing and infantile dialogue.
[12:17:37] <Levitator> I don't know how anybody can stomach his shit.
[12:20:11] <pwillard> The Howard Stern of filmaking
[12:21:20] <Levitator> Closer to Jerry Springer meets Michael Moore.
[12:21:45] <bss36504> Levitator: isnt that sort of his point though? His movies are successful because of the shock factor, and the satire, and the dark humor.
[12:26:35] <carabia> I think his movies are successful because he knows (well, he used to know...) how to put a nice rolling rhythm on the storytelling
[12:27:13] <carabia> ever after he's been just making more or less gore and movies way too long where he has obviously failed.
[12:28:05] <carabia> nowadays i think he's nothing but hype and gore
[12:28:14] <carabia> but that's just me
[12:30:36] <bss36504> idk, I didnt think the gore in Reservoir Dogs was too gratuitous, not much more than a more recent R-rated action film. Pulp fiction had some bloody scenes, but on the whole wasnt just a hack and slash. Kill bill certainly was, but that was sort of the point of that movie. Inglorious Bastards was (i thought) somewhat gruesome, but to the point that
[12:30:36] <bss36504> it was silly, and Django wasnt particularly gruesome as far as I remember.
[12:33:13] <carabia> pulp fiction, jackie brown and kill bills to an extent are by far the only movies i found worth watching
[12:34:00] <carabia> the storytelling in inglorious bastards is just fubar, probably why it turned out to be so long and rumor has it was supposed to be even longer
[12:35:05] <carabia> actually, i quite liked django too, it was a breeze to watch
[12:35:09] <bss36504> http://i.imgur.com/RuVlyZY.jpg
[12:35:29] <carabia> yeah, that was probably the climax of the movie
[12:35:38] <carabia> too bad you just have to wait two hours for it or something.
[12:36:00] <bss36504> So you like 5/9 of his movies, that's not a bad percentage I'd say, especially since they are pretty polarizing
[12:36:18] <Levitator> Inglorious was one of his least awful movies, and as a result it was just boring instead of being horrible.
[12:36:37] <bss36504> haha
[12:44:23] <carabia> he's made more than 9 movies, sort-of
[12:45:05] <bss36504> I was just counting the ones he directed himself, the "Classic Tarantino" movies
[12:45:42] <carabia> yeah, sure
[12:46:09] <bss36504> I haven't watched even a tiny amount of the others he's contributed writing to
[12:46:41] <carabia> if we go for percentages, i'd say 3/5 of those movies you couldn't really count "polarizing"
[12:48:12] <carabia> the presence of violence in pulp fiction is probably the standard in any run of the mill action movie nowadays
[12:48:39] <carabia> well okay, maybe the head pop in the car :)
[12:49:31] <carabia> jackie brown's very clean production and django's polarization could be only accounted to some nigger-activism, and who cares about that anyway.
[12:50:40] <DKordic> carabia: Can't You go to ##Electronics :P .
[12:51:04] <carabia> DKordic: how dare you
[13:46:40] <ub|k> any special care i should take connecting 3 different things to the same SPI bus?
[13:47:02] <LeoNerd> Make sure all the devices behave nicely (i.e. hiZ) their MISO line when deselected
[13:47:16] <LeoNerd> If any of them don't, the cunning application of a 74'125 might help
[13:51:06] <ub|k> i'm suspecting some interference. basically, there's a beeping noise in the background while the dac is playing
[13:53:56] <ub|k> LeoNerd: don't have any 74125 around, would a 4050 work?
[13:54:42] <LeoNerd> No. The entire point of the 74'125 is that it has an OE pin that makes the output pin hiZ when not enabled
[13:54:49] <LeoNerd> Because this is what MISO lines ought to do
[13:55:18] <LeoNerd> But some not-quite-SPI chips don't do that.. e.g. they'll leave the "DO" line in a permanently driven state
[13:57:32] <ub|k> i'm suspecting the max7221 might be doing something like that
[13:58:27] <LeoNerd> That's one of the primary differences between the 7219 and the 7221 in fact
[13:58:41] <LeoNerd> the 21 is a "true SPI" device which makes DO hiZ when the chip is deselected
[13:59:49] <ub|k> oh, then it's not it
[14:00:57] <ub|k> maybe some part of the circuit is oscillating and making this noise?
[14:02:16] <carabia> a diagram might help, got one at hand?
[14:02:27] <ub|k> carabia: yep
[14:02:28] <ub|k> give me a moment
[14:02:32] <carabia> cause you're not giving much to work with
[14:03:35] <LeoNerd> Got enough decoupling caps on the board?
[14:03:45] <LeoNerd> You can never have too many I find
[14:05:53] <carabia> I think there might be some funny business going on with the amp end
[14:19:51] <ub|k> http://imgur.com/a/Y8J7z
[14:20:35] <ub|k> i hope i didn't make any mistakes transcribing it (hadn't added the DAC yet)
[14:23:36] <carabia> there's no external amp?
[14:23:51] <carabia> also, "beeping", can you be more specific?
[14:24:31] <ub|k> carabia: nope, just connecting to my headphones
[14:25:32] <ub|k> carabia: while dac is playing a sample, there is a constant background noise, a beep well within hearing range
[14:25:50] <ub|k> as soon as it stops, there's no more noise
[14:26:23] <carabia> but it's constant, as in continuous?
[14:26:31] <ub|k> yes
[14:27:06] <ub|k> that doesn't happen if i disconnect the max
[14:28:25] <ub|k> could also be a firmware issue...
[14:32:07] <bss36504> ub|k: if you write a static value into the DAC and dont update it, is the noise still present?
[14:33:34] <ub|k> bss36504: yes
[14:34:06] <bss36504> do you have an o-scope?
[14:35:29] <ub|k> bss36504: nope :/
[14:35:42] * ub|k really should buy one
[14:38:45] <bss36504> Hmm...well, you could try adding more cap to the vdd pins near the DAC, for starters.
[14:39:10] <bss36504> It looks like overall your design is lacking decoupling.
[14:40:33] <bss36504> Ohhhh I bet I know what it is.
[14:40:46] <ub|k> bss36504: yeah, i'm very bad at analog electronics, not surprising
[14:41:10] <bss36504> Hang on let me double check before I say something wrong
[14:43:31] <bss36504> Ok, from what I could glean the MAX7221 uses duty cycle control to control intensity of the segment displays (as opposed to being a linear current sink). Since you lack decoupling near both the segment displays and your dac, some high frequency noise is being introduced into the supply, which you hear on the output of the dac
[14:43:51] <ub|k> wow. that makes sense
[14:44:12] <ub|k> i do have some decoupling next to the MAX
[14:44:12] <bss36504> so stick some .1uf and maybe some 1u or 10u near the segments and you'll probably be ok
[14:46:41] <bss36504> Yeah, but if you look at the charts on page 4 of the MAX7221 datahseet, it looks like at 15/16 brightness, the current draw may be sever 10's of milliamps for 10us. That's not trivial in terms of supply noise in this application. You do have good bulk 10uF caps near your regulator, but really you want to litter your design with 100nF (as a general
[14:46:41] <bss36504> rule of thumb) near anything that might switch on and off, or might be affected by supply noise
[14:47:07] <bss36504> If simple decoupling doesnt work, you'll need to look into some LC filtering of the supply to your DAC.
[14:48:42] <bss36504> Or use a precision reference for VREF that is sourced "upstream" of your regulator, ie closer to the source voltage in, again, with good amounts of decoupling
[14:49:04] <bss36504> theoretically a good DAC should have no trouble with noise if the reference is stable, even if the supply is noisy (within reason)
[14:49:27] <ub|k> bss36504: ok, i'll look into that, thanks a bunch!
[14:49:37] <ub|k> i'll be back in a moment
[14:51:31] <bss36504> the "fun" part of this problem is that the noise is in the audible range, so a simple low pass filter on the output won't work. you'll have to solve this problem at the supply level before it gets to the DAC.
[15:53:56] <ub|k> bss36504: btw, the DAC is not being fed off the regulator. it's 5v
[15:54:09] <ub|k> adding caps so far hasn't helped
[15:54:43] <antto> moar cowbell!
[15:54:49] <antto> i meant caps
[15:54:56] <bss36504> what happens if you leave the 7221 and take the segment displays off?
[15:55:13] <bss36504> ub|k has a fever, and the only prescription....
[15:55:16] <bss36504> is more caps
[15:55:40] <antto> MOAR CAPS
[15:55:55] <carabia> should there be a *shades insertion* somewhere in there bss36504?
[15:56:52] <antto> 'o-o'
[15:58:14] <bss36504> carabia haha maybe
[15:58:58] <carabia> '●-●'
[15:59:10] <ub|k> bss36504: works like a charm if i disconnect the common cathodes
[15:59:28] <carabia> moar caps then
[15:59:28] <bss36504> Try putting a bigger iset cap in there.
[16:00:09] <bss36504> iset resistor, sorry
[16:00:16] <bss36504> my brain switched off for a second there
[16:00:30] <bss36504> like when the power flickers and your computer restarts
[16:01:51] <antto> your computer has a fever...
[16:01:52] <antto> >:)
[16:03:42] <ub|k> bss36504: doesn't help much
[16:04:31] <antto> https://qph.ec.quoracdn.net/main-qimg-11450e55951105b046859cfa26e38ea9-c?convert_to_webp=true
[16:18:32] <ub|k> bss36504: 470uF caps next to both Vcc and Vss of the MAX greatly reduce the effect
[16:18:38] <ub|k> still audible, though :/
[16:21:53] <ub|k> don't have bigger caps than that :p
[16:25:39] <bss36504> did you try reducing the current with a larger iset resistor?
[16:28:07] <ub|k> bss36504: tried 200k instead, no luck
[16:29:09] <ub|k> *2ok
[16:29:14] <ub|k> 20k i mean
[16:33:01] <ub|k> 47k reduces it further
[16:33:09] <ub|k> but it stays, doesn't go away completely
[16:38:54] <bss36504> ub|k: you probably want a large bulk electrolytic like 100uF alongside a ceramic 100nf or something next to the MAX
[16:39:09] <bss36504> in fact, that's what the datasheet says in the applications section
[16:39:57] <bss36504> the bulk electrolytic has a higher ESR so it discharges slowly, but has more energy, whereas the ceramic has a low ESR and can provide decoupling until the electrolytic "catches up"
[16:42:18] <bss36504> How many segments are active at a given time on average?
[16:43:50] <ub|k> bss36504: the only solution i've found so far is putting like 3x 470uF at the DAC's power lines
[16:44:05] <ub|k> and 2x 470uF next to the 7seg display
[16:45:28] <bss36504> 8 segments active at 15mA each is like 120ma, which would cause about 20mV spike on the output of the regulator. The LM1117 doesnt have very good transient response
[16:45:47] <ub|k> bss36504: the regulator is not feeding the DAC
[16:45:56] <bss36504> oh...right
[16:46:08] <bss36504> Where is the 5V coming from?
[16:46:14] <bss36504> either way, not a very great regulator
[16:46:16] <carabia> yeah, what's feeding the circuit
[16:46:29] <ub|k> right now, ISP (USB)
[16:47:00] <bss36504> Ok, well that there might be the issue, you're expecting a wimpy little usb supply to handle 120mA transients without ripple
[16:48:49] <bss36504> I think you need a) 100uF Electrolytic + 100nF next to MAX7221 and next to DAC, and b) 470uF Electrolytic + 200nF ceramic next to DAC.
[16:49:16] <bss36504> right now any ripple on the 5V side gets directly injected into the DAC. There isnt even a regulator to try and compensate for ripples on the supply side
[16:49:36] <bss36504> if you supplied the DAC at 3.3V, even from the existing regulator, you'd probably have better luck right off the bat
[16:50:01] <ub|k> ah, let me try that
[16:50:03] <bss36504> then you'd feed the small signal from the DAC into a proper amplifier if necessary.
[16:55:13] <ub|k> hm... why does the DAC still work even when Vdd is disconnected? :O
[16:56:21] <bss36504> probably has a clamping diode of some sort to prevent Vref from going too high above VDD. It's not nice to supply the device that way
[16:57:10] <ub|k> but they're both disconnected
[16:57:15] <ub|k> Vref and Vdd
[16:58:14] <ub|k> anyway, 3.3 doesn't help, i'm afraid
[17:02:44] <bss36504> Oh both terminals were unconnected? No clue why it worked then.
[17:03:45] <ub|k> btw, another 470uF cap seems to work better than 100uF
[17:03:51] <bss36504> I gotta head home, hopefully you figure it out by tomorrow. I'll check back in
[17:04:09] <ub|k> thanks a lot!
[17:04:19] <ub|k> really appreciate it!
[21:26:51] <ferdna> so how is the debate going?
[21:44:32] <carabia> ferdna: sup?
[21:44:58] <ferdna> carabia, not much and you?
[21:53:01] <carabia> are you bringing murican politics into this?
[21:59:27] <ferdna> carabia, lol... kind of...
[21:59:36] <ferdna> i was just wondering...
[21:59:39] <ferdna> ive never voted...
[22:11:28] <carabia> Tonight's homework assignment is for you to think how could you contribute to this with avrs
[22:11:44] <carabia> and start a fight with a stranger, and lose
[22:14:10] <ferdna> hahaha
[22:23:44] <rue_house> what if the stranger really turns out to be a woos
[22:24:19] <rue_house> wus?
[22:24:27] <carabia> everyone has their breaking point
[22:24:32] <carabia> so you just gotta try harder.
[22:25:32] <rue_house> w?s?
[22:27:01] <rue_house> wait, if your trying to lose and your opponent gives up, WHAT DO YOU DO!?
[22:27:44] <carabia> refer to my last line
[22:29:13] <rue_house> hmm, boiler
[22:29:24] <rue_house> I wonder if its topped up
[23:36:26] <dgriffi> Why won't this code work? http://pastebin.com/WEPM0x5d
[23:50:30] <rue_shop4> well, did you need to call initports()?
[23:50:43] <rue_shop4> cause you didn't
[23:51:58] <sabor> cli/sei in ISRs is dangerous (except you really really know what you do)
[23:53:21] <rue_shop4> oh, why you doing that
[23:54:14] <rue_shop4> yea, you didn't call the port init, so portb is still an input
[23:56:29] <dgriffi> whoops... yes, I forgot to call init_ports()
[23:57:58] <dgriffi> well, now I get faint 440 mixed with 880 continuously... not on/off
[23:59:43] <dgriffi> I'm copying what I see in https://github.com/occamsshavingkit/port-o-rotary, changing stuff so it hopefully works for an ATtiny85