#avr Logs

Nov 05 2017

#avr Calendar

12:19 AM Xnke: Hello, folks
12:22 AM Xnke: anyone here use the ATmega8U2 with the Arduino IDE?
12:22 AM Xnke: I can't find any info on using it for more than just the USB controller...
12:22 AM Tom_L: pretty tiny to use for much of anything
12:22 AM Tom_L: not much else will fit really
12:22 AM Xnke: all it has to do in this application is receive 4800 baud serial data once a second, pluck out the time and date, and spit it back out as 9600 baud RS-232 data to my display module
12:22 AM Xnke: the display is a nice 20x2 line VFD, that measures 12"x2"
12:23 AM Xnke: it just happens to speak RS232, 9600 baud. I have a handful of Skytraq GPS modules, and three Atmega8U2's laying around
12:24 AM Xnke: the 8U2 doesn't really need to have the bootloader onboard, I just haven't done any AVR work outside of Arduino.
12:24 AM Tom_L: take a look at LUFA
12:24 AM Xnke: And to be honest-I don't even really need the USB interface
12:24 AM Tom_L: i think it may barely fit on it
12:24 AM Tom_L: it comes with a bootloader by default
12:25 AM Xnke: I mean, optiboot is supposedly 512B, that would leave 7.5K to work with
12:25 AM Tom_L: if you program it with ISP you will likely overwrite it
12:25 AM Tom_L: you can program it with the bootloader using FLIP or DFU programmer via the USB port\
12:26 AM Xnke: if it was a 16U2 or 32U2 it would come with it-but it seems the 8U2 is not preprogrammed?
12:26 AM Xnke: not 100% sure on that yet though
12:26 AM Tom_L: hmm i though all the U chips came with it
12:26 AM Xnke: yeah-I have only found two people that seem to say it doesn't
12:27 AM Xnke: Like I said-I really don't need the USB part of it, sparkfun was having a fire sale on these at 95 cents each...so I have a few
12:27 AM Xnke: I just don't think the project warrents the use of a ATmega2561, which is the other AVR I have on hand
12:28 AM Tom_L: http://www.avrfreaks.net/forum/atmega8u2-programming
12:28 AM Tom_L: Yes. All Atmel USB chips come pre-loaded with DFU - just attach an 8MHz or 16MHz crystal.
12:28 AM Xnke: Ok, so in this case
12:28 AM Xnke: I can't use Arduino to code it, but it does come with a bootloader
12:28 AM Tom_L: take HWB low and pulse reset to enable the bootloader iirc
12:29 AM robinak is now known as robink
12:29 AM Xnke: oops
12:29 AM Xnke: Look at post 7 in that thread, Tom
12:30 AM Tom_L: well dean would know
12:30 AM Tom_L: he wrote LUFA
12:30 AM Tom_L: he also wrote a special version that would fit on the 8
12:30 AM Xnke: Is dean ABCminiuser?
12:30 AM Xnke: or Clawson?
12:31 AM Tom_L: abc
12:31 AM Tom_L: dean camera
12:31 AM Xnke: ah, ok
12:32 AM Xnke: seems like I oughta grab a 16U2 or 32u2 I guess, dunno what I'll do with these 8U2's then
12:33 AM Xnke: I think my code would easily fit in 8k, but I don't have the experiance to really feel sure about what I'm doing outside of using the Arduino IDE to program.
12:33 AM Xnke: (Haven't used avrdude outside of arduino, that is)
12:34 AM Tom_L: well you won't if you use the bootloader
12:34 AM Xnke: right, but if I use the bootloader, I'm down to 4K for prgram
12:34 AM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/boards/USBTiny_Mkii/USBTiny_Mkii_User_manual_index.php
12:34 AM Tom_L: that explains the process
12:34 AM Tom_L: i made some programmers with 32u2 chips
12:35 AM Xnke: unfortunately, I have one of those-libUSB is a nightmare to work with
12:36 AM Xnke: Hopefully it's not needed...
12:36 AM Tom_L: it's been quite a while since i messed with em
12:36 AM Xnke: yeah-windows 8+ and LibUSB, and libCUSB, do not get along at all, it seems
12:37 AM Xnke: lots of internet complaints, and I never could make it work-I use my only real Uno as an ISP 90% of the time
12:37 AM Xnke: works great 90% of the time, too
12:37 AM Tom_L: ahh yeah you gotta be careful with that
01:05 AM day__ is now known as daey
02:44 AM JanC_ is now known as JanC
03:00 AM rue_mohr: so, a usbasp is like $1.50 from the internet
03:00 AM rue_mohr: so, why...
03:00 AM rue_mohr: are people going to such lengths to program an avr?
03:31 AM antto: xmega
03:52 AM polprog: because usbasp is crap and most of them dont work due to old firmware
03:54 AM Darkmoon_UK: Anyone know why Atmel Studio would still be flagging common ‘int’ types as an error even though I’m clearly importing stdint and everything compiles ok?
03:54 AM Darkmoon_UK: It just looks like a bug… or maybe JetBrains’ IDE’s have spoiled me with… you know… always working.
04:00 AM Darkmoon_UK: Turns out simply navigating to the stdint.h file and back again fixed the error…
04:04 AM polprog: mayb i should not be generalizing
04:05 AM polprog: the $1.50 USBASP they buy from ebay is crap
04:05 AM polprog: normal usbasp works well
04:05 AM Lambda_Aurigae: polprog, the usbasp is great..the software that comes on them is crap...
04:05 AM Lambda_Aurigae: unless one tries it on one of the many usb ports in which it won't work.
04:06 AM polprog: This small one is crap, they never work: http://allegro.pl/programator-isp-usbasp-asp-avr-arduino-tasma-i7025054773.html
04:07 AM polprog: the ones with bare PCB (probably different vendors in shenzen) with newer fw are good
04:07 AM Lambda_Aurigae: well there's your problem.
04:07 AM Lambda_Aurigae: it's all in polish!
04:08 AM polprog: ebay is non-existent in here
04:10 AM _ami_: polprog: normal usbasp always have worked great.
04:11 AM _ami_: its just the ebay seller gave it a bad name.
04:11 AM polprog: that's what i mean
04:11 AM polprog: but most people in my opinion buy the cheaper one
04:12 AM Lambda_Aurigae: they work except for the ones with the software that makes them not work when a chip is running too slow.
04:22 AM antto: mine is https://www.reprap-france.com/sites/default/files/styles/prod-fiche/public/externals/457e0d29286fe820a612028b57ef958e.png?itok=cYimIg6d
04:23 AM polprog: is that a full size usb socket?
04:23 AM _ami_: antto: u could make one DIY avr programmer. its not that HARD :)
04:23 AM polprog: i made my first programmmer from a couple of resisotrs and a db25 plug
04:24 AM Lambda_Aurigae: my first one was based on a 74ls244....I still use it.
04:24 AM antto: it stopped working properly, so i made myself an stk200, then i figured the USBASP is probably running an old firmware and there's newer, so i flashed it - the problem didn't go away
04:24 AM Lambda_Aurigae: a d
04:24 AM Lambda_Aurigae: and it's like 15 years old.
04:24 AM _ami_: wow!
04:25 AM antto: when you plug it the computer goes nuts
04:25 AM polprog: Lambda_Aurigae: nice
04:25 AM _ami_: antto: your programmer does not have make usb.. how do plug it to PC?
04:25 AM _ami_: male* USB
04:25 AM antto: linux registers the device as being plugged and unplugged randomly, and sometimes it can't get its device type/brand/model stuff
04:26 AM Lambda_Aurigae: antto, could be the hardware usb interface....some used resistors, some used zeners...depending on how it was dnone, it could be causing an electrical short.
04:26 AM antto: windows just does ding.wav dong.wav and throws error dialogs
04:26 AM _ami_: basically usb enumeration is failing
04:26 AM Lambda_Aurigae: v-usb used 3 different methods of getting the 3.3V levels needed on usb connection.
04:26 AM antto: thing is.. it used to work on the same computer when it was "new"
04:26 AM Lambda_Aurigae: run at 3.3V, some resistors, or zeners
04:26 AM antto: it just *suddenly* started to not work
04:27 AM Lambda_Aurigae: I've seen the zener method screw with usb ports.
04:27 AM Lambda_Aurigae: and the resistor method screw with others.
04:27 AM Lambda_Aurigae: v-usb is a hack after all and just barely meets most of the spec for low speed usb.
04:28 AM _ami_: antto: check if usb pullup is correctly working on your programmer.
04:28 AM antto: _ami_ it has the same USB port as you have on a USB host
04:28 AM _ami_: ok
04:28 AM antto: so i have the funky cable that has the same USB connectors on both ends
04:28 AM Lambda_Aurigae: usb A to A
04:29 AM Lambda_Aurigae: I have a pic programmer like that.
04:29 AM Lambda_Aurigae: had to make a cable by cutting two cables and splicing them together.
04:29 AM antto: _ami_ what pullup?
04:29 AM _ami_: pullup at D- line
04:30 AM Lambda_Aurigae: antto, internally...there should be two zeners and one pullup resistor...or three resistors...two inline and one pullup.
04:30 AM _ami_: 3.3v --- 1.5k --- D-
04:30 AM _ami_: oh, its usbasp ? :P
04:30 AM _ami_: damn,
04:30 AM Lambda_Aurigae: that's what it looks like to me _ami_
04:30 AM Lambda_Aurigae: specially as it says USBASP in bold letters across the front.
04:30 AM antto: Lambda_Aurigae near the USB socket, i see two diodes in MELF or miniMELF package, which seem to have some blue marking instead of the usual black marking
04:31 AM antto: and some tiny passive components around them
04:31 AM _ami_: oh yeah, sorry, i missed it.
04:31 AM Lambda_Aurigae: those would be 3.3V zeners.
04:31 AM Lambda_Aurigae: there should also be a resistor from D- to VCC.
04:32 AM Lambda_Aurigae: it's what denotes the thing as being low speed usb.
04:32 AM _ami_: antto: you could try making your own avr programmer. if you have a 'blue-pill board'
04:32 AM _ami_: https://github.com/amitesh-singh/FASTUSBasp
04:32 AM _ami_: i plan to add usb to serial support soon into this programmer.
04:32 AM Lambda_Aurigae: I still prefer the stk200 style parallel port programmers...they just work.
04:33 AM antto: nono, i'm not planning to be using USBASP
04:33 AM antto: it's equivalent to "dead" in my book
04:33 AM Lambda_Aurigae: I should get the dev system in the shop fired back up and finish the pic16f1454 based avr programmer.
04:33 AM antto: even if i fix it - it works unreliably and it can't do xmega at all
04:33 AM Lambda_Aurigae: single chip, no crystal needed to get usb connection working..
04:34 AM Lambda_Aurigae: and it's great for pissing off AVR purists.
04:34 AM antto: the stk200 works.. for atmegas
04:34 AM Lambda_Aurigae: yeah.
04:34 AM Lambda_Aurigae: not so good for xmega
04:34 AM Lambda_Aurigae: but, have never had one of those here.
04:34 AM _ami_: one question guys, - usbasp programmer can program xmegas ?
04:34 AM antto: https://i.imgur.com/EMZzUdq.jpg
04:34 AM antto: _ami_ no, it can't
04:34 AM Lambda_Aurigae: _ami_, I think there was a version of usbasp firmware that did.
04:34 AM _ami_: oh, okay.
04:35 AM _ami_: oh, cool
04:35 AM Lambda_Aurigae: not sure how well it worked.
04:35 AM * _ami_ googles
04:35 AM antto: xmegas are PDI, not ISP
04:35 AM Lambda_Aurigae: I seem to remember seeing it.
04:35 AM Lambda_Aurigae: https://gearfoxblog.wordpress.com/2016/05/29/usbasp-with-pdi/
04:36 AM Lambda_Aurigae: first hit for google of usbasp pdi
04:36 AM antto: i know about this
04:36 AM Lambda_Aurigae: usbasp also doesn't do the tiny tiny chips...the ones that use TPI
04:36 AM _ami_: https://ketturi.kapsi.fi/2013/05/programming-xmega-with-usbasp-avrdude/
04:36 AM antto: it's like a big hack, and i'm tired of hacks
04:37 AM Lambda_Aurigae: I have a Tom_itx programmer if I ever need to use those.
04:37 AM Lambda_Aurigae: v-usb is a big hack....has been from the start.
04:37 AM _ami_: Lambda_Aurigae: usbasp does TPI programming too.
04:38 AM _ami_: i can see tpi.c/.h files in usbasp firmware code.
04:38 AM Lambda_Aurigae: stk200 works with the attiny85 and atmega1284p chips that I use so I'm good with what I have.
04:38 AM antto: stk200 works with the atmega2561 i use, so i'm fine also ;P~
04:38 AM antto: https://i.imgur.com/EMZzUdq.jpg <-
04:39 AM polprog: paralell programers ftw
04:39 AM antto: my dell optiplex has parallel port ;]
04:39 AM Lambda_Aurigae: years and years ago when rue_mohr was first starting in AVR he made these little circuit boards that fit in a db25 hood and used a 74ls244 chip to make an stk programmer
04:40 AM antto: wut they do exactly?
04:40 AM Lambda_Aurigae: 2 sided board that you slid between the pins of the db25 connector and soldered on then soldered the chip in place.
04:40 AM Lambda_Aurigae: antto, what does what do?
04:40 AM Lambda_Aurigae: 74ls244 is just a buffer chip.
04:40 AM antto: the 74ls244 stuff
04:40 AM Lambda_Aurigae: protects your parallel port from shorts and such.
04:41 AM antto: ah, i think i used some low-ohm resistors in series
04:41 AM Lambda_Aurigae: https://sites.google.com/site/emrirc/avrstuff
04:41 AM Lambda_Aurigae: bit safer using a buffer.
04:41 AM Lambda_Aurigae: 74244 or 74125...74125 is smaller.
04:41 AM antto: oh, the buffer takes VCC from the target
04:42 AM Lambda_Aurigae: I've built them to take it from the parallel port too..that's what mine does.
04:42 AM antto: mine is fully passive
04:42 AM Lambda_Aurigae: https://sites.google.com/site/emrirc/avrisp-unbuffered.gif
04:43 AM Lambda_Aurigae: I've also just stuffed wires into the parallel port for a quick makeshift programmer on the fly.
04:44 AM Lambda_Aurigae: also made a few that took power from the ps-2 keyboard port.
04:44 AM polprog: that's how my first one looked like
04:45 AM Lambda_Aurigae: used to have these parallel-ethernet adapters that had keyboard power cables.
04:45 AM Lambda_Aurigae: just stole the cables as the ethernet adapters were horribly slow and useless...and they became donors for the cases and db25 sockets.
04:46 AM rue_bed: I'm the only one to use an ide port
04:46 AM Lambda_Aurigae: rue_bed, I built one of those too just to test it.
04:46 AM rue_bed: :)
04:46 AM Lambda_Aurigae: also built one of those 4 port usb hub programmers
04:47 AM Lambda_Aurigae: glub but was that slow.
04:47 AM rue_bed: I had big plans for io systems on ide busses
04:47 AM rue_bed: I have a few unfinished cards
04:47 AM Lambda_Aurigae: my bestest programmer was the one that used no computer at all.
04:48 AM Lambda_Aurigae: a 555 in 1-shot mode for clock, a button, and some switches and LEDs.
04:48 AM Lambda_Aurigae: programming chips the old fashioned way, with switches!
04:48 AM rue_bed: parallel programming?
04:48 AM Lambda_Aurigae: nope.
04:48 AM Lambda_Aurigae: did it ISP
04:48 AM rue_bed: impressive considering then
04:48 AM Lambda_Aurigae: pain in the arse.
04:49 AM Lambda_Aurigae: parallel would have been easier.
04:49 AM rue_bed: I bootstrapped my z80 that way
04:49 AM Lambda_Aurigae: did 6502 chips back in the day that way.
04:49 AM _ami_: impressive!
04:49 AM Lambda_Aurigae: and my old home made 4-bit computer too.
04:49 AM rue_bed: I learned to check after my first entry had an error that made it run amock and destroy the ram contents
04:49 AM Lambda_Aurigae: before I built the strip reader forit.
04:50 AM rue_bed: attempt 2, I put the eprom programmer in the firmware but forgot to make a way to jump out of the monitor to user code
04:50 AM Lambda_Aurigae: strip reader was fun...first version was hole punches in a strip of graph paper.
04:50 AM _ami_: Lambda_Aurigae: you consider yourself more of electronics engineer or a firmware programmer?
04:50 AM Lambda_Aurigae: second generation I did the #2 pencil on graph paper and electrical contacts.
04:51 AM Lambda_Aurigae: _ami_, no...I'm more of an old school hacker.
04:51 AM rue_bed: I did a parallel interface to a pc printer port, with a bit of user code, I could "print" my source to the computer
04:51 AM _ami_: parallel interface on pc is gone in my time :/
04:52 AM Lambda_Aurigae: _ami_, last computer I bought, 3 years ago, had one.
04:52 AM Lambda_Aurigae: and I see it on new computers still..at least new motherboards.
04:52 AM Lambda_Aurigae: not all of them...
04:52 AM Lambda_Aurigae: but the gigabyte boards that I would buy all have one...and serial port too.
04:52 AM _ami_: i don't have on my PC which i bought 1 year ago.
04:53 AM polprog: they will have them as long as superIO chips have them
04:53 AM Lambda_Aurigae: I have 3 i5 laptops with parallel ports...1 built in and the other 2 have docking bays with parallel on them.
04:54 AM Lambda_Aurigae: this dell server that I'm using as a workstation now has serial port on the back and parallel port header on the motherboard.
04:54 AM _ami_: btw, IMHO, firmware programming is more satisfying than writing an application in GTK or QT or EFL or other middle ware stuffs.
04:54 AM polprog: _ami_: agreed
04:54 AM _ami_: its satisfying to my programming soul. thats why i do that.
04:55 AM Lambda_Aurigae: _ami_, I started with electronics 42 years ago and computers 38 years ago...
04:55 AM polprog: it's satisfying when you see it working
04:55 AM _ami_: In that process, i pick some electronics knowledge too :D
04:55 AM _ami_: polprog: indeed.
04:55 AM Lambda_Aurigae: blinky lights rock!
04:56 AM polprog: even that assembly blinker i wrote for the tutorial. that was satisfying as hell
04:56 AM Lambda_Aurigae: when I was the IT manager for a software development company I had "DWICBL" on my business card.
04:56 AM polprog: one blinking led. heh
04:56 AM _ami_: i have worked on several MCUs in short amount of time. from Arduino, avr, esp8266, esp32 to stm32, now I get all of this. :D
04:56 AM Lambda_Aurigae: Dude What's In Charge of Blinky Lights
04:56 AM polprog: lol
04:57 AM Lambda_Aurigae: _ami_, learn how they work, deep down, and it makes fixing/programming/hacking full computers much easier...at least it does for me...
04:57 AM _ami_: indeed. it is a case for me.
04:57 AM Lambda_Aurigae: I know how shit works, I know how to fix it, I know how to properly break it.
04:58 AM Lambda_Aurigae: after many years it becomes almost instinctive.
04:58 AM _ami_: In 1 month of time (working on free time), i wrote my own stm32 C++ library :)
04:59 AM polprog: the best bart is when they call you to fix audio and you push one tiny button on the console and it starts to work. (in most cases the bus wasnt connected to main signal bus)
04:59 AM polprog: hehe
04:59 AM polprog: single button.
04:59 AM Lambda_Aurigae: in the copier/printer world where I work there isn't much I can't fix...and people are amazed when I get into a new model or something and can just know what's wrong without manuals.
04:59 AM _ami_: lol
05:00 AM Lambda_Aurigae: a couple months back I got, "Oh, you read serbian?" while working with a customer's computer,,,which was configured for serbian instead of english.
05:01 AM Lambda_Aurigae: my response was, "Nope, I just know what all the buttons do without having to read what's on them."
05:01 AM polprog: wow
05:01 AM Lambda_Aurigae: it was windows 7 and I was installing print drivers.
05:01 AM polprog: im literally laughing ;) that's amazing
05:01 AM _ami_: :)
05:01 AM Lambda_Aurigae: I install those same print drivers a dozen times or more in a day usually.
05:02 AM polprog: people do this when i sometimes instead of clicking "control panel", just open up MMC from the command prompt
05:02 AM Lambda_Aurigae: the boxes all look the same no matter then language on them.
05:02 AM polprog: and do the stuff in mmc
05:02 AM Lambda_Aurigae: last week had a customer with linux workstations.
05:03 AM Lambda_Aurigae: I popped open a terminal and started installing drivers from there....
05:03 AM Lambda_Aurigae: he was amazed that I didn't use the mouse and gui.
05:03 AM polprog: it's like the matrix scene when the guy says he doesnt see the numbers but brunettes, blondes
05:03 AM Lambda_Aurigae: hell, I've been using linux for 20 years.
05:03 AM _ami_: WHAT!! - i hoped for better response from a linux user
05:03 AM _ami_: damn
05:04 AM Lambda_Aurigae: they had only just switched to linux a year ago...
05:04 AM polprog: linux has changed a lot in the past 10 years
05:04 AM Lambda_Aurigae: small office, saving money, got a bunch of older computers and his teenage kid helped him get started with linux.
05:04 AM polprog: in some distros you can "click every setting out"
05:04 AM polprog: like ubuntu
05:04 AM _ami_: but i see your point here. most of the people use linux because company or their development environment is around linux.
05:04 AM Lambda_Aurigae: polprog, there's still stuff you can do from command prompt that's not in the gui.
05:05 AM polprog: unless its a huge fuckup where you have to use the terminal
05:05 AM _ami_: yeah, i have seen those ubuntu users.. they had same wallpaper/theme for years :/
05:05 AM polprog: Lambda_Aurigae: but the majority of settings there is accessible both ways.
05:05 AM polprog: i stopped using ubuntu two years ago
05:05 AM polprog: it was just, blergh
05:05 AM Lambda_Aurigae: I use ubuntu here...just because it's more compatible with some of the software I run.
05:05 AM Lambda_Aurigae: but, I don't use plain ubuntu
05:06 AM Lambda_Aurigae: I run ubuntu mate.
05:06 AM polprog: yeah, plain one is awful
05:06 AM _ami_: i moved to Arch linux a year ago
05:06 AM polprog: i ran xubuntu for a while
05:06 AM Lambda_Aurigae: the unity desktop is horrid.
05:06 AM polprog: now i run arch
05:06 AM _ami_: runs Enlightenment WM
05:06 AM polprog: mine runs xfce
05:07 AM Emil: Debian+xfce
05:07 AM polprog: that's the scene i thought about when Lambda_Aurigae said he knows what all the buttons do without rading: https://www.youtube.com/watch?v=qAYXgbSlSv0
05:07 AM Emil: Ubuntu Mate is hooooorrible
05:07 AM polprog: morning emil
05:08 AM Emil: polprog: morning :)
05:08 AM Lambda_Aurigae: mate is kind of gnome2 light.
05:09 AM Lambda_Aurigae: and it works for my wife and mother-n-law
05:09 AM polprog: i threw IceWM for VNC on my server
05:10 AM polprog: works well and it's light enough for the old hardware
05:10 AM Lambda_Aurigae: these days I don't run anything older than i3 so I'm good with this.
05:10 AM polprog: i have to order a new i7 machine
05:11 AM Lambda_Aurigae: got my i7 laptop
05:11 AM polprog: this "server" is a pentium PC i used when i was 7
05:11 AM Lambda_Aurigae: and my dual quad-core xeon workstation here.
05:11 AM polprog: right now it's humming behind my back crunching some SQL
05:11 AM Emil: polprog: :D
05:11 AM Emil: its 32 bits
05:11 AM Emil: isnt it
05:11 AM polprog: it is. but it works.
05:12 AM Emil: mate
05:12 AM polprog: dont
05:12 AM Emil: just go to any school and ask for an old 64 bit
05:12 AM Lambda_Aurigae: he is in poland...they only use 27 bits anyhow.
05:12 AM Lambda_Aurigae: [:
05:12 AM polprog: Lambda_Aurigae: i dont get it :D
05:12 AM polprog: i have a good i7 on my mind. cheap too
05:13 AM polprog: ill just copy the /var and /home where the data is on the new one when it arrives
05:13 AM Lambda_Aurigae: polprog, around here, poland is backwards and old school...hence the polish jokes.
05:13 AM polprog: ah, polack jokes ;)
05:13 AM Lambda_Aurigae: that too.
05:14 AM Lambda_Aurigae: I have polish heritage in my family so get a lot of it.
05:16 AM antto: i use debian+LXDE
05:23 AM Emil: Lambda_Aurigae: 1/64th?
05:23 AM Lambda_Aurigae: closer to 1/8
05:23 AM Lambda_Aurigae: bout the same as my native american heritage.
05:24 AM Lambda_Aurigae: along with some Czech and a few others.
05:57 AM Jartza: https://imgur.com/a/pHOTq
05:58 AM Jartza: modern art
05:59 AM Lambda_Aurigae: looks like 70s art to me.
05:59 AM Lambda_Aurigae: [:
06:00 AM Jartza: they did that with SMD parts on 70s? :)
06:00 AM Lambda_Aurigae: no, but the point to point solder thing...
06:00 AM Jartza: yea
06:01 AM Jartza: looks like I'm running out of solder, I only had 0.8mm left :D
06:01 AM Jartza: got some kind of tin-flood there
06:01 AM Lambda_Aurigae: noooo!
06:03 AM Lambda_Aurigae: I'm down to about 3 pounds of the good stuff myself.
06:03 AM Jartza: I need 0.3mm, 0.4mm, 0.5mm and 0.56 at least
06:03 AM polprog: i need to get fine solder
06:03 AM Lambda_Aurigae: the stuff I have is a resin core .5mm lead....the old style.
06:04 AM polprog: i have resin core 1mm 60/40
06:05 AM polprog: cumbersome for smd, for finer pitch i use hot air with leaded paste
06:06 AM Lambda_Aurigae: no hot air here.
06:06 AM Lambda_Aurigae: and I seldom touch smt
06:06 AM polprog: i dont have a real hot air station
06:06 AM polprog: buthane iron is sufficient
06:57 AM Emil: hot air is awesome
06:59 AM Thrashbarg: yup
07:00 AM polprog: hot air best air
07:01 AM Emil: Jartza: what's the update about?
07:03 AM Jartza: Emil: we're making one more (and probably final) batch of Tagsu
07:03 AM Jartza: just the problem, that the old dc booster chip is EOL
07:03 AM Emil: Ah
07:04 AM Emil: Btw, I thought Tagsu was open hardware and foss
07:04 AM Emil: But apparently it isnt?
07:04 AM Jartza: it was supposed to be :D
07:04 AM Jartza: and probably will be in future
07:04 AM Jartza: just haven't been active in cleaning up and documenting stuff
07:04 AM Jartza: currently it has very cryptic firmware without too much docs
07:05 AM Emil: so=
07:05 AM Emil: ?
07:08 AM Jartza: just personal problem :D
07:08 AM Jartza: I don't want to release that before cleanup
07:08 AM Emil: ah
07:08 AM Emil: I know that problem all too well, also :D
07:08 AM Emil: But I mean
07:08 AM Emil: just put it out there and it's done
07:09 AM Jartza: yea, meaning to eventually
07:09 AM Jartza: probably when we get the next batch done
07:09 AM Jartza: that's a good marketing ;)
07:13 AM Jartza: I don't want to make new batches anymore
07:40 AM Emil: haha :D
07:41 AM Emil: And yet you are
07:43 AM _ami_: Lambda_Aurigae: my wife also able to figure out Enlightenment WM after few trials. :)
09:10 AM Jartza: Emil: yeah, I am, but we agreed this will be the last one
09:10 AM Jartza: if I ever make more, they will be something completely different
09:10 AM Jartza: a bit more modern approach :)
11:51 AM atk is now known as t-
11:52 AM t- is now known as oop
12:34 PM rue_mohr: antto,
12:34 PM rue_mohr: Lambda_Aurigae,
12:34 PM rue_mohr: cool ok
12:34 PM rue_mohr: http://ruemohr.org/~ircjunk/avr/458_avr_prog.jpg
12:34 PM rue_mohr: this was the large version
12:34 PM rue_mohr: iirc rifraf reduced it to a 14 pin chip
12:35 PM rue_mohr: http://ruemohr.org/~ircjunk/avr/457_avrprog.jpg
12:35 PM rue_mohr: http://ruemohr.org/~ircjunk/avr/442_avrprog.jpg
12:35 PM rue_mohr: http://ruemohr.org/~ircjunk/avr/almost_ready.jpg
12:35 PM rue_mohr: http://ruemohr.org/~ircjunk/avr/avrprog.jpg
12:36 PM rue_mohr: where is the pdf?
12:36 PM polprog: what's rifraf?
12:37 PM rue_mohr: "one of the founders"
12:37 PM rue_mohr: he got founded out
12:38 PM rue_mohr: http://ruemohr.org/~ircjunk/avr/lcd3.jpg
12:38 PM rue_mohr: you should see the box now!
12:38 PM Lambda_Aurigae: 442 is the one I have.
12:39 PM rue_mohr: rrly!
12:39 PM Lambda_Aurigae: you sent me one many moons ago.
12:39 PM rue_mohr: ya still ahve it!?
12:39 PM rue_mohr: SWEEET
12:39 PM Lambda_Aurigae: yup.
12:39 PM rue_mohr: :/ I cant find the pdf
12:40 PM Lambda_Aurigae: which pdf?
12:40 PM rue_mohr: with the schematic of it, that has the wrong 6 pin pinout
12:40 PM Lambda_Aurigae: oh.
12:40 PM Lambda_Aurigae: easy
12:40 PM rue_mohr: that had half the world making 6 pin isp headers that were wrong
12:40 PM Lambda_Aurigae: https://sites.google.com/site/emrirc/avrstuff
12:40 PM Lambda_Aurigae: first one.
12:41 PM Lambda_Aurigae: third one uses the 74125,,,reduced size chip
12:41 PM rue_mohr: yea thats it!
12:41 PM rue_mohr: how did this go, they reversed miso and mosi ?
12:41 PM Lambda_Aurigae: something like that.
12:41 PM Lambda_Aurigae: mine were like that forever...probably still have a couple like that.
12:42 PM rue_mohr: yea what a disaster
12:42 PM rue_mohr: I just went with 10 pin on everything
12:42 PM Lambda_Aurigae: although I ended up making 5 pin straight connectors with male pins to fit onto solderless breadboards.
12:43 PM Lambda_Aurigae: and powering the programmer from the parallel port.
12:43 PM polprog: rue_mohr: oh i thought it was some piece of PCB soft
12:43 PM polprog: rue_mohr: "Do not turn off" lol
12:43 PM Lambda_Aurigae: polprog, those were rue's early avr programmers back when we got started in avr.
12:44 PM Lambda_Aurigae: rifraf was an aussie as I recall who did some neat avr based POV stuff.
12:44 PM polprog: what time was that?
12:44 PM Lambda_Aurigae: 12 years ago, give or take.
12:44 PM polprog: hmm
12:44 PM Lambda_Aurigae: maybe a bit longer.
12:44 PM polprog: avr channel trivia ;)
12:45 PM Lambda_Aurigae: I've come and gone from here several times over the years.
12:45 PM rue_mohr: zlog
12:45 PM Lambda_Aurigae: under different names.
12:45 PM rue_mohr: Tom_L, what happened, I tried to rewind 10 years and it cant find the log!
12:46 PM rue_mohr: Oo hmm, where are my logs
12:47 PM Lambda_Aurigae: ok..time to go something that looks like worky so the wifey won't yell at me for buying new toys yesterday.
12:47 PM polprog: just checked old email
12:47 PM polprog: first one from a nickserv (not on freenode) is from jan 2014
12:47 PM polprog: heh
12:48 PM polprog: didnt think im on irc that long
12:48 PM polprog: albeit on a different name
12:49 PM rue_mohr: ok, I have up to 2013
12:52 PM rue_mohr: 09:15:43: ..........Tom_L:http://www.youtube.com:80/watch_popup?v=lgwF8mdQwlw&feature=player_embedded
12:52 PM rue_mohr: 10:57:51: ..........orlok:hmm
12:52 PM rue_mohr: 10:57:56: ..........orlok:anybody heard of festo?
12:52 PM rue_mohr: 11:06:26: ..........davem:they do alot of pneumatics
12:52 PM rue_mohr: 11:21:16: ...katsmeow-afk:Tom, there is no water in the radiator in that pic
12:52 PM rue_mohr: 11:28:32: ..........orlok:hmm the arm looks cool but is slow
12:52 PM rue_mohr: 11:29:24: ..........orlok:meh trendy styling but practicality fail
12:52 PM rue_mohr: 11:29:35: ..........orlok:http://www.festo.com/ext/en/14179_14197.htm#id_14197
12:52 PM rue_mohr: experpt from 7 years ago today, now
12:55 PM rue_mohr: wow, I gave up on #electronics in 2010
12:55 PM polprog: i gave up on ##electronics after a week
12:56 PM rue_mohr: around 2010 the monkeys took over
12:57 PM rue_mohr: !!
12:58 PM rue_mohr: #avr was taken over by us 2005-01-26
12:58 PM rue_mohr: int80h created it
12:58 PM rue_mohr: it was dead
12:59 PM rue_mohr: 03:24:18: ..........pepsi:heh
12:59 PM rue_mohr: 03:24:41: ..........pepsi:-ChanServ- Channel: #pic
12:59 PM rue_mohr: 03:24:41: ..........pepsi:-ChanServ- Contact: Gila, last seen: 1 year 10 weeks 6 days (22h 25m 49s) ago
12:59 PM rue_mohr: 03:24:41: ..........pepsi:-ChanServ- Registered: 1 year 48 weeks (14h 1m 23s) ago
12:59 PM polprog: huh
12:59 PM rue_mohr: er, missed the reline
12:59 PM rue_mohr: 03:24:14: .......rue_mohr:I wonder who has #pic
01:00 PM rue_mohr: 03:33:36: ......alindeman:Well, I was going to see who he wanted to delegate the channel to
01:00 PM rue_mohr: 03:33:41: .........br33zy:rue_mohr
01:00 PM rue_mohr: 03:33:45: .........br33zy:right?
01:00 PM rue_mohr: 03:33:45: .......rue_mohr:
01:00 PM * rue_mohr raises hand
01:00 PM rue_mohr: 03:33:47: ..........pepsi:yeah
01:00 PM rue_mohr: 03:33:50: .........br33zy:yeah rue_mohr
01:01 PM rue_mohr: 03:38:11: ......alindeman:int80_h: Sound OK to give the channel to rue_mohr ?
01:01 PM rue_mohr: 03:38:24: ........int80_h:it's not my channel anymore
01:01 PM rue_mohr: 03:38:34: ......alindeman:Well, it was, so it's close enough 8)
01:01 PM Lambda_Aurigae: I have one of pepsi's atmega128 dip boards too.
01:01 PM rue_mohr: "03:42:50: .........br33zy:I'll work on the wiki"
01:02 PM rue_mohr: WTF is the wiki!!!!????
01:02 PM Lambda_Aurigae: anybody named Farldarm or Arcturus in that?
01:02 PM Lambda_Aurigae: kinda miss br33zy too.
01:02 PM rue_mohr: Lambda_Aurigae, nope
01:03 PM rue_mohr: I think that was one of the first 3 days of us with #avr
01:03 PM Lambda_Aurigae: I know I was around in and around that time...a lot on #microcontrollers back then and #electronics/##electronics
01:04 PM Lambda_Aurigae: because I'm the one who gave you that pdf for that stk200 clone avr programmer
01:04 PM rue_mohr: hmm
01:04 PM rue_mohr: iirc that was ~2009
01:04 PM Lambda_Aurigae: pretty sure I was in as Arcturus at the time.
01:04 PM * rue_mohr dials forward the wayback machine
01:05 PM Lambda_Aurigae: I've been in iowa 9 years and it was before I moved here.
01:06 PM Lambda_Aurigae: at least 2 years before I moved here as I recall.
01:07 PM rue_mohr: symnron?
01:08 PM rue_mohr: #electronics-2005-01-21.html:<font color="#3333ff"><small><small>02:42:30:</small></small>&nbsp;.........br33zy:</font><font color="#999999">pepsi, http://www.bethnray.com/atmel/docs/avr-ispdongle.pdf</font><br>
01:08 PM rue_mohr: that is the first reference I can find in my logs to the pdf
01:10 PM Lambda_Aurigae: hmm....I did use that nick back then too.
01:10 PM Lambda_Aurigae: forgot that nick.
01:10 PM Lambda_Aurigae: that's my runescape name...hehe
01:11 PM rue_mohr: k, I need to tink
01:11 PM rue_mohr: think
01:12 PM rue_mohr: and get more model M keybaords
01:13 PM rue_mohr: I need to completely redo my web... space
01:16 PM Lambda_Aurigae: dang..how could I forget Symnron?
01:16 PM Lambda_Aurigae: and Andros
01:16 PM Lambda_Aurigae: and Sordna!
01:16 PM Lambda_Aurigae: used those back then too.
01:19 PM Lambda_Aurigae: I think Farldarm and Arcturus were pre-#avr nicks
01:20 PM rue_mohr: so what will be the next one?
01:20 PM Lambda_Aurigae: dunno.
01:20 PM Lambda_Aurigae: kinda sticking with Lambda_Aurigae for a while.
01:20 PM rue_mohr: ok, I'll look for Dunno
01:20 PM Lambda_Aurigae: one of those lesser known stars.
01:20 PM rue_mohr: ----
01:21 PM rue_mohr: if I was writing an avr-howto today:
01:21 PM Lambda_Aurigae: daym... back when we all got together here, LoRez was an ircop.
01:21 PM rue_mohr: I'd suggest getting an arduino board, C editor, gcc and avrdude
01:21 PM LoRez: it wears on you.
01:21 PM rue_mohr: I thought he still was?
01:21 PM polprog: Try alcor or mizar
01:21 PM polprog: or both
01:28 PM rue_mohr: nup
01:28 PM rue_mohr: but I'm not sure if its taling longer to grep it or parse *.html
01:29 PM Lambda_Aurigae: gotta go find router bits to route in some hinges.
01:31 PM rue_mohr: hehe
01:31 PM * rue_mohr hands Lambda_Aurigae a patch cord
01:34 PM * polprog hands Lambda_Aurigae a gigabit switch
01:39 PM localhos1: what is the best way to start with a.v.r. ??
01:41 PM learath: buy an avr and do something?
01:41 PM learath: arduino makes it super easy.
01:42 PM localhos1: link?
01:44 PM learath: uhm?
01:44 PM learath: https://www.arduino.cc/
01:46 PM localhos1: that is all i need ?
01:50 PM localhos1: that looks very easy xD
01:50 PM localhos1: thanks v. much
01:52 PM cehteh: ♪♬♩♩trolling on a lazy sunday afternoon ♪♬♩♩
01:53 PM learath: cehteh: was that trolling?
01:53 PM cehteh: dunno
01:54 PM cehteh: but either stupid or troll i'd guess
01:54 PM learath: I tend to just assume massive brain damage, from years of working tech support.
01:54 PM learath: seems to be amazingly common
01:54 PM cehteh: close enough to trolling
01:54 PM learath: The asking for a link to arduino is.. pretty unbelieveable, I admit
01:58 PM polprog: tech support really that bad?
01:59 PM learath: I spent 45 minutes getting one person to admit their computer ran macos not windows.
01:59 PM polprog: dont scare me
01:59 PM polprog: im thinking about a carer in it
02:00 PM polprog: IT*
02:00 PM learath: Part of that is my fault - I believed them.
02:00 PM polprog: users lie
02:02 PM polprog: at school one teacher is trying to catch me to help with a vga to hdmi converter
02:02 PM polprog: but my wizardry skills arent enough to make a cheap chink box work
02:03 PM learath: And for no reason. It baffles me
02:03 PM polprog: maybe they lie because they dont know
02:03 PM polprog: maybe they treat people as shit
02:03 PM learath: "did you reboot, which will fix your issue?" "yes" checks uptime "your system has been up for 20 days"
02:03 PM polprog: maybe because they are lazy
02:03 PM polprog: ^
02:03 PM learath: stupid.
02:04 PM polprog: physics test tomorrow
02:04 PM polprog: morning, even worse
02:19 PM Lambda_Aurigae: rue_mohr, my router makes lots of sawdust.
02:19 PM Lambda_Aurigae: got a ryobi 18V palm router.
02:19 PM Lambda_Aurigae: great for routing in hinges and such.
02:20 PM Lambda_Aurigae: had it for 3 months...today is first time I've tried it.
02:43 PM x7C3_ is now known as x7C3
02:43 PM x29a_ is now known as x29a
02:49 PM polprog: pizza time
04:35 PM Lambda_Aurigae: popcorn time here.
04:36 PM antto: copporn?
04:36 PM polprog: hardcore
04:36 PM Lambda_Aurigae: I have a professional grade popcorn popper in my kitchen.
04:37 PM Lambda_Aurigae: normally like $1300.00 USD.
04:37 PM polprog: we sometimes make popcorn too
04:37 PM LeoNerd: Who Pops The Popper?
04:37 PM Lambda_Aurigae: I got it for 300.
04:37 PM Lambda_Aurigae: makes popcorn like you get at the theater.
04:37 PM Lambda_Aurigae: one of my clients makes them not far from here.
04:38 PM Lambda_Aurigae: this one was a year old demo unit on their showroom...had been used 3 times....
04:38 PM polprog: good deal
04:39 PM Lambda_Aurigae: it's not always what you know but who you know.
04:39 PM polprog: i always try to score a mint condition used stuff.
04:39 PM polprog: agreed
04:39 PM Lambda_Aurigae: they have been our customer for many years..longer than I've been with the company.
04:40 PM Lambda_Aurigae: but I was able to make their old copier and new copier do things nobody else had been able to.
04:40 PM Lambda_Aurigae: impressed them.
04:40 PM Lambda_Aurigae: I kept telling them I was looking for a scratch-n-dent if it was a good price.
04:40 PM Lambda_Aurigae: finally they called me and said they had a bargain for me.
04:40 PM polprog: im getting some used voip phones to play with this way
04:40 PM Lambda_Aurigae: that would be fun.
04:41 PM Lambda_Aurigae: specially if they are usable with asterisk.
04:41 PM polprog: they should be
04:43 PM Ameisen: so
04:43 PM Ameisen: I've been talking with the owner of the AVR LLVM codebase
04:43 PM Ameisen: he's pleased with my changes, though we had a long discussion about potential optimizations and changes
04:43 PM Ameisen: basically 'what needs to be done to get GCC parity, and what needs to be done to beat GCC'
04:43 PM Ameisen: in 2 areas, Clang already beats GCC
04:44 PM Ameisen: 1. __flash can be implemented for C++ in Clang very quickly, as address space support already exists. Cannot be done easily in g++.
04:44 PM Ameisen: 2. Clang handles some edge case optimizations already that gcc fails at.
04:44 PM Ameisen: CLang currently is failing at almost all operations that require manual lowering code, since it isn't there.
04:45 PM Ameisen: It also doesn't have a substantial number of specific optimizations, but neither does gcc
04:45 PM LeoNerd: If it can multiply by 3 on an ATtiny it will be doing better than gcc
04:45 PM Ameisen: Two in particular - 1. optimizing instruction generation/ordering based upon flag states - neither GCC nor Clang take into account that an instruction sets just the carry flag
04:45 PM Ameisen: both just say 'it changed SREG'
04:45 PM Ameisen: while not wrong, it is overly strict
04:45 PM Ameisen: and thus prevents some scheduling optimizations
04:46 PM Ameisen: it can be fixed, though GCC's scheduler wouldn't take it into account - LLVM's will]
04:46 PM Ameisen: 2. Neither handle dual-registers well
04:46 PM Ameisen: Both are set up in a way that presumes that since pointers are 16-bit, any instructions work on 16-bit
04:46 PM Ameisen: which is a bad assumption, and causes a ton of lowering code to be needed
04:46 PM Ameisen: and since lowering code is last stage, causes a lot of redundant code and register usage
04:47 PM Ameisen: very hard to fix in GCC, hard to fix in LLVM
04:47 PM twnqx: what about 0b support in clang?
04:47 PM Ameisen: he has a patch for AVR that helps somewhat in LLVM, but doesn't handle the general case
04:47 PM Ameisen: 0b - binary literals?
04:47 PM twnqx: yes#
04:47 PM Ameisen: they are already supported in C++ in GCC and Clang
04:47 PM Ameisen: that's a frontend issue though, not really specific to AVR
04:47 PM twnqx: it's in C in gcc, too
04:47 PM Ameisen: might be. Prolly not hard to add to clang
04:48 PM Ameisen: My suggestion, since it has nothing to do with AVR - if it's not in clang now, just expose binary literals to C in a patch and submit it.
04:48 PM Ameisen: and they'll add it to mainline
04:48 PM Ameisen: I'd rather not throw it in with AVR changes
04:48 PM twnqx: i think with gcc it's avr specific. no idea.
04:48 PM Ameisen: I can't imagine it's difficult to implement in clang due to how the fonrtend is architected.
04:48 PM Ameisen: not sure why it would be
04:49 PM Ameisen: it's front-end specific
04:49 PM Ameisen: as said though, it's part of C++ in general
04:49 PM Ameisen: so, the logic already exists in Clang
04:49 PM Ameisen: it's just not getting hit for C
04:49 PM twnqx: while i agree to the sentiment, as far as i know that's how it is (it's beyond the C spec)
04:49 PM Ameisen: I don't mind extensions. It just isn't AVR-specific
04:49 PM Ameisen: and thus I'm wary of sticking it into the AVR branch
04:50 PM Ameisen: I'd rather it go directly into mainline and get backported
04:50 PM Ameisen: my AVR branch is going to end up being upstreamed regularly anyways, but the more that gets globally changed, the harder it is to get patch approbal
04:50 PM Ameisen: approval*
04:50 PM Ameisen: and there are already a few global changes I'm wary of
04:50 PM Ameisen: mainly code-architectural changes to the LLVM target system to make writing targets easier
04:51 PM Ameisen: testing on godbolt
04:51 PM Ameisen: godbolt says that binary literaly work in C in Clang 5 at leas
04:51 PM Ameisen: least
04:51 PM Ameisen: and 4.0.1
04:52 PM Ameisen: and 3.0
04:52 PM Ameisen: so, not an issue - already works
04:52 PM Ameisen: https://godbolt.org/g/W3h6ge
04:53 PM twnqx: that's cool
04:53 PM twnqx: what about the current way of placing stuff in flash __attribute__ progmem?
04:53 PM Ameisen: I don't think progmem fully works in Clang atm - it's partially there
04:53 PM polprog: goodnight everybody
04:53 PM Ameisen: but I'd rather support __flash
04:54 PM Ameisen: __flash is way more useful
04:54 PM twnqx: so your code will have to be compile dependent
04:54 PM twnqx: which is not so very nice
04:54 PM Ameisen: that's the g++ maintainer's fault
04:54 PM Ameisen: GCC supports __flash, g++ doesn't
04:54 PM Ameisen: Clang can support it for both C and C++
04:54 PM twnqx: really? never heard of __flash :(
04:54 PM Ameisen: :D
04:54 PM twnqx: and i write pure C code
04:54 PM Ameisen: It's a GCC extension for AVR
04:54 PM Ameisen: for C
04:55 PM Ameisen: it doesn't exist in g++ as the g++ maintainers refuse to add it
04:55 PM Ameisen: or support it
04:55 PM twnqx: stupid
04:55 PM Ameisen: this is because the C committee adopted the ISO reuqirements for address spaces
04:55 PM Ameisen: but it was never adopted by the C++ committee
04:55 PM Ameisen: and g++ maintainers are sticklers, even refusing extensions
04:55 PM Ameisen: the clang maintainers aren't sticklers.
04:55 PM Ameisen: __flash is awesome though
04:55 PM Ameisen: it's a modifier rather than an attribute
04:55 PM Ameisen: thus... int * __flash ptr works
04:56 PM Ameisen: and the compiler auto-generates the correct access code
04:56 PM Ameisen: you don't need to use the program-memory load/store instructions in inline asm
04:56 PM Ameisen: in C++, __flash is incredibly useful as you can access a __flash array as both constexpr (at compile-time) or as a program memory access (at run-time)
04:56 PM Ameisen: it's a PITA to get that working otherwise
04:57 PM Ameisen: unfortunately, g++ doesn't support __flash which makes me have to do some annoyingly frustrating things in C++ to get around it
04:57 PM Ameisen: I write C++, not C
04:57 PM twnqx: it works in gcc
04:57 PM Ameisen: so I don't usually test what C supports
04:57 PM Ameisen: it works in gcc, but not if you compile as c++
04:57 PM twnqx: which is funny all the more
04:57 PM Ameisen: gcc calls g++ for c++
04:57 PM Ameisen: and the extension doesn't exist for g++
04:57 PM twnqx: yeah
04:58 PM Ameisen: clang works fundamentally differently, which makes __flash easier to handle
04:58 PM Ameisen: that, and address space support already exists in clang
04:58 PM Ameisen: it doesn't exist at all in g++
04:58 PM twnqx: somehow in gcc 5 or 6 sadly you had to use const ptr
04:58 PM Ameisen: so, yes, if clang has __flash, it means good C++ has to use clang, not g++
04:58 PM Ameisen: but I see little problem with that
04:58 PM Ameisen: I'd rather be able to use a better toolchain if I want to
04:58 PM twnqx: which was annoying to me in one case where i mixed pointers to flash and to ram :P
04:59 PM Ameisen: and if you want to be able to port back to g++, just don't use __flash
04:59 PM Ameisen: I'm also planning on adding int24 (which is in gcc), int48 (which is not), float16 (which is not), float24 (which is not)
04:59 PM Ameisen: well, avr has universal pointers as well
04:59 PM Ameisen: which work for flash and ram
04:59 PM twnqx: i wouldn't even want to know what you have to do to put your large tables into rom and keep them there :P
05:00 PM Ameisen: in C++, right now?
05:00 PM Ameisen: it's awful
05:00 PM Ameisen: with __flash?
05:00 PM Ameisen: my code would be half the size in that area
05:00 PM Ameisen: and easier to use
05:00 PM twnqx: though actually, in C i have to use pgm_read_byte or memcpy_P as well
05:01 PM Ameisen: https://github.com/ameisen/Tuna-i3-Plus/blob/master/Tuna/tunalib/utils.hpp#L819-#L1035
05:01 PM Ameisen: I had to write that code alone to support flash memory with a template
05:01 PM Ameisen: that wraps data that has to be accessed as progmem
05:01 PM Ameisen: I don't like the approach.
05:01 PM Ameisen: It's just all I can do without __flash
05:02 PM Ameisen: with __flash, I don't need to even touch memcpy_P, pgm_read_*, or such
05:02 PM Ameisen: the compiler will handle it
05:02 PM twnqx: can't you include the C avr/pgmspace.h and use the macros to make it at least look nicer?
05:02 PM Ameisen: it's just the better way to do it
05:02 PM Ameisen: the macros aren't written properly for constexpr
05:02 PM Ameisen: that, and I als have it written for odd byte-sizes like 3, 5, etc
05:03 PM Ameisen: using the macro would generate suboptimal code for those cases
05:03 PM Ameisen: I basically rewrote the program-memory readers as a templated function
05:04 PM Ameisen: but it's use is automated through the flash template
05:04 PM Ameisen: flash<int> a; - using a will call the sequence automatically
05:04 PM Ameisen: or if it's at compile-time will just get the value
05:09 PM robinak is now known as robink
05:09 PM twnqx: hm. again, didn't know that lpm reg, Z + const exists
05:09 PM twnqx: only knew about autoincrement
05:10 PM twnqx: oh wait, that's mega and not normal ones again
05:11 PM Ameisen: yeah
05:11 PM Ameisen: I need to add an if constexpr for non-mega
05:11 PM Ameisen: I haven't done it yet because my testing chip is meg
05:11 PM Ameisen: mega
05:11 PM Ameisen: and i haven't written an AVR emulator yet
05:11 PM Ameisen: though I have to
05:12 PM Ameisen: one of the requirements I set for my 3d printer firmware is unit testing, which requires a functional AVR emulator to test the code.
05:12 PM Ameisen: also need an AVR firmware to test timing of functions to make sure that they execute within a reasonable timeframe
05:12 PM Ameisen: AVR emulator*
05:13 PM Ameisen: AVR is thankfully a pretty simple architecture, so an emulator won't be hard
05:13 PM twnqx: and you're missing ELPM for >64k devices :P
05:13 PM Ameisen: should be easier than my MIPS emulator
05:13 PM twnqx: oh god emulators
05:13 PM twnqx: i stopped working on one last year
05:13 PM twnqx: acrtually, more like two years ago
05:13 PM Ameisen: surprisingly, the firmware wasn't using ELPM on my printer even though it's > 64k
05:13 PM Ameisen: it's very difficult to automatically determine if you should be using ELPM or not
05:13 PM twnqx: btw, how many ants are you?
05:13 PM Ameisen: since you don't know what the value of a runtime pointer is
05:14 PM Ameisen: only a compile-time pointer
05:14 PM Ameisen: 12
05:14 PM Ameisen: I can show you a picture of the ants, let you count 'em
05:14 PM Ameisen: prolly about 20
05:14 PM Ameisen: the solution is likely to always use ELPM unless you _know_ the address is < 64KiB
05:15 PM Ameisen: as a runtime branch is worse than just using elpm
05:15 PM twnqx: that... would probably be my solution, at least on >64k devices
05:15 PM Ameisen: lesseeeee
05:15 PM Ameisen: LPM... 1 word, 3 cycles
05:15 PM Ameisen: ELPM - 1 word, 3 cycles
05:15 PM Ameisen: yeah, honestly... no reason to use LPM if you support it
05:15 PM twnqx: but need to set up rampz
05:16 PM Ameisen: though it has more requirements of the compiler
05:16 PM Ameisen: yeah, which is why firmwares still usually just use LPM
05:16 PM Ameisen: and ignore >= 64KiB
05:16 PM Ameisen: it's cheaper to set up the load state
05:17 PM Ameisen: the main issue is that C++ doesn't give me a good, constexpr way to test the value of a pointer
05:17 PM Ameisen: if I could determine at compile time that a pointer access will always be >= 64 KiB or <, it'd be better
05:17 PM Ameisen: __flash would solve that
05:17 PM Ameisen: :|
05:18 PM twnqx: you probably are never bored, right? :P
05:18 PM twnqx: have you ever emulated all the IO of a µC?
05:19 PM oop is now known as atk
05:20 PM twnqx: 'cause the thing i was working on stalled when i hit the point where i really had to emulate bitwise shifting of data into a can controller :/
05:21 PM Ameisen: I have plenty of things I work on
05:21 PM Ameisen: still manage to be bored
05:21 PM Ameisen: the last full emulator I wrote was a spec-compliant MIPS32r6 emulator
05:21 PM Ameisen: I have not emulated IO yet, which obviously AVR needs
05:21 PM twnqx: but probably only the CPU core, no IO
05:21 PM Ameisen: I'm actually excited about that
05:21 PM Ameisen: sounds like fun
05:21 PM twnqx: it's not
05:21 PM twnqx: it's PUITA
05:21 PM Ameisen: depends
05:21 PM twnqx: PITA*
05:21 PM Ameisen: I find lots of PITA things to be fun
05:21 PM Ameisen: I write emulators because I find it fun
05:21 PM twnqx: it's challenging, that's for sure
05:21 PM Ameisen: i wrote my MIPS emulator because 'why not'
05:22 PM Ameisen: then I wrote an optimizing brainfuck interpreter to run in it to use as a benchmark because 'why not'
05:22 PM twnqx: here's a chip recommendation for you: Tricor TC1796
05:22 PM twnqx: Tricore*
05:22 PM twnqx: cpu core is even in qemu
05:22 PM Ameisen: the brainfuck interpreter was useful since it ran a very expensive fractal program
05:22 PM Ameisen: and it could run natively or in MIPS
05:22 PM Ameisen: so I could test performance differentials
05:22 PM Ameisen: the MIPS emulator, in AOT mode, was about 10x slower than running it natively on my x86-64 system
05:23 PM Ameisen: in interpreted, about 100x slower
05:23 PM Ameisen: if I compiled the MIPS emulator in Emscripten and ran it in a browser with JS, it was about 300x slower
05:23 PM Ameisen: still faster than any existing real MIPS chip
05:23 PM twnqx: 2150 pages user manual for the IO modules, 280 pages core archicture, 576 pages instruction set
05:24 PM Ameisen: an advantage of emulating IO for AVR is that I can sample real IO reads from my 3d printer
05:24 PM Ameisen: and push them onto the board.
05:24 PM Ameisen: to test what the firmware is doing
05:24 PM twnqx: and it's slow enough to emulate realtime :P
05:24 PM Ameisen: that's sort of the purpose of a unit test anyways
05:24 PM Ameisen: 'if the ADC values indicate a potential thermal runaway, does the firmware handle it right'
05:24 PM Ameisen: basically, safety checks
05:24 PM Ameisen: no firmware I know of atually unit tests them
05:25 PM Ameisen: I'd like to know that the firmware code at least has SOME validation that a fire might be prevented
05:25 PM Ameisen: an AVR emulator also makes instruction counting easier for functions that have loops and such
05:25 PM twnqx: i'm trying to find an entry point in an extracted firmware
05:25 PM Ameisen: can test the real-world costs of algorithms
05:25 PM twnqx: but i gave up with IDA
05:26 PM Ameisen: usually the entry point is fixed.
05:26 PM twnqx: so i thought "just whip up an emulator"
05:26 PM twnqx: well, i am looking for an interrupt handler
05:26 PM Ameisen: though that fixed address is usually the bootloader
05:26 PM Ameisen: oh
05:26 PM Ameisen: an emulator would work
05:26 PM twnqx: and that might not even be the code i am looking for in the end
05:26 PM Ameisen: though you'd need to simulate the IO states that it actually sees
05:26 PM Ameisen: to have it be correct
05:26 PM twnqx: oh yes
05:26 PM Ameisen: though...
05:27 PM Ameisen: technically you don't have to
05:27 PM Ameisen: reattach the IO devices to a PCI board, and connect those in software to your emulator
05:27 PM Ameisen: :D
05:27 PM twnqx: i can almost run the chip's boot rom to the point where i can run my own code from CAN
05:27 PM Ameisen: or do it over USB or something
05:27 PM Ameisen: hook up an arduino to sample IO, connect it to your PC via USB
05:27 PM twnqx: it was fun to see it initialize undocumented registers
05:27 PM Ameisen: and link the USB inputs from the arduino to your emulator's IO
05:27 PM Ameisen: heh
05:27 PM Emil: twnqx: what chiå?
05:27 PM Ameisen: debugging my MIPS emulator was fun too
05:28 PM twnqx: TrCore TC1796
05:28 PM Ameisen: you learn a shitton about how not only the chip works
05:28 PM Ameisen: but also how the _compiler_ thinks
05:28 PM Emil: twnqx: undocumented registers are kawai :D
05:28 PM Emil: kawaii*
05:28 PM Ameisen: That, but debugging an emulator is annoying for one big reason -
05:28 PM Ameisen: you have no idea if your program you're testing is buggy, or your emulator.
05:28 PM twnqx: well, it's likely only benchmarking the on-chip dram
05:28 PM Emil: twnqx: why are you using such poropietari ic?
05:28 PM Ameisen: this was a big issue when I was porting libc++ and libunwind
05:28 PM twnqx: and setting up some stuff for access
05:28 PM Ameisen: I didn't knw if my emulator was failing, or the code in those libraries
05:28 PM twnqx: Emil: not me, the stuff i want to know about does :P
05:29 PM Ameisen: so I had to trace things in the emulator, validate all the outputs, etc
05:29 PM Ameisen: More difficult when you're debugging an AOT compiler within the emulator as well
05:29 PM Ameisen: since you can't just debug variable states
05:29 PM Emil: twnqx: do share
05:29 PM Ameisen: you're debugging x86 asm that you generated
05:29 PM Ameisen: which is fun
05:29 PM Ameisen: I'm not lying, it was a lot of fun
05:29 PM Ameisen: but I'm weird
05:30 PM twnqx: https://i.imgur.com/Db4nqCP.jpg does that help?
05:30 PM Ameisen: pretty
05:30 PM twnqx: slightly modded so i could boot it from CAN and run my own code that would send the flash out via CAN again
05:31 PM Ameisen: are those stripped torx or hex screws
05:31 PM Ameisen: look like stripped torx
05:31 PM Ameisen: I have a bunch of nice, new, clean torx screws if you need some :D
05:31 PM Ameisen: jeez that has a lot of chips
05:31 PM twnqx: that's only the back side
05:31 PM Ameisen: you could probably get a cheap ARM, write an emulator, run it on i
05:31 PM Ameisen: it
05:32 PM Ameisen: and be better off
05:32 PM twnqx: https://i.imgur.com/ZnL2PJR.jpg
05:32 PM twnqx: that doesn't help me understand what the existing code on that thing does :P
05:32 PM twnqx: which is all i really care about
05:32 PM twnqx: i wanted to break out the JTAG interface, but i failed at reballing :(
05:33 PM twnqx: (i also failed at desoldering, but i expected to destroy this one in the first place)
05:34 PM twnqx: and if you wonder what this is: it's an engine ECU for a modern day car
05:34 PM twnqx: tons of sensors and high-current actuators
05:35 PM Ameisen: sure it does
05:35 PM Ameisen: if you have a fully functional emulator, the code can be analyzed without a jtag
05:35 PM twnqx: sure, but why would i use an ARM if i have a PC?
05:35 PM Ameisen: because you can jam the ARM in there and use it instead of the board that exists
05:35 PM twnqx: nah
05:36 PM twnqx: 4.4ghz can't emulate that chip in realtime unless i go into heavy multithreading
05:36 PM twnqx: some instructions are so strange that nothing you've ever seen matches up with it
05:37 PM twnqx: specialized adressing modes for FFT tables, stuff like that
05:38 PM twnqx: and god, emulating overflow on 64bit registers
05:38 PM twnqx: how do you even detect that
05:38 PM twnqx: unless you go down to asm yourself
05:39 PM Ameisen: you can emulate that on ARM64
05:39 PM Ameisen: pretty easily :P
05:39 PM twnqx: if C would only expose carry/overflow flag to C
05:39 PM Ameisen: eh. My vemips emulator is C++
05:39 PM twnqx: and not only down to yourself doing ASM
05:39 PM Ameisen: handles the carry bit fine
05:39 PM Ameisen: I use an if/else for it, but it compiles sanely
05:39 PM twnqx: how?
05:40 PM twnqx: can't use "if ((a+b) > maxint) {}"
05:40 PM Ameisen: carry_bit = (the multiplication of these is > 0xFFFFFFFFFFFFFFFF);
05:40 PM Ameisen: that is, the result of the multiplication is less than max(a, b)
05:40 PM Ameisen: as it overflowed
05:40 PM Ameisen: the compiler seems smart enough to realize that the carry bit is set in that state
05:41 PM Ameisen: err
05:41 PM Ameisen: overflow_bit rather
05:41 PM Ameisen: for MUL
05:41 PM twnqx: now to it for unsigned addition :P
05:41 PM twnqx: do it*Ü
05:41 PM twnqx: maxint + 1
05:42 PM Ameisen: carry_bit = (a + b) < std::max(a, b);
05:42 PM Ameisen: the only way that the result would be smaller than the largest of the two is if an overflow occurred.
05:42 PM Ameisen: thus, the carry bit needs to be set
05:43 PM twnqx: mh. that might make int128_t go away
05:43 PM twnqx: which was my solution, just go wider :P
05:43 PM Ameisen: yeah, no reason to store extra state you aren't using
05:43 PM Ameisen: relatively trivial to detect overflow
05:44 PM Ameisen: using int128 also makes it a little harder on the compiler
05:44 PM Ameisen: that, and vemips builds primarily under msvc... which doesn't have int128_t
05:44 PM twnqx: yeah, gcc extensions
05:44 PM Ameisen: it builds under Clang, too, though the binary is faster in MSVC
05:44 PM Ameisen: MSVC sucks at some things, but it is very good at optimizing
05:45 PM twnqx: i don't use windows, which kind of excludes me from msvc
05:45 PM Ameisen: merging my vemips svn repo into vemips github repo
05:45 PM Ameisen: it's not small
05:45 PM Ameisen: makes sense
05:45 PM Ameisen: I like using Visual C++ as IDEs are incredibly useful for projects like that
05:45 PM Ameisen: where you have to track state through multiple files
05:46 PM Ameisen: visual debuggers are nice
05:47 PM Ameisen: hmm, actually
05:47 PM Ameisen: I don't do the carry_bit trick
05:47 PM Ameisen: I forgot, I didn't need to
05:48 PM Ameisen: I set it up so I could automatically trap the overflow signal and use that to set the bit.
05:48 PM Ameisen: thus not requiring eextra code
05:48 PM Ameisen: :D
05:48 PM twnqx: wait, c++ does runtime bounds checking`
05:48 PM twnqx: ?
05:48 PM Ameisen: https://github.com/ameisen/vemips/blob/master/src/mips/instructions/coprocessor1_inst.cpp#L41-L61
05:48 PM Ameisen: No, but the CPU certainly does
05:48 PM Ameisen: and NT Kernel lets you trap on things
05:49 PM Ameisen: wait
05:49 PM Ameisen: that's float add
05:49 PM Ameisen: that's why
05:49 PM Ameisen: trivial to detect floating point overflow in x86-64, which I use
05:49 PM Ameisen: let me find the integer one
05:49 PM twnqx: yeah, the fpu generates an interrupt on such thing :P
05:49 PM Ameisen: Well, not in fast-math
05:49 PM Ameisen: though you can still detect it.
05:50 PM Ameisen: ah, right
05:50 PM Ameisen: MIPS doesn't have an overflow flag
05:50 PM twnqx: wtf, why does my code generator generate an extra space
05:50 PM Ameisen: it has an overflow exception.
05:50 PM Ameisen: https://github.com/ameisen/vemips/blob/master/src/mips/instructions/processor_inst.cpp#L123-L141
05:51 PM Ameisen: which I just upcast to int64 during the op, because I target x86-64
05:51 PM Ameisen: so doing it this way is faster than a compare against max
05:51 PM twnqx: yes
05:51 PM Ameisen: if I were emulating MIPS64, I'd have to do the other way
05:51 PM Ameisen: note, I should probably change the || there to an |
05:51 PM Ameisen: will generate one less branch
05:51 PM twnqx: actually that's why i am upgrading to int128_t
05:51 PM Ameisen: though on x86-64 on Windows, 99% of the time that code is never getting hit
05:52 PM Ameisen: as all instructions in processor_inst.cpp are JITted
05:52 PM Ameisen: I wrote a terrible JIT :|
05:52 PM Ameisen: but it works
05:52 PM twnqx: i never went to a jitter
05:52 PM Ameisen: well, it's technically AOT
05:52 PM Ameisen: kinda a hybrid
05:52 PM Ameisen: I did the JIT because 'why not'
05:52 PM Ameisen: It started as a basic optimization pass, just rewriting the virtual storage so it used function pointers instead of instruction lookup
05:52 PM Ameisen: at that point, it was trivial to start replacing basic instructions
05:53 PM Ameisen: then it just kept going
05:53 PM Ameisen: it's an awful JIT though
05:53 PM Ameisen: way slower than it has to be to generate, doesn't generate great code
05:53 PM Ameisen: but way faster than interpreting
05:53 PM Ameisen: https://github.com/ameisen/vemips/tree/master/src/mips/processor/jit/jit1
05:54 PM Ameisen: though it handles jumps remarkably well
05:54 PM twnqx: doesn't jitting mean you have to duplicate the address space and generate x86 code on the fly?
05:54 PM Ameisen: Yes. I generate x86 code on the fly, but I don't do JIT optimizations based upon state
05:54 PM Ameisen: it's sort of... on-the-fly AO
05:54 PM Ameisen: AOT
05:55 PM Ameisen: JIT usually implies it is self-optimizing
05:55 PM Ameisen: this just does a basic pass to convert it to somewhat-sane x86-64 machine code
05:55 PM twnqx: i guess i can just live with two indirect jumps for decoding
05:55 PM Ameisen: most instructions end up coded directly in machine code
05:55 PM Ameisen: all FPU instructions and a few very complex instructions are just encoded as CALLs which call the interpreter function
05:55 PM Ameisen: since the state is shared between them, it doesn't matter
05:56 PM Ameisen: when AOT is on, it's still dramatically faster though
05:56 PM Ameisen: the codegen isn't even very good
05:56 PM twnqx: i don't care about speed, i don't care about cacle exactness
05:56 PM Ameisen: yeah, I care about speed
05:56 PM Ameisen: :)
05:56 PM Ameisen: I also cared about correctness
05:56 PM twnqx: i did initially
05:56 PM twnqx: how do you simulate the cache state?
05:57 PM Ameisen: if I told the emulator to execute 10 instructions and return, the CPU state should be where it is in 10 instructions
05:57 PM twnqx: e.g. instruction fetch timing
05:57 PM Ameisen: I don't. MIPS leaves cache up to being implmenetation defined
05:57 PM twnqx: so you are not exact
05:57 PM Ameisen: I'm perfectly exact to the spec.
05:57 PM Ameisen: the specification doesn't mandate anything
05:57 PM Ameisen: I don't emulate any specific MIPS chip
05:57 PM twnqx: but your core won't run correctly with regards to IO state
05:57 PM Ameisen: I emulate MIPS32r6 - it's its own chip
05:57 PM Ameisen: compared to what?
05:58 PM Ameisen: I'm not emulating anything specific
05:58 PM Ameisen: It runs perfectly correctly compared to itself, ans complies with the MIPS spec
05:58 PM twnqx: well, to me, cycle exact is cycle exact
05:58 PM Ameisen: it is cycle exact, as per the VM-CPU's specifications
05:58 PM twnqx: my code runs at 1 instructon per "virtual" cycle, regardless of true timing
05:58 PM Ameisen: there's no cache latency in my implementation, which is perfectly valid for MIPS spec
05:58 PM Ameisen: as it's implementation defined.
05:59 PM Ameisen: that's the nice thing about 'implementation defined;'
05:59 PM Ameisen: if I were emulating a _specific_ MIPS chip, I'd have to take it into account
05:59 PM Ameisen: the point of this particular VM was actually to run arbitrary code safely within simulations/games
05:59 PM Ameisen: so users could have computers/robots/such in-game
05:59 PM twnqx: i am emulating a specific chip and i hope i don't have to care :P
05:59 PM Ameisen: and debug them
05:59 PM Ameisen: and such
05:59 PM Ameisen: since it's an iterative VM, infinite loops don't hurt
06:00 PM Ameisen: and since it's a true VM, it's safe - their code has no ability to break things
06:00 PM Ameisen: thus, speed and memory-footprint mattered
06:00 PM Ameisen: I can actually make it about 5x faster if I reserve 4 GiB of address space for every VM
06:00 PM Ameisen: since memory access becomes simpler
06:00 PM Ameisen: but that dramatically limits how many VM instances can exist, even on 64-bit
06:01 PM twnqx: 80015064 59 ff 0a 7c st.w [%a15], -15926 ($c1ca), %d15unaligned 32bit write access
06:01 PM twnqx: Aborted
06:01 PM twnqx: :/
06:01 PM twnqx: that's where i stoppped with my own "true" code
06:01 PM Ameisen: most x86-64 chips have 48-bit address space, which would mean only 64K instances could exist
06:01 PM twnqx: running the original software
06:01 PM Ameisen: so, I don't use the mapping trick
06:01 PM Ameisen: which makes loads/stores slower
06:01 PM Ameisen: :(
06:01 PM twnqx: because i also realized
06:01 PM Ameisen: one nice thing about x86 - it doesn't care about alignment during load/store
06:02 PM Ameisen: aka... mov/mov
06:02 PM twnqx: that the cpu sometimes can handle unaligned access, sometimes it can't
06:02 PM Ameisen: https://github.com/xoreaxeaxeax/movfuscator
06:02 PM Ameisen: if you've never seen that
06:02 PM Ameisen: some CPUs can handle unaligned access of certain sizes
06:02 PM Ameisen: and not others
06:02 PM Ameisen: that is - the alignment must be equivalent to the size you're trying to read
06:03 PM Ameisen: some require word alignment at all times (and only have load/store for words)
06:03 PM Ameisen: some have no alignment requirements (like x86)
06:03 PM twnqx: and i wonder what this code really is supposed to do
06:03 PM Ameisen: look at that movfuscator link if you've never seen it
06:04 PM Ameisen: it was proven that the x86 MOV instruction is turing complete.
06:04 PM Ameisen: So he wrote a compiler that only uses MOV
06:04 PM twnqx: https://gist.github.com/chrschmidt/6344ab8c11589ff6bb8c28df8b3b51f4 partial output of my emulator
06:04 PM Ameisen: I'm unfamiliar with the arch you're working on
06:04 PM Ameisen: so I can only offer vague assistance
06:04 PM twnqx: call -> nop -> ret
06:04 PM Ameisen: what is your host?
06:04 PM Ameisen: x86-64?
06:04 PM twnqx: yeah
06:05 PM Ameisen: please use intel syntax :
06:05 PM Ameisen: :(
06:05 PM * Ameisen hates reading AT&T syntax
06:05 PM Ameisen: it's an intel arch, use their syntax :|
06:05 PM twnqx: that's not the host, the code is from the running trciore
06:05 PM Ameisen: I never understood ATT syntax
06:05 PM Ameisen: even AVR/ARM/etc syntax is more similar to Intel's
06:05 PM twnqx: the code is also amended for my readability :p
06:05 PM Ameisen: I am still working on a virtual architecture
06:05 PM Ameisen: doesn't mimic any real CPU
06:05 PM Ameisen: it's designed to be easy to write backends for, and easy to write emulators for
06:06 PM twnqx: e.g. signed decimal + hex immediate, plus effective result, plus side effects
06:06 PM Ameisen: first instantiation is pure 32-bit - instructions are 32-bit, immediates are 32-bit
06:06 PM twnqx: tricore is a FUN arch
06:06 PM twnqx: 32/64 bit
06:06 PM Ameisen: working out the one complex instruction
06:06 PM Ameisen: shuffle
06:06 PM Ameisen: shfl (zero, $1, 0b000'000'000'111) = $2 --- this would populate $2 with all zeros, except the lower byte would be the upper byte from $1
06:06 PM Ameisen: shfl ($1, $1, 0b111'110'101'100) = $2 --- this just endian swaps $1 into $2.
06:06 PM twnqx: 64bit by combining 32bit regs, like x86
06:07 PM twnqx: and then
06:07 PM twnqx: it can only do 16bit immediates.
06:07 PM Ameisen: however, since the immediate only uses 12 bits... I have 20 bits I have no idea what to do with
06:07 PM Ameisen: I can make it way more complex and do more
06:07 PM Ameisen: like transformation of bytes
06:07 PM twnqx: so ANY jump turns to "load upper 16bit, add lower 16 bit, jump indirect"
06:07 PM twnqx: >_>
06:07 PM twnqx: decompilers love it.
06:07 PM Ameisen: i was considering duplicating the 12 bit accessors to another set, and having them be XORd against the first set
06:07 PM Ameisen: which would make it way more flexible
06:08 PM Ameisen: right now it's a simple shuffle, but just so much wasted bittage
06:08 PM Ameisen: alternatively, I could give it three source registers, and use 16 bits for shuffling... though I could still do the same xor thingy
06:08 PM twnqx: affff5f8 dc 05 ji %a5
06:08 PM twnqx: a0000000 3c 04 j +8 ($08) <a0000008>
06:08 PM twnqx: a0000008 91 00 00 28 movh.a %a2, 32768 ($8000)
06:08 PM twnqx: a000000c d9 22 1e b2 lea %a2, [%a2], 8926 ($22de)
06:08 PM twnqx: a0000010 dc 02 ji %a2
06:08 PM twnqx: 800022de 7b 00 00 d0 movh %d13, 0 ($0000)
06:09 PM Ameisen: it's a nice little instruction that the compiler backend likes
06:09 PM Ameisen: since it also can do endian swapping
06:09 PM Ameisen: including _sized_ endian swapping
06:09 PM twnqx: hand-of from rom to uncached flash, first thing: jump to cached flash
06:09 PM Ameisen: it's the only instruction in the entire ISA that actually can work at a sub-word level
06:09 PM twnqx: are there cpus that can't swap?
06:09 PM Ameisen: no, but it's not a swap instruction
06:09 PM Ameisen: it's shuffle
06:10 PM Ameisen: you can use shuffle to swap
06:10 PM Ameisen: and do lots of other stuff
06:10 PM Ameisen: I based it off of SSE's shuffle
06:11 PM twnqx: i actually can get about 80k instructions deep into the code. already had to emulate the timer sub system for it...
06:11 PM Ameisen: that ISA, as said, isn't a real CPU
06:11 PM Ameisen: it's an ISA meant only for emulation
06:11 PM Ameisen: meant to replace vemips for my game stuff
06:11 PM twnqx: i ave more fun breaking things than creating things.
06:11 PM Ameisen: since it also replaces copyright issues with imgtec
06:11 PM Ameisen: who own MIPS
06:11 PM Ameisen: I'm still working on a few games where you build/program robots to fight
06:11 PM twnqx: isn't MIPS free, which is why the chinese clone it?
06:12 PM Ameisen: you can debug them in gdb/visual c++/etc
06:12 PM Ameisen: no
06:12 PM Ameisen: the chinese just don't care about patents and copyright
06:12 PM Ameisen: never have
06:12 PM Ameisen: MIPS spec is available for free, but it has licensing
06:12 PM Ameisen: and imgtec stopped talking to me once I explained to them what the emulator was
06:12 PM Ameisen: which makes me uncomfortable using it
06:13 PM Ameisen: I even offered to work with imgtec to make it into full-fledged development emulator
06:13 PM Ameisen: which they desperately need
06:13 PM Ameisen: no response
06:13 PM Ameisen: I have one of the only MIPS32r6 implementations there is, and nobody wants it :P
06:13 PM Ameisen: it wouldn't be hard to make it cycle-correct to arbitrary chips, either
06:14 PM Ameisen: but, that's why I'm working on my custom arch
06:14 PM Ameisen: the custom ISA is _designed_ to be easy to write backends/emulators for
06:14 PM Ameisen: easy ot port to a toolchain, easy to emulate/AOT/whatnot
06:14 PM Ameisen: simpler than other virtual ISAs I've seen as well
06:15 PM Ameisen: they tend to try to compact the code too much - which makes sense performance-wise, but makes backends and emulators harder to write
06:15 PM Ameisen: I'm keeping it simple
06:15 PM Ameisen: just let the AOT brute force it
06:15 PM Ameisen: Plus, since I have a (patent pending) streaming compression algorithm which lets you access compressed data via a pointer and automatically decompresses on the fly, I can keep instruction data compressed in memory for the emulator, anyways
06:16 PM Ameisen: I don't want to go into details about that algorithm, but in benchmarks, it tends to be faster that just decompressing an entire stream and using it uncompressed.
06:16 PM Ameisen: for a few reasons
06:16 PM Ameisen: it's also simpler to use
06:16 PM Ameisen: since you just get a pointer you use like normal
06:17 PM Ameisen: It's nice for some of my codebases since I don't need to have multiple pipelines
06:17 PM Ameisen: and it works with multiple threads, so I can give a compressed pointer to something like Direct3D APIs and it works
06:17 PM Ameisen: and is fun as hell to watch it access data
06:18 PM Ameisen: I really need to submit the patent though
06:18 PM Ameisen: costs money, don't have money atm
06:18 PM twnqx: patents are expensive, yeah
06:18 PM Ameisen: it's a very useful algorithm, though, and I want to defensively patent i
06:18 PM Ameisen: it
06:18 PM Ameisen: and I've seen nothing similar to it
06:19 PM Ameisen: I've also gotten the algorithm to work with compression schemes other than zlib
06:19 PM Ameisen: I think... I had brotli working
06:19 PM Ameisen: snappy didn't work very well