#avr Logs

Apr 04 2018

#avr Calendar

12:17 AM polprog: _ami_: congrats on the fastusbasp ;)
12:24 AM rue_bed: 74xx74 RS flipflop
12:24 AM rue_bed: or a 555
12:24 AM rue_bed: which is also an RS
12:25 AM rue_bed: with perculier fringe case behaviour
12:27 AM polprog: oh i forgot i've got 7474 as well. wanted to see if i could make one outta 7400
12:44 AM Jartza: hello
12:44 AM Jartza: long time no irc
12:52 AM rue_bed: ?
12:52 AM rue_bed: sometimes I dont notice
12:52 AM rue_bed: how long?
12:53 AM rue_bed: polprog, the 555 takes the least board relistate
12:53 AM _ami_: polprog, thanks.
12:54 AM polprog: rue_bed: ill try and see how that 555 works out, and that 7474. I think id go with the 555 eventually but i wanna try everything
12:55 AM _ami_: polprog, is it for the seeedstudio tweet?
12:56 AM polprog: yeah
12:56 AM polprog: rue_bed: tge
12:56 AM _ami_: ah, that pcb board was old.
12:56 AM polprog: there are 4 rue* users, got two irc computers in the shop and two in the house?
01:01 AM _ami_: polprog, i am happy with the fact that i finished fastuabsasp project. finally its a complete project and it does what it claims. :D
01:02 AM _ami_: i thought of selling it on @tindie but quickly realized that there are so many AVR programmers out there. :)
01:03 AM polprog: yours stands out
01:09 AM _ami_: thanks. :)
01:33 AM Jartza: rue_bed: I dunno, haven't been much ircing in last two weeks
02:02 AM zerox2a is now known as saedelaere
04:05 AM ButtMan: Hi
04:45 AM polprog: iH
05:17 AM day__ is now known as day
05:21 AM zopsi_ is now known as zopsi
06:42 AM Sadale_ is now known as Sadale
07:08 AM nuxil: Jartza, Your fan duct, how is it working? got good replys about it performance ?
07:17 AM MrFahrenheit: python's sys.getrefcount also counts the reference the function itself creates... so it will never be less than 2
07:18 AM MrFahrenheit: I kept trying to figure out where the second reference came from when I realised
07:35 AM ButtMan: Im just getting started with the "Xmega-b1 Xplained" and im having trouble finding example code or it. Could someone point me in the right direction
07:43 AM polprog: interesting read:
07:43 AM polprog: https://en.m.wikipedia.org/wiki/Architecture_of_Windows_NT
07:58 AM nuxil: ButtMan, isnt there a getting started guide on microchips site ?
07:58 AM nuxil: http://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=ATXMEGAB1-XPLD
07:58 AM nuxil: at the end of the page.
08:04 AM ButtMan: nuxil, i was looking more at code examples, im quite new to the whole atmel studio enviroment (worked alot in arduino ide) im trying to measure using the ADC but consume as litte power as possible while doing so.
08:06 AM ButtMan: The think i keep getting stuck on is using as little power as possible using the WDT interrup to wake it up from power down mode
08:14 AM polprog: can you paste the source code somewhere?
08:18 AM cehteh: note that the WDT oscillator uses some (little) power by itself, if you can,then you better disable it and wake up from other external sources
08:18 AM cehteh: maybe external RTC with interrupt output, once a second or only at desired times. that will use far less power
08:19 AM Emil: ButtMan: ditch Atmel Studio
08:19 AM Emil: immediately
08:20 AM Emil: polprog: I trusted you to tell people this T.T
08:20 AM ButtMan: Emil: Why?
08:20 AM cehteh: that too :D but well, whatever floats the boat
08:20 AM ButtMan: I dont like it but it seems to be the only IDE to use when using AVR's
08:20 AM Emil: ButtMan: because you are better off without it
08:20 AM Emil: ButtMan: ohmygod
08:20 AM ButtMan: Emil: any alternative?
08:21 AM Emil: here let me push this red pill down your throat
08:21 AM Emil: what if you didn't have to use an IDE
08:21 AM cehteh: makefiles + your favorite editor
08:21 AM Emil: but you could use any of your favourite editor
08:21 AM ButtMan: just use avr dude?
08:21 AM Emil: (which can be an IDE)
08:21 AM polprog: avrdude is also a very useful program :)
08:21 AM Emil: ButtMan: https://emil.fi/avr
08:21 AM ButtMan: But how would i go about compiling the programs?
08:22 AM polprog: if you want a full blown ide, Eclipse has AVR support
08:22 AM polprog: ButtMan: emils link has it all covered
08:22 AM Emil: and https://emil.fi/d/streamer.c
08:22 AM Emil: as example code
08:22 AM polprog: but as i said, go get Eclipse if you want an ide -- avrstudio is getting worse every release
08:22 AM Emil: polprog: it's also nice since nowadays the same process applies to Winshit :D just install bash
08:22 AM polprog: rofl
08:23 AM ButtMan: The guide i used to get the ADC working on the Xplained was https://eewiki.net/display/microcontroller/ADC+Example+for+Xmega before i forget to answer your question
08:23 AM polprog: Emil: or install Linload (linux bootloader that replaces a running NT kernel)
08:24 AM polprog: ButtMan: so your current problem is the WDT interrupt not triggering?
08:24 AM ButtMan: But using your guide i can just program streight in VIM?
08:25 AM ButtMan: polprog: a combination of that and not letting it fully power down
08:25 AM Emil: ButtMan: yes
08:25 AM Emil: ButtMan: you can just use vim
08:26 AM Emil: or emacs
08:26 AM Emil: or nano
08:26 AM Emil: or ed
08:26 AM Emil: or your own
08:26 AM polprog: ed, now thats just cruel
08:26 AM Emil: polprog: ed is the standard editor
08:26 AM polprog: ButtMan: i assume you enabled interrupts?
08:26 AM ButtMan: polprog: when going into power down mode it should go to a few µA but it usally drains hundreds of µA
08:27 AM polprog: ButtMan: that few uA is just for the CPU, the board will take some more power
08:27 AM polprog: for pullups and whatnot
08:27 AM ButtMan: Emil: never heard of "Ed" i mostly use VIM and Nano
08:27 AM Emil: ButtMan: man ed
08:27 AM polprog: ed is a line based editor, good if your terminal is a printer
08:27 AM Emil: polprog: that program is never good
08:28 AM Emil: it's absolute cancer
08:28 AM Emil: I'd rather code my own editor
08:28 AM Emil: than use ed
08:28 AM polprog: Emil: ikr!
08:28 AM ButtMan: then ed it is!
08:28 AM Emil: I challenge thee
08:28 AM ButtMan: :D
08:28 AM polprog: Take some adderall before running it
08:28 AM polprog: xD
08:28 AM polprog: or meth
08:29 AM ButtMan: Thanks for the tip, il probably just stick to nano or VIM
08:29 AM ButtMan: XD
08:31 AM nuxil: notepad++ ftw :D
08:31 AM Emil: ButtMan: but yeah that document should get you running (/avr)
08:31 AM Emil: and for adc
08:31 AM Emil: well
08:31 AM Emil: these are all for m328p pretty much
08:31 AM Emil: but the datashits for xm are also clear
08:31 AM ButtMan: shouldnt be to diffrent?
08:31 AM nuxil: ButtMan, i just use notepad++ on my windoes to edit the sourcecoude on a smb network. then i just ssh into my linuxbox and run the makefile
08:32 AM nuxil: arg. cant type.
08:32 AM ButtMan: teh learning curve has been steep when transitioning from Arduino IDE
08:33 AM ButtMan: Il probaby end up doing the same but using Sublime Text edit
08:33 AM nuxil: i started off with a bare Atiny85 and made my own programmer. never used any ide's :)
08:33 AM ButtMan: nuxil: Im stuck with the ICE
08:33 AM Emil: ButtMan: naw, should be very similar
08:33 AM Emil: ButtMan: order a couple of usbasps from ebay
08:33 AM Emil: like 5
08:33 AM Emil: (also the adapters)
08:34 AM Emil: it'll cost you like 10 usd
08:34 AM nuxil: yea
08:34 AM Emil: or you can do it yourself
08:34 AM nuxil: super cheap chinees stuff. but it works :p
08:34 AM ButtMan: Emil: i have quite a few usb programmers/ debuggers already ;)
08:34 AM Emil: well why did you say you are stuck with ICE?
08:35 AM ButtMan: Emil: Since i have two of them and i want to get my moneys worth :P
08:35 AM Emil: ah
08:35 AM Emil: sure
08:35 AM Emil: avrdude works just fine with ice
08:35 AM ButtMan: Great!
08:37 AM ButtMan: I also got a book "Programming and interfeacing ATMEL AVR Microcontrollers" its nice, but leaves out alot. got any recomendations on books for embedded C?
08:37 AM Emil: you don't need such
08:38 AM Emil: you only need https://www.nongnu.org/avr-libc/user-manual/index.html and the datasheet
08:38 AM Emil: (preferably the Atmel time datasheet, the micoshit version is hard on the eyes)
08:38 AM nuxil: bookmark that page
08:38 AM nuxil: you will need it
08:38 AM nuxil: :D
08:38 AM ButtMan: Thanks!
08:39 AM ButtMan: yeah its quite disapointing what micro-shit has done to ATMEL....
08:39 AM nuxil: what did they do ?
08:39 AM ButtMan: purchased atmel
08:40 AM Emil: well it's understandable
08:40 AM Emil: and they haven't done anything too bad
08:40 AM Emil: I just find it super annyoing that they must break shit
08:40 AM Emil: and break the super fine atmel datasheets
08:40 AM nuxil: thats old news. i thought you ment they did something bad. like change chip production etc.
08:41 AM ButtMan: no they are just not the kind of owners youd like i guess
08:42 AM ButtMan: but thanks for the getting started tips, it has been of much help!
08:42 AM nuxil: i was never into pic's so i cant say if microchip is bad or not. but so far it hasent affected the avr chips "so far".
08:42 AM polprog: got any recomendations on books for embedded C? -- The C Programming Language by Kernighan and Ritchie - good to know the ins and outs not found in arduino, also the libc docs Emil linkied
08:43 AM Emil: nuxil: just because their development platform is not open source
08:44 AM Emil: nuxil: just because the software is cancer
08:44 AM Emil: microshit is cancer
08:44 AM Emil: pics as hardware are pretty good though
08:44 AM Emil: well, relatively
08:44 AM ButtMan: Will check it out, ive done most of my programming in C++ and just recently got into microcontrollers for "real"
08:44 AM polprog: Programmable Interrupt Controller but turns out you can also write your own main()
08:44 AM polprog: :D
08:45 AM polprog: you can use c++ on micros to some extent
08:45 AM polprog: s/micros/avr/
08:45 AM polprog: i dunno about other ones
08:45 AM polprog: stm8 probably not - sdcccp is a c compiler
08:46 AM Emil: you can absolutely use c++ on micros
08:46 AM polprog: also recently the 3 guys apaort from me in #sdcc have been talking in russian to each other xD
08:46 AM ButtMan: polprog: yeah i know, but i want to become a better programmer in general, i work with more hardware then software but i have a huge intrest in software
08:46 AM Emil: It's just that the constructs taht are easily available are not that good for the limited resource environment
08:46 AM polprog: ButtMan: thats exactly my story but backwards
08:46 AM Emil: also C is just better
08:46 AM polprog: how about go?
08:46 AM polprog: or rust
08:47 AM polprog: or forth
08:47 AM Emil: polprog: yes there's support
08:47 AM Emil: forth is quite old already
08:47 AM polprog: maybe some ladder logic :D
08:48 AM ButtMan: polprog: if there is will then you can alway improve!
08:50 AM ButtMan: is it worth programming in asembler, it better than C but is it practical nowadys
08:50 AM polprog: yeah
08:50 AM polprog: theres a whole soft i2c library for avr written in assembly
08:50 AM polprog: http://polprog.net/blog/asm/
08:52 AM ButtMan: polprog: Will check it out! but will stick to C for now!
08:52 AM learath_ is now known as learath
08:55 AM rue_mohr: polprog, my C port of it worked
08:55 AM polprog: i know
08:55 AM polprog: ill have to try it out
08:55 AM rue_mohr: but his asm ver is definitly better
08:55 AM polprog: when i'll be doing something with stm32
08:56 AM rue_mohr: yea, I'm porting it to stm32 now
08:56 AM rue_mohr: wait a min, I did, it worked
08:56 AM polprog: take a break :D
08:57 AM polprog: im looking at lm3914
08:57 AM polprog: led level meter IC
08:57 AM rue_mohr: yes, I did and it did work
08:57 AM rue_mohr: I kept dialing up the speed and it didn't stop working
08:57 AM polprog: im thinking id add an integrator with, say 500ms time and make a level meter
08:58 AM polprog: rue, you just didnt crank it up enough
08:58 AM polprog: time to submerge the stm in liquid nitrogen
08:58 AM polprog: and overclock!
08:58 AM rue_mohr: or use rectangular RGB leds and ahve the peak as a different colour
08:58 AM rue_mohr: maybe on a different 3914
08:59 AM rue_mohr: use the audio in bar mode and the peak in dot mode
08:59 AM rue_mohr: use green for the normal level and hook red/blue togethor on a peak meter, so it comes up white or purple
08:59 AM rue_mohr: AND USE HIGHWAY OFFRAMPS FOR ARMS!
09:00 AM polprog: i was thinking about adding a second 3914 via a shoter integrator and leaking peak detector to add a single "flying" peak bar on each channel
09:00 AM rue_mohr: keep in mind tho LASER EYES ARE __NOT__ CUTE
09:00 AM rue_mohr: but yea, use rgb leds
09:00 AM polprog: evil idea, a level meter that uses those RGB color changing leds. gaaayyy
09:00 AM rue_mohr: no
09:00 AM rue_mohr: real 4 pin rgb leds
09:01 AM rue_mohr: you could even switch the colour the normal uses to show red when its overdrive
09:01 AM polprog: ooo, nice
09:01 AM polprog: good point
09:01 AM polprog: and use this as a CLIP led https://en.wikipedia.org/wiki/Flashtube
09:01 AM rue_mohr: https://www.aliexpress.com/item/50pcs-Rectangular-LEDs-255-Diod-RGB-LED-Diffused-Cathode-Anode-Square-2-5-5mm-Red-Green/32655243116.html
09:01 AM rue_mohr: QUICK BUY
09:02 AM polprog: 3 bucks wow
09:04 AM polprog: i was thinking abou tusing green-yellow-amber-red scale
09:07 AM rue_mohr: pfff, how '85 is THAT
09:08 AM rue_mohr: how much was the 3914?
09:08 AM polprog: or go with a magic eye tube and be full '55
09:08 AM polprog: didnt get it yet
09:08 AM rue_mohr: ah, compare against tiny26 when you do
09:08 AM polprog: probably tiny26 is cheaper
09:08 AM polprog: but anaog is analog :D
09:08 AM polprog: compare against a bunch of bc547 to make differential amps out of :D
09:09 AM rue_mohr: |:| rlly?
09:09 AM rue_mohr: you gonna try out a 555 for a latch?
09:09 AM rue_mohr: and when the hell do you sleep?
09:09 AM polprog: not today. i caught some nasty virus and apart from that im taking abreak today
09:09 AM polprog: tomorrow definitely
09:09 AM rue_mohr: mhmm
09:10 AM rue_mohr: I cant remember how many leds you can charlieplex on a tiny13
09:10 AM rue_mohr: 5 io, -1 for input
09:10 AM rue_mohr: 4.. so 6 leds
09:10 AM rue_mohr: no
09:10 AM rue_mohr: 12
09:10 AM polprog: 12?
09:10 AM cehteh: more i think
09:10 AM polprog: can always drop in a 595
09:10 AM rue_mohr: yea
09:11 AM rue_mohr: 4 points
09:11 AM cehteh: 5 IOs== 50 leds :D
09:11 AM rue_mohr: 4 clockwise, 4 counterclockwise, 2 one way in the corss, 2 the other way
09:11 AM cehteh: err 20
09:11 AM rue_mohr: 4*2+2*2
09:11 AM cehteh: https://en.wikipedia.org/wiki/Charlieplexing
09:11 AM rue_mohr: no, you need an analog input
09:11 AM rue_mohr: so only 4 io
09:11 AM cehteh: ok 12 then
09:12 AM rue_mohr: so 12
09:12 AM rue_mohr: iirc the 3914 is only 10 leds
09:12 AM polprog: thats right
09:12 AM cehteh: you can disable reset :D
09:12 AM rue_mohr: disabling the reset is a bit too commicozie for me
09:13 AM rue_mohr: dont ahve an hv programmer
09:13 AM rue_mohr: polprog, for what its worth
09:13 AM polprog: can always add a post start timeout to be able to catch the reset low - can it be disabled programatically?
09:14 AM rue_mohr: I have a project box with a large pcb and an insane number of leds, and some 4017, and lm3914, to make a scope with
09:14 AM polprog: a scope
09:14 AM rue_mohr: polprog, you can disable reset in software?
09:14 AM polprog: okayy
09:14 AM rue_mohr: you never seen that one?
09:14 AM polprog: rue_mohr: im the one who asked that :D
09:14 AM polprog: iirc you could. or was that JTAG
09:14 AM rue_mohr: use the lm3914 for vert and the 4017 for horiz sweep
09:15 AM polprog: rue_mohr: makes sense. i wanna see that
09:15 AM rue_mohr: I want to do it, sometime
09:15 AM polprog: didnt traverse ~ircjunk
09:15 AM rue_mohr: I oopsed tho
09:15 AM polprog: deep enough
09:15 AM rue_mohr: the leds I bought are *slightly* larger than 0.2"
09:15 AM rue_mohr: so I'm "in the process" of "touching" each of them with the grinder
09:15 AM polprog: hehe
09:16 AM rue_mohr: iirc its almost 1000 leds
09:16 AM rue_mohr: just green ones
09:16 AM polprog: because of the popularity of those in kebab and fast food joints i tend to call all small monochrome LED banners "kebab displays"
09:16 AM polprog: green or amber, best crt colors
09:16 AM rue_mohr: but I got some RGB ones for doing a trigger level on the edge or something
09:16 AM polprog: impressive
09:17 AM polprog: whats the resolution?
09:17 AM rue_mohr: iirc, something like 30x40?
09:17 AM rue_mohr: must be slightly less
09:18 AM rue_mohr: maybe 30x30
09:18 AM rue_mohr: I can check later
09:18 AM polprog: got any pics already or still trimming the leds?
09:18 AM rue_mohr: https://c1.staticflickr.com/4/3139/3013706266_4af41d9bc1.jpg
09:19 AM rue_mohr: its been idle in the box for a while
09:19 AM rue_mohr: https://www.youtube.com/watch?v=tgdM6uO30ds
09:19 AM rue_mohr: heh
09:20 AM polprog: 4017 has the datasheet old enough they include a die picture in it
09:20 AM polprog: wonder why they did that
09:21 AM rue_mohr: so when you spill the bins you can sort them
09:21 AM polprog: heh
09:24 AM polprog: i was thinking how would i make an equalizer or a spectralyzer
09:25 AM polprog: whether the latter one would be a serie of narrow bandpass filters connected to 3914s
09:25 AM polprog: the first one, i need to look at
09:25 AM rue_mohr: I wrote fft code, true 8 bit, runs an m328
09:25 AM polprog: nice
09:25 AM rue_mohr: other than that, you have a LARGE array of bandpass filters
09:25 AM polprog: how much maths is necesary to understand it?
09:26 AM rue_mohr: didn't get into understanding their method a lot, adjusted the HELL outa working code
09:26 AM rue_mohr: code written in '65
09:26 AM rue_mohr: and used by almost everyone today
09:27 AM polprog: i mean, as many as many bands you wanna have
09:27 AM polprog: hohoho
09:27 AM rue_mohr: https://www.youtube.com/watch?v=td7jzhWz-B0
09:28 AM rue_mohr: getting it to work in 8 bit was insane
09:28 AM polprog: http://www.riccardoferri.net/wp-content/uploads/2013/05/2813.jpg at this point they are most likely using a DSP
09:28 AM polprog: ah ive seen that video of yours
09:29 AM rue_mohr: m328, 8 bit right thru
09:30 AM rue_mohr: it dosn't use a proper square root
09:30 AM tpw_rules: rue_bed: what were you basing it off the original fortran
09:31 AM rue_mohr: I did
09:31 AM tpw_rules: can the fortran version of gcc compile to avr?
09:31 AM rue_mohr: I had to go back to the fortran to work out why the codee being used today is SO STUPID
09:31 AM rue_mohr: most of the stupid things were carried thru from the origional fortran code
09:31 AM tpw_rules: did you turn up any meaningful answers
09:31 AM rue_mohr: yes
09:32 AM tpw_rules: my friend is doing a project exactly like this actually lol
09:32 AM tpw_rules: but it's on a swank stm32 with hard float
09:32 AM rue_mohr: lots of things in the modern code are stupid cause they were limitations to what fortran could do
09:32 AM tpw_rules: how fast does it run?
09:32 AM rue_mohr: did you see the video?
09:32 AM rue_mohr: dont recall if I timed it
09:33 AM polprog: rue_mohr: how much C code did it produce
09:33 AM polprog: ?
09:33 AM rue_mohr: iirc its faster than the sample rate I was runnig
09:33 AM tpw_rules: i mean it looks fast
09:33 AM tpw_rules: but yeah that's kinda low bins
09:33 AM tpw_rules: i would be interested in the code
09:33 AM rue_mohr: less the max7219 library
09:33 AM tpw_rules: hm?
09:34 AM rue_mohr: http://paste.debian.net/1018495/
09:34 AM rue_mohr: that much
09:34 AM tpw_rules: oh it's just that loop
09:34 AM rue_mohr: :)
09:34 AM rue_mohr: gtg, work!
09:35 AM rue_mohr: amazing eh?
09:35 AM polprog: nice
09:35 AM rue_mohr: I ahve more generic code for larger types
09:35 AM rue_mohr: and more resolution
09:35 AM rue_mohr: the 8 bit was a take-off of it
09:36 AM rue_mohr: I have a 'blog' of the process of making it, if anyone is into it
09:36 AM polprog: yeah, i can see it uses some imaginary numbers
09:37 AM polprog: would be interested if you have some comemnt to the code
09:37 AM rue_mohr: yes, did you know fortran could only take 1 data array? so they had to mux values to do multiple arrays
09:37 AM polprog: jesus
09:38 AM MrFahrenheit: ugh, so python's c_char_p type which is supposed to represent a char* silently converts stuff to strings, and silently converts it back to a pointer again...
09:38 AM rue_mohr: bye
09:38 AM MrFahrenheit: so str_free(str_alloc()) will have you freeing random python memory causing random crashes
09:38 AM MrFahrenheit: that's just evil
09:38 AM polprog: heh
09:39 AM polprog: didnt know python had pointers
09:39 AM polprog: hell
09:39 AM MrFahrenheit: you have to use POINTER(c_char) instead, and then bust your ass converting it to a string every time
09:39 AM MrFahrenheit: it's the ffi interface, they're not native
10:09 AM Phantom is now known as Casper
10:49 AM Ameisen: Still sad to see almost no AVR code use either [u]int24_t, or varying-size constrained types :(
10:49 AM Ameisen: can make the code so much faster.
10:50 AM Ameisen: polprog - basically every language has pointers in _some_ fashion
10:50 AM Ameisen: their semantics differ though
10:50 AM Ameisen: it's hard to get away from the concept of 'object that points to another object'
10:50 AM Ameisen: as 'object that references another object' is often too limiting for APIs
10:51 AM polprog: i regarded python as a very high level language, and was thinking as pointers being raw memory addresses
10:51 AM polprog: ie ones that you can do ptr arithmetics with
10:51 AM Ameisen: At some level, there are going to be raw addresses.
10:52 AM Ameisen: Since... there have to be
10:52 AM Ameisen: if you require pointer arithmetic, then the definition becomes _way_ more constrained
10:52 AM Ameisen: to me, semantically, a pointer is just a mutable object that points to other objects.
10:52 AM Ameisen: whereas a reference is an immutable object that points to another object.
10:53 AM Ameisen: pointer arithmetic, etc, is specific to the system
10:53 AM Ameisen: and there are certainly architectures out there where pointer arithmetic is UB
10:53 AM Ameisen: because they aren't really integers
10:53 AM Ameisen: lots of odd ISAs have been made over the years that wouldn't neatly fit into von Neumann or Harvard
10:54 AM Ameisen: By my definition, Java's handles are pointers.
10:54 AM Ameisen: mutating them doesn't mutate the object to whcih they point, but rather mutates the pointer.
10:54 AM Ameisen: C# has both
10:54 AM tpw_rules: uint24_t is a thing?
10:54 AM Ameisen: yes
10:54 AM Ameisen: it's part of the GCC extensions for AVR
10:55 AM Ameisen: and is supported in GCC and g++
10:55 AM tpw_rules: huh. i'll have to try it one time
10:55 AM nuxil: you beed to typedef it to that
10:55 AM Ameisen: smaller types are always better on AVR because of its 8-bit nature
10:55 AM Ameisen: since they're all composite
10:55 AM Ameisen: yeah
10:55 AM tpw_rules: yeah i've written avr asm i see the advantages
10:55 AM Ameisen: default I think it's __uint24 and __int24?
10:55 AM tpw_rules: are there any smaller float types?
10:55 AM Ameisen: no
10:55 AM Ameisen: oddly enough.
10:55 AM Ameisen: They have float16 in ARM, not but AVR
10:56 AM Ameisen: it wouldn't be hard to add it
10:56 AM Ameisen: I just don't think anyone is prioritizing it
10:56 AM Ameisen: it wouldn't be hard to add float16/float24
10:56 AM tpw_rules: also counterpoint: pointers are specifically the abstraction of references. a pointer is just a number, only some pointers point to objects
10:56 AM Ameisen: float8 seems useless
10:57 AM nuxil: Ameisen, yea. typedef __uint24 uint24_t;
10:57 AM Ameisen: In some architectures, as far as I recall, you cannot have pointers that don't point to objects - the concept would be meaningless
10:57 AM tpw_rules: what's a null pointer?
10:57 AM Ameisen: not particularly common architectures, though
10:57 AM Ameisen: usually something specifically defined by the ISA in those cases
10:57 AM Ameisen: it's a cocnept more common to the object-oriented ISAs that were in vogue in the 70s
10:57 AM tpw_rules: but those aren't pointers then. they're object references
10:57 AM Ameisen: before people realized it was a stupid idea
10:58 AM tpw_rules: what about common pointers that aren't objects? like to hardware registers, or NULL itself?
10:58 AM Ameisen: You gave more or less the C definition
10:58 AM Ameisen: I'm giving the more broad definition
10:58 AM tpw_rules: i feel the more broad definition is the object reference
10:58 AM Ameisen: which is generally "a mutable value that references a location in memory."
10:58 AM Ameisen: whereas a reference is "an immutable value..."
10:59 AM nuxil: Ameisen, i tried mixing asm and uint24. oddly it used 4 registers. but when i inspect a variable thats just unit24 i see it uses 3 registers. so i whent back to 32but vars. i might have done something wrong tho
10:59 AM tpw_rules: sure i would accept that definition. but previously you said "to me, semantically, a pointer is just a mutable object that points to other objects."
10:59 AM nuxil: asm & C
10:59 AM Ameisen: nuxil - register usage is separate from the language
10:59 AM tpw_rules: not all locations in memory are objects. so i'm somewhat confused
10:59 AM Ameisen: C and C++ for AVR define the size of *int24 as 3 bytes, and the proper value ranges
11:00 AM Ameisen: however, the reduction code in the optimizer and backend for the compiler likely have difficulty with the concept of '3 bytes'
11:00 AM tpw_rules: gcc is kinda weird on avr
11:00 AM Ameisen: all compilers are weird for AVR
11:00 AM tpw_rules: every time i look at the generated asm i find something silly
11:00 AM Ameisen: it's a PITA ISA
11:00 AM tpw_rules: why do you say that
11:00 AM tpw_rules: it's not PIC :P
11:00 AM Ameisen: it has pointers that are larger than the registers. That goes contrary to the optimizer in both GCC and Clang.
11:00 AM tpw_rules: oh
11:00 AM Ameisen: which is why the asm tends to be stupid
11:00 AM Ameisen: there are a lot of hacks in GCC's backend to accomodate this
11:00 AM tpw_rules: yeah that is where a lot of my problems lie
11:00 AM Ameisen: by forcing register pairs (sometimes where it doesn't make sense)
11:01 AM tpw_rules: pic solved that problem ;)
11:01 AM Ameisen: that is why sometimes uint24s are no better than uint32
11:01 AM Ameisen: it doesn't understand how to properly allocate registers for that
11:01 AM nuxil: Ameisen, well. i just found it odd that it would use 4 registers when a uint24 was passed to a asm fnc. but when defined in C it used 3. but that may be due to the mixing,
11:01 AM Ameisen: uint24s will never be _worse_ than uint32 though
11:01 AM Ameisen: so it's always optimal to use them if you can
11:01 AM Ameisen: the inline assembly compiler probably doesn't have a good concept of uint24
11:01 AM Ameisen: umm... if you awnt, you can try giving it a more explicit constraint
11:01 AM Ameisen: though it shouldn't be necessary
11:02 AM Ameisen: if (value > 0xFFFFFF) __builtin_unreachable();
11:02 AM Ameisen: on GCC, that establishes a value constraint and the optimizer DOES use it
11:02 AM Ameisen: in Clang, that doesn't quite work - they have __builtin_assume(conditional) which does
11:02 AM Ameisen: they won't use a branched unreachable for optimization choices
11:03 AM Ameisen: my AVR code is littered with __assume(c)s... which is define'd to that
11:03 AM Ameisen: helps the compiler perform optimizations and better code reduction by making assumptions about values
11:03 AM Ameisen: which is huge on AVR
11:03 AM tpw_rules: what kind of avr code do you write?
11:03 AM Ameisen: 3d printer crap
11:03 AM Ameisen: :|
11:03 AM tpw_rules: i feel like i would just drop into asm at that poin
11:03 AM tpw_rules: oh
11:03 AM Ameisen: though I'm slowly moving towards using ARM for it instead
11:03 AM nuxil: Ameisen, marlin ?
11:03 AM tpw_rules: have you heard the word of our lord and savior stm32
11:03 AM Ameisen: my main project is a fork of MArlin
11:03 AM Ameisen: Marlin itself is horrible C++
11:03 AM nuxil: nice
11:03 AM Ameisen: and generates horrible AVR machine code
11:04 AM Ameisen: tpw_rules - C++, even littered with __assume, is still more readable and maintainable than asm
11:04 AM Ameisen: I've actually gotten rid of some of Marlin's inline assembly
11:04 AM Ameisen: properly written C++ with __assume generated better code.
11:04 AM tpw_rules: yeah that's why i asked the type of project. on something like that you're totally write
11:04 AM tpw_rules: :|
11:04 AM tpw_rules: right
11:04 AM Ameisen: they had specialized code for multiplying certain values and then taking the 'kind of upper 16 bytes'
11:05 AM Ameisen: the 16 bytes of the result of a multiplication below the top 8 bytes
11:05 AM Ameisen: it was faster in C++.
11:05 AM tpw_rules: i hope you mean bits
11:05 AM Ameisen: waaaay more readable as well
11:05 AM Ameisen: err
11:05 AM Ameisen: yeah
11:05 AM Ameisen: sorry
11:05 AM nuxil: lol
11:05 AM tpw_rules: like the middle 2 bytes?
11:05 AM Ameisen: it presumed a 5-byte result.
11:05 AM Ameisen: it was weird code.
11:05 AM Ameisen: so it was basically 01100 >> 2, if everything were bits.
11:05 AM Ameisen: instead of bytes.
11:06 AM Ameisen: it also performed the multiplication and all that
11:06 AM tpw_rules: yeah that's why i would use a cortex m4f :P
11:06 AM Ameisen: C++ just ended up generating better code.
11:06 AM Ameisen: Generally, the compiler can do a better job iif you give it the context to do so
11:06 AM Ameisen: inline assembly tends to be very... 'harsh'?
11:06 AM tpw_rules: i did a whole project in asm for attiny85, but that was a cycles matter
11:06 AM Ameisen: it makes the optimizer throw away a bunch of optimizations, tends to force register purges...
11:06 AM tpw_rules: yeah it bamboozles the compiler a lot
11:07 AM Ameisen: Ideally, every single instruction would also be a compiler intrinsic
11:07 AM Ameisen: which would fix that.
11:07 AM Ameisen: but nobody seems to want to do that.
11:07 AM tpw_rules: maybe it's the use case
11:07 AM Ameisen: it's the approach Microsoft took in MSVC
11:07 AM Ameisen: when doing x86-64 in MSVC, you cannot use inline asesmbly
11:07 AM tpw_rules: what would all that turned off machinery do with some intrinsic nops to meet timing
11:07 AM Ameisen: they instead put almost every instruction into an intrinsic.
11:08 AM tpw_rules: i think that makes sense for their use cases
11:08 AM Ameisen: intrinsic nops would still expand to nop.
11:08 AM Ameisen: you're being explicit.
11:08 AM Ameisen: Honestly, I'd rather the nop intrinsic take an optional argument for _how many_ nops
11:08 AM tpw_rules: whne it's like __builtin__inline__vpqr32fvv_sse
11:08 AM Ameisen: so you don't have like 20 of them
11:08 AM Ameisen: and don't have to write a loop which may or may not be unrolled :|
11:09 AM tpw_rules: but would an intrinsic nop be eaten later by the optimizer?
11:09 AM Ameisen: though honestly, the compiler shoudl be free to emit a loop for a ton of nops _if_ it can prove it's the same number of cycles, just smaller.
11:09 AM tpw_rules: i don't think that would have helped my project though
11:09 AM tpw_rules: but it would be interesting
11:09 AM nuxil: i dont like inline asm. i found it to be weird. i rather write the asm code in pure asm and call it from C.
11:09 AM nuxil: atleast the gcc inline
11:09 AM Ameisen: an intrinsic nop would never be eaten by by the optimizer because you've explicitle emitted one.
11:09 AM Ameisen: explicitly*
11:10 AM Ameisen: raw asm called externally is even worse for size and performance than inline asm
11:10 AM Ameisen: inline asm at least gives _some_ hints to the compiler.
11:10 AM tpw_rules: what if you delineate it at function boundaries?
11:10 AM Ameisen: external asm is a full on function call using the ABI.
11:10 AM tpw_rules: then it's already abi limited. although i suppose the optimizer can't violate the abi. but can it in 99% of cases?
11:10 AM Ameisen: The ideal compilation/link setup doesn't honor function boundaries. They are abstract.
11:10 AM Ameisen: Which is what LTO is for.
11:11 AM Ameisen: Can't really LTO asm though...
11:11 AM tpw_rules: i've tried lto on arm but it broke debugging
11:11 AM Ameisen: since it doesn't generate IL
11:11 AM Ameisen: you don't use LTO for debug builds
11:11 AM Ameisen: LTO is a release optimization
11:11 AM Ameisen: it is guaranteed to end up mangling the program's structure
11:12 AM tpw_rules: i have weird feelings about debug != release, at least on embedded
11:12 AM tpw_rules: but i usually pick -Os -g and accept the mild manglage
11:12 AM Ameisen: embedded is difficult for it.
11:12 AM Ameisen: I've actually managed to get better sizes and performance than -Os
11:12 AM Ameisen: there's -O...g? -Od? can't remember the flag
11:13 AM tpw_rules: by doing what?
11:13 AM Ameisen: which enables only optimizations that don't interfere with debugging
11:13 AM tpw_rules: yeah -Og is optimized for debuggability
11:13 AM Ameisen: tpw_rules - by experimenting with almost all of the GCC optimization/codegen flags.
11:13 AM tpw_rules: but i usually accept them and debug and release with -OS -g
11:13 AM tpw_rules: i've had to do that on avr projects
11:13 AM tpw_rules: -mstrict-X says hi
11:13 AM Ameisen: a big one I did was actually altered the optimizer parameters so that it would expand searches for inlines/etc to be almost infinite
11:13 AM Ameisen: which actually reduces program size quit ea bit
11:13 AM tpw_rules: and -ffunction-sections, -fdata-sections, -Wl,gc-sections
11:13 AM Ameisen: otherwise it restricts it
11:14 AM Ameisen: -ffunction-sections/-fdata-sections is useless with LTO
11:14 AM Jartza: nuxil: it's working with 5015 radial (the adapter is in thingiverse too) pretty nicely
11:14 AM Ameisen: since it makes it work differently
11:14 AM tpw_rules: yeah but like i said i don't run LTO :P
11:14 AM Jartza: with axial, it still needs some improvements
11:14 AM Ameisen: but I do :D
11:14 AM tpw_rules: well i've never tried it on arm
11:14 AM tpw_rules: avr
11:14 AM tpw_rules: :|
11:14 AM Jartza: nuxil: it's made by "form before function" -principle :D
11:14 AM tpw_rules: i haven't tried debugging on AVR either so lol
11:14 AM tpw_rules: how do i turn it on?
11:14 AM Jartza: but I will run some simulations next weekend
11:15 AM Ameisen: https://github.com/ameisen/Tuna-i3-Plus/blob/master/Tuna/rbbuild/gcc_buildhandler.rb
11:15 AM Ameisen: you can see all the flags I tinkered with there
11:15 AM tpw_rules: do you use -mcall-prologues?
11:15 AM Ameisen: No. I have it there in a comment
11:15 AM Ameisen: but I didn't see a benefit.
11:15 AM nuxil: Jartza, i like the design. i got axial fans tho. 2x
11:15 AM Ameisen: call prologues would end up being wrapped in if it were optimal by inlining and LTO
11:16 AM Ameisen: all the --param flags basically tell the optimizer passes to run over the _ENTIRE_ binary
11:16 AM Ameisen: instead of trying to optimize for build time
11:16 AM Ameisen: I found it barely changed build time, but had a substantial impact on the size of the binary.
11:16 AM Ameisen: except for the two I ternary'd out with FAST_BUILD
11:17 AM Ameisen: some make the binary a bit larger though. I was balancing trying to use up my flahs
11:17 AM Ameisen: flash
11:17 AM nuxil: Jartza, err, sorry i got 2x radial fans. i saw someone has modified it for radial tho. but was curiouse how the prints turn out with your fan.
11:17 AM Ameisen: larger isn't always slower - a ton of inlining is way faster but can inflate the binary.
11:17 AM Ameisen: but I do know that tinkering with those settings, you can get WAY smaller than Os
11:18 AM Ameisen: I've been doing similar with my arm project
11:18 AM Ameisen: tinkering with settings
11:18 AM Ameisen: though I'm working on getting a Clang-based embedded toolchain working for that
11:18 AM Ameisen: which... changes things a bit.
11:19 AM Ameisen: Clang is a bit easier to alter so I can add embedded extensions more easily.
11:19 AM Ameisen: by a 'bit', I mean a lot
11:19 AM Ameisen: gcc/g++ are a mess
11:19 AM tpw_rules: nah removing the gc sections and just doing -flto is like 5% wors
11:20 AM Ameisen: well, yeah
11:20 AM Ameisen: I didn't say remove gc sections
11:20 AM Ameisen: I just said function sections/data sections doesn't relaly do much for LTO in my build
11:20 AM Ameisen: because everything gets merged together
11:20 AM Ameisen: gc-sections is still useful
11:20 AM Ameisen: there are other sections
11:21 AM Ameisen: the idea with function/datasections is that functions and data objects are put into their own sections to make it easier to garbage collect. However, LTO keeps everything in IR form, out of sections altogether, then builds them as one compilation unit
11:21 AM Ameisen: so... the concept of 'sections' becomes blurry for that.
11:21 AM Ameisen: It's still there, just... less.
11:21 AM Ameisen: Some stuff stays in sections though, especially compiler-generated stuff. So gc-sections is still useful.
11:22 AM nuxil: Jartza, also why are you useing axial fans? Get a radial one :p radial fans are particularly suitable to displace air in over-pressure situations and ensure a stable laminar air flow in a channel. ;)
11:22 AM Ameisen: LTO/LTCG is an interesting approach to trying to fix the problems of the ancient C compilation system though
11:22 AM Ameisen: which also plagues C++
11:22 AM Ameisen: the other common approach is 'unity' builds, which is what libpng does, IIRC
11:22 AM Ameisen: where you just merge all the source files into one big source file
11:22 AM Ameisen: breaks parallelism in the build something fierce though
11:24 AM Ameisen: The reason I've been working on a Clang-based toolchain for ARM is because I was having ICEs when trying to establish a full LTO pipeline with GCC when building libgcc and newlib
11:24 AM Ameisen: whereas with Clang it just... works.... probably because Clang was built around the concept
11:25 AM Ameisen: whereas gimpl/lto was an afterthought with GCC
11:25 AM Ameisen: though lld has given me some headaches
11:25 AM Ameisen: as compared to ld.bfd or ld.gold
11:25 AM Ameisen: It's _supposed_ to be a drop-in replacement... but it tends to make mistakes.
11:26 AM Ameisen: I've also done a little work on AVR in Clang.
11:26 AM Ameisen: mainly added a few shift optimizations, but not all of them.
11:26 AM Ameisen: There's a ton of sequences that you have to write out ofr all the possible shifts.
11:26 AM Ameisen: if only AVR had sized shifts :|
11:26 AM Ameisen: then you hav eto integrate it properly into reduction code to eliminate redundant ops...
11:27 AM Ameisen: I also added some masking optimizations to AVR's arithmetic so if it _knows_ that certain bytes in a composite integer (like uint32) are zeros, it doesn't operate on them
11:27 AM Ameisen: it wasn't doing that before
11:27 AM Ameisen: GCC does, but GCC has 20 years of AVR optimizations
11:27 AM Ameisen: but isn't being updated anymore for AVR
11:28 AM Ameisen: GCC/g++ maintainers don't seem to care about anything but the major ISAs, and routinely break things/don't check to see if they broke something elsewhere. They also tend to reject patches they don't 'understand', because they're, say, AVR-specific.
11:29 AM Ameisen: the LLVM-Clang maintainers, on the other hand, -want- more architectures, and are way more open about new features.
11:29 AM Ameisen: The toolchain is also a bit more integrated and easier to build
11:34 AM Jartza: nuxil: it can be used either with radial or axial
11:35 AM Jartza: nuxil: and "someone modified" it for radial, the adapter is also in the same page as the fan duct :D
11:35 AM nuxil: nice. im soon out of filament tho.. a week before i get more :D
11:35 AM Jartza: so that someone is me, and it's not "mod", it's adapter ;)
11:36 AM Jartza: there's also adapters for capacitive/inductive sensor, and I'm drawing bltouch & some other adapters to it too
11:36 AM nuxil: i have ordered a bltouch sensor. but since its from aliexpress i guess it will take 1-2 months before it arrives :D
11:49 AM maciejjo_ is now known as maciejjo
12:11 PM MrFahrenheit: my scope has a huge dc offset when it's powered on, and then the offset decreases as it warms up
12:11 PM MrFahrenheit: well, I say huge, it's about 1mV
12:14 PM Casper: just 1mV?
12:14 PM Casper: my analog oscope had about 0.7V
12:14 PM Casper: took about 5 minutes to mostly stabilise
12:15 PM MrFahrenheit: it's fairly noticeable on the smallest voltage range (500uV)
12:15 PM Jartza: nuxil: and if it's from aliexpress, it's probably fake, unless the seller was Tevo
12:16 PM Jartza: IIRC Tevo is the only aliexpress seller with original
12:16 PM nuxil: i know
12:16 PM MrFahrenheit: they clone clones?
12:16 PM Casper: if fake and announced as genuine, report it
12:16 PM Casper: ali need a massive cleaning, but nobody report
12:17 PM MrFahrenheit: or actually, the tarantula looked original, most other printers in that range seemed to be copies of prusa
12:18 PM MrFahrenheit: can't blame them, the original is super expensive, like $750
12:21 PM MrFahrenheit: speaking of aliexpress, nobody on there will ship to me using china post, just dhl :S
12:21 PM MrFahrenheit: funny seeing $100 items with $750 shipping
12:34 PM Casper: lol
12:34 PM Casper: where are you that china post do not deliver to?
01:03 PM MrFahrenheit: Casper, they do, it's just that it's not an option given to me on most aliexpress items
01:04 PM MrFahrenheit: I contacted them about it once and they said the sellers are responsible for setting that
01:04 PM MrFahrenheit: so I told them that makes no sense, most ebay items work fine
01:04 PM MrFahrenheit: I'm guessing it's a bad default that no one bothers correcting
01:19 PM Ameisen: as said earlier, radial fans are high pressure, axial fans are high volume
01:19 PM Ameisen: radial fans don't much particularly much air, but generate high pressure that can go through channels/ducts/stuff. Axial fans suck at that because they are low pressure, but in open situations can push far more air.
01:19 PM Ameisen: they also make high-pressure axial fans, but I am unsure of the specifications of them and I suspect they're still lower pressure than radial fans.
01:39 PM Casper: MrFahrenheit: or you are in a country with lots of fraud or postal issue
01:54 PM MrFahrenheit: Casper, you sound like the aliexpress support girl :P - it's ONLY an issue on aliexpress, I order stuff from china every fre days
01:54 PM MrFahrenheit: *few
02:15 PM nuxil: i found support on ebay to be good. i only have only bought 2 things from aliexpress from tevo. no never had the need for support there "yet"
02:16 PM Casper: stuff from china take 5-8 weeks to come, and the aliexpress refund for no delivery expire after 45 days
02:16 PM nuxil: :\
02:17 PM Casper: at the 44th day I contacted them, they urged me to fill a complain toward all the sellers
02:17 PM Casper: saying it was within the 30 days delivery garanteed...
02:17 PM Casper: truth is, it was not, they closed my account because they twisted my arm to fill the complains...
02:18 PM Casper: I told them that all I wanted was an extention as they will come, they said to fill a refund claim
02:19 PM Casper: they all came but one, the only one I wanted to make a complain because I knew the seller was a scammer (ali couln't contact them, account was closed)
02:19 PM nuxil: hmm on ebay you do it the other way around.
02:20 PM nuxil: you contact seller 1st. if you cant resolve it then contact ebay support with "cant resolve issue with seller"
02:20 PM nuxil: and they will step in
02:22 PM MrFahrenheit: Casper, banggood stuff arrives much faster than most china shipments, try them out
02:22 PM MrFahrenheit: 3 weeks compared to 5-8 on ebay
02:23 PM MrFahrenheit: although stuff I order on ebay can arrive fast, but that's random
02:39 PM Ameisen: ugh
02:39 PM Ameisen: wife invited her friend from NJ here for the week
02:39 PM Ameisen: the house is a complete mess
02:39 PM Ameisen: while she's out taking her to some stores, I'm cleaning the house
02:40 PM Ameisen: I feel like crap... moving so many boxes into the attic. Heavy.
02:40 PM Ameisen: also moving stuff into my little office/workshop
02:40 PM nuxil: so thats what it takes to make you start cleaning :p
02:40 PM cehteh: while you still have time for IRC :D
02:41 PM antto: decoy wife - unleashed
02:42 PM antto: why no C/C++ allowed in nekkid functions :~(
02:44 PM Casper: MrFahrenheit: the problem is the canadian customs
02:44 PM Casper: I beleive they purposelly delay every single shipment that do not have a tracking number to the door
02:44 PM Casper: by 3-5 weeks
02:45 PM nuxil: Casper, lol. a friend of mine has the same teory about the custom here :p
02:45 PM nuxil: Conspiracy theory
02:45 PM Ameisen: What's a good, low-latency photocoupler
02:45 PM Ameisen: been seeing a bunch on Amazon, but their latencys are like 10-20us
02:46 PM Ameisen: [14:41:20] <antto> why no C/C++ allowed in nekkid functions :~(
02:46 PM Ameisen: because naked functions don't have a prolog, and thus cannot set up a stack.
02:46 PM Ameisen: solution: Have your naked function call a C++ function that is marked as always inline.
02:46 PM antto: hm
02:47 PM antto: i'm trying to apply this: https://www.avrfreaks.net/forum/soft-c-avrgcc-monitoring-stack-usage?page=all
02:47 PM antto: and i only used the C version of the code, cuz i don't like/understand asm
02:47 PM Ameisen: There's no way that the C/C++ version should work.
02:48 PM Ameisen: a naked function cannot have local variables.
02:48 PM Ameisen: the inline asm version works because it's very explicit.
02:48 PM MrFahrenheit: has anyone here packaged a library for linux before? one that didn't use autotools
02:48 PM Ameisen: MrFahrenheit - 'sorta'
02:48 PM Ameisen: my ruby scripts and stuff can build for linux, but they don't generally package things
02:48 PM MrFahrenheit: it seems autotools does so many things I now have to do manually
02:48 PM Ameisen: I very much dislike autoconf and automake
02:49 PM Ameisen: so I have my own toolsets
02:49 PM antto: yeah, i read that just now, avrgcc says that C won't work in nekkid functions, only "basic asm" (not even "extended asm")
02:49 PM Ameisen: correct
02:49 PM antto: but i want to modify this a bit
02:49 PM Ameisen: as said, you can call an always inline function, which will set up a rudimentary stack for you
02:49 PM Ameisen: but that might break how it works
02:50 PM antto: the canary value.. i want it to come from a #define STACK_CANARY 0x55 (or whatever)
02:50 PM MrFahrenheit: Ameisen, how important are so version numbers and soname? cause rust (or rather cargo) can't set it so I have the option to skip them and just have a libfoo.so or use patchelf to set the version manually
02:50 PM Ameisen: Don't know. I don't normally deal with those things :|
02:50 PM Ameisen: I'm not usually packaging things are libraries, but rather as full things
02:50 PM Ameisen: and usually only a few people are using them, so versioning has yet to be an issue
02:51 PM Ameisen: Linux is somewhat of a PITA for me to target, generally
02:51 PM MrFahrenheit: that's my problem, seems like 99% of libraries have it done for them with autotools
02:51 PM Ameisen: it's a much more fragmented ecosystem for development than Windows or OSX
02:51 PM Ameisen: I mean, there's no reason you cannot do it without autotools
02:51 PM Ameisen: you can version thing syourself, set up your own system
02:51 PM MrFahrenheit: it's not hard to target linux if you just do it the windows way and dump everything to /opt
02:51 PM Ameisen: I'm not super familiar with how Linux handles versioning
02:51 PM Ameisen: I know how Windows does.
02:52 PM MrFahrenheit: the hard part is following the rules, which is opposite of fragmentation
02:52 PM Ameisen: Linux handles it sometimes better, sometimes worse, in my experience.
02:52 PM Ameisen: the problem is that if you follow the specific rules that work everywhere, you very much restrict yourself.
02:52 PM Ameisen: :|
02:52 PM Ameisen: I wasn't aware that autotools handled versioning. In what way?
02:53 PM Ameisen: does it set a version in one of the elf headers of the binary?
02:53 PM MrFahrenheit: it's not really hard, it's just I'm packaging a rust library so the rust part is making it hard
02:53 PM Ameisen: ah
02:53 PM Ameisen: well
02:53 PM Ameisen: packaging a rust library shouldn't be any different than C or C++ on that end
02:53 PM MrFahrenheit: well the soname is the issue
02:53 PM Ameisen: once it's linked, it's functionally just a binary.
02:53 PM Casper: nuxil: the conspiracy theory is actually very plausible, the gouvernement talked many times about how china cause problems and want to stop it
02:54 PM MrFahrenheit: https://github.com/rust-lang/cargo/issues/5045
02:54 PM Ameisen: can't you inject soname yourself?
02:55 PM Casper: and since canada post would be responsable for late shipment if it is tracked, those pass right throught. Those with no tracking get delayed. I know for a fact that they do release them in batch.... Might be because the customs actually pass throught the lot, or maybe because they ends up saying f* it we need space and just opass it...
02:55 PM MrFahrenheit: it's a bit awkward, but there is a way
02:55 PM Casper: but I got 3 weeks worth of delivery the exact same day
02:55 PM Ameisen: objcopy should be able to do it
02:55 PM Ameisen: since it has --remove-section and -add-section
02:56 PM MrFahrenheit: I was hoping to skip it, but looking at my /lib folder, almost every library has it so I gotta follow
02:56 PM Ameisen: heh
02:56 PM Ameisen: you should look at my ruby scripts
02:56 PM Ameisen: 'hoping to skip it' isn't a phrase that I know.
02:56 PM Ameisen: :|
02:57 PM Ameisen: It's a full parsing system that collects the environment, sets it up, figures out which source files are being built, builds the dependency trees for them, analyzes the dependencies to see hwat needs to be rebuilt, compiles, links, packages.
02:57 PM Ameisen: all in a rather small ruby script
02:57 PM Ameisen: really fast, too
02:57 PM Ameisen: probably can be made to work for Rust
02:57 PM Ameisen: handles C, C++, and asm right now, using either GCC or Clang
02:58 PM Ameisen: only thing it doesn't do is scan .vcxproj if you are building from Visual C++, because while I have a C++ library that will parse a vcxproj, I am not willing to write that in Ruby.
03:00 PM MrFahrenheit: rust has a build system (cargo) and it can compile and run rust files during compilation
03:00 PM Ameisen: In this case, it sounds like Cargo is incomplete, though.l
03:00 PM Ameisen: My build system exists mainly so I can run arbitrary toolchains using arbitrary tools
03:00 PM Ameisen: like building AVR and ARM binaries using Visual C++
03:00 PM MrFahrenheit: for example, there's a bunch of libraries that have a dsl that gets compiled to rust using one line in the cargo build.rs file
03:01 PM MrFahrenheit: useful for parser generators and such
03:02 PM Ameisen: ah
03:02 PM Ameisen: my ruby scripts can sorta do that
03:02 PM Ameisen: haven't really needed it.
03:02 PM Ameisen: my MIPS emulator _does_ do that
03:02 PM MrFahrenheit: neat
03:03 PM Ameisen: part of the build process is building and running a simple C++ tool which includes the same headers that define the instructions to emulate. It uses the same data to build a new C++ source file with some tables and also generates a function that, if provided with a 4-byte MIPS instruction, will go through a nest of switch statements to find which instruction it is.
03:03 PM Ameisen: substantially faster than using something like unordered_map
03:04 PM Ameisen: rebuilds the table when it detects that the source headers are newer than the generated file
03:05 PM Ameisen: more to the point, though, I don't usually like language-specific build systems
03:05 PM Ameisen: what if my project has C, C++, assembly, rust, ruby, and python?
03:05 PM Ameisen: my build script don't car.e
03:05 PM Ameisen: it just hits the right toolchains for every file it detects.
03:06 PM MrFahrenheit: yeah it can get in the way
03:06 PM Ameisen: (that it recognizes)
03:06 PM Ameisen: of course, afaik there is currently no ruby->machine code compiler I'm aware of
03:06 PM Ameisen: I've been considering writing one
03:07 PM Ameisen: so, I wouldn't presently know exactly how to write a toolchain file for ruby
03:07 PM MrFahrenheit: oh, what would you call a function that gives you a string representation of an object?
03:07 PM Ameisen: I guess I could write a simple C++ file that executes the ruby script...? and embed the script in the binary?
03:07 PM Ameisen: dump
03:07 PM Ameisen: marshall
03:07 PM Ameisen: to_string
03:08 PM Ameisen: serialize
03:08 PM Ameisen: depends on the purpose
03:08 PM MrFahrenheit: I called it device_description, but it doesn't actually take a device object, but a descriptor object... but calling it descriptor_description looks wrong
03:08 PM Ameisen: if the string representation is in a specific format... usually you would call it 'to/as_format'
03:09 PM MrFahrenheit: descriptor_string, descriptor_text, descriptor_name, no idea
03:09 PM Ameisen: get_description / get_descriptor
03:10 PM MrFahrenheit: I guess string is the way to go, since it is just the string version of it
03:10 PM Ameisen: though note that generally, if you have a to_string
03:10 PM Ameisen: you have a from_string as well
03:10 PM Ameisen: that's the problem with primitive conversions is that people generally expect to be able to reverse it
03:11 PM Ameisen: rather than a function that is implying that it is extracting information
03:12 PM MrFahrenheit: in a normal language, yeah, but this is a c api
03:20 PM MrFahrenheit: gonna package this tomorrow, gotta package the library, the cli tool and the python wrapper
03:20 PM MrFahrenheit: then convince polprog to test it with his rigol
03:20 PM MrFahrenheit: cause if it doesn't work, I wasted my time
03:23 PM polprog: Ill try to make it work
03:23 PM polprog: ;)
03:23 PM polprog: Luckily or not.. I have some extra free time now
03:24 PM MrFahrenheit: I actually found out yesterday that NI VISA works on linux too :P
03:26 PM polprog: Got anything to read about VISA?
03:26 PM polprog: Im curious
03:27 PM MrFahrenheit: not really, just seems like everyone uses it cause it's there
03:27 PM MrFahrenheit: doesn't seem like it has a great API, and it seems very bloated for what it does
03:37 PM MrFahrenheit: polprog, would you rather test the rust version (need to install rust to compile it) or the c version (probably has bugs, but seems to mostly work) or do you want me to send you a binary instead (might wipe your drive and steal your credit card info)
03:43 PM polprog: Send me both C and rust version, i did something small with rust so i think ill manage
03:57 PM MrFahrenheit: they're completely different
03:59 PM polprog: Ah
03:59 PM polprog: So youve written two separate programs for one thing?
04:02 PM polprog: Ideally youd push it to github, where i could fork it and then create a separate repo with my remote screen gui
04:02 PM MrFahrenheit: well I wrote the c one, then I.. ehm... REWROTE IT IN RUST *confetti*
04:03 PM polprog: Now rewrite it in go. And dont forget the blockchain this time ;)
04:03 PM MrFahrenheit: lol, no generics
04:03 PM polprog: lol
04:04 PM MrFahrenheit: also, I'm only gonna push it to github after I know whether it works with rigol
04:04 PM polprog: Sure
04:04 PM MrFahrenheit: cause it's getting renamed if it only works with siglent scopes :P
04:04 PM polprog: Hehe
04:05 PM MrFahrenheit: also, I still gotta write the kernel module
04:05 PM MrFahrenheit: then you'll be able to just cat&echo with the scope
04:05 PM polprog: Wow
04:06 PM polprog: Like, echo arbitrary VISA commands whatever that is?
04:06 PM MrFahrenheit: scpi, but yeah
04:06 PM MrFahrenheit: technically the current linux driver would let you do that, but it sucks
04:07 PM polprog: Hmm scpi looks simple enough but its designed for such a broad field of instruments..
04:08 PM polprog: That its really notl warranty it will work with XYZ out of the box
04:12 PM MrFahrenheit: here's the rigol command set http://int.rigol.com/File/TechDoc/20151218/MSO1000Z&DS1000Z_ProgrammingGuide_EN.pdf
04:12 PM MrFahrenheit: it's much nicer compared to the siglent one
04:14 PM polprog: Is this the command set which allows you to grab screenshots, or im mixing things up here?
04:14 PM polprog: I can see this allows you to set and read most parameters
04:14 PM MrFahrenheit: yep
04:15 PM polprog: DISP:DATA ?
04:16 PM MrFahrenheit: yes, that should give you a BMP file
04:16 PM polprog: Hm m
04:16 PM polprog: Guess ill have an interesting day tomorrow
04:17 PM MrFahrenheit: with a small header that has to be removed
04:17 PM polprog: If i wake up able to function
04:17 PM polprog: ;)
04:17 PM MrFahrenheit: the siglent equivalent is SCDP?
04:17 PM MrFahrenheit: annoyingly, the siglent only supports BMP, they could have sped up their remote interface so much by supporting PNG
04:18 PM polprog: True
04:18 PM polprog: Even at 10 fps. PAIN
04:18 PM MrFahrenheit: the BMP file is 750k, and the scope only has a 64 byte usb buffer, so it takes ~0.5s to transfer the data
04:19 PM polprog: Ouch
04:19 PM polprog: 64 byte
04:19 PM MrFahrenheit: yeah, I have no idea why that was done, but there you go
04:19 PM polprog: The siglent or rigol one?
04:20 PM polprog: Well i guess an easier way to have a live gui, would be just for measure stuff. AllMeasure window on rigol takes half of display with 2 channels enabled ...
04:20 PM polprog: Ill see
04:20 PM polprog: Definitely has a lot of potential
04:21 PM MrFahrenheit: the siglent has a 64 byte buffer, and only the new model I have, the older one has a much bigger one
04:22 PM polprog: Ehh. Ill see tomorrow
04:22 PM polprog: Night
04:22 PM MrFahrenheit: night
05:03 PM Ameisen: but yeah
05:03 PM Ameisen: what's a good, cheap low latency photocoupler
05:03 PM Ameisen: Amazon has a bunch of PC817cs, but 10-20us is too slow for me
05:09 PM Tom_itx: https://www.mouser.com/datasheet/2/414/OPI1266_D-1291502.pdf
05:11 PM Tom_itx: 6N135 6N136
05:11 PM MrFahrenheit: I was about to say 6n135
05:12 PM MrFahrenheit: 4n25 also seems to have fast rise/fall times
05:14 PM Ameisen: https://www.sifive.com/products/hifive1/ - neat
05:16 PM cehteh: ah yes
05:16 PM cehteh: risc-v gains a lot momentum
05:16 PM MrFahrenheit: still find it funny that they got the kernel to run on it before there was even a chip capable of doing that
05:17 PM Ameisen: No FPU, though.
05:17 PM cehteh: not for that price
05:17 PM Ameisen: I can get a Cortex-M4 with an FPU for that price
05:18 PM cehteh: thats not the point
05:18 PM Ameisen: 128Mbit of flash
05:18 PM Ameisen: 16 MiB of flash is quite a bit.
05:18 PM cehteh: ARM has 30+ years advantage
05:19 PM cehteh: risc-v is aboout open hardware/source it will take a lot time and money to catch up
05:21 PM Ameisen: To be fair, an FPU is an FPU
05:21 PM Ameisen: it's a fairly interchangeable part. Just have to interface the rest of the CPU with it.
05:21 PM Ameisen: the actual function of the FPU doesn't really change - they all follow the same spec.
05:21 PM Ameisen: mostly.
05:22 PM cehteh: not exactly
05:24 PM cehteh: floating math is somewhat standadized, but the register model on '87 chips and modern intel archs is quite unique
05:26 PM Ameisen: true
05:27 PM Ameisen: but if you are doing ARM development, you could probably just take the circuitry for an M4 or M7 FPU, and integrate it into a RISC-V chip, hook it up right with the instruction parser et al, and it should just work
05:27 PM Ameisen: you shouldn't need to design a whole new FPU
05:27 PM Ameisen: I was disappointed that RISC-V didn't just require an FPU
05:27 PM Ameisen: it's going to end up being a _very_ fragmented ecosystem
05:43 PM MrFahrenheit: they're targeting the microcontroller and the cpu market
05:44 PM MrFahrenheit: honestly, if they just make a platform that has discoverable peripherals, it would be better than arm for me
06:28 PM rue_mohr: so? anyone try the fft code?
06:30 PM rue_mohr: zlog
06:30 PM rue_mohr: clog
06:31 PM MrFahrenheit: worse than facebook
07:52 PM mulvane_ is now known as mulvane
07:52 PM pebble`_ is now known as pebble`
07:52 PM nux_ is now known as nuxil
09:09 PM eszett_: how can I check if my atmega32u4 is dead or not?
09:10 PM eszett_: it doesn't asnwer while trying to initialize it with avrdude
09:10 PM eszett_: jeez..
09:12 PM Tom_itx: did you try flip?
09:12 PM Tom_itx: or dfu
09:14 PM eszett_: I'm using the command line "avrdude -c usbasp -p m32u4"
09:15 PM eszett_: and it says target doesn't answer, but the chip got the 5v power it needs
09:15 PM eszett_: ah, you recommend using dfu instead?
09:15 PM eszett_: wait..
09:15 PM Tom_itx: it comes with a bootloader ya know
09:16 PM Tom_itx: unless it got erased
09:16 PM Tom_itx: you don't even need a programmer to program it
09:18 PM eszett_: ye, theoretically.. but I'm not sure there is a bootloader on it, or if it got erased. The prob is target doesn't answer..
09:18 PM eszett_: (there are certain batches without bootloader ex factory)
09:27 PM eszett_: I can't set fuses with dfuprogrammer right?
09:27 PM eszett_: So I need a connection via my USBasp and avrdude anyway
09:27 PM Tom_itx: no
09:27 PM Tom_itx: or some isp programmer yes
09:27 PM eszett_: to set clock speed fuses correctly
09:27 PM eszett_: That's why I'm still stuck with USBasp+avrdude
09:27 PM Tom_itx: i've never fiddled with fused on a U chip honestly
09:28 PM eszett_: it's not hard, if the chip would asnwer =)
09:28 PM Tom_itx: i know, just never needed to
09:29 PM eszett_: I have a more general question, which person do I have to contact If i need help with debugging circuits? Is there any profession?
09:30 PM Tom_itx: rue's pretty good at it
09:30 PM eszett_: ok that's via internet.
09:30 PM eszett_: but in real life?
09:31 PM Tom_itx: no idea where you're at
09:31 PM Tom_itx: but i'd ask rue anyway
09:31 PM eszett_: ok.. I will thanks for the hint
09:38 PM eszett_: The weird thing is, the chip doesn't really need much to answer on a USBasp call: it doesnt need a working crystal, nor any decoupling caps, just the 5v voltage, and the connection SCK, MISO and MOSI, that's it. So after checking all that, I'm about to believe that the chip itself is defect. Maybe I should desolder it and replace it by a new one..
09:38 PM Tom_itx: it does need a xtal i believe
09:39 PM Tom_itx: i'm not entirely sure the U chips have internal clock
09:39 PM Tom_itx: never really thought about it because i've always used a crystal
09:40 PM eszett_: ye vthey have a internal clock, its bad but for USBasp still enough
09:40 PM Tom_itx: ok
09:40 PM eszett_: err.. sufficient I mean
09:41 PM Tom_itx: used chips?
09:41 PM Tom_itx: maybe it's been disabled
09:41 PM Tom_itx: in lieu of an external clock
09:41 PM eszett_: What I really miss with those chip is a self-testing signal, like a short voltage peak on pin xyz, so that you can check if it says "I'm alive"
09:42 PM eszett_: I mean you don't want to desolder and resolder.. this is work
09:42 PM eszett_: its enabled by default
09:42 PM Tom_itx: i never changed fuses after adding a crystal
09:43 PM Tom_itx: you sure?
09:43 PM Tom_itx: i haven't read the pdf so i'm asking...
09:43 PM eszett_: ye because else you couldn'T talk to it setting fuses
09:43 PM eszett_: I set fuses and did all that before, with another circuit that worked fine
09:43 PM eszett_: but this one here is somehow... flawed or faulty or whatever
09:46 PM Tom_itx: ok, do you get a pulse on the xtal1 pin?
09:46 PM Tom_itx: that's a valid test
09:47 PM Tom_itx: err xtal2 maybe
09:48 PM Tom_itx: that may have to be enabled
09:48 PM eszett_: hmm good question.. let me check
09:48 PM Tom_itx: P5 pdf
09:48 PM Tom_itx: says it may need to be enabled for output
09:48 PM Tom_itx: xtal1 might show something
09:49 PM Tom_itx: although it's considered input
09:49 PM Tom_itx: xtal2 is considered output
09:49 PM z999: hi Tom_itx
09:49 PM z999: you have a lot of diffferent handle names
09:50 PM Tom_itx: no
09:50 PM Tom_itx: just a couple
09:50 PM Tom_itx is now known as Tom_L
09:50 PM eszett_: on XTAL2 I get something like 30Hz
09:50 PM Tom_L: kinda slow
09:50 PM eszett_: ye..
09:51 PM Tom_L: that could just be noise too
09:51 PM eszett_: it isn't noise, but it's really too slow.
09:52 PM eszett_: hmm, I check the Hz on a breadboard circuit with the same atmega32u4 chip. that should be working
09:52 PM Tom_L: check a good one
09:52 PM Tom_L: compare the results
09:52 PM eszett_: ye )=
09:53 PM Tom_L: breadboards are noisy
09:53 PM z999: brb
10:04 PM eszett_: jeez... it's hard to get jumper cables longer than 30cm
10:41 PM rue_mohr: easy to get crimpers
10:42 PM Ameisen: harder to crimp effectively.
10:42 PM rue_mohr: not with the right crimpers
10:42 PM rue_mohr: I got a set and ahve ends, whe I need custom stuff I do my own
10:43 PM rue_mohr: its easy, but takes more time than buying them
10:46 PM eszett_: Ye, however.. I need to use relieable material, can'T afford risking do-it-yourself "hope it works" stuff. finally, found some 50cm long ones and ordered from aliexpress..
10:53 PM _ami_: finally i have completed my diy bench power supply project. : https://pbs.twimg.com/media/DZ-uahOUQAA0koi.jpg
10:54 PM _ami_: https://pbs.twimg.com/media/DZ-ubrkV4AE58qO.jpg
11:00 PM Casper: no you did not
11:00 PM Casper: 2 pots need to be fixed
11:02 PM _ami_: Casper, yes. i should cut the tabs
11:03 PM Casper: and fill in the plastic void, and somehow color match it!
11:03 PM Casper: ... I might be a bit too much of a perfectionist
11:03 PM _ami_: :)
11:03 PM _ami_: it was getting late yesterday (3 am) and i wanted to finish it asap. :P
11:04 PM _ami_: it took me 2 days (time after office & family time) to finish this. probably 4-5 hrs of work.
11:09 PM _ami_: btw, Casper , that yellow button is for discharging caps :D (22 ohms/2W load is attached, black taped Perf board)
11:11 PM Casper: tonight is a very costly night for the power compagny
11:12 PM Casper: in this region, 33 290 clients on 764 316 have no power right now
11:12 PM Casper: with 167 different blackout
11:12 PM Casper: so atleast 167 faults to find
11:12 PM Ameisen: hmm
11:12 PM _ami_: why is there blackout? storm?
11:13 PM Casper: high wind
11:13 PM Ameisen: maybe we should band together, and design RISCV-8/RISCV-16
11:13 PM Ameisen: or simple RISCV-32 chips for embedded
11:13 PM Ameisen: to outcompete AVR and ARM
11:14 PM _ami_: Ameisen, hire me! :D
11:34 PM day__ is now known as day
11:49 PM Casper: Ameisen: with a fast multichannels 14+ bits ADC and DAC