#avr Logs

Jun 27 2017

#avr Calendar

01:41 AM nikomo_ is now known as nikomo
01:54 AM Thrashbarg_ is now known as Thrashbarg
04:35 AM Thrashbarg_ is now known as Thrashbarg
05:05 AM eichiro_ is now known as eichiro
05:05 AM akaWolf1 is now known as akaWolf
05:09 AM Jartza_ is now known as Jartza
07:32 AM polprog: Emil: sorted that QFN m328 stuff?
07:33 AM Emil: polprog: hm?
07:33 AM Emil: Oh it was just a brainfart on my part
07:34 AM Emil: It should be right
08:44 AM polprog: hmm
08:44 AM polprog: so we have one dmx-capable led light at school
08:44 AM polprog: dmx is basically rs485...
08:45 AM polprog: i found this which looks like it could work, although it would be nice to have some isolation
08:46 AM polprog: https://puu.sh/wvxR4/9c29d13d65.gif
08:46 AM polprog: i guess it's time to get that light going ;)
08:47 AM polprog: would an optocoupler between 232 interface and 485 transceiver be a good idea?
08:47 AM polprog: or sould there be some ready made isolator (probably analog devices makes those) after the 485 transceiver?
08:47 AM LeoNerd: Why bother? If it's on the same power domain, it's not doing anything useful
08:48 AM LeoNerd: Maxim make some good RS485 isolators. I sell boards with them on :)
08:48 AM polprog: just in case somebody plugs phantom 48V supply on the other end :P
08:48 AM polprog: im not the kind of person who buys ready made boards
08:48 AM LeoNerd: Yes but a: don't do that, b: that's why DMX *specifically* says to use 5pin XLR and not 3
08:48 AM polprog: that dmx uses 3 pin xlr
08:48 AM LeoNerd: Anyone using 3pin XLR for DMX deserves what they get. All 48 volts of it
08:48 AM LeoNerd: Also c: RS-485 transceivers are usually rediculously tough things
08:48 AM polprog: also, we dont have 5 pin xlr cables
08:49 AM LeoNerd: The Max chip I use on the isolator is 2.75kV[rms] capable
08:49 AM polprog: so i guess i will try to use the usb-uart converter i have to mate it with max485 i have
08:50 AM LeoNerd: Ah, though it can only withstand -8 to +13V between A/B pins and cable-side ground.
08:50 AM LeoNerd: Soyeah, the 48V phantom mic power will upset it
08:50 AM polprog: i am the only person pluggin things there so i will have to be careful
08:50 AM LeoNerd: MAX485 is similar
08:51 AM LeoNerd: But anyway: the point of an isolator is to handle the case where DMX ground is not system ground on the receiver
08:51 AM LeoNerd: It won't help with 48V phantom power accidents
08:52 AM polprog: i understand DE pin on the max485 enables transmission, so i'll have to pull it high when i send data, so i need to connect it to some RS232 signal pin (on the converter) that goes high on TX
08:52 AM polprog: which pin would that be (apart from TX)
08:54 AM LeoNerd: Any GPIO will do
08:54 AM LeoNerd: The UART module on an ATmega doesn't have a way to signal that in hardware, so you'll have to do it in software
08:54 AM LeoNerd: any pin will do
08:54 AM LeoNerd: But also if you're a DMX receiver, you only ever receive, so you can just hardware that low
08:54 AM LeoNerd: Or if you're a transmitter, you can hardwire it high because a DMX transmitter is driving the lines permanently
08:55 AM polprog: theres no atmega there
08:55 AM polprog: would that pin be DTR?
08:56 AM LeoNerd: Uhwait what are you doing?
08:57 AM polprog: i have an usb-uart (or rather 5V rs232) dongle, with all rs232 pins broken out, and MAX495. I need to make a usb-rs485 converter
08:57 AM LeoNerd: Oh.. for DMX? Yah that's probably not going to go well
08:58 AM LeoNerd: DMX has very exact timing requirements with respect to the break condition; most USB-UART adapters aren't good at break
08:58 AM LeoNerd: Also additionally a lot of them can't even do 250kBaud at all :)
08:58 AM polprog: maybe not DMX...
08:58 AM polprog: rs485 in general
08:58 AM LeoNerd: Mostly they are divisors/multipliers of the 57600 standard
08:58 AM polprog: that converter of mine can do 2M nicely (tested with a scope)
08:59 AM LeoNerd: Sure... they usually go up to 2M, but they're not usually arbitrarily scaled
08:59 AM LeoNerd: There's only a few fixed divisors
08:59 AM LeoNerd: I know that real FT232 chips can do 250000baud, but at least one of the cheaper alternatives can't.. I forget which
08:59 AM LeoNerd: Anyhow.. for something custom you get to just pick the rate, so you can pick one of the standard divisor ones :)
08:59 AM polprog: ok, forget DMX
09:00 AM LeoNerd: I wouldn't suggest using DTR as the control signal though, because OSes often get a bit picky about controlling that. Use whichever of CTS/RTS is the output line (I always forget)
09:00 AM LeoNerd: you tend to get better control on that
09:00 AM polprog: the aim is to get experience and learn serial comms. for example a small avr board on the end of a long cable, communicating via rs485
09:00 AM * LeoNerd nod
09:00 AM LeoNerd: I've done that a lot. I have a bunch of stage-show cueing equipment based on it
09:01 AM polprog: mincom on linux can control flow nicely
09:01 AM LeoNerd: Yes; flow-control is CTS/RTS.. not DTR/DSR
09:02 AM polprog: ah
09:02 AM LeoNerd: CTS/RTS are the "I can handle more bytes now" controls
09:02 AM LeoNerd: DTR/DSR are the "I am alive at all" controls
09:03 AM polprog: and on the avr side, id connect rxd and txd to rxd and txd on the maxim, and that control pins (2 and 3) to a gpio i pull low when i send, right?
09:03 AM polprog: thanks for explaining the CTS, RTS, DTR, and DSR :o
09:03 AM LeoNerd: Yah, or just leave ~RE permanently low
09:03 AM LeoNerd: I don't usualyl find it necessary to turn off the receiver.. I let it receive all the time
09:03 AM polprog: yeah, that's a good idea
09:04 AM LeoNerd: Initially you'd imagine it's easier to do local echo suppression with that, but in practice you have to do all sorts of other things in a multidrop bus *anyway* that it becomes easier to do them all together
09:05 AM polprog: id probably develop some higher level protocol on rs232, like make the CPU acknowledge that it got data, think primitive TCP-like thing
09:06 AM LeoNerd: Yah.. a packetiser
09:06 AM * LeoNerd has one of those
09:06 AM polprog: gimme a sec, ill draw a simple schematic
09:06 AM LeoNerd: Mine is rather loosely based on the packet engine that the nRF24 radio chips use
09:07 AM LeoNerd: I have a mixed radio/wired system with a big base station holding the radio and RS-485 line, and various other stations either on wire or wireless
09:10 AM learath_ is now known as learath
09:10 AM polprog: what does it do?
09:11 AM LeoNerd: "it"?
09:15 AM polprog: the system
09:15 AM LeoNerd: 14:30 <LeoNerd> I've done that a lot. I have a bunch of stage-show cueing equipment based on it
09:15 AM polprog: ah
09:15 AM polprog: ok
09:15 AM LeoNerd: Mostly a huge interconnected bus of lots of LEDs and buttons to trigger the
09:15 AM LeoNerd: them
09:16 AM polprog: would the rs485 comms look like this: https://puu.sh/wvyYL/de87e3a3c7.png
09:16 AM LeoNerd: Sortof; you do want the ground wire in there too
09:16 AM polprog: pardon some details like caps and the fact that both are connected to the vcc
09:16 AM polprog: that's a good idea
09:16 AM polprog: so GNDs connected together
09:17 AM LeoNerd: (is that KiCad in Polish?)
09:18 AM polprog: yes, i noticed that they translated that too :P
09:19 AM polprog: at some point you know the shortcuts so well, you dont even look at menus
09:20 AM polprog: (it must have set itself based on the system-wide locale)
09:21 AM polprog: cant wait to test that when i get back home
09:41 AM polprog: i think i get it now
09:41 AM polprog: thanks
09:41 AM polprog: o/
09:59 AM rue_house: is there a specific 100 - 50 ohm NZR manchester serial encoder / reciever/driver chip?
01:07 PM day_ is now known as daey
02:33 PM xentrac: 0.1 mm wires held together with Kapton tape: https://hackaday.com/2017/06/26/oscilloscope-mod-for-the-blues/
02:34 PM polprog: i like that mod, and im surprised that it's this simple
02:34 PM polprog: luckily that display had the same width for those two colors
02:36 PM xentrac: yeah, lots of displays use either SPI or humongous parallel interfaces
02:46 PM bss36504: I mean, I read the article, "didn't want to wait for a PCB" blah blah blah, but I'll be god-damned if I'm gonna go fuck around with my perfectly functional $4K o-scope.
02:46 PM bss36504: Just make an interposer board and wait two weeks
03:04 PM Emil: Hmm
03:04 PM Emil: I ought to really make my own libs
03:04 PM Emil: instead of this non existent source file control
03:05 PM Emil: Hals are nice
03:05 PM Emil: I am weak
03:06 PM Emil: hMM
03:06 PM Emil: I wonder if I should do it like the standard linux api
03:06 PM Emil: With endpoints
03:07 PM Emil: so I could have a single write(number, buffer,length)
03:08 PM Emil: And then I could associate different peripherals with it
03:08 PM Emil: I think that if I did it compile time it would work okay
03:08 PM Emil: But I bet there would be overhead
03:09 PM xentrac: that's a perfectly reasonable thing to do; check out the open-source sfio library for a good example of how to do it
03:10 PM xentrac: the overhead is about 4-8 instructions per read or write call, which is acceptable if length is large
03:11 PM Emil: I am outgrowing my belowed avrs T.T
03:11 PM Emil: Do you have a link to that lib?
03:11 PM Emil: Google is not playing nice
03:12 PM Emil: to be real though
03:12 PM xentrac: https://github.com/lichray/sfio
03:12 PM Emil: We already have the stream api that we could use with avrs
03:12 PM Emil: Oh it was that
03:13 PM xentrac: depending on what you're doing, sending a stream of bytes to it may or may not be a super useful abstraction
03:14 PM Emil: Is the compiler smart enough to understand that if I do
03:14 PM xentrac: no
03:14 PM Emil: switch(case){constant1: x; break; constant2: y; break;};
03:14 PM Emil: and only use constants when calling a function that uses that case
03:14 PM Emil: it would remove the overhead
03:15 PM xentrac: oh, occasionally
03:15 PM xentrac: if it decides to inline the function, you have pretty good chances
03:15 PM Emil: I mean that should be pretty obvious from the compiler standpoint
03:15 PM xentrac: but if the cases that aren't taken are too large, it might get intimidated out of doing the analysis
03:16 PM xentrac: it's not very good API design anyway
03:16 PM Emil: and it would be allow for a programmer to simply declare a table of functions and call my the constant
03:16 PM Emil: Or how would you do that
03:16 PM xentrac: table?
03:16 PM Emil: I mean
03:16 PM Emil: say I have a "fd" 0 which would mean uart
03:16 PM Emil: and a fd of 1 which would mean spi
03:17 PM Emil: so write(0, buf, len) would write len bytes read from buf to serial
03:17 PM xentrac: I understand
03:17 PM Emil: and write(1, buf, len) would write len bytes from buf out of spi
03:17 PM Emil: how would you do that?
03:18 PM xentrac: that's a totally reasonable thing to do, but that's precisely because you can call it with things that aren't constants
03:18 PM xentrac: you end up with an array of function pointers (or structs containing function pointers, or pointers to structs containing function pointers, or indices into an array of function poniters)
03:18 PM Emil: I disgusting but usable thing would be to sed replace write(1, x, y) with write_spi(x, y) :D
03:19 PM Emil: a macro compiling step >:D
03:19 PM xentrac: true
03:19 PM Emil: or write(SPI, x, y);
03:19 PM Emil: which would be readable
03:20 PM xentrac: I think write_spi(x, y) is preferable to write(SPI, x, y)
03:20 PM Emil: Annoying that we can't trust the compiler >:(
03:20 PM xentrac: the benefit of the second one is that you can define a function that takes the fd to write to as an argument
03:20 PM Emil: xentrac: but then you end up with many differently named functions
03:21 PM Emil: write(SPI, x, y) is clear and nice
03:21 PM xentrac: it's fine to have many differently named functions if they do different things and are called from different places
03:21 PM xentrac: it's bad to have one function that does many things and is called from many different places each of which wants it to do one thing
03:21 PM Emil: I disagree, really
03:21 PM Emil: like that unix/linux
03:21 PM Emil: You have a single unified api of write
03:22 PM Emil: and writing to sockets or files or wherever
03:22 PM Emil: it just werks and is easy to use and remember
03:22 PM eeproks-- is now known as eeproks
03:22 PM Emil: you don't have to think about the physical abstractions
03:22 PM xentrac: yes, and the reason for that is so that you can change what a piece of code does by passing it different file descriptors
03:22 PM Emil: indeed
03:22 PM xentrac: it makes your code more flexible
03:22 PM Emil: indeed
03:22 PM xentrac: but you're talking about code that wouldn't gain that flexibility
03:23 PM Emil: I disagree
03:23 PM xentrac: it would just gain the indirection tax on comprehensibility that we pay gladly in Unix in order to get that flexibility
03:23 PM Emil: It would be flexible
03:23 PM Emil: it's the perf and cost of abstraction that I worry about
03:24 PM xentrac: if you statically assign 1 to SPI and then your code is always using a constant argument, you aren't getting any flexibility
03:24 PM Emil: no
03:24 PM xentrac: if your code is using a *variable* argument, or if you can assign 1 to something that isn't SPI, that's a different situation; you do get the flexibility
03:24 PM Emil: that's why I replaced write(1, x, y) with write(SPI, x, y)
03:24 PM xentrac: and that is an excellent thing to do
03:25 PM xentrac: if you go another step in that direction, you get io(WRITE, SPI, x, y)
03:25 PM xentrac: an additional step further and you just have call(WRITE, SPI, x, y)
03:25 PM xentrac: these are not improvements
03:26 PM Emil: call is redundant
03:26 PM xentrac: however, if you are writing code that sends some bytes to something and you want to be able to send them to somewhere else, you can pass the fd as an argument to your function, and then you have write(output, x, y), which allows you to do lots of useful things
03:27 PM Emil: io(WRITE, SPI, x, y) is "fine" but adds an unnecessary complexity layer, write(where, buffer, length) and read one of course are fine
03:27 PM Emil: because we only have two functions (read and write)
03:27 PM Emil: but multiple endpoints
03:27 PM Emil: (spi, i2c, uart, parallel, ....)
03:27 PM xentrac: for example, you can compile your code under Linux and output to a string and compare the output to the expected output in an automated test
03:28 PM xentrac: sfio makes that pretty easy
03:28 PM Emil: but then we are unnecessarily associating runtime information with constant arguments
03:28 PM xentrac: yes
03:28 PM Emil: unnecessarily storing that information
03:28 PM xentrac: yes
03:28 PM Emil: when it could be compile time compiled away
03:28 PM xentrac: if you want to gain flexibility and eliminate all that runtime overhead, it's possible to do it with C++ templates
03:29 PM xentrac: or code generation
03:29 PM Emil: which that dirty sed thing is
03:29 PM Emil: and I don't want C++
03:30 PM Emil: I want it in C :D
03:30 PM Emil: Fucking inflexible tools god damn it
03:30 PM Emil: :D
03:30 PM bss36504: Emil: C++ templates are, how you say, kawaii :P
03:30 PM xentrac: you could try Rust
03:30 PM xentrac: :)
03:30 PM Emil: >Rust
03:30 PM Emil: >Not even once
03:31 PM xentrac: C is pretty flexible, but it isn't designed for strong compile-time guarantees
03:31 PM Emil: xentrac: but that's what I expect it to do T.T
03:31 PM Emil: bss36504: C++ is känser
03:31 PM Emil: REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
03:31 PM xentrac: ahre
03:31 PM bss36504: If you want to do any serious metaprogramming, templates are the way (assuming you stay in a C-like environment)
03:31 PM bss36504: Preprocessor sucks a bag of dicks
03:31 PM Emil: bss36504: it does T.T
03:31 PM xentrac: mmmm, dicks
03:31 PM bss36504: lol
03:31 PM xentrac: yeah, templates suck for serious metaprogramming but there aren't better options in C-like environments
03:32 PM bss36504: I don't think they suck
03:32 PM bss36504: the template compiler is turing complete. There is literally no end to what you can get the compiler to do for you
03:32 PM bss36504: combine template metaprogramming with SFINAE and you're ready to rule the world.
03:32 PM Emil: And then you have this shit with supporting multiple mcus
03:32 PM Emil: and that's another can of worms entirely T.T
03:33 PM xentrac: bss36504: is there a way to eliminate the redundant 5 on line 109 of http://canonical.org/~kragen/sw/dev3/weemenumain.cc?
03:33 PM bss36504: can you pastebin that so I dont give my work computer cancer?
03:33 PM xentrac: haha
03:33 PM xentrac: uh
03:33 PM Emil: at least linenumbers would be nice
03:33 PM xentrac: can you just git clone it?
03:33 PM xentrac: the directory I mean
03:33 PM Emil: also using spaces
03:33 PM Emil: reee
03:34 PM xentrac: if you mismatch the two 5s the compiler does give you a compile-time error at least
03:34 PM Emil: eemenu<my_noncurses, my_menu<weeweemenu<my_noncurses, 5> >, 5> menu;
03:34 PM Emil: this line?
03:34 PM bss36504: eh i just downloaded it anyway.
03:35 PM xentrac: yes, that one
03:35 PM xentrac: sorry it's such a big example
03:35 PM bss36504: Which 5 is the redundant one, the first or the second?
03:36 PM xentrac: they are redundant with one another; given either you could in theory deduce the other
03:36 PM xentrac: since they're specified on the same line anyway I'd be happy with either direction
03:36 PM bss36504: I guess it depends on the implementation of weemenu<>
03:37 PM xentrac: it's in weemenu.h
03:37 PM bss36504: I mean, I assume you could just make the 5 of the weeweemenu accessable to the enclosing weemenu, right?
03:37 PM xentrac: well, it is accessible to it, yes
03:38 PM Emil: how smart is gcc with optimising function pointers?
03:38 PM xentrac: zero smart
03:39 PM xentrac: maybe there is a really obvious way to make use of the max_nesting of the enclosed weeweemenu to set the max_nesting of the outer weemenu and I'm just not seeing it
03:39 PM bss36504: This menu structure hurts my brain, xentrac
03:39 PM bss36504: why so many classes?
03:40 PM bss36504: Like, what's the difference between a weemenu and a weeweemenu?
03:40 PM xentrac: Well, so, the issue is, uh
03:40 PM xentrac: the user program invokes the weemenu with a keystroke or a request to redraw, right? Like, the top-level event loop or whatever
03:41 PM xentrac: and then weemenu needs to invoke the menu tree function (struct my_menu in this case)
03:42 PM xentrac: but the menu tree function then needs to invoke library functions to do things like materialize menu items and submenus
03:42 PM xentrac: originally I wanted to have just two classes: weemenu and the menu tree function (class)
03:43 PM xentrac: but in order to get all the binding to happen at compile time with no function pointers, each of them had to refer to the other
03:43 PM xentrac: which meant that each one had to be a template parameter to the other
03:43 PM xentrac: so in order to keep the template parameter reference graph from being cyclic in such a way, I broke apart class weemenu into weemenu and weeweemenu
03:44 PM xentrac: so weemenu contains all the things that need to invoke the menu tree function, and weeweemenu contains all the things the menu tree function needs to invoke
03:44 PM xentrac: so it all works, barely
03:44 PM bss36504: I think you're making it way harder than necessary.
03:45 PM xentrac: of course I am! but if you can show me how to make it simpler without using more RAM I would be super happy to be enlightened
03:45 PM Emil: xentrac: is this on a micro?
03:45 PM xentrac: is there a way to assemble such a cyclic type graph in C++ with template parameters? I know how to do it in OCaml but it requires special syntax that doesn't seem to have a C++ equivalent
03:45 PM Emil: No
03:45 PM Emil: Then why do you reaaaally care if it uses one byte more?
03:45 PM xentrac: the whole point is to run it on AVR, yes
03:46 PM Emil: Interestin
03:46 PM xentrac: but weemenumain.cc is a harness to run the same code on Linux for testing
03:46 PM Emil: On what kind of screen are we talking about?
03:46 PM Emil: And what kind of functionality?
03:46 PM bss36504: xentrac: Your menu should be constructable with just one class. You can make that class a template that optionally takes a functor, which would be the "action" for that node. Otherwise I assume the default "action" for a node would be to navigate to sub-nodes
03:46 PM xentrac: like one of those four-line dot-matrix LCDs with font generators built in
03:46 PM Emil: okay
03:46 PM Emil: so
03:46 PM xentrac: bss36504: yes, I agree
03:47 PM Emil: I would just define my menu structure and keep track of it where we are
03:47 PM xentrac: not the node though
03:47 PM Emil: and then on use input
03:47 PM xentrac: the entire menu system
03:47 PM Emil: do whatever we are doing
03:47 PM Emil: it takes the least amount of memory, is fast and just werks
03:47 PM xentrac: since the nodes in the menu system don't exist in memory; the entire five-level-deep menu tree here takes only five bytes of memory
03:48 PM xentrac: Emil: what you are saying sounds like what this code is doing
03:48 PM Emil: xentrac: then why does it look so complicated? :D
03:48 PM Emil: Just keep track of where you are in the menu
03:48 PM Emil: and move according to user input
03:48 PM xentrac: that's right
03:49 PM xentrac: it looks so complicated because of the stuff I was explaining above
03:50 PM xentrac: originally I wrote this code with virtual methods and there were only two classes --- the library weemenu class and the user class that defined the menu structure
03:50 PM bss36504: xentrac: class Node { reference to parent, list of references to children, action functor passed via template} ?? Youre already gonna be hardcoding the menus together, so why does it need to have template arguments for all kinds of junk? I guess you might add a template argument for how many child objects there are in a node
03:50 PM xentrac: but I wanted to eliminate the RAM use for the vtables
03:51 PM bss36504: so basically what I'm saying is use the template to take a functor and use that like a function pointer would be used.
03:51 PM bss36504: https://stackoverflow.com/questions/1174169/function-passed-as-template-argument
03:51 PM bss36504: https://stackoverflow.com/questions/356950/c-functors-and-their-uses
03:51 PM xentrac: no, I know about functors, thanks :)
03:51 PM xentrac: the whole point of weemenu is that the nodes don't exist in RAM
03:51 PM Emil: Why should they?
03:52 PM xentrac: you can't make references to them if they don't
03:52 PM xentrac: and you don't have to hardcode the menus; weemenumain has some submenus with a dynamically variable number of items
03:52 PM xentrac: after line 91, for example
03:53 PM bss36504: Well how would they exist fully in flash if they have dynamic numbers of items? Wouldnt that imply they lived in RAM?
03:53 PM bss36504: All you are gaining, from what I can tell, by not using vtables is less overhead for the address lookup, but no impact on memory consumption
03:53 PM xentrac: No, they don't exist at all except when they're being drawn
03:54 PM Emil: So where do you get the data to populate them?
03:54 PM xentrac: on line 96 there is a sprintf call
03:54 PM xentrac: while they're being drawn you do have a couple of function activation records on the stack
03:55 PM xentrac: (being drawn or being activated)
03:55 PM xentrac: but those are only present during the redraw process; that RAM is freed up for other functions to use when your program is doing other things
03:56 PM Emil: So you want dynamic allocation of memory?
03:56 PM xentrac: Sure, you could call allocating stack frames in C "dynamic allocation of memory"
03:56 PM bss36504: Well, I mean, that is
03:57 PM xentrac: or overwriting the buffer on line 96 with sprintf
03:57 PM xentrac: but usually when people say "dynamic allocation of memory" they don't mean overwriting a buffer with sprintf
03:57 PM xentrac: they mean heap allocation
03:57 PM xentrac: and that I definitely do not want
03:59 PM xentrac: because, among other things, it requires pointers, which are memory-hungry, and because whether it will fail or not at runtime depends on how good your memory allocator is at avoiding fragmentation for the allocation pattern of your program
03:59 PM Emil: https://emil.fi/jako/kuvat/2017-06-27_23-29-15_sxxaBUUt.png
03:59 PM Emil: Is there anything else I should have here
04:00 PM xentrac: and most of the time on an AVR there isn't a whole lot you can do if you run out of memory. in fact usually you can't even detect it; using TVout I got the top of my stack overwriting the framebuffer at times — and then vice versa, leading to a crash
04:01 PM xentrac: you probably want to connect AREF to Vcc also, not just to the capacitor; it doesn't have a pullup
04:02 PM Emil: xentrac: it does
04:02 PM xentrac: really??
04:02 PM Emil: and what I have there is specified in the datasheet
04:02 PM xentrac: okay :)
04:02 PM Emil: Actually connecting it to vcc is baaad
04:02 PM Emil: Externally
04:02 PM xentrac: you probably want a bypass cap on Vcc and maybe separately on AVCC, but maybe you just aren't drawing those
04:03 PM xentrac: Why?
04:03 PM Emil: Bypass is next to ldo
04:03 PM Emil: xentrac: because then you can't use anything else
04:04 PM Emil: Because the internal and other references are connected to the AREF pin
04:04 PM Emil: if you select
04:04 PM Emil: There is no separate analog mux
04:04 PM Emil: https://emil.fi/jako/kuvat/2017-06-27_23-34-06_QdC1Mucp.png
04:05 PM Emil: https://emil.fi/jako/kuvat/2017-06-27_23-34-36_ifMNpZND.png
04:05 PM xentrac: aha, I see
04:05 PM Emil: https://emil.fi/jako/kuvat/2017-06-27_23-35-21_Eo4uptht.png
04:06 PM Emil: https://emil.fi/jako/kuvat/2017-06-27_23-35-35_8qmINMG4.png
04:06 PM Emil: this last one is the most important one
04:06 PM Emil: where it is said clearly
04:06 PM xentrac: also you'd be shorting the output of the analog mux to Vcc, which could set it on fire, according to that diagram
04:06 PM xentrac: I didn't realize this
04:06 PM Emil: yup
04:08 PM xentrac: bss36504: I understand that this code is a difficult-to-understand way to achieve what it achieves, and I would welcome a more straightforward one
04:09 PM xentrac: or even just a way that doesn't require me to duplicate the 5 on line 109
04:10 PM xentrac: the main difficulty with your proposal of having a Node class with pointers to its parents and children is that it occupies RAM proportional to the number of menu items, which weemenu doesn't
04:11 PM xentrac: there's an additional difficulty that if you want the action functor classes to be dispatched statically rather than dynamically, you end up including them as template arguments, which eventually ends up including the child node types as template parameters to the parent node type
04:12 PM xentrac: so ultimately the type of the root node of your menu system encodes the entire menu tree with all of its possible actions somewhere in the tree of template parameters
04:13 PM Emil: Favourite 16MHz smd crystal?
04:13 PM Emil: I have abracons
04:13 PM xentrac: I think I did try something like that but wasn't able to get it to do anything reasonable. I'd hate to try to read the compiler error messages
04:13 PM Emil: but they are "big" :D
04:14 PM xentrac: crystals are big
04:14 PM Emil: No but there are small ones, too
04:14 PM xentrac: if you want small I think you have to go with a ceramic resonator
04:14 PM xentrac: I mean watch crystals are kind of small
04:15 PM xentrac: I wish I had something useful to say about your hardware design, Emil, sorry :(
04:16 PM Emil: xentrac: I decided to optimise
04:16 PM Emil: https://emil.fi/jako/kuvat/2017-06-27_23-45-47_iYsOUaT7.png
04:16 PM Emil: I wonder if I should add another bypass cap though
04:17 PM Emil: Perhaps some 0402 100n >:D
04:18 PM xentrac: no more diode, and you're wiring PB2 high?
04:18 PM cehteh: Emil: i wonder if the ferrite on the output makes any sense
04:19 PM Emil: cehteh: it's to attempt to filter out any RF
04:19 PM cehteh: (wonder == really dont know .. but i have some doubts)
04:19 PM Emil: To better the SNR of the nrf
04:19 PM cehteh: when you need a ultra stable voltage then use some voltage reference ic, or a better rated regulator,and comply to its datasheet
04:19 PM Emil: Not ultra stable
04:20 PM Emil: but with little rf noise
04:20 PM cehteh: prolly better to put that on the input side before the cap
04:20 PM cehteh: but i dunno
04:20 PM Emil: cehteh: I consulted a radio designer for Bluegiga (Silicon labs) that designed most of their bluetooth things
04:21 PM Emil: he said to put it on the output side :D
04:21 PM cehteh: ok
04:21 PM Emil: I did have it on the input side originally
04:21 PM cehteh: yes i seen that
04:21 PM cehteh: both sides
04:21 PM xentrac: ♪ I've choked my clocks from both sides now ♪
04:21 PM Emil: xentrac: I'm leaving B2 to the user to do whatever
04:21 PM Emil: it does have a 16bit output on it
04:22 PM cehteh: while with low power you wont generate much noise anyway, thats proportional to the current switch iirc
04:22 PM Emil: If they don't know that you need to have it as output or wired high, not my problem :D
04:23 PM Emil: Anyone know how to make the CvPCB not block forever btw?
04:23 PM Emil: What are the libs that make it slow as fuck?
04:25 PM Emil: 2x1.6mm
04:25 PM Emil: that's some kawaii shit right there :3
04:25 PM Emil: but the cost is ":D"
04:26 PM Emil: https://www.digikey.fi/product-detail/en/avx-corp-kyocera-corp/CX2016DB16000H0FLJC1/1253-1700-1-ND/6123327
04:27 PM Emil: https://emil.fi/jako/kuvat/2017-06-27_23-57-28_XQwDD8dI.png
04:28 PM Emil: I wonder if this wold give me problems :D
04:28 PM Emil: That's little more than my 6mil traces that 0.3mm
04:28 PM Emil: 12 mills
04:28 PM Emil: mils*
04:29 PM Emil: Well, why the heck not
04:31 PM Emil: What the fuck digikey
04:31 PM Emil: why did you delete shit from my card
04:31 PM Emil: Are you fucking retarded
04:32 PM Emil: Fuuuuuck thiiiis
04:51 PM Emil: Aww shit
04:51 PM Emil: I'm becoming tempted into doing rf design
04:51 PM Emil: Here
04:51 PM Emil: Bare nrf24l01+ chips
04:51 PM Emil: thiiis is dangerous
04:51 PM Emil: But damn would it be kawaii
04:54 PM polprog: rf is voodoo.
04:55 PM polprog: when signals travel better via pipes than traces its the dangerous area
04:55 PM polprog: woooo
04:56 PM Emil: This shit is eating me up
04:56 PM Emil: I have like 20 of those smd nrf24l01+ modules from ebay :D
04:56 PM Emil: And now I would be going to my own design
04:56 PM Emil: I want but I don't want
04:57 PM polprog: so you want bare nrf chips? with pcb antennas and stuff?
04:57 PM polprog: i dont remember what vand was that
04:57 PM polprog: band*
04:59 PM polprog: ok, forget what i said. it looks like theres absolutely minimum amount of parts there
05:00 PM polprog: on the module. id try and make a directional antenna
05:00 PM polprog: a 2.4ghz yagi :P
05:00 PM polprog: i may know more on that topic later
05:00 PM Emil: https://emil.fi/jako/kuvat/2017-06-28_00-30-08_akMMQa3X.png
05:00 PM Emil: Either PCB or Chip antenna
05:00 PM Emil: PCB is more expensive
05:00 PM Emil: I think
05:01 PM Emil: It all comes down to which is more omnidirectional
05:01 PM polprog: hows pcb antenna more expensive
05:01 PM Emil: polprog: chip antennas are cheap
05:01 PM polprog: and whats chip antenna
05:01 PM Emil: and take less area
05:01 PM Emil: http://www.pulseelectronics.com/wp-content/uploads/2016/12/G041.pdf
05:02 PM polprog: wow thats cool
05:02 PM polprog: hell
05:04 PM Jartza: haha
05:04 PM Jartza: I also found out I have some nrf24l01+ stuff in my stash
05:05 PM Jartza: but they are this kind of boards
05:05 PM Jartza: dev boards or whatever
05:05 PM polprog: hell, i have some esp wifi modules i havent used yet
05:05 PM Jartza: with 6-pin header
05:05 PM Emil: Okay lol the chips are like 3€ from digishit
05:05 PM Jartza: sorry, 8-pin
05:06 PM Emil: polprog: I have a fuckton of things I have just bought because eBay is too easy :D
05:06 PM Emil: Like seriously
05:06 PM Emil: I should finish my part list thingy
05:07 PM Jartza: http://i.imgur.com/K3klTAd.jpg
05:07 PM Emil: Yeah I have those, too
05:07 PM Emil: like 20 also
05:07 PM Emil: Doing absolutely nothing :D
05:07 PM Jartza: seems they have collected some dust
05:08 PM Jartza: yeah, I've never used single one of those
05:08 PM Emil: It's the cost of becoming better at the shit you do T.T
05:08 PM polprog: lol
05:08 PM Jartza: I don't even know what to use them for
05:08 PM Emil: What the fuck are these nrf24l01+ modules that mouser claims can do 8Mbps
05:08 PM Jartza: I have no need now :D
05:08 PM polprog: thats a handful of modules
05:08 PM Emil: Jartza: tell me about it T.
05:08 PM Emil: T
05:08 PM Jartza: maybe wireless fricking vga
05:08 PM Jartza: lol
05:09 PM Emil: Ah it's the fucking SPI data rate
05:09 PM Emil: Such cheating
05:09 PM Emil: Jartza: I meaaaaaaaaaaaan
05:10 PM Emil: Yeah no :D
05:10 PM polprog: hey, it just hit me i have a 2.4 ghz yagi antenna in my wardrobe
05:10 PM polprog: gotta get that module
05:11 PM Emil: I'm getting too bold at hw design :D
05:11 PM Emil: Design all the shit
05:12 PM polprog: yeah. my luck with getting ready made modules migh be similar
05:12 PM polprog: im more for designing a rig with some stm than getting a blue pill
05:12 PM polprog: :l
05:13 PM polprog: maybe that explains why i did not buy an arduino xD
05:14 PM polprog: what the hell! its $1 on the net
05:15 PM polprog: lol, ill get 5 of those bastards
05:15 PM Emil: yeah they are cheap as fuck
05:15 PM Emil: But don't expect much range out of them
05:16 PM polprog: it depends on the antenna
05:16 PM polprog: it should be possible to make them talk while on the same desk
05:17 PM polprog: with proper yagis or just wire antennas it may work for bigger distances
05:17 PM polprog: if i could get a second 2.4g yagi...
05:19 PM polprog: there are also 433mhz modules out there
05:19 PM Emil: https://emil.fi/jako/kuvat/2017-06-28_00-49-19_vItW8JRM.png
05:19 PM Emil: These make me hot
05:20 PM Emil: smaller, Smaller, SMALLER
05:20 PM Emil: Smaller Mania
05:20 PM polprog: wow
05:21 PM Emil: This shit's contagious :D stay away polprog, while you still can :D
05:21 PM polprog: mfw chips so small i could sniff them
05:21 PM polprog: :D
05:22 PM Emil: "I love the smell of Silicon in the morning"
05:22 PM Emil: Smell that?
05:22 PM Emil: You smell that?
05:22 PM Emil: Silicon, son.
05:22 PM polprog: i love the smell of rosin in the morning
05:23 PM Emil: Nothing else in the world smells like that. (Except opening chink shit orders >:3)
05:23 PM Jartza: haha yea
05:23 PM polprog: the smell of new as we call it
05:23 PM Jartza: although I need wireless BBQ thermometer
05:23 PM polprog: nrf!
05:23 PM Jartza: been thinking of utilizing thermocouples
05:23 PM Emil: Jartza: jpa can help with dat
05:23 PM Emil: You saw his project
05:23 PM Emil: daaaaamn was it nice
05:23 PM Jartza: oh, didn't
05:23 PM polprog: i can help with TCs
05:23 PM polprog: ;)
05:24 PM Emil: TCs?
05:24 PM Emil: Ah thermocouples
05:24 PM polprog: yea
05:24 PM Jartza: at least I don't think I saw one
05:24 PM Jartza: I must've been in irc too little lately :)
05:24 PM Emil: http://jpa.kapsi.fi/stuff/pix/uunimittari2.jpg
05:24 PM Emil: http://jpa.kapsi.fi/stuff/pix/P1000468.JPG
05:24 PM Emil: http://jpa.kapsi.fi/stuff/pix/uunimittari.jpg
05:25 PM polprog: nice
05:25 PM Emil: Lemme try to find the transmitter pic
05:26 PM Jartza: oh, cool
05:26 PM polprog: theres a maxim chip that gives quite a precise output (8 bits radix iirc)
05:27 PM polprog: my thermo used the chip that gives 2 bit radix
05:27 PM Emil: http://jpa.kapsi.fi/stuff/pix/um_pcb_soldered.jpg
05:27 PM Jartza: but yea, I need something that can handle up to around 350°C or so
05:27 PM Emil: http://jpa.kapsi.fi/stuff/pix/P1000484.JPG
05:27 PM Jartza: so thermocouple
05:27 PM Emil: Jartza: no such thing
05:27 PM Emil: For ics
05:27 PM Emil: you need to have the measurement unit separate
05:28 PM Emil: (but you knew that :D)
05:28 PM Jartza: no, the probe :)
05:28 PM Emil: Yeah
05:28 PM polprog: max 31855 and max6674
05:28 PM Jartza: I already found stainless probes with 1.2m lead that can handle 800°C (the probe part) / 375°C (the cable)
05:28 PM polprog: latter one gives 3 bits after radix, first gives 3 bits after radix
05:29 PM Jartza: but that oven meter is very neat
05:29 PM polprog: i made a video on my thermocouple thermo
05:29 PM Emil: Jartza: link dat
05:30 PM Jartza: I need to check where did I put the link, just a sec
05:30 PM polprog: https://youtu.be/AMncaxF-dDU
05:30 PM Emil: polprog: hmm
05:31 PM Emil: polprog: what does radix mean in this context?
05:31 PM polprog: decimal bits
05:31 PM Emil: only 256 different levels?
05:32 PM polprog: if i can call them like that, 2 bit = 0.25 resolution, 3 bits = 0.125 res
05:32 PM Emil: ah
05:32 PM Emil: and then there's the integer part, too?
05:32 PM polprog: yeah
05:32 PM Emil: so integer part, fractional part
05:32 PM Emil: and then exponential part?
05:33 PM Jartza: http://www.ebay.co.uk/itm/New-1pcs-3M-Stainless-Steel-Thermocouple-K-type-Probe-Sensor-100-1250-Degree-/271811897854
05:33 PM polprog: no, it was not exponential
05:33 PM Emil: polprog: alrighty so
05:33 PM polprog: its explained in the datasheet
05:33 PM polprog: and later in the vid iirc
05:33 PM Jartza: that's the other link
05:33 PM polprog: :)
05:33 PM Jartza: but the price sounds stupidly low for that :o
05:33 PM Emil: polprog: it's pretty much then just integertbits+fractionalbits bit measurement
05:33 PM Jartza: I remember it was around 15€ :o
05:33 PM Emil: divided over a certain range
05:33 PM polprog: yep
05:34 PM polprog: i shoul make more vids
05:35 PM Emil: Do it
05:36 PM Jartza: http://www.ebay.co.uk/itm/K-Type-Thermocouple-6-150mm-Probe-with-90-Bend-Pointed-Tip-for-BBQ-Smoker-/381508016564
05:36 PM polprog: newest project is boring, asm stuff to change a value on a 7 seg
05:36 PM Jartza: there's the other probe I was looking at
05:37 PM Jartza: also thinking of creating PID fan controller for my Kamado :
05:37 PM Jartza: :)
05:37 PM Emil: I'll order a few
05:37 PM Jartza: it could be one unit with wireless temp display and PID controlled fan
05:37 PM Emil: Annoying that it doesn't mention the coefficient
05:37 PM Jartza: yeah, I ordered 2 of both, just somehow thought the first one was more expensive :)
05:37 PM polprog: what coefficient?
05:38 PM Emil: polprog: those jarza's links
05:38 PM polprog: maybe ill make a vid about that texas pwm driver
05:38 PM Jartza: the first one I linked was going to be "permanently" installed, hence I wanted one with threads
05:38 PM Jartza: that'll measure the temperature of the BBQ grill itself
05:39 PM Jartza: then 2-3 probes for meat inside
05:39 PM Emil: Jartza: you got them?
05:39 PM Jartza: at least I'm planning to have 4 thermocouple inputs
05:39 PM Emil: Did you measure what the coefficient was?
05:39 PM polprog: like the probes from south park?
05:39 PM Jartza: not yet, it's been like 5 days or so when I ordered
05:39 PM Jartza: slow ship from china :)
05:39 PM Emil: Ah :D
05:41 PM Emil: Testi
05:44 PM polprog: i should go to sleep, wakeup at 7 tomorrow
05:44 PM polprog: and then a whole day of fun
05:44 PM Emil: Not a bad idea
05:44 PM polprog: o/
05:44 PM Emil: What fun?
05:44 PM polprog: electronic fun
05:44 PM polprog: ;)
05:45 PM Emil: nice
05:45 PM Emil: Good night
05:45 PM xentrac: nini
05:45 PM polprog: night
05:45 PM Jartza: I have 3 days of this customer and then the assignment is done
05:46 PM Jartza: july is summer vacation and after summer "new" customer
05:46 PM Jartza: or actually returning to one :)
06:08 PM xentrac: what's the assignment?
06:08 PM xentrac: oh, the barbecue grill
06:11 PM Emil: xentrac: no Jartza works for this hip R&D company
07:41 PM Emil: https://emil.fi/jako/kuvat/2017-06-28_03-10-46_yZovTMbb.png look at my footprint my footprint is amazing
07:41 PM Emil: https://emil.fi/jako/kuvat/2017-06-28_03-11-24_1h1TEeaR.png
07:42 PM Tom_itx: what software?
07:42 PM Tom_itx: i've done lots of packages in eagle
07:45 PM Emil: KiCAD
07:45 PM Emil: And this arbitrary limiting to just rectangles is annoyin
07:45 PM Emil: g
08:38 PM BongoShaftsbury: any recommendations for having an external and portable power supply
08:38 PM Lambda_Aurigae: depends on how much power you need
08:38 PM Lambda_Aurigae: voltage, current draw, runtime
08:39 PM Lambda_Aurigae: I use usb recharger packs for my rPI on occasion...I have one that will run it for half an hour.
08:39 PM BongoShaftsbury: short run time > 10 min, just a 5v micro controller + a few discrete components (led, gps)
08:40 PM Lambda_Aurigae: get a usb recharger pack.
08:40 PM Lambda_Aurigae: built in charging system, nice 5V output.
08:45 PM _ami_: wtf is wrong with aliexpress sellers
08:45 PM _ami_: i have ordered 13 different items.. and i got only 3 items
08:45 PM Lambda_Aurigae: pretty good odds for russian roulette.
08:45 PM Lambda_Aurigae: or,,,,chinese checkers?
08:47 PM _ami_: Lambda_Aurigae, it was well packed (in black polythene bag)
08:47 PM _ami_: i hv paid for the shipping
08:47 PM _ami_: china post registerd one
08:47 PM _ami_: my project was relying on items which i needed most and those are missing
08:49 PM Lambda_Aurigae: murphy is watching over you!
08:49 PM BongoShaftsbury: rue mentioned ali express having like 30 orders of his still pending
08:51 PM _ami_: Lambda_Aurigae, :)
08:51 PM _ami_: murphy law has applied on me. :/
08:52 PM _ami_: i have moved to different country and i did not hope that this would happen here. :/
08:52 PM Lambda_Aurigae: time to move to a different planet.
08:53 PM _ami_: haha :)
08:54 PM * psf 45 days and nothing about my package from Aliexpress.
09:01 PM Tom_itx: they finally figured out that you will keep ordering and paying even if they don't ship you anything
09:23 PM _ami_: i am not gonna buy from ali anymore
09:23 PM _ami_: after this experience, not any more
09:23 PM Lambda_Aurigae: you say that now
09:24 PM Lambda_Aurigae: then in two months you will find some gadget for $1.59 in dozen quantity and have to have it
09:24 PM _ami_: :)
09:25 PM _ami_: its similar to saying after a bad hangover in morning, i am not gonna drink anymore. :D
09:27 PM Lambda_Aurigae: yup.
09:27 PM Lambda_Aurigae: but you are hooked, addicted
09:27 PM Lambda_Aurigae: one taste of techno-heroin and you are hooked for life!
09:28 PM Lambda_Aurigae: aaand, bedtime for bonzoids.
09:30 PM _ami_: Yup. this is what i gonna say whenever someone say why i do electronics stuffs. (copying your statement) :D
09:31 PM _ami_: my wife has recently asked why i waste my time on these. :P
09:42 PM eeproks: My wife says she likes I have this interest, even if she doesn't much get low-level electronics.
11:31 PM Thrashbarg_ is now known as Thrashbarg
11:56 PM day_ is now known as daey