#avr Logs

Mar 11 2018

#avr Calendar

12:12 AM nuxil: _ami_, nice. enjoy your new scope :)
12:15 AM Casper: nuxil: almost mine!
12:15 AM Casper: mine is the DS1104Z
12:15 AM Casper: are you going to hack it?
12:25 AM nuxil: i would if i could, but i cant so i shant.
12:25 AM nuxil: got no DS scope.
12:26 AM Casper: I mean _ami_
03:50 AM _ami_: Casper: already hacked it :D
03:50 AM _ami_: its running on blazing 100 Mhz :D
03:50 AM antto: u h4x0r!
03:51 AM _ami_: well, its nothing special.. similar to cracking a license software. :P
03:51 AM nuxil: is it just software hack ?
03:51 AM _ami_: run a keygen and put the serial hack.
03:51 AM _ami_: nuxil: yes
03:51 AM nuxil: oh. nice
03:51 AM _ami_: just software hack
03:51 AM antto: and get stuffed with viruses ;P~
03:51 AM nuxil: run keygen in a vw
03:51 AM nuxil: :p
03:52 AM nuxil: *vm
03:52 AM _ami_: nuxil: there is a link to generate the key.
03:52 AM _ami_: its so simple.
03:53 AM antto: like getting the zombie virus, you just go out, wave yer hands a little, and they come at ya
03:53 AM antto: so simple!
03:53 AM _ami_: http://gotroot.ca/rigol/riglol/
03:54 AM _ami_: antto: windows sh$t has viruses
03:54 AM antto: yeah, and nothing else does?
03:54 AM _ami_: nuxil: btw, u can uninstall the key if you want.
04:13 AM polprog: hey _ami_ !
04:13 AM polprog: morning everyone :)
04:14 AM polprog: https://youtu.be/I8gUyMLyAMU
04:16 AM nuxil: mmm. keygen songs :)
04:17 AM nuxil: Unreal Superhero is best keygen song :p
04:18 AM _ami_: polprog: hello, whats up
04:18 AM nuxil: polprog, https://www.youtube.com/watch?v=m4V3FJHTNHc
04:34 AM polprog: nuxil: ohh yeah! i know this one!
05:13 AM Emil: _ami_: nice!
05:14 AM polprog: i was looking at analog scopes recently
05:14 AM polprog: found some hameg with advanced analog video features
05:15 AM polprog: if i had some spare funds id get it. someone close to me was selling it
05:15 AM _ami_: is it good idea to connect 1R 100W power resistor to PSU for stable output?
05:15 AM _ami_: i am in process of making one.
05:16 AM _ami_: using buck converter and SMPS (PC power supply)
05:17 AM polprog: if you dont exceed 100W
05:18 AM polprog: i've seen a guy use a length of enamel wire in a tub of water
05:19 AM polprog: water needs a shitton of energy to heat.
05:19 AM polprog: a kilo of water needs 4.2 kJ to heat up by 1 deg C
05:20 AM polprog: so that should suffice as a dummy load :)
05:21 AM _ami_: polprog: o yeah. i have seen that video somewhere on youtube.
05:22 AM _ami_: that was pretty clever.
05:22 AM polprog: mikelectricstuff by any chance?
05:24 AM polprog: https://youtu.be/WECW88rJYrE
05:26 AM _ami_: polprog: yeah, that was the one.
05:27 AM polprog: now if only i remembered how to convert between joules and watts
05:38 AM nuxil: polprog, really ? :p
05:38 AM nuxil: joules = watts * seconds iirc :p
05:38 AM polprog: look. noone taught me the physics between electronics
05:38 AM polprog: Volt is a basic unit for me. i know it is sonething over something. but i dont know what :D
05:39 AM polprog: this phones keyboard sucks
05:40 AM nuxil: imagin the triangle. V at top. I and R at bottom.
05:42 AM nuxil: https://upload.wikimedia.org/wikipedia/commons/5/56/Ohm%27s_law_triangle.PNG
05:43 AM nuxil: now replace U with F, I with m, and R with a , and you got newtons formular :)
05:43 AM nuxil: https://bam.files.bbci.co.uk/bam/live/content/z2wbdxs/small
05:43 AM nuxil: :)
05:44 AM nuxil: or this one for https://www.electronics-tutorials.ws/dccircuits/dcp4.gif :p
06:15 AM polprog: nuxil: i know those ;(
06:15 AM polprog: ;) *
06:31 AM Emil: _ami_: wtf are you doing with the resistor
06:31 AM Emil: you mean in series?
06:31 AM Emil: why the fuck would you add impedance like that
06:33 AM Emil: if you need some minimum regulating current then add a constant current source that does it for you
06:47 AM _ami_: Emil: never mind. :P
07:14 AM Emil: _ami_: no I want to know :D
07:14 AM Emil: What were you thinking? :D
07:21 AM _ami_: Emil: i was actually thinking about making a electronic DC load to test my PSU.
07:24 AM Emil: _ami_: yeah but how does that 1R 100W resistor come into play there? :D
07:24 AM Emil: if you want an electronic dc load that's a constant current source ;)
07:26 AM _ami_: probably with pwm/adc MCU, it can act like constant current/volt
07:27 AM Emil: noooo
07:27 AM Emil: horrible
07:27 AM Emil: just take a beefy as fuq mosfet, attach a beefy heat sink with a cooling fan to it and then adjust the current
07:34 AM Emil: a transistor can be easier
07:42 AM antto: beefy mosfet? what if he's vegan?
08:30 AM Emil: Are you discriminating against beefy mosfets? That
08:30 AM Emil: that's racist!
08:30 AM Emil: This is a mosfet #safespace
08:30 AM Emil: all mosfets are welcome here
08:52 AM _ami_: lol
09:28 AM polprog: i bought a sun ultra 1 computer
09:49 AM nuxil: why?
09:50 AM Tom_L: you really don't know???
09:52 AM nuxil: waste of money buying this old stuff. better off putting that money on a piggy jar and get something real usefull equipment that isnt like 25 years old or so :p
09:54 AM Emil: exactly
09:56 AM nohitzzz2: exactly not
09:57 AM nuxil: hey im happy. for once Emil agrees with me :D
09:57 AM nuxil: just kidding :D
09:59 AM nuxil: nohitzzz2, if this was some sort of 20+year analoge lab equipment of some sort. it might not be a bad investment. depens on what your work is. but a computer thats 20+ years old. meh. thats just waste of money imo.
10:00 AM Emil: yeah if you can actually do measurements with it it can be useful but general purpose computing? Into the SER it goes
10:01 AM Emil: There is absolutely nothing to be gained from hoarding old computers
10:01 AM Emil: I know all too well what it leads to
10:01 AM nuxil: :D
10:01 AM polprog: why? for fun
10:02 AM Emil: polprog: what exactly will you be doing with that?
10:02 AM Emil: It's from the late 90s
10:02 AM Emil: It really has no retro feel
10:02 AM Emil: it's just horrible
10:03 AM polprog: Programming in assembly, messing with BSD
10:03 AM nuxil: aand you need a sun ultra 1 for that ?
10:03 AM Emil: Just
10:03 AM Emil: no
10:03 AM Emil: What nuxil said
10:03 AM Emil: you don't need a sun ultra 1 for that :
10:04 AM nuxil: go get a refund :p
10:04 AM polprog: never had a sparc. im interested
10:04 AM Emil: argh :D
10:04 AM Emil: Well
10:04 AM Emil: your money you lost :D
10:04 AM Emil: Still pains me
10:04 AM polprog: not that much money really.
10:09 AM nuxil: i hope you have lots of problems with it.
10:09 AM nuxil: so you learn a lesson
10:09 AM nuxil: dont buy old crap :p
10:10 AM Tom_L: yeah, get gen8 intel
10:10 AM learath: hah
10:10 AM Tom_L: ftw
10:10 AM Emil: 100% agree with nuxil
10:10 AM learath: post-meltdown? :P
10:11 AM polprog: thanks nuxil
10:11 AM nuxil: hehe youre welcome :D
10:11 AM polprog: i have a shitton of x86_64 computers
10:11 AM polprog: just wanted something completely different ;)
10:12 AM nuxil: why you go backwards in time ? isnt arm the future and what you should be investing time in?
10:13 AM Tom_L: nuxil, you could ask that of any human
10:13 AM Tom_L: why DO we go back in time?
10:13 AM learath: ugh. arm. 'we trained him wrong on purpose, as a joke'
10:13 AM polprog: it is, thats why i got stm32 in the first place
10:14 AM polprog: but i like computer history
10:14 AM polprog: if there was a, say, amiga for cheap, id buy it
10:16 AM nuxil: i had amiga500 and amiga2000. cant say that i would use them today even if i still had the,. so they would just sit an occupy space.
10:17 AM polprog: plus. its a 64 bit released 8 years before x86_64 was released
10:18 AM polprog: im just interested. for the same reason i set up a vm with BSD. im just curious
10:18 AM polprog: and its different when you have the hardware running
01:06 PM Emil: https://emil.fi/d/2018-03-11_20-05-22_1DlQmTDg.png <- when you don't give a fuck about the assignment at hand :D
01:07 PM polprog: i know people who would kill you for doing that in C. but i love this and i would do that as well if i could
01:11 PM Emil: https://emil.fi/d/2-binary.c
01:11 PM Emil: added error handling :D
01:11 PM polprog: #include <arpa/inet.h>
01:11 PM Emil: yeah?
01:11 PM polprog: wow i didnt know such an include exists
01:12 PM polprog: didnt write much c for linux
01:12 PM Emil: well
01:12 PM Emil: here's the thing
01:12 PM Emil: the networking files on lenux are a fucking clusterfuck
01:12 PM Emil: I'm 100% serious when I say this
01:12 PM polprog: not very surprised ;)
01:12 PM Emil: And the documentation of what is where and _why_ is like, not really available :D
01:13 PM Emil: So to know if you need something you pretty much just have to look at example code
01:13 PM polprog: wow
01:13 PM Emil: you can't just read man pages and easily write networking code :D
01:13 PM polprog: s/networking/linux
01:13 PM Emil: arpa/inet.h, netdb.h netinet/in.h, sys/socket.h, ...
01:14 PM polprog: luckily i have a book on programming in linux so if i ever need to do so
01:14 PM Emil: the names aren't even logically laid out
01:14 PM polprog: i have some examples right there
01:14 PM Emil: polprog: well sure I can always reference beej
01:14 PM polprog: and i might write something even
01:14 PM Emil: but it's still a clusterfuck
01:14 PM polprog: beej?
01:14 PM Emil: http://beej.us/guide/bgnet/
01:14 PM Emil: the holy guide
01:14 PM polprog: i wonder how posix/bsd implement net
01:15 PM polprog: thanks for the link
01:15 PM Emil: polprog: same thing
01:15 PM polprog: i only wrote some serial handling code using termios and it was pretty much following examples
01:15 PM Emil: you didn't use termios but for setting settings
01:15 PM Emil: serial devices behave like sockets
01:16 PM Emil: well, the file descriptor abstraction is really fucking good
01:16 PM polprog: i know/ its awesome
01:16 PM polprog: oh nice its available as pdf
01:17 PM polprog: yeah i meant termios for setting up instead of ioctls... i said termios since setting up was most of the code. it was just a simple write and read invocation to get a feeling of how that works
01:20 PM Emil: but yeah
01:20 PM Emil: beej is highly recommended
01:23 PM polprog: only network programming i ever did was a telnet like program in java
01:23 PM polprog: when i was 12
01:23 PM polprog: or so
01:24 PM polprog: I'm so certain, in fact, they will be error-free, that I'm just going to put my fingers in my ears
01:24 PM polprog: and chant
01:24 PM polprog: la la la la if anyone tries to claim otherwise
01:24 PM polprog: already love this book
01:24 PM Emil: :D
02:06 PM Ameisen: Emil - I feel like that would be 1000% cleaner _and_ easier to write to have just written a simple inline function or maro
02:06 PM Ameisen: macro
02:06 PM Ameisen: or templated function in C++
02:11 PM Emil: Ameisen: go ahead
02:12 PM Emil: Ameisen: try it
02:18 PM Ameisen: https://pastebin.com/hjZJkU5n
02:19 PM Ameisen: there you go
02:19 PM Ameisen: there's the dumbest way I can think of that's still better
02:19 PM Ameisen: change exit(9) to exit(code)
02:20 PM Ameisen: and read_error(code) to read_error(errcode);
02:20 PM Ameisen: too lazy to type right
02:20 PM APic: Lazyness pwns.
02:34 PM Emil: Ameisen: eh?
02:35 PM polprog: huh so thats how you use templates in cpp
02:35 PM polprog: thanks Ameisen
02:37 PM Jartza: eveningh
02:38 PM nohitzzz2: evening
02:41 PM Emil: Iltaa
02:45 PM Ameisen: I mean
02:45 PM Ameisen: that's one way to use templates in C++
02:45 PM Ameisen: templates are just functional programming syntax
02:45 PM polprog: thanks anyway
02:45 PM polprog: ;)
04:11 PM Ameisen: hmm
04:12 PM Ameisen: just noticed that the ARM Embeded toolchains runtime libraries (libc, libm, libg, etc) consist of regular object files, not fat LTO object files. If they were built as fat LTO, the end program would likely be faster (when built with -flto)
04:38 PM Emil: Ameisen: that would require shipping them all
04:38 PM Emil: in one package
04:38 PM Emil: pretty much
04:38 PM Emil: if I'm not mistaken
04:39 PM Emil: Ameisen: and can't you still lto those regular object files?
04:44 PM Ameisen: you are mistaken.
04:44 PM Ameisen: all the .a is is an archive of object files
04:44 PM Ameisen: you just build the object files with -flto and -ffat-lto-objects
04:44 PM Ameisen: that's pretty much it.
04:45 PM Ameisen: adding those flags would make all of the object files in the archive contain both regular machine code (for normal links) and LTO bitcode (for LTO)
04:45 PM Ameisen: I can probably rebuild all the libs myself. I'd just rather they come distributed that way
04:48 PM Emil: Heh
04:48 PM Emil: I'm trying to break our course submission platform
04:49 PM Ameisen: Technically, having LTO objects in there would make optimization much better, because inlining can occur
04:49 PM Ameisen: since the LTO bitcode is functionally the internal data format of the middle-end
04:52 PM dev1990: Ameisen: are you up-to-date with current state of LTO integration and development ?
04:52 PM Ameisen: in GCC? No, though it appears to be functional.
04:53 PM dev1990: well gcc/clang
04:53 PM Ameisen: clang I presume has much better LTO support as it was built around the premise.
04:53 PM dev1990: I watched some stuff from cppcon like thinlto and other implementation
04:55 PM Ameisen: MSVC had LTO like 10 years before GCC
04:55 PM Ameisen: Sometimes huge improvements, sometimes marginal
04:55 PM dev1990: but I think the better optimalization will come when C++ gain modules
04:55 PM Ameisen: I can't think of a reason not to use it on embedded, certainly.
04:56 PM Ameisen: Modules shouldn't be an optimizatoin
04:56 PM Ameisen: It will make the code cleaner and more sane, but I can't think of any optimization benefits.
04:56 PM dev1990: whole new compilation model will lead to optmalization and performance
04:56 PM Ameisen: I mean, you can use modules _now_ in MSVC.
04:57 PM Ameisen: I'm pretty sure the Microsoft-variant of modules is the one that both Microsoft and the Clang team are supporting
04:57 PM Ameisen: Clang has their own but they have vouched for the MS one
04:58 PM Ameisen: ooh
04:58 PM Ameisen: GCC 7.2 has -fconcepts
04:58 PM Ameisen: meaning... I can write firmware that uses concepts
04:58 PM dev1990: yeah for some time
04:58 PM Ameisen: :D
04:58 PM Ameisen: I wonder if I can combine concepts with __builtin_constant_p
04:59 PM Ameisen: and overload functions based upon whether the argument is constexpr or not
05:00 PM dev1990: hmm I'm more intrested in metaclasses :> I pray for it and dot operator
05:00 PM Ameisen: an overloadable dot operator scares me
05:01 PM Ameisen: though if you aren't using LTO, btw, you should be
05:01 PM Ameisen: there's almost no reason not to
05:02 PM dev1990: well I'm on gentoo should I recompile my whole system with it ?
05:02 PM Ameisen: hmm
05:02 PM Ameisen: _maybe_. IIRC, there were some things in Linux (when I tried to rebuild) that didn't like LTO
05:02 PM Ameisen: 99% chance a problem with the code or something, not with LTO
05:02 PM Ameisen: you can certainly try.
05:02 PM Ameisen: you'll get a linker error if it fails
05:08 PM dev1990: this will improve over time, but well I'm on GCC 7.3 as base system compiller, maybe I'll check
05:08 PM dev1990: I tried when LTO was a introduced as new features and it was disaster
05:23 PM polprog: i read a bit about LTO and i see it embeds some intermediate code to the object. whats that for?
05:25 PM Emil: polprog: so the point is that
05:25 PM Emil: polprog: if you look at all your code you can find similarities
05:25 PM Emil: if you compile file by file you'll get locally optimised code (hopefully) but it's still only locally optimised
05:26 PM Emil: lto allows your compiler to truly make spaghetti code and optimise everywhere
05:26 PM Emil: The resultant code is almost impossible to debug but boiiii you can get perf boosts
05:26 PM polprog: sounds good,
05:26 PM polprog: would debug by blinkenlights :D
06:05 PM Ameisen: sorry, was reading over ARM embedded docs
06:06 PM Ameisen: also fixed some linker problems, saved about 5 KiB of space
06:06 PM Ameisen: in a more constrained version kinda of what Emil said
06:07 PM Ameisen: the compiler copmiles by compilation unit. The optimizer (the middle end) has its own representation of the program.
06:07 PM Ameisen: LTO emits a marshalled version of this representation. When the linker hits, it pulls in all the LTO code from all of the object files, and then optimizes it as one large program file.
06:08 PM Ameisen: Sorta violates the one compilation unit concept of C and C++, but that's dead in the water anyways
06:29 PM polprog: oh.
06:30 PM polprog: makes sense to me now. every day is a learning day :)
06:49 PM MrFahrenheit: man, why doesn't uboot have a binary memory dump
07:07 PM polprog: niters
07:44 PM PepperyPomegrana: Generally, will the respective bit in the GIFR register be set even if sei() is not called?