#avr | Logs for 2016-05-11

Back
[06:14:16] <skz81> <LeoNerd> gcc will turn PORTB |= 1 into a SBI instruction >> just tried, with -Ox, x!=0, it does, but not with -O0
[06:17:02] <skz81> With -O0, the behaviour is the one Lambda_Aurigae stated : read, math, write. it make sense, finally...
[06:18:00] <Jartza> mostly you still want -Os anyway
[06:18:17] <Jartza> unless you have a lot of flash to spare
[06:18:59] <skz81> Jartza, you could want to compile a given single file using -O0, maybe ;°)
[06:19:30] <Jartza> maybe, sometimes, but I haven't had that kind of need yet
[06:46:46] <Jartza> I usually anyway check what kind of assembly the compiler generates
[06:46:50] <Jartza> because I'm curious
[09:18:51] <LeoNerd> skz81: Sounds plausible yes
[15:39:43] <liwakura> is there an channel for electrical engineering here?
[15:40:25] <liwakura> just noticed that one of my mains power to 5V switch converters has a capacitor connecting the primary and the secondary site
[15:40:32] <liwakura> s/site/side
[15:42:43] <theBear> what value ?
[15:42:55] <theBear> and what is it conneted either side ?
[15:43:08] <liwakura> on the secondary site, its ground
[15:43:20] <theBear> very possibly just feedback or a legally/standards mandated coupling for CE/similar
[15:43:41] <liwakura> on the primary, its connected via a silicium diode and a fuse to one of the mains pins
[15:44:22] <theBear> silicon , or just regular aka "diode" hmm, what pin ?
[15:44:30] <liwakura> sadly, i can't read the value since the coil blocks the view
[15:45:48] <liwakura> theBear: its like Primary Pin 1 ---- fuse -----|>|--------| |----- Secondary GND
[15:45:50] <theBear> the wha ? diode ? if it's black and silver/white band it probly 1n4??? but doesn't much matter, oh cap, what general size/appearance ?
[15:45:56] <theBear> and what i primary pin 1
[15:46:05] <theBear> active/neutral/gnd
[15:46:12] <liwakura> a second
[15:47:39] <liwakura> so, now. with primary pin im referring to one of the 230V AC pins
[15:47:56] <theBear> yeah, and i'm asking which 230vac pin :)
[15:48:04] <liwakura> random.
[15:48:18] <liwakura> depends on in what direction you plug it in
[15:48:31] <liwakura> euro plugs are symmetric
[15:48:38] <theBear> i'm thinkin yellow cap, maybe 15mm*20mm*4mm, oh, you got those kinda plugs, so active/neutral
[15:48:41] <WormFood> is it possible that it isn't a cap, and maybe some other component?
[15:48:57] <theBear> are the switchers euro or something else ? they got iec input or what ?
[15:49:14] <theBear> yeah picture it up
[15:50:13] <WormFood> There are some components, that are for lightning protection, that looks like a cap. I can't remember the name of the part off the top of my head, but I'd recognize it, if I saw it.
[15:52:10] <liwakura> ugh
[15:52:15] <liwakura> upload needs ages
[15:52:36] <liwakura> here: https://w1r3.net/UnnrWUFW.jpg
[15:54:03] <liwakura> the blue thing is the "cap" in question
[15:54:26] <WormFood> I don't think that's a cap
[15:54:36] <WormFood> I believe that is for lightning protection
[15:54:57] <liwakura> but it also has the ---| |---- symbol below it
[15:55:11] <theBear> WormFood, spark gap
[15:55:12] <WormFood> MOV
[15:55:20] <theBear> is the name
[15:55:23] <theBear> for lightining
[15:55:23] <WormFood> no
[15:55:29] <WormFood> not the part I'm thinking of
[15:55:34] <theBear> tha looks like a 2kv cap
[15:55:38] <WormFood> I know what a spark gap is. I've worked in radio for years.
[15:55:42] <theBear> mov not usually that fat
[15:55:57] <theBear> ptc/mov combo is popualr for damage control mains input protection in lots of things
[15:56:42] <theBear> ahh, black wire is neutral, the psu/board expects polarised mains input, is black wire the one feeding it ?
[15:56:55] <WormFood> you're right, usually they're thinner, but the construction techniques look the same from that picture.
[15:57:09] <liwakura> theBear: since the plug is symmetrical, N and L might be at random
[15:57:10] <liwakura> also
[15:57:17] <liwakura> i googled "electical mov"
[15:57:22] <liwakura> and the picture i found matches that
[15:57:28] <WormFood> L = Line, N = Neutral
[15:57:40] <liwakura> http://i.stack.imgur.com/Vck2Q.jpg
[15:57:43] <theBear> WormFood, colour and dimension really screams 2kv rated err, ceramic? never had to order one
[15:57:43] <aandrew> yep movs are insane
[15:57:55] <theBear> they are ?
[15:57:57] <WormFood> http://p.globalsources.com/IMAGES/PDT/B1001628090/Metal-Oxide-Varistor.jpg
[15:58:01] <aandrew> the only way to test if a MOV is still protecting the cirucit is to hit it with another overvoltage
[15:58:34] <WormFood> so, are we going with, it's a MOV?
[15:58:37] <liwakura> i was just curious because i thought an cap would break the galvanic separation
[15:58:40] <theBear> kh222/mj502, that's in the ballpark i used to see every day, damn i'm rusty ... i do like the guessing game tho
[15:58:43] <liwakura> WormFood: i guess so
[15:58:58] <theBear> wtf would a series mov go to secondary gnd for then ?
[15:59:01] <aandrew> it's definitely a mov
[15:59:06] <WormFood> That's my best guess. Just based on your description, that was my guess.
[15:59:22] <aandrew> if you can pull a part number off it we can verify
[15:59:23] <theBear> i ain't arguing that it a mov, but my question remains
[15:59:28] <WormFood> a cap there wouldn't make any sense in that configuration
[15:59:33] <theBear> i wrote the p/ns needed for voltage just then
[15:59:37] <theBear> oh, wrong pic
[15:59:39] <theBear> woops
[16:00:07] <theBear> i wonder if it very low voltage, some kinda ugly neutral bonding for standard reasons
[16:00:30] <aandrew> usually three on the input, line to gnd, neutral to gnd and line to neutral
[16:00:38] <aandrew> on secondary to gnd though, that's... interesting
[16:00:57] <liwakura> aandrew: sorry, the coil blocks the view in a shitty angle, and its printed with yellow on blue background
[16:00:58] <liwakura> no chance
[16:01:10] <theBear> aandrew, off of what looks like 350vdc or so
[16:01:37] <aandrew> but that defeats the galvanic isolation
[16:01:44] <theBear> what does ac from neutral/gnd mains socket/side to gnd secondary look like
[16:01:51] <theBear> does it claim galvanic ? that's rare
[16:01:55] <aandrew> I guess you could use it as a "holy shit we should never be more than 350V from earth"
[16:02:22] <aandrew> theBear: well no, I'm saying if you have a transformer in your PSU you get galvanic isolation for free
[16:03:17] <liwakura> so, should i assume that the depicted circuit does no galvanic isolation?
[16:03:35] <theBear> but well, i spose in theory with a opto for feedback, but it's seldom needed/useful, tho holding your circuit ground from floating too high ina class 1 or 2 (gnd/double-ins.) circuit canbee wise
[16:03:44] <theBear> why you care anyway ?
[16:03:47] <theBear> re: galv
[16:05:06] <liwakura> connecting multiple power supplies together
[16:05:12] <liwakura> like, common ground
[16:05:15] <liwakura> multiple devices
[16:05:22] <aandrew> theBear: depends on the application really
[16:05:26] <liwakura> and currents over data connections
[16:05:58] <liwakura> if i have two points where i accidentally have some direct connection to mains power, i'll get stuff and maybe myself fried
[16:06:31] <theBear> aandrew, i spose, i was wthinking user-accessible stuff obviously, and/or stuff that plugs to other stuff, say audio r o video
[16:06:40] <theBear> or even serial.similar
[16:06:50] <theBear> liwakura, galvanic != floating
[16:07:02] <liwakura> theBear: elaborate?
[16:07:12] <aandrew> most times I defeat the galv anyway (my circuit ground to a real PE
[16:07:14] <theBear> again, measure ac voltage from neutral to secondary ground,, and i can't elaborate, that's just the way it is
[16:07:47] <theBear> galvanic is a chemical/metal thing, not a voltage/electrical one, well, the chemical side is electrical i spose, but it's not about floating or not
[16:08:06] <liwakura> okay, then i meant floating the whole time.
[16:08:24] <theBear> and a small value cap or a mov above mains voltagelike they usually are is far from a hard link voltage wise
[16:09:14] <liwakura> okay
[16:10:09] <liwakura> theBear: also, its indeed galvanic isolation, not because its chemical, but its because its the same dude who discovered/defined it
[16:10:34] <liwakura> at least thats what wikipedia says
[16:12:05] <theBear> wtf ? and as usual i won't be fully convinced until a real source or two says it
[16:12:27] <theBear> wait, you mean i gotta look damned curiosit y
[16:13:30] <liwakura> just google it
[16:13:38] <liwakura> he.
[16:13:42] <theBear> obviously :)
[16:13:44] <liwakura> what a generic excuse.
[16:13:55] <theBear> what excuse ?
[16:14:08] <theBear> i'm fine with being wrong about stuff, speciallyy if i learn
[16:14:23] <liwakura> i couldn't find a scientific source until now
[16:15:56] <liwakura> also, with "excuse" i was referring to "just google it"
[16:16:11] <liwakura> not something you said
[16:16:22] <theBear> http://www.farwestcorrosion.com/del-overview/ and http://www.planetanalog.com/document.asp?doc_id=528053 seem to agree with me and partiall you
[16:16:27] <theBear> ahh :)
[16:17:16] <theBear> they can still be ground/voltage referenced and even direct connected, but there is a physical break somewhere to achieve a specific desire/requirement, usually corosion-related
[16:17:53] <liwakura> wait, boats do actual galvanic chemical stuff to protect their hulls
[16:17:57] <theBear> tho often that may be more about differing metal contact in circuit not messing up with time as much as perhaps saving a boat from rsting/anti-meal plating
[16:18:06] <liwakura> thats unrelated to galvanic isolation
[16:18:39] <theBear> i've even seen "anti rust device" boxes in cars, which i'm sure aer literally just wires inside, that do the phone-line style "active galvanising" approach to anti corrosion
[16:18:55] <theBear> liwakura, 2nd link, just read into even
[16:19:44] <liwakura> the 2nd is about the isolation
[16:19:48] <theBear> even clearly says that mains/ac CAN pass and still be galv isolated, tho i spose that's the same as a transformer without dc in many ways
[16:19:56] <theBear> sorry first
[16:21:44] <theBear> my point is (in my head at least, i getting wrorse at describing as i learn more) that it's about not contacting metal/conductors somewhere, not strictly about voltage, and apparently particulaly ac voltage.. see that boat one suggests clearly to me that series cap for example can be galvanic isolation still
[16:22:06] <theBear> and i spose caps got no touching parts either side of dialectric
[16:22:39] <theBear> brrr i need to grab a jumped and make a coffee, it's all 10c here,and that's almost as cold as it gets ;)
[16:23:07] <liwakura> theBear: the first link is actually an interesting mixup of both things
[16:23:57] <liwakura> you need floating/isolation between boats so they don't act as electrodes in the saltwater and corrode themselves quickly
[16:24:36] <theBear> no, THIS link is an interesting mixup !~ https://www.youtube.com/watch?v=A4uyN5rQbbU
[16:25:10] <liwakura> im trying to be serious, stop that
[16:25:13] <theBear> annd yeah, same as electro plating/anti plating AND how galvanised gutters "work", but they do it more like a battery of zinc and i dunno, steel ? same idea tho
[16:25:20] <theBear> same with phoen lines being negative voltage
[16:26:01] <theBear> man, every time this clip blows my mindballs
[16:27:04] <theBear> oh wow, animal vs buddy rich, heh, related vids are a scary mix when yer got my youtube habits (mostly bad music and bad cartoons)
[16:28:15] <theBear> i see... if i don't turn the knob, the stove don't heat the water.... something new every day
[23:01:47] <PoppaVic> the night is young, and another Dumb Question arises..
[23:02:41] <PoppaVic> I'm looking into writing a bootloader vs writing an app. Seems fairly straightforward.. Then, I read on avrfreaks that they address ram different. Umm.. Huh?
[23:04:27] <Xark> PoppaVic: You mean a bootloader? I thought they just ran from a different address (and interrupt vectors), and that was required to write to flash.
[23:05:25] <Xark> PoppaVic: I don't think they are radically different than a normal app... You could perhaps take a peek at Optiboot source? https://github.com/Optiboot/optiboot/tree/master/optiboot/bootloaders/optiboot
[23:06:13] <PoppaVic> They coexist in the same address-space. So, I'm just curious which particular insanity infected avrfreaks
[23:06:44] <PoppaVic> ..not like they can't see each other - or you'd have a lovely set of issues
[23:09:09] <PoppaVic> ahh
[23:09:51] <PoppaVic> It may well be the issue was idjits that can't code.. His examples use auto variables. *sigh* OK, that makes me feel much moabetta
[23:16:55] <Xark> Perhaps. From a quick scan of Optiboot Makefile, the main difference I see from normal AVR app are these options (to relocate to bootloader area) -> -Wl,--section-start=.text=0x7d80 -Wl,--section-start=.version=0x7ffe
[23:17:57] <PoppaVic> which is a gimme'
[23:31:53] <WormFood> a bootloader is no different from a regular program. The only difference is the interrupt vectors and address where the code lives.
[23:32:19] <WormFood> I'm also working on a bootloader right now.