#avr Logs

Nov 19 2017

#avr Calendar

12:17 AM absynth is now known as dan2wik
03:03 AM day is now known as daey
03:06 AM DusXMT: rue_shop3: And... how does that relate to my question about whether interrupts are discarded or delayed when global interrupts are disabled and later enabled? (which I found out is the latter, thanks to Emil) I couldn't care less about the 7-segment display
03:13 AM cehteh: DusXMT: its more lowlevel than that
03:14 AM cehteh: you need to differentiate between interrupts being generated (the hardware sets the bit that some interrupt is pending)
03:14 AM cehteh: and interrupts are being handled (when saied bit is set it jumps into the ISR)
03:18 AM DusXMT: cehteh: Of course. So that means that when global interrupts are enabled, the hardware periodically checks all enabled interrupts to see if any of the flags that indicate that it occured are set (which can occur even when global interrupts are disabled, presumably), and according to that runs the appropriate ISRs?
03:18 AM * DusXMT just wants to know whether he's understanding it right
03:19 AM cehteh: somethink like that, as hardware does it, its hardwired on single instruction
03:20 AM DusXMT: Okay, thank you :)
06:18 AM * nuxil yawns
06:18 AM nuxil: mornings
06:22 AM _ami_: usbdisp using stm32f103X/libopencm3 + custom kernel driver https://pbs.twimg.com/media/DO-ZIsdUQAAKx4o.jpg
06:22 AM nuxil: so im sitting and looking at example codes on github. i see a lot, well most people use _BV(whatever). i never use it.
06:22 AM _ami_: ili9488 8 bits parallel display.
06:23 AM nuxil: what does _BV stand for ? i know what it does. im not sure how the name relates to its operation
06:23 AM _ami_: _BV is bit shift macro defined in avr-libc header files
06:23 AM _ami_: _BV(X) ==> 1 << X
06:23 AM nuxil: i know. im asking why is it called _BV
06:23 AM nuxil: B for bit... V for ? :p
06:24 AM _ami_: ask atmel engineers
06:24 AM nuxil: :p
06:26 AM nuxil: _ami_, what are you working on there ?
06:26 AM _ami_: its a usb display
06:26 AM _ami_: wrote firmware and then kernel driver
06:26 AM nuxil: nice :)
06:26 AM _ami_: running Enlightenment WM on it.
06:27 AM nuxil: awesome. i ran englightment maybe like 10+ years ago.
06:27 AM nuxil: it was so much prettier than gnome :p
06:27 AM nuxil: but useless :p
06:28 AM _ami_: nuxil: its much better now :)
06:29 AM _ami_: i use the raster's dark theme.
06:29 AM _ami_: along with paper theme for gtk themes
06:30 AM _ami_: nuxil: https://extra.enlightenment.org/themes/flat
06:30 AM _ami_: i have compiled his recent theme and put at e server few months back.
06:31 AM _ami_: but you know making themes takes lot of time
06:31 AM nuxil: so is the orginal developer still working it. or has it been handed down to someone else?
06:31 AM _ami_: nuxil: raster you meant?
06:31 AM nuxil: yea
06:34 AM cehteh: last i heared he works for samsnug, doing tizen and TV stuff
06:35 AM _ami_: yes
06:35 AM _ami_: he is my boss :D
06:35 AM cehteh: hehe
06:35 AM cehteh: i once met him in 2001 or so
06:36 AM cehteh: crazy times that where .. dotcom bubble
06:46 AM _ami_: cehteh: nice. i did not know that you know him. small world.
07:49 AM Emil: Hmm
07:50 AM Emil: Does gcc automatically convert <<n where n is greater than 2 to multiplication on megss?
07:51 AM Emil: Since hardware mul is faster than consecutive shifts
07:51 AM cehteh: likely, i doubt they leave out such an simple optimization
07:52 AM cehteh: how much cycles is multiplication?
07:53 AM Emil: 2
07:53 AM Emil: 8x8=>16
07:53 AM cehteh: the more interesting question is how it implements when the shift amount is variable
07:56 AM Emil: well
07:56 AM Emil: hmm
07:58 AM Emil: thats actually a good question
07:59 AM Emil: we should have a competition
08:01 AM cehteh: i am having fun with implementing a small scripting language i wanted to use since years :D
08:52 AM day is now known as daey
09:26 AM nuxil: cehteh, what kind of language? brainfuck, omgrofl :p ?
09:45 AM day is now known as daey
09:46 AM antto: "Omgrofl is not case-sensitive, thus lol is the same as LoL. You may use this to produce nicer code."
09:46 AM antto: x_x
09:49 AM cehteh: nuxil: nah serious one, used for optarg parsing and C glue language
09:50 AM cehteh: something lke optargs are a macro program --IF --EQ foo bar --DO --PRINT "Hello World" --END in short
10:00 AM nuxil: :)
10:02 AM day is now known as daey
10:03 AM nuxil: So question. what are you gonna use it for. are you doing it because "you can and as a exersise for your self", when there are tonz of small scripting language out there thats OS&Gpl to be used.
10:05 AM nuxil: so question is really. why reinvent the wheel when they already come in all sorts of sizes :p
10:08 AM cehteh: there is nothing exactly like i want, so i want to see how far i can go, and i have real use for it
10:09 AM cehteh: should become very small and more tightly integrated in C than other (i do a lot in lua which is a nice extension language, but still stays rather beside C)
10:09 AM cehteh: with its own datatypes, memory model and vm
10:10 AM nuxil: oki. i never used lua myself. i hear they say its one of the fastest ones to use. and i dont doubt that. seen that many games have moved from python and other languages to lua.
10:10 AM nuxil: but i always was a python dude myself :p
10:11 AM cehteh: python is a truckload
10:12 AM nuxil: you dont want python if you want speed
10:12 AM nuxil: its slow as hell
10:12 AM cehteh: stil faster than ruby :D
10:12 AM cehteh: but lua is small and fast
10:12 AM nuxil: yup
10:12 AM cehteh: but i want something i can really integrate even in really small tools
10:13 AM cehteh: just a few kb in size
10:18 AM day is now known as daey
10:31 AM fooman2011: Hello. For my project I will need a large memory storage that will be read/write a lot of times. Could you please tell me what kind of memory I should use ? EEPROM ? Flash Nand ? Other ? A DIP component will be great (easy to sold)
10:32 AM cehteh: SD card? ....
10:32 AM LeoNerd: How nonvolatile does it need to be?
10:32 AM cehteh: battery backed SRAM?
10:33 AM cehteh: punchtape!
10:33 AM nuxil: lol
10:34 AM day is now known as daey
10:34 AM cehteh: maybe avr's are not up to the job when you want to do massive data handling
10:35 AM fooman2011: Oh yeah sorry another requirement is that the data must be kept even if the power is cut.
10:35 AM cehteh: even if you can connect SD cards .. handling huge ones will be slow and pita in sdio mode
10:36 AM cehteh: moreover .. what shall happen on partial writes (power cut while write in progress) .. you need some system handling that, which is pretty doable, but could become cumbersome on a avr
10:37 AM fooman2011: SD cards ? too complicated to manage I think...
10:38 AM fooman2011: i'm a noob
10:38 AM cehteh: actually thats among the easiest
10:38 AM fooman2011: Sold an SDcard slot should be difficult
10:38 AM nuxil: um.. not really
10:39 AM cehteh: still why so much data? and cant you offload the data storage (send it via serial to some computer)
10:39 AM cehteh: maybe a raspberry pi is better cut for the job? what are you gonna to do?
10:40 AM nuxil: yea, a pi can store massive data.
10:40 AM nuxil: look into Pi zero
10:40 AM cehteh: pi itself not and it might be unreliable, but you can do some stuff on it at least
10:41 AM antto: FRAM ;P~
10:41 AM cehteh: yes that works too
10:41 AM cehteh: lots of options
10:42 AM cehteh: sram with supercapacitor as backup power
10:42 AM fooman2011: the project must be very low current
10:42 AM fooman2011: the power is given by 3 AAA cells
10:42 AM cehteh: thats pretty much
10:43 AM cehteh: some kind of data logging or what?
10:44 AM fooman2011: ?
10:44 AM nuxil: hes asking if it is.
10:44 AM fooman2011: I have an eppaer screen, and an atmega328. one time per day the image will be updated from the memory to the epaper screen
10:45 AM fooman2011: i need memory to store the data
10:45 AM cehteh: sd card ..
10:45 AM cehteh: doesnt need power when not active, with epaper you can go into deep sleep
10:46 AM cehteh: that will last centuries on 3 AAA cells when done right
10:46 AM cehteh: years at least :D
10:46 AM fooman2011: this is the objective
10:47 AM cehteh: maybe go for lithium primary cells .. because their self-discharge ia almost zero
10:47 AM cehteh: normal AAA cells alcaline or whatever discharge faster than you draw power :D .
10:48 AM fooman2011: thanks for the advice
10:48 AM cehteh: but it depends pretty much on you doing good electronics design (w/o leaking power, resistive loads) and proper programming to sleep the whole thing
10:49 AM fooman2011: cehteh
10:49 AM cehteh: AVR's are also not the best suited for such things, but should still woirk
10:50 AM nuxil: fooman2011, http://codeandlife.com/2012/04/25/simple-fat-and-sd-tutorial-part-3/ maybe its helpfull
10:50 AM fooman2011: cehteh: the problem with sdcard can be corrupted if the power is cut during a read or write operation.
10:50 AM cehteh: fooman2011: only during a write, but not during read
10:51 AM fooman2011: I read somewhere that even during a read it can be corrupted
10:51 AM cehteh: and when you power by battery, how can power be cut?
10:51 AM nuxil: fooman2011 use the battlerycheck code written by some guy in here. and dont write if batt power is lower then N.
10:51 AM cehteh: exactly
10:51 AM cehteh: you only turn on the sd card stuff when the battery voltage is sufficient,
10:52 AM nuxil: make a flashing light saying batt change needed :p
10:52 AM cehteh: that drains the battery even more :D
10:52 AM day is now known as daey
10:52 AM nuxil: jup.. so he has to change :p
10:53 AM cehteh: but you can put a static "battery empty" on the eink display and shutdown
10:53 AM cehteh: and when you need realy high reliability you add checksums and redundancy
10:54 AM cehteh: maybe 3 or more SD cards with the same content, then you can make an election algorithm comparing all data and choose by majority about what data is correct
10:54 AM cehteh: i dont know what you are planning to do
10:55 AM cehteh: prolly there are even military or space grade non volatile storage solutions ... with enough money at hand :)
10:57 AM fooman2011: thanks for your advices, I will try to use an sdcard.
10:59 AM cehteh: you may also look into MSP430 µC instead AVR's
10:59 AM nuxil: fooman2011, if you need to check battery you can use this http://git.pipapo.org/?p=battswitch.git;a=blob;f=src/battswitch.c
11:00 AM nuxil: its for atiny45. just adapt it
11:00 AM fooman2011: Is UART is possible using MSP430 ?
11:00 AM cehteh: nuxil: that draws too much power :D
11:00 AM fooman2011: lol
11:01 AM nuxil: hehe
11:01 AM cehteh: was meant for shorter lived lipo watchdog, but the voltage divider always draws a bit current and it doesnt do deep sleeps
11:02 AM cehteh: with a 5Ah block lipo for an afternoon thats not a problem :)
11:02 AM cehteh: fooman2011: just check out, i never used the MSP's
11:03 AM cehteh: and using AVR's would be simpler because there is gcc and lots free resources available
11:03 AM cehteh: while ultra low power stuff has a lot complications
11:04 AM cehteh: see voltage divider problem, sleep modes, how to wake up etc etc
11:06 AM fooman2011: yep
11:06 AM nuxil: yea. but if you use megaohms it will last a long time, but still a unvanted drain.
11:07 AM cehteh: and doesnt work reliable
11:08 AM cehteh: picks up noise easily
11:10 AM day is now known as daey
11:22 AM feliwir: hey, has someone used the official Bosch Drivers for BME280 and BMI160 before? It requires me to define set a template function for read/write and delay
11:22 AM feliwir: https://github.com/BoschSensortec/BME280_driver
11:23 AM feliwir: how would i use the SPI interface of that driver with the arduino?
11:24 AM fooman2011: ok well in fact I only need an AVR to wake up one time per day and send UART command. What is the best AVR to do that ? With the lowest current consumption in sleep mode.
11:24 AM fooman2011: MSP430 ?
11:32 AM NoHitWonder: there's gcc for msp430 too
11:34 AM NoHitWonder: TI has partnered with SOMNIUM® Technologies Limited (http://somniumtech.com) (previously with Red
11:34 AM NoHitWonder: Hat until first quarter 2016) to bring you a new and fully supported open-source compiler as the successor
11:34 AM NoHitWonder: to the community driven MSPGCC. The MSP430 GCC uses the MSP430 ABI and is compatible with the
11:34 AM NoHitWonder: TI compiler. This free GCC compiler supports all MSP430 devices and has no code size limit.
11:36 AM fooman2011: cehteh: the MSP430 voltage range is 1.8V-3.6V so 3 AAA (4.5V) cannot be used. The epaper screen voltage range is 3.3V-5.5V any advice to power this using the low current as possible ?
11:43 AM fooman2011: is reducing voltage draws current ?
12:05 PM day__ is now known as daey
12:14 PM rue_ is now known as rue_mohr
12:14 PM rue_mohr: nuxil, BV = BitValue
12:14 PM fooman2011: Here is the very detailed problem. I have an Epaper Display Screen (voltage range: 3.3V-5.5V). One time per day the I would like that a Microcontroller wakes up, sends UART commands to the screen and then back to sleep. The objective is to power this using the same battery cells during several years. Now I need your help to choose the micro controller and the battery cells.
12:19 PM rue_mohr: ok, if you write a program to just hold an avr in full sleep mode, see how the power consumption compares to your battery life
12:20 PM rue_mohr: you might be able to use the alarm on a RTC chip with a zero-standby power circuit
12:20 PM rue_mohr: then your only powering the rtc
12:22 PM day__ is now known as daey
12:44 PM Emil: fooman2011: some attiny
12:44 PM Emil: well
12:44 PM Emil: actually
12:44 PM Emil: atmega
12:54 PM day__ is now known as daey
01:37 PM nuxil: Atiny has low power consumption – Active Mode: 1 MHz, 1.8V: 300 μA, – Power-down Mode: 0.1 μA at 1.8V
01:37 PM nuxil: dont know about atmega
01:40 PM Emil: They are quite similar
01:40 PM Emil: You can get down to a few nanoamps iirc
01:40 PM nuxil: o.O
01:41 PM nuxil: well. 0.1u is 100n :p so in powerdown mode its already there
01:43 PM nuxil: isnt basiclally all atmel "avr" chips low power consumtion?
01:45 PM Emil: sorta
01:54 PM polprog: if oyou disable everything but the core
01:54 PM polprog: then only the core takes the power
02:11 PM antto: there are some xmegas which are meant for (uber?) low power, you might want to check those as well
02:12 PM antto: and xmegas are 3.3V or less
02:31 PM rue_shop3: use a fet to turn the whole avr off
02:31 PM rue_shop3: use a rtc chip to do a wakeup
02:31 PM rue_shop3: on alarm
02:31 PM rue_shop3: DS130...6?
02:31 PM rue_shop3: an rtc will take less power than anything you can come up with, I'm sure of it
02:32 PM polprog: yeah
02:32 PM rue_shop3: I can show you a zero standby current power controller
02:32 PM polprog: a hard power switch :P
02:32 PM rue_shop3: no, an electronic switch the rtc can do a wakeup with
02:34 PM rue_shop3: pretty sure the alarm pin still works on the dallas rtc's when the vcc is off
02:35 PM nuxil: what i dont get about his project is his display. is it suppose to be active all time ? he said once a day he wanted to upload a pitcure to it.
02:37 PM nuxil: is he suppose to go to the screen every day at set time and watch it for a few sec?
02:38 PM polprog: huh?
02:39 PM nuxil: that fooman2011 dude who needed somesetup with battery and would last long time
02:39 PM polprog: ah
02:39 PM nuxil: oh. he has left
02:40 PM polprog: yeah
02:40 PM polprog: i had to scroll up
02:40 PM Emil: Which is annoying af
02:40 PM polprog: some epaper thingy
02:40 PM Emil: As fuck*
02:40 PM polprog: epaper keeps the state when it's powered of, am i right?
02:41 PM nuxil: idk. never messed with them.
02:41 PM polprog: im thinking about oleds
02:41 PM polprog: got pretty inspired by this years hackaday badge
02:42 PM Ameisen: so..
02:42 PM Ameisen: is there an equivalent to avr-size to use on object files
02:42 PM Ameisen: to determine the symbol/section sizes in them
02:42 PM Ameisen: trying to have my build-tool print the sizes of objects so I can identify quickly what are large
02:42 PM polprog: just "size"
02:42 PM Ameisen: avr-size on an object file is just returning 0 0 0 0
02:42 PM polprog: ;)
02:43 PM Ameisen: I'm on Windows; I don't have 'size'
02:43 PM Ameisen: that'll return the size of the object file, anyways, as a file
02:43 PM Ameisen: but that won't be very useful for me
02:43 PM polprog: nevermind then
02:43 PM Ameisen: since it's LTO
02:43 PM polprog: like the tape?
02:44 PM Ameisen: tape?
02:44 PM polprog: LTO magnetic tape cartridges
02:44 PM Ameisen: https://gcc.gnu.org/wiki/LinkTimeOptimization
02:44 PM polprog: ah
02:45 PM Emil: Ameisen: virtual linux
02:45 PM Emil: Ameisen: >I'm on windows is an excuse
02:45 PM Emil: install linux on main computer
02:45 PM Emil: or dualboot
02:45 PM Emil: or something
02:46 PM polprog: i have never programmed on windows lol
02:46 PM polprog: except for school's "cs classes"
02:46 PM Ameisen: why would I want to reboot to Linux so my build tool can get the size of an object file
02:46 PM Emil: And neither should you
02:46 PM Ameisen: that sounds like an INCREDIBLY convoluted build tool
02:46 PM Emil: Ameisen: >Developing on Windows
02:46 PM Emil: LULZ
02:46 PM Ameisen: Emil - don't really care about your opinion in this matter.
02:47 PM Ameisen: So... you might want to stop that track right there
02:47 PM polprog: it's possible to develop on windows
02:47 PM Emil: Ameisen: well you shouldn't whine about not having linux tools, then
02:47 PM polprog: those are not linux tools
02:47 PM Ameisen: I could trivially add 'size', but it's an LTO file
02:47 PM polprog: it's gnu tools
02:47 PM Ameisen: thus, there are no clear sections
02:47 PM Emil: Ameisen: also cyqwin or WSL
02:47 PM Ameisen: it's before garbage collection.
02:47 PM polprog: there probably is an implementation on windows like vim or emacs ha
02:48 PM polprog: s
02:48 PM Ameisen: Thus I'm having difficulty figuring out how to figure out where the large symbols are
02:48 PM nuxil: you just need sometinhg to show the size ? anything ?
02:48 PM Ameisen: getting the raw size of an LTO object file isn't going to be useful
02:48 PM nuxil: powershell ?
02:48 PM Ameisen: nuxil - Ideally I can figure out where large symbols are.
02:48 PM Ameisen: LTO object files are before link and garbage collection, so it's not useful
02:48 PM Ameisen: since you can have one that is 2 MiB, and 0 bytes afterwards
02:48 PM Ameisen: once the linker throws it all away
02:49 PM Ameisen: I tried emitting an ELF with symbols, but for whatever reason, I still cannot derive symbol sizes
02:54 PM polprog: how cool is that, this http://uk.farnell.com/densitron/dd-128128fc-6a/pmoled-128-128-colour/dp/1829707 has some driver file for arduino on github
02:54 PM polprog: that helps
02:55 PM Ameisen: so far, unsure how to get symbol sizes out of the ELF, as nothing seems to work
02:55 PM Ameisen: interestingly, I _do_ get some more valid data if I take the ELF, convert it to RAW, and then convert it back to ELF?
02:57 PM Ameisen: annoyed by the warnings I get with lround when I use it on an int24
02:57 PM Ameisen: there is no lround overloaded for int24.
03:01 PM nuxil: this any help ? http://www.atmel.com/webdoc/avrlibcreferencemanual/group__demo__project_1demo_project_obj.html
03:06 PM Ameisen: I've actually gone over all those docs...
03:06 PM Ameisen: for whatever reason, it simply isn't working in my case
03:14 PM day__ is now known as daey
03:17 PM Ameisen: Interesting
03:17 PM Ameisen: I just cut 4 KiB out of my .text section
03:17 PM Ameisen: I'm on O3. I set fno-early-inlining (which turns off early inlining and I guess forces inlining heuristics).
03:17 PM Ameisen: I then set finline-limit to a very high value
03:18 PM Ameisen: these combined made my .text section shrink quite a bit
03:18 PM Ameisen: my guess is that when inline-limit is high on its own, early inliing just goes "OK INLINE THIS!"
03:18 PM Ameisen: when you have it off, a high inline-limit makes ALL functions eligible, and the heuristic does a better job
03:19 PM Ameisen: before: 117626 366 5054 123046 1e0a6 .bin/tuna.elf
03:19 PM Ameisen: after: 114628 366 5051 120045 1d4ed .bin/tuna.elf
03:20 PM Ameisen: just letting y'all know
03:20 PM Ameisen: figured anyone else doing AVR work would want to know
03:34 PM Ameisen: If the inline-limit value is too large or small, the code generation is worse
03:34 PM Ameisen: so, I'm working on hand-tuning the value
03:34 PM Ameisen: the default value is not good though
03:52 PM polprog: good job
03:52 PM Ameisen: -finline-limit=134217728
03:52 PM Ameisen: that value generates the best code for me
03:52 PM Ameisen: higher is worse, lower is the same or worse
03:53 PM nuxil: how did you come to that value ?
03:53 PM Ameisen: by starting with a high value and dividing it by two over and over, testing the binary size
03:53 PM nuxil: :)
03:53 PM Ameisen: brute force
03:54 PM Ameisen: the next div2 lower is the same
03:54 PM Ameisen: lower than that gets worse
03:54 PM Ameisen: multiply it by two, worse again
03:54 PM Ameisen: default value is WAY worse
03:54 PM Ameisen: might be different for other projects.
04:29 PM Emil: Ameisen: you can't find a value like that
04:49 PM rue_mohr: nuxil, he said its epaper, so it can be powered down and will maintain its image
04:51 PM nuxil: oki.
04:51 PM nuxil: Emil, why cant he do that ?
04:52 PM rue_mohr: Ameisen, whats the limit do?
04:59 PM Ameisen: sets an arbitrary max (the value itself is unknown as to what it actually 'is') as per the max function size the compiler will consider for inlining
05:00 PM Ameisen: fno-early-inlining disables early inlining, and thus forces inlining heuristics
05:22 PM Ameisen: I use a number of other options that also help that aren't obvious
05:27 PM rue_shop3: and its in...?
05:27 PM rue_shop3: tell me its not bytes
05:27 PM rue_shop3: if you have any fucntions that are even 134217728 bytes, you have what must be the worst code in the world your trying to compile
05:28 PM rue_shop3: I'v never been able to get gcc to inline anything, even when I tried to box it into a corner
05:28 PM Ameisen: it has no unit
05:28 PM Ameisen: it's literally an arbitrary value
05:28 PM Ameisen: it has no definition
05:29 PM rue_shop3: ofcourse...
05:29 PM Ameisen: I'd rather the compiler consider basically everything though, than just saying 'nah'
05:29 PM Ameisen: I'd also rather the compiler not say 'sure' before testing.
05:29 PM Ameisen: :P
05:32 PM rue_shop3: if I put the word "inline" before a _1_ line function, I'd really appreciate that it actailly did inline it
05:32 PM rue_shop3: but alas, no
05:32 PM Ameisen: well
05:32 PM Ameisen: neither C nor C++ specs guarantee such a thing
05:33 PM Ameisen: there's the forceinline modifier which is an extension in basically all compilers
05:33 PM Ameisen: it will honor if it it's possible
05:35 PM rue_shop3: pretty sure I tried a few of them, it would NOT inline the, basically macros, I was asking it to
05:35 PM rue_shop3: so, where I can, I just use macros now so it cant not inline it
06:11 PM Emil: nuxil: because it's not just a monotonic function
06:17 PM Ameisen: With O3: 109324 368 5051 114743 1c037 .bin/tuna.elf
06:18 PM Ameisen: err
06:18 PM Ameisen: With O3 and all my options:
06:18 PM Ameisen: 109324 368 5051 114743 1c037 .bin/tuna.elf
06:18 PM Ameisen: with just Os: 88518 418 5047 93983 16f1f .bin/tuna.elf
06:18 PM Ameisen: with Os and all my options: 85390 374 5051 90815 162bf .bin/tuna.elf
06:18 PM Ameisen: I can get smaller than that, I haven't calibrated my 'tinycode' build
06:19 PM Ameisen: https://pastebin.com/ChQvjyrT
06:25 PM Ameisen: there's a few options enabled by Os that make it larger, and a few other options not enabled that make it smaller
06:26 PM Ameisen: however, I haven't done the tinycode build fully as the smallest possible code isn't the fastest
07:22 PM rue_shop3: ok, it took a day
07:22 PM rue_shop3: but I moved the reprap
07:22 PM rue_shop3: Ameisen, well, no, the largest code is the fastest, thats the rub
07:23 PM rue_shop3: you conserve memory or improve performance
07:23 PM Ameisen: I mean, I could certainly make larger code that's slower.
07:23 PM Ameisen: So can GCC
07:23 PM Ameisen: there are a few options enabled that shrink code because GCC gets confused and starts emitting redundant instructions
07:23 PM Ameisen: which is both larger and slower
07:32 PM nuxil: rue_shop3, are you sure ? what if you got the skill of structure packing. a lost art
07:32 PM nuxil: http://www.catb.org/esr/structure-packing/
07:34 PM nuxil: :p
07:40 PM rue_shop3: k, I know about bitfields
07:40 PM rue_shop3: huh
08:45 PM Ameisen: rue_shop3 - I had to disable a few optimizations that were bloating code but not making it faster (slower, actually)
08:45 PM Ameisen: Presumably due to incorrect optimization heuristics in GCC for AVR
08:56 PM rue_mohr: is it written in C++
09:22 PM Ameisen: is what written in C++
09:27 PM rue_shop3: the code you working on
09:28 PM rue_shop3: arg, I cant seem to buy enough pads of postits for the shop, can never find any
09:31 PM Ameisen: I almost exclusively use C++, so yes
09:32 PM Ameisen: almost all the settings work for C as well
09:32 PM Ameisen: except for a few that are if'd out for C
09:32 PM rue_shop3: well there is part of your performance problem, its too busy with memory managment
09:33 PM Ameisen: Not sure if I want to justify that with a response, since it seems that you have a very deep confusion about how C++ works.
09:33 PM Ameisen: I can assure you that I am using no dynamic memory management anywhere in this codebase, which would be difficult in the first place as I would have first had to implement a heap, which would be annoying on AVR.
09:34 PM Ameisen: for the same reason malloc/realloc/free would be difficult.
09:34 PM rue_shop3: pretty sure new() is the same hit as malloc()
09:35 PM rue_shop3: maybe a bit worse
09:35 PM Ameisen: 'new' is only defined to allocate an object and then call the constructor on the pointer.
09:35 PM Ameisen: how it does that is implementation-defined
09:35 PM Ameisen: being 'worse wouldn't make any sense.
09:36 PM Ameisen: however, using new (other than placement new) would not be able to be done without the same infrastructure that using malloc would require, unless I implemented custom new overloads to use a stack allocator or something
09:36 PM rue_shop3: iirc, malloc wont even initialize the new space, but new() has to set up lots of pointers and default values
09:36 PM rue_shop3: and thats why c++ methods have such a hit on microcontrollers
09:38 PM Ameisen: new() will initialize to the default value of the type.
09:38 PM Ameisen: Very few codebases in the first place use either malloc _or_ new, as most libraries for microcontrollers completely lack heap support.
09:39 PM Ameisen: Not that you have to use 'new' to use classes or class methods anyways
09:39 PM Ameisen: Only if you want to allocate them using dynamic allocation
09:39 PM Ameisen: When you only have 8 KiB of RAM, I don't know why you'd want to do that.
09:40 PM Ameisen: Regardless, this codebase does not perform any dynamic memory allocation.
09:47 PM rue_shop3: hey
09:47 PM rue_shop3: that might be a good point, how much ram is on a t13?
09:48 PM rue_shop3: :/ 64 bytes
09:48 PM rue_shop3: drat
09:48 PM rue_shop3: oh no, only 64 in the eeprom too
09:49 PM rue_shop3: bugger
09:49 PM rue_shop3: I wonder how many cycles to get a value from program flash
09:50 PM rue_shop3: ok, might work, looks like 3
09:53 PM rue_shop3: I want to put some code on a tiny13 that needs 2x 256byte lookup tables
09:53 PM rue_shop3: leaves half the memory for the software, its going to be tight
09:58 PM Ameisen: I only have a few lookup tables, they're in progmem
09:59 PM rue_shop3: your on a timy85 tho, right?
10:03 PM Ameisen: no
10:03 PM Ameisen: atmega2560
10:03 PM rue_shop3: oh sorry, I thought you were the tiny85 video guy
10:04 PM rue_shop3: huh
10:04 PM rue_shop3: I can put a t13 and a usb converter into a joystick and have a custom usb joystick
10:19 PM Casper: so yesterday I go check if the rope for the christmas wreath is still good... I pull on it and it unhook from the roof hook... today I take the ladder and go check it up... the hook ripped off... grrr now I need a longer and bigger hook :(
11:12 PM day__ is now known as daey