#avr Logs

Jan 12 2018

#avr Calendar

12:00 AM nuxil: my god. why is faceshit full of scam adverts today. anyone else notice this ?
12:03 AM nuxil: i got to stop using that shit :p
12:03 AM cehteh: i didnt notice, i never started using it
12:03 AM nuxil: if you havent created FB by now. dont. youre not missing out on anything big.
12:03 AM nuxil: *FB account.
12:09 AM Casper: me no facebook account!
12:09 AM Casper: never had!
12:09 AM Casper: but this week 2 clients got those fake virus alert and to call microsoft...
12:09 AM Casper: something is fishy right now
12:13 AM nuxil: im sitting here and woundering if i should buy a etcher tank for making pcb's. found a rather cheap one i think.
12:13 AM nuxil: https://www.kjell.com/no/produkter/elektro-og-verktoy/elektronikk/kretskort/behandling/etseaggregat-p89420
12:13 AM nuxil: compared the prize to elfa.se. around 1/2 time cheaper here :p
12:13 AM nuxil: now if i can get the name of the tank and not just the model number maybe i can find it cheaper on Ebay :p
12:22 AM Casper: before buying a tank
12:22 AM Casper: try to transfert your design on some pcb first
12:22 AM Casper: and see if you can get a proper transfert
12:22 AM Casper: it is not as easy as it sound
12:23 AM nuxil: im just sick of doing these prototype boards. they work. but they are ugly as hell :p
12:23 AM Casper: really, try the transfert first
12:24 AM Casper: before investing in anything else
12:24 AM Casper: what kind of printer do you have? inkjet or laser?
12:24 AM nuxil: yea. im not buying anything yet,
12:24 AM nuxil: i got many printers :p
12:25 AM nuxil: lasers both ink
12:25 AM nuxil: both laser & inc
12:26 AM nuxil: found the tank on ebay. lol. and its more expensive
12:27 AM Casper: do you plan to do toner transfert?
12:28 AM nuxil: no
12:31 AM nuxil: i need a laminator or some other heating method. a iron ? i have none of thouse :p
12:34 AM nuxil: anyway. there is alot of new stuff i want. i also need a new scope.
12:58 AM Casper: really, before you buy the tank, find a way to transfert. The laminator I bought was too cold. I did some search online, and it seems like you need some special type and modify them
02:52 AM Jartza: Casper: I bought the cheapest laminator I could find locally (around 19€) and new thermostat to it (200°)
02:53 AM Jartza: it's not optimal as PCB travels through too quick, but 2-3 passes and it's perfect
02:53 AM Jartza: there was a simple schematic how to slow down the motor too, but I was too lazy
04:26 AM Smuckerz is now known as TheComplaintJar
05:24 AM Emil: And there we go
05:24 AM Emil: hmac-sha256 also works
05:24 AM Emil: the api is horrible though :D
05:39 AM Emil: https://emil.fi/d/2018-01-12_13-38-26_S9G9AYul.png
05:39 AM Emil: Behold
05:39 AM Emil: https://emil.fi/d/2018-01-12_13-38-58_7OxPYhCv.png
05:41 AM Haohmaru: u code in nano?
05:41 AM Haohmaru: h4x0r
05:44 AM Emil: ikr
05:44 AM Emil: But realy
05:44 AM Emil: I should move to vim
05:45 AM Emil: It's getting tiresome editing stuff manually in nano
05:45 AM Haohmaru: get an IDE at least
05:45 AM Emil: while vim has glorious powers
05:45 AM Emil: Haohmaru: >IDE
05:45 AM Emil: TOP KEK
05:45 AM Emil: Like I would touch a filthy IDE even with a long stick :D
05:45 AM Haohmaru: shadap and accept it!
05:45 AM Emil: If it does't run in a ssh terminal it's not worth using ;)
05:45 AM Emil: Well, that's a lie
05:46 AM Emil: But eh :D
05:46 AM Haohmaru: do you even use a desktop?
05:47 AM Emil: Yeah, all the time
05:47 AM Emil: https://emil.fi/d/2018-01-12_13-46-32_bO05WK2P.png
05:47 AM Haohmaru: wut is that? bitchx?
05:48 AM Haohmaru: uber big resolution, vector font
05:48 AM * Haohmaru vomits
05:48 AM Emil: eh?
05:48 AM Emil: No vector font
05:48 AM Emil: Resolution is only 2560x1440
05:49 AM Haohmaru: it's vector
05:49 AM Emil: It's 150% scaled Windows
05:49 AM Emil: The ssh program is putty on tray
05:50 AM Haohmaru: and you're filtering away channel events
05:50 AM Haohmaru: meeeeh
05:50 AM Emil: :D
05:50 AM Emil: You think I want to see all the fucking joins and quits
05:50 AM Emil: helll naw
05:50 AM Haohmaru: how do you not talk with ghosts then
05:51 AM Emil: I do, but less often because I rarely initiate specific conversations with people
05:51 AM Emil: And well
05:52 AM Emil: Most people also use a vpc/bouncer
05:53 AM Emil: Like, I mostly bash rue_ and talk with Polprog and LeoNerd :D
05:53 AM Emil: On this channel
05:53 AM Haohmaru: who doesn't
05:53 AM Haohmaru: ;P~
05:54 AM Emil: True, true
06:37 AM day: Haohmaru: you read the joins/quits? i rely on the autocomplete to tell me if someone is here or not
06:37 AM day: i guess the joins come in handy
06:39 AM Haohmaru: the point is not whether i "read" them
06:40 AM Haohmaru: i use specific text colors so ignoring joins/quits is easy, yet they are not hidden
06:43 AM day: i have them on as well. obviously color coded as well. but the only good they do imho is give me a better feeling of time when skipping through the backlog
08:33 AM jragon: If I want to use a function call back in an isr does it the pointer to it need to be volatile?
08:36 AM jragon: At the moment the lcd screen is flashing: https://gist.github.com/Jragon/0ba003b5e02085bc8f46ae401045acc5, if I comment out the function call it the "update prop: " is still output to the console, so the timer is set up fine
08:42 AM nuxil: well. volatile int *p will not do much. that would just declare a pointer to a volatile int.
08:42 AM nuxil: to get a pointer thats volated you need to do something like; volatile int * volatile p;
08:43 AM jragon: does it need to be volatile for the ISR to use it? Since it's not actually modifying the pointer I wouldn't have thought so
08:44 AM nuxil: im not sure. i just know that if you want to change a some int/char etc you need to use voltile.
08:44 AM jragon: the ISR has the right address, printing the value of voltage_update and properties[i]->update prints the same result
08:56 AM jragon: so I changed the isr a bit, probably for the best. It now just sets a flag, and then in the main function it calls the callback if the flag is set
08:56 AM jragon: this works fine! :)
08:56 AM nuxil: the flag is volitale ?
08:56 AM jragon: yeah
08:57 AM nuxil: :)
08:57 AM jragon: I'm not sure why the pointer to the function didn't work
08:57 AM jragon: this way the ISR is shorter anyway
08:59 AM nuxil: anywho. have fun. im off for a nap :)
09:07 AM Jartza: well you should not spend too much time in ISR anyways
09:07 AM Jartza: so setting flag and calling callback elsewhere is much better
09:08 AM rue_: yep, get out of your isr as fast as you can
09:09 AM rue_: its holding up other things, which might be ISRs
09:09 AM rue_: never delay, sleep, or while() in an isr
09:10 AM rue_: while is what causes lockups
09:15 AM jragon: mm. This might have been a bit of serendipity; had the call back actually worked my isr would be looong!
09:30 AM eszett: hi. are there, for the sake of concordance, standards in AVR color coding? I have yellow for RST, blue for CLK, white for MISO and green for MOSI
10:14 AM polprog: Emil: whats that X.org icon on the windoze tray?
10:15 AM Emil: polprog: It's xming
10:15 AM Emil: Allows x11 tunneling to winshit
10:16 AM polprog: nioce
10:16 AM Emil: So I can tunnel x11 applications, even the whole god damn desktop, to my machine
10:16 AM polprog: nice!
10:16 AM Emil: Yeah it's pretty cool
10:16 AM Emil: but you have to keep in mind that x11 tunneling is heavy as fuck :D
10:16 AM polprog: i need to set it on my bsd thing then! so i can connect over from windoze
10:16 AM Jartza: I use XQuartz for resons...
10:16 AM Emil: the perf is abusmal if you don't have a good connection
10:16 AM Jartza: reasons, even
10:16 AM Emil: Jartza: what are those reasons?
10:16 AM Emil: polprog: nonono
10:16 AM Emil: polprog: you don't need anything but x on your server
10:16 AM Jartza: Emil: Macbook pro & MacOS :)
10:17 AM Emil: ah
10:17 AM Emil: polprog: you only need to install xming on your windows machine
10:17 AM polprog: https://puu.sh/yZRcl/e130ebb8b3.png
10:17 AM Jartza: and because XQuartz comes with it
10:17 AM polprog: Emil: IKR
10:17 AM Emil: polprog: I got cancer
10:17 AM Emil: :D
10:17 AM polprog: i meant i need to set it up on windows so i can remote into my bsd machine
10:17 AM polprog: why
10:17 AM Emil: polprog: you said the other way ;)
10:17 AM Emil: "I need to set it on my bsd"
10:18 AM polprog: also i have JPQs color filtered as you can see
10:18 AM polprog: englisch languag hardy languag
10:18 AM polprog: gotta go, dinners ready
10:18 AM Emil: jpq?
10:18 AM polprog: join/part/quit
10:19 AM Emil: ah
10:34 AM polprog: how do you like my dekstop?
10:35 AM polprog: the sektop on BSD is even more minimalistic than yours Emil, it just runs openbox and Xterm ;P
10:35 AM Emil: polprog: it's beautiful
10:36 AM Emil: What I don't like, though, is how your activit is unsorted :D
10:40 AM polprog: Emil: its sorted by new
10:40 AM Emil: I know
10:40 AM Emil: It's infuriating :D
10:40 AM polprog: i like the way the numbers swap around :p
10:40 AM Emil: Hmm, that is pretty good though
10:40 AM polprog: took a long time to make. and im very happy with it ;)
10:45 AM Emil: Oh you coded it yourself?
10:46 AM Emil: That's pretty cool
10:46 AM polprog: no, it took some time of setting up to find the right feel
10:46 AM polprog: it's xfce with some custom themes installed ;)
11:06 AM eszett: Is someone of you using avrdude? which version? I've read that avrdude version 5.8 is best compatible with my programmer. However, all around the latest version of avrdude is given as 5.1, i'm abit confused??
11:08 AM eszett: mea culpa, It's 5.10, and I've interpretet 5.10 as 5.1, like a machine
11:08 AM eszett: I start thinking like a machine
11:15 AM eszett: I don't get it... If I open tera term I can change the mode of my programmer, e.g. SPI mode. If I close tera term the programmer mode is lost again. If I leave tera term open and use avrdude, avrdude says "access denied". How can I change the mode of my programmer and use avrdude?
11:19 AM polprog: what programmer are you using that you can change it's mode via teraterm? buspirate?
11:23 AM eszett: ye
11:23 AM eszett: I use tera term to change the mode of buspirate to "SPI"
11:24 AM polprog: hmm ok
11:24 AM eszett: But how can I use avrdude then?
11:24 AM eszett: avrdude says "access denied" because tera term is running. If i close tera term, the mode configuration is lost again.
11:24 AM polprog: i never used buspirate with avrdude, what options are you using?
11:24 AM eszett: well, I set the clock speed for example
11:25 AM eszett: the clock speed of bus pirate
11:25 AM polprog: "known broken versions: avrdude < 5.8, buspirate firmware 5.0-5.9"
11:26 AM polprog: http://dangerousprototypes.com/docs/Bus_Pirate_AVR_Programming#AVRDude_.26_Bus_Pirate_Version_Compatibility
11:26 AM eszett: ye I checked firmware compatibilty
11:26 AM eszett: it's fine here, I have avrdude version 5.10
11:26 AM eszett: and my bus pirate is firmware version is version 5.10 (the same number)
11:26 AM polprog: ok
11:27 AM eszett: according to the docs of dangerous prototypes this is compatible
11:27 AM polprog: whats the avrdude error message then?
11:27 AM eszett: however, I don't get the logic behind changing configuration of bus pirate with tera term, if you can't save the configutation
11:28 AM eszett: I have with avrduide the error message "rc=-2"
11:28 AM eszett: which basically the same as "target doesn't respond to programmer"
11:28 AM polprog: teraterm is for operating the bus pirate in interactive mode
11:28 AM eszett: interactive mode?? hmm
11:28 AM polprog: also, have you tried running avrdude with -v or -vv for verbose logging?
11:29 AM eszett: ye, here is the result: https://i.imgur.com/px4ucuh.png
11:30 AM polprog: also the config resets because avrdude sends a # as the first command (reset)
11:31 AM eszett: yes? the config even resets when I quit tera term
11:31 AM polprog: i dont know...
11:31 AM polprog: there is a paragraph about rc=-2 error in the link there
11:31 AM eszett: but IIRC in my past times, bus pirate could work as an AVR programmer even without changing any config
11:32 AM Emil: eszett: avrdude supports buspirate directly
11:32 AM Emil: eszett: read the documentation
11:32 AM eszett: thats interesting
11:33 AM eszett: that means all of the important config I can do with tera term, I can do with avrdude, too?
11:33 AM Emil: And the latest version of avrdude is 6.xx
11:33 AM Emil: 6.3
11:33 AM eszett: ah..
11:33 AM Emil: and 5.1 is definitely not 5.10
11:34 AM eszett: yes it was an error of reasoning, I thought like a microcontroller 5.10=5.1
11:34 AM Emil: eszett: https://emil.fi/toolchain read this or http://www.nongnu.org/avr-libc/user-manual/install_tools.html to compile the latest version
11:34 AM Emil: eszett: 5.10 is never 5.1
11:34 AM eszett: ye
11:35 AM Emil: I hate the convention myself but it means: 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 5.10, 5.11, 5.12, ...
11:35 AM eszett: exactly
11:35 AM Emil: so v5.10 means five point ten
11:35 AM polprog: its ok, 10 > 1
11:35 AM Emil: and v5.1 means five point one
11:36 AM eszett: 5.ten =)
11:36 AM polprog: what about v4.14.13 like the linux kernel has
11:36 AM Emil: polprog: version four point fourteen point thirteen
11:37 AM Emil: what those numbers mean is another thing though, usually first is major, second is minor and third is rolling or something
11:37 AM polprog: ah i thought you hate the convention to use two digits as the minor version
11:38 AM Emil: polprog: I hate how unreadable it becomes
11:38 AM polprog: version 1.I1ll1i
11:38 AM polprog: or even better hex versioning: 8.B8
11:53 AM polprog: oh ffs im sick of netbsd
11:53 AM polprog: doesnt work well as a graphical system ,there is not even firefox in the binary package repo, i dont have time to compile every piece of crap i wanna use
12:22 PM antto: day, irc colors i mentioned earlier: https://i.imgur.com/NBZzEif.png
01:40 PM polprog: Emil: thanks for telling me about xming! https://puu.sh/z00XH/99d82955a3.png
02:39 PM nuxil: uninstall all thouse games, dont waste your time on that stuff.. read books instead :p
02:48 PM polprog: never!
03:38 PM nuxil: oh thats right. kids these days dont know how read books :p
03:38 PM nuxil: just kidding :)
03:43 PM jragon: I've broken my callback again :( It seems to be doing the same thing (weirdly flashing the TFT display). I've complicated the structure a bit from an array of structures to a struct with an array inside. https://gist.github.com/Jragon/ba2c5597bb6367b1e55b017b4db9f989
03:45 PM jragon: I can't fathom what change has made the difference. I've tried changing the function prototype back to just (struct prop *), but that didn't help
03:46 PM jragon: I think it may be because properties->p[i]->update doesn't contain the right address
04:01 PM jragon: aha! i hadn't properly initialised the pointer to properties. It's back working now (ish, I've just discovered new issues with the graph drawing functions)
05:05 PM Ameisen: Is there a good, fast floating-point sine approximation for avr
05:32 PM Emil: polprog: np! :D
05:33 PM Emil: Ameisen: fixed point tables sure
05:33 PM Emil: polprog: also I see you have RSS
05:34 PM Emil: polprog: you should watch AnthonyPit1
07:07 PM Ameisen: I actually found an approximation for sine and cosine online
07:07 PM Ameisen: which are certainly faster
07:07 PM Ameisen: and accurate enough
07:07 PM Emil: Than lookup tables?
07:07 PM Emil: Highly doubtful
07:07 PM Ameisen: lookup table would certainly be the fastest approach
07:07 PM Emil: Yeah
07:07 PM Ameisen: would need a lot of entries to be useful
07:07 PM Emil: true
07:08 PM Ameisen: that makes me a little wary of taking a lookup-table approach
07:08 PM Ameisen: this is faster than using the stdlib ::sin and ::cos
07:08 PM Ameisen: with it and a few other changes, I'm able to using my floating-point motion control code even in a 2560, though at a low rate
07:10 PM timemage: Ameisen, an 8th of the full table, i think.
07:10 PM Ameisen: on floats...
07:10 PM Ameisen: what is the 'full table' being defined as?
07:10 PM timemage: Ameisen, -pi to +pi
07:10 PM Ameisen: what's the dV between table entries?
07:10 PM Ameisen: to define the size of the table?
07:11 PM timemage: Ameisen, what i'm getting at is, there's tones of symmetry to exploit in the sine function when it comes to lookup tables. something a lot of people miss.
07:11 PM Ameisen: Oh, sure, because it's basically the same thing in different direction
07:12 PM Ameisen: directions*
07:12 PM Ameisen: but you still need a dV at some point to define how big each 'step' in the lookup table is, which is going to define the precision
07:12 PM Ameisen: for every float value, it's far too large for flash memory
07:13 PM Ameisen: so, some reasonable derivative needs to be defined.
07:17 PM Emil: Ameisen: linear approximation between steps
07:17 PM Emil: Or if you are fancy then parabolic
07:17 PM Emil: they produce really accurate results
07:18 PM Ameisen: well, yes, lerping. Parabolic approximation I think is going to end up slower than a direct sine approximation
07:18 PM Emil: But linear is probably faster
07:18 PM Ameisen: Yes, though it's not accurate.
07:18 PM Ameisen: I'm doing motion control, so those flat ranges could kind of screw things up]
07:19 PM Ameisen: or at least will induce jerk
07:22 PM lunatec: good morning
07:49 PM Emil: Ameisen: linear is actually pretty accurate
07:49 PM Emil: linear terms actually dominate in short ranges
07:50 PM Ameisen: Sure, it's just if your table is too small, it's not going to give smooth motion
07:50 PM Emil: that's true
07:50 PM Emil: but for a pretty accurate sine table you don't need much
07:50 PM Ameisen: and I'm a little wary that 'big enough' is too big
07:51 PM Ameisen: given how limited memory is
07:51 PM Emil: What's your device?
07:51 PM Ameisen: 2560
07:51 PM Emil: lulz, it has plenty of space
07:51 PM Ameisen: I do need to speed up this code more though
07:51 PM Emil: not to mention that you of course store that table in progmem
07:51 PM Ameisen: I am able to run the float-point version at 8KHz
07:51 PM Emil: instead of ram
07:51 PM Ameisen: if I fixed-point it, I suspect far faster is possible
07:52 PM Emil: You didn't think you'd store the lookup table in ram?
07:52 PM Ameisen: No
07:52 PM Ameisen: I just am unsure how many entries I need
07:53 PM Ameisen: Right now, the approximation is a branch, a subtract, a multiply, a multiply, an addition, a multiplication, and an addition
07:53 PM Ameisen: some of those against constants
07:55 PM Emil: 256kB is a huge number. Let's say 16 bit sinewave table (pretty overkill already) and like 1024 samples per quadrant. So you have 1024*2=2048k sinetable that offers great quality
07:55 PM Emil: and that sinewave table can be used for any frequency and so on
07:56 PM Emil: you think that less than 1% of program space is too much?
07:57 PM Emil: You probably only need 256 samples per quadrant at 8 bits so that's only 256 bytes for the table
07:57 PM Emil: That's so little it can easily live in ram
07:58 PM Emil: (the first one could also, it takes only 1/4 of ram)
07:58 PM Emil: Now if you add linear interpolation to that table you get even better results
08:00 PM Emil: Hmm, I could calculate the total error
08:00 PM Emil: which would actually be pretty close to zero
08:00 PM Emil: since it evens out
08:00 PM Emil: but like average sample error could also be calculated
08:01 PM Emil: Integrated over a cycle
08:01 PM Emil: I should quickly model that
08:03 PM Emil: Ameisen: what's your output?
08:03 PM Emil: If it's PWM then lulz
08:05 PM Ameisen: Emil - sorry
08:06 PM Ameisen: no, it's pulses for a stepper motor
08:06 PM Ameisen: I'm generating a sine-based motion pattern for acceleration/deceleration
08:06 PM Ameisen: right now I can only do it at 8KHz
08:06 PM Ameisen: it just can't keep up faster than that
08:07 PM Ameisen: I am doing the tick-based approach rather than the step-based approach, as I haven't come up with a proper discrete derivation of it yet
08:07 PM Ameisen: so I am doing a LOT of mah
08:07 PM Ameisen: math*
08:30 PM Emil: Ameisen: lulz
08:31 PM Emil: You don't need accuracy at all for stepper motor patterns
08:31 PM Emil: also linear ramps are so much easier
08:32 PM Emil: Though if you have optical encoders to get absolute position then sine is fine
08:37 PM Ameisen: Emil - I'm doing motion control, implementing s-curves
08:37 PM Ameisen: not just normal trapezoid fun stuff
08:37 PM Ameisen: so, I don't need perfect precision, but lines in the curve are noticeable in the ramps
08:38 PM Ameisen: also easier to market if it's incredibly smooth rather than just rather smooth
08:38 PM Ameisen: :)
10:08 PM Emil: You could always use greater derivatives
10:08 PM Emil: Parabolic curvers are nice
11:58 PM day__ is now known as day