#avr Logs

Sep 26 2017

#avr Calendar

12:08 AM Casper: rue_house: ?
12:18 AM day__ is now known as daey
12:27 AM _ami_: interesting device: https://www.freetronics.com.au/blogs/news/new-product-mac-address-module#.Wcndt6uRVhE
12:37 AM Casper: stupid imo
12:38 AM Casper: a small flash script could fix the issue easilly
12:39 AM Casper: on flash, get date and time of day, convert that to 3 bytes, modify eeprom file for those 3 bytes
03:31 AM _ami_: usb_bulk_read/write() are for both Isochronous and bulk enpoints?
05:36 AM mmfood: I have an 24 detent encoder for setting a value on a timer, but it is glitching at a really low turn rate. What should I look for to find a higher quality encoder?
05:42 AM LeoNerd: The price? ;)
05:49 AM Emil: mmfood: of course it is glitching when you turn it slowly
05:49 AM Emil: It's not a potentiometer
05:49 AM Emil: You have to add filtering
05:58 AM mmfood: Emil: I might have phrased that poorly, of course it is not glitching if I turn it REALLY slow, but it doesn't take much.
05:58 AM LeoNerd: Also, don't forget it's still just two switches. Switches bounce
06:00 AM mmfood: I have an RC-filter of 100nF and 27k at each pin atm, maybe that needs some tweaking
06:01 AM LeoNerd: An arsey filter? ;)
06:02 AM mmfood: I don't have a oscilloscope at hands atm either so I can't really see whats going on
06:02 AM LeoNerd: Ah, that's unfortunate
06:14 AM Emil: wait
06:15 AM Emil: mmfood: wat
06:15 AM Emil: rotary encoders glitch if you turn them slowly
06:15 AM Emil: they work fine if you turn them fast
06:15 AM Emil: (depending on design, of course)
06:15 AM LeoNerd: A well-designed one shouldn't
06:15 AM Emil: mmfood: http://www.electroschematics.com/wp-content/uploads/2015/06/rotary-encoder-arduino-wiring.png
06:15 AM LeoNerd: That's why they are Grey coded
06:16 AM Emil: if you can call it gray coding
06:16 AM Emil: That's an overstatement imho
06:16 AM LeoNerd: It's a 2-value 4-state trivial case of Grey, yes
06:16 AM Emil: They just switch in the order you turn the knob
06:17 AM Emil: it's a coincidence that it matches gray
06:17 AM LeoNerd: Huh?
06:17 AM LeoNerd: The proper ones will be a 2-value Grey
06:17 AM LeoNerd: A on, then B on, then A off, then B off
06:17 AM Emil: you don't understand :D
06:17 AM LeoNerd: With each detent, just a *single* one of those values will change
06:17 AM Emil: sigh
06:18 AM Emil: LeoNerd: it's just phase shifted by 90 degrees
06:18 AM Emil: It's a coincidence that it matches gray encoding
06:19 AM LeoNerd: Eh; the reasoning doesn't matter. It still happens to be Grey, and thus have Greylike properties
06:21 AM Emil: Just treat the other output as a clock and for every clock latch check the state of the other output.
06:21 AM Emil: Clock edge*
06:21 AM LeoNerd: Yah, that's what I do
06:21 AM Emil: Falling/rising*
06:22 AM Emil: LeoNerd: meaning: if it was gray code you'd need a state machine to track it
06:22 AM Emil: It's just coincidence that it matches
06:26 AM cehteh: about glitching: some (most) rotary encoders need debouncing
06:28 AM LeoNerd: Yah; I usually run mine on the same I²C-attached GPIO expander that my other front panel buttons are on
06:29 AM LeoNerd: I find that the INT->ISR schedule for a tiny delay -> read over I²C delay is quite nice for debounce
06:29 AM cehteh: hah hack :D
06:30 AM cehteh: some rather expensive rotary encoders use hall sensors
06:31 AM LeoNerd: Hack? That's a lovely neat design :P
06:31 AM LeoNerd: It's proven very reliable for me anyway
06:33 AM cehteh: https://upload.wikimedia.org/wikipedia/commons/a/a8/Gray_code_rotary_encoder_13-track_opened.jpg .. or optical
06:48 AM Emil: cehteh: I wish I had that high quality rotay encoders <3
06:49 AM LiaoTao: That's beautiful
06:49 AM LiaoTao: Though how does it read the tracks?
06:49 AM Emil: LiaoTao: top middle
06:49 AM Emil: LiaoTao: that's a scanner
06:50 AM _ami_: internet of shit: https://www.indiegogo.com/projects/smalt-the-world-s-first-interactive-centerpiece-health#/ :P
06:50 AM LiaoTao: Reflected light?
06:50 AM Emil: _ami_: >$9,426 USD raised by 0 backers
06:50 AM Emil: :DDDD
06:50 AM Emil: wtf
06:51 AM _ami_: Emil: it did not get enough fund :P
06:51 AM _ami_: closed now.
06:51 AM _ami_: but look at the idea :P
06:51 AM LiaoTao: Jesus Christ
06:55 AM _ami_: how to transfer data on isochronous data endpoints from linux host to device?
06:56 AM _ami_: i wonder why default libusb does not implement isochronous transfer :/
06:56 AM _ami_: check /usr/include/usb.h -> no function for iso transfer
06:58 AM LeoNerd: Maybe isochron is harder to do from the userland that libusb will be running in? It requires quite precise timing constraints
06:59 AM LeoNerd: Best done in kernel, or on a real RTOS
07:02 AM _ami_: LeoNerd: good point.
07:02 AM _ami_: it was simple for me to create an isochronous usb device
07:02 AM _ami_: https://pastebin.com/khujrMHg
07:02 AM _ami_: now i need to find a working isochronous sample at host side.
07:03 AM _ami_: i wonder if libusb-1.0 has support for iso.
07:04 AM _ami_: i was trying with usb_bulk_write/read to read/write to iso eps.
07:05 AM _ami_: i get these warnings..
07:05 AM _ami_: [Sep26 20:22] usb 2-1.8.2: usbfs: process 4304 (a.out) did not claim interface 0 before use
07:05 AM _ami_: aha, so i have to claim interface before using.. weird... did not have to do with control/bulk EPs
07:10 AM Emil: _ami_: why not use a newer version of libusb?
07:11 AM _ami_: Emil: yes, i would use the newer version.
07:11 AM Emil: Ohwait, 1.0 is apparently the newest
07:11 AM Emil: I thought it was at 2.0
07:12 AM Emil: _ami_: https://emil.fi/jako/kuvat/2017-09-26_14-21-59_UbdJTKSW.png does not resolve
07:12 AM Emil: oops
07:12 AM _ami_: 1.0 is the latest
07:13 AM _ami_: there are two usb versions.
07:13 AM _ami_: one is at /usr/include/usb.h
07:13 AM Emil: http://www.amitesh-singh.github.io/ doesn't resolve
07:13 AM Emil: which is what you have on the descriptor
07:13 AM _ami_: other is /usr/include/libusb/*
07:13 AM _ami_: Emil: http://amitesh-singh.github.io/
07:14 AM Emil: _ami_: but you have the www one on the descriptor ;)
07:14 AM _ami_: yeah :P
07:14 AM Emil: https://emil.fi/jako/kuvat/2017-09-26_14-43-03_KrLLbTCL.png
07:18 AM _ami_: damn. this libusb functions are so different from default usb functions :P
09:23 AM rue_house: I'v heard a lot of frustration with libusb
09:25 AM Tom_L: off today?
09:26 AM Tom_L: haven't seen much of you
09:29 AM rue_house: no, its another work day
09:46 AM _ami_: rue_house: yeah :/
09:52 AM johnnyroboo: Hey I have really basic question. I was looking at the build process we use in class and it uses objcopy but doesn't copy the .bss section. Why? I understand that it is zeroed out but still isn't it needed?
09:57 AM rue_house: hmm, I'm just headed to work, can you wait 9 hours?
10:00 AM Tom_L: are you giving me a choice?
10:13 AM Emil: johnnyroboo: what would have that section be used for?~
10:20 AM Tom_itx: The BSS segment, also known as uninitialized data, is usually adjacent to the data segment. The BSS segment contains all global variables and static variables that are initialized to zero or do not have explicit initialization in source code.
10:21 AM Tom_L: it's the bull shit section
10:30 AM polprog: bull shit section :D
10:33 AM johnnyroboo: Yeah so doesn't that mean any uninitialized is missing from the program at run time? Since it's not included in the hex file that is flashed to the system?
10:34 AM johnnyroboo: ^variable
10:35 AM polprog: no, the variable would be allocated during runtime in this case believe
10:50 AM Emil: bss is uninitialised data
10:51 AM Emil: according to avr-libc
10:55 AM Emil: Any bss data that is edites runtime is assigned either unique sram or register
01:15 PM woddy1 is now known as EmperorTrump
01:23 PM JanC_ is now known as JanC
05:42 PM cehteh: https://img-9gag-fun.9cache.com/photo/a7DVNpL_700b.jpg
05:43 PM cehteh: i always liked the good old fashioned screw terminals :)
05:46 PM Tom_L: your wiring job?
05:47 PM cehteh: no
05:47 PM Tom_L: A) it has to be a plastic box
05:48 PM Tom_L: B) the green terminal GND is backward on one switch
05:48 PM Tom_L: which is supposed to have it's own bare wire anyway
05:49 PM Tom_L: white is typically neutral and black is 'hot'
07:56 PM enh: hi
08:07 PM _ami_: enh, yo,
08:07 PM enh: all right there?
08:08 PM _ami_: Yup
09:49 PM enh: Only now I believe the protocol I wrote to transfer arbitrary data via SPI is working well in both directions. Such a hard task this thing is
09:51 PM rue_shop3: Tom_L, wow, thats ****ed
09:54 PM Tom_L: not my pic
09:55 PM Casper: cehteh: what? how can there be 120V across two screw on a common box??!?
09:59 PM tpw_rules: they wired hot to ground on one of the switches
10:08 PM Casper: yeah plastic box...
10:08 PM Casper: which I really don't like, and I even wonder why they are legal
10:18 PM enh: Plastic boxes for what?
10:19 PM Tom_L: for house wiring
10:23 PM enh: They are everywhere
10:24 PM Tom_L: yeah but that's what allowed that fail to fail
10:24 PM enh: You mean in the walls? Behind switches and outlets?
10:24 PM Tom_L: insulation
10:24 PM Tom_L: yes
10:24 PM enh: Here you almost cannot find metal boxes any more. All PVC.
10:24 PM Tom_L: one of the switches' gnd was miswired
10:25 PM Tom_L: you can
10:25 PM Tom_L: but not as many
10:25 PM enh: Switches carry ground in US?
10:26 PM Tom_L: yeah but it's kinda redundant
10:26 PM Tom_L: earth gnd
10:26 PM enh: Here most switches are single channel.
10:27 PM Tom_L: just the metal frame is gnd
10:27 PM Tom_L: nothing internal to the switch
10:27 PM enh: ah, ok.
10:27 PM enh: I see on TV, on programs like Property Brothers, How different wiring is in US houses.
10:28 PM Tom_L: different ages
10:28 PM enh: Here in Brazil it is hard to find tripolar cables.
10:28 PM enh: We pull 2.5mm, or 1.5mm single cables together to make them tripolar.
10:29 PM enh: And we have masonry and flexible tubes everywhere.
10:29 PM enh: All hard to change.
10:29 PM enh: US is much more practical
10:42 PM Thrashbarg_ is now known as Thrashbarg