#avr Logs

Apr 16 2017

#avr Calendar

11:39 AM Emil: hmm
11:43 AM Emil: I wonder if I could just do dac - amp - 4 (channek) sample and hold circuits :D
11:43 AM Emil: bom and code optimisation yay
11:45 AM julius: hey
11:45 AM julius: Emil: apparently you can not enable the ADC and then in another line set its prescalar..has to happen on one line
11:45 AM julius: also my readADC function wasnt working...for whatever reason
11:48 AM Emil: julius: hmm, no wonder
11:49 AM Emil: and yeah, I absolutely can go that route :D
11:50 AM julius: no wonder?
11:54 AM Emil: yeah it is logical that the clock would be latched on adc enable
11:54 AM Emil: though I have not noticed that anywhere else with the peripherals
11:55 AM Emil: dunno why theh felt adc was special enough for that
11:56 AM Emil: perhaps due to noise immunity
12:07 PM julius: ah ok
12:08 PM julius: thats beyond my current understanding of the adc
12:45 PM Jan-: hihi
12:45 PM Jan-: what did I do wrong: https://pastebin.com/CTB8yxhs
12:48 PM Snert: void ltc_get_framerate_ui_name(ltc_framerate rate, char* name){ <-- ltc_framerate_rate, (missing underscore?)
12:48 PM Snert: I'm prolly wrong but that looks funny to me.
12:48 PM Jan-: it's an enum
12:48 PM Jan-: ltc_framerate is an enum, rate is a variable of that type.
12:48 PM Jan-: did I do something daft with that
12:49 PM Snert: clearly I'll have to study enums.
12:50 PM Jan-: don't believe me
12:50 PM Jan-: I'm not a real coder
12:50 PM Emil: ummm
12:50 PM Snert: ltc_framerate_rate ?????
12:50 PM Snert: ltc_framerate rate ?????
12:50 PM Emil: you can't really do what you are doing there
12:50 PM Snert: see the diff?
12:51 PM Jan-: I'm clearly not getting how enums work
12:51 PM Jan-: in C# if I have an enum called foo, I can have a variable called bar which is a foo
12:51 PM Jan-: myfunc(foo bar)
12:52 PM Jan-: Or do I just handle the enum as an int?
12:52 PM Emil: Jan-: you can't assign compound literals like that
12:53 PM Emil: this aint python
12:53 PM julius: when using: UBRRH = UBRRVAL >> 8;
12:53 PM Emil: this is c
12:53 PM julius: ups
12:53 PM Jan-: What's a compound literal
12:54 PM Emil: Jan-: those compound literals go out of scope the instant your block exits
12:54 PM Emil: if you want to store them you need to have globals or copy the text to the segment pointed by the char pointer
12:55 PM Jan-: What's a compound literal
12:55 PM Emil: you can google it
12:55 PM julius: when using: UBRRH = UBRRVAL >> 8; the top 8 bit from UBRRVAL get shifted 8 places to the right, why do they use this: UBRRL = UBRRVAL & 0xff; to get the lower 8? why not just UBRRL = UBRRVAL isnt it assumed that the lowest 8 bits are taken like in the first line example?
12:55 PM Emil: so either you copy the strings to the memory pointer by name or you assign name to a global
12:55 PM Emil: julius: yes, it is assumed
12:56 PM Emil: julius: but it is defensive programming
12:56 PM julius: in what way is that more secure?
12:57 PM Emil: Jan-: also what you are doing there is literally cancer
12:57 PM Emil: julius: you should be able to figure it out yourself
12:59 PM Emil: Jan-: string literal is another name herw
12:59 PM Jan-: emil I have no idea why it doesn't work, which part of it you're referring to, what your concerns are or how to fix any of it.
12:59 PM julius: sure that zeros out the upper 8 bits...but for what reason if you only take the lower 8
01:00 PM Jan-: so I guess... okay?
01:00 PM Emil: Jan-: I explaoned above what you need to do
01:00 PM twnqx: julius: because you don't trust your compiler.
01:00 PM twnqx: if the compiler does the right thing it's a noop anyway
01:00 PM julius: why would i not trust the compiler?
01:01 PM twnqx: could be buggy
01:01 PM Emil: because people who write compilers are dicks
01:02 PM twnqx: i had a case with gcc where it did some unexpected 16bit operation instead of the expected 8 bit
01:03 PM julius: UBRRVAL & 0xff is still a 16bit var after the &, isnt it? if the compiler takes the wrong bits, it takes the wrong bits
01:03 PM Emil: if you tell a compile writer or have them decide what is technically ub they will do so much annoying shit in the name of performance that my brain hurts
01:03 PM Emil: julius: you can continue complaining if you want :D but it is still a form of defensive coding
01:04 PM julius: im not complaining
01:04 PM Emil: that said, I dont use macros like that, they are awful :D
01:04 PM julius: i dont understand how that line makes it more secure
01:05 PM julius: whats the improvement of just doing: UBRRL = UBRRVAL
01:05 PM Emil: defensive programming
01:06 PM Emil: Jan-: anycase, did you manage to fix it?
01:06 PM julius: defensive how
01:07 PM Emil: Jan-: I was wrong
01:07 PM Emil: string literals survive the whole thing
01:07 PM Jan-: I think I'm just going to put it in an int
01:07 PM Jan-: screw enums
01:08 PM Jan-: more trouble than they're worth
01:08 PM Emil: haha
01:09 PM Emil: http://stackoverflow.com/questions/4654655/how-to-pass-enum-as-function-argument-in-c
01:10 PM Emil: if you use enums btw, remember to use the 8 bit wide enum flag for the compiler
01:10 PM Jan-: I did it the other way around typedef enum ltc_framerate {UNKNOWN, R23976, R24, R25, R2997, R30};
01:10 PM * Lambda_Aurigae prefers offensive coding. My code offends most anybody who manages to get hold of it.
01:11 PM Chillum: using slurs as variable names?
01:12 PM Jan-: er... huh?
01:12 PM specing: int fucker = 1;
01:12 PM Chillum: lol
01:12 PM Jan-: is R24 a slur?
01:12 PM Chillum: only to R2 based droids
01:14 PM Jan-: C error messages are just horrible.
01:15 PM Jan-: "variable or field ltc_get_framerate_ui_name declared void"
01:15 PM Jan-: why yes. yes, it is. that is not an error.
01:15 PM Lambda_Aurigae: I use a lot of 1 character variable names and such..holdover from the days of basic.
01:15 PM Lambda_Aurigae: and have used a struct called stuff and a 2d character array called things...used those multiple times.
01:15 PM julius: Lambda_Aurigae: could you give it a shot why .... & 0xff is more defensive than just taking the lowest 8 bits with: UBRRL = UBRRVAL
01:15 PM Lambda_Aurigae: my code is very,,,,not good.
01:16 PM julius: i hate one char variable names ;)
01:16 PM Lambda_Aurigae: see,,offended someone already!
01:16 PM Lambda_Aurigae: neither of those methods is better or worse in my opinion.
01:17 PM Lambda_Aurigae: if UBRRL is uint8_t and UBRRVAL is uint16_t then either way should work....look at how the compiler builds it..
01:17 PM Lambda_Aurigae: could come out the same in the end or might be different commands to do it.
01:18 PM Lambda_Aurigae: I think doing the & would actually add an assembly instruction or maybe two in there.
01:18 PM Lambda_Aurigae: in the end, if it works, fuck it.
01:20 PM Jan-: OK, so how do I look up a human readable text description of an enum member
01:20 PM Jan-: if not with a switch statement
01:21 PM Jan-: or in fact even WITH a switch statement, if it won't let me treat an enum as a type
01:22 PM julius: Lambda_Aurigae: i actually found a src example online where the shorter version was used
01:22 PM julius: Lambda_Aurigae: sure it works...i just never thought about it why
01:25 PM julius: Lambda_Aurigae: could it be that UBRRL = UBRRVAL & 0xFF actually creates a 8 bit variable temporarely before assigning it to UBRRL?
01:33 PM xentrac: Jan-: you can have a variable that is, for example, a pointer to void or a function returning void, but not void itself
01:33 PM julius: muad is really trying to join, maybe allah does not want him to
01:34 PM xentrac: I mean there's no fundamental reason that has to be illegal; it's just that a variable that can't hold any values isn't very useful
01:36 PM xentrac: jan-: if you have an enum ltc_framerate { a, b, c ... } and you want to declare a variable as that type, then you can say enum ltc_framerate x; but you can't say just ltc_framerate x;
01:36 PM xentrac: you could typedef enum { a, b, c... } ltc_framerate; and then use that
01:37 PM xentrac: I kind of agree that they are more trouble than they are worth in C
01:37 PM xentrac: although they are the best way to define numeric constants
01:38 PM xentrac: julius: you are going to totally hate this (non-AVR) code I've been reading today
01:38 PM Jan-: I don't get it.
01:39 PM Jan-: Anyway, is there a way of looking up names for enum entries that Emil won't say is cancer?
01:39 PM Jan-: can I have an array of strings and just do in numerically?
01:39 PM xentrac: don't worry if Emil says things are cancer
01:39 PM Jan-: {"Foo","Bar","Baz","Quux","Antidisestablishmentarianism"}?
01:39 PM xentrac: you can definitely index an array of strings with an int
01:39 PM xentrac: yes
01:39 PM xentrac: julius: o = D[(d >> 6 & 15 | d >> 14 & 1008) + J[(int) h / 4] * 768] * (b = h >> 56) >> 8;
01:40 PM Jan-: Ah. Is Emil a bit of a dick? I was wondering.
01:40 PM xentrac: we're all a bit of a dick sometimes
01:40 PM Jan-: I'm not. I'm practically perfect in every way. :D
01:40 PM xentrac: perhaps microcontrollers have made us grouchy
01:40 PM xentrac: soon you will be like us
01:40 PM * Jan- is quoting Mary Poppins, for what it's worth
01:40 PM julius: xentrac: not hate...just not so usefull if you ever want to read that again and know what it does...maybe after a few months of pause
01:40 PM xentrac: :)
01:41 PM xentrac: julius: hey, I didn't write it
01:41 PM xentrac: also this is the deobfuscated version
01:41 PM julius: Jan-: got boobs?
01:41 PM julius: xentrac: you mean the readable one?
01:41 PM Jan-: Me?
01:41 PM julius: yes
01:41 PM Jan-: It's short for Janine, so either I'm a girl or I had really weird parents.
01:42 PM Jan-: Or both. I guess.
01:42 PM julius: oh shit...i was betting on you being a man. the answer would be: no boobs = not perfect
01:42 PM xentrac: heh, nice save, julius
01:42 PM Jan-: most people assume I'm a swedish guy.
01:42 PM Jan-: frankly, on the internet, that's probably for the best
01:42 PM xentrac: julius: the original version of that line of code was:
01:42 PM xentrac: 8>>40)+( 4-l)*(h<<8>>40)>>2&16774143; o=D [(d>> 6&
01:42 PM xentrac: 15|d>>14 &1008)+J[(int)h/4]*768]*(b=h>>56 )>>8; G[
01:42 PM julius: you should go with a female name in irc...makes man want to help you
01:42 PM Jan-: oh screw that noise
01:43 PM Jan-: have you met most of the men on IRC?
01:43 PM Jan-: The odds are good, but the goods are odd.
01:43 PM specing: plot twist: Jan- is actually a nordic neckbeard
01:43 PM julius: im saying helping...not getting married
01:43 PM Jan-: oh hey specing
01:43 PM Jan-: how's stuff
01:43 PM specing: slow
01:43 PM Jan-: ohdear.
01:43 PM specing: not good
01:43 PM julius: xentrac: who writes code like that?
01:44 PM xentrac: julius: this code is by Gil Dogon
01:44 PM Jan-: can I assume an enum will be sequentially numbered, or should I be specific about it?
01:44 PM Jan-: and also, what type should I declare my array of strings as?
01:44 PM xentrac: enums are guaranteed to be sequentially numbered unless you specify otherwise
01:45 PM Jan-: what's the underlying type used to index them? it only needs to be 8 bits.
01:47 PM xentrac: char *ss[] = { "foo", "bar", "baz" };
01:47 PM Jan-: kickass.
01:47 PM Jan-: do all of the strings have to be the same length
01:47 PM xentrac: nope
01:47 PM xentrac: because it's an array of pointers
01:47 PM xentrac: not an array of arrays of bytes
01:47 PM * Jan- fears pointers
01:47 PM xentrac: you can index arrays with any kind of int; I'm not 100% clear on the details of the coercion rules but they don't matter on AVR
01:47 PM * Jan- checks there are no pointers lurking in a dimly-lit corner
01:48 PM xentrac: heh, pointers aren't real
01:48 PM Jan-: The concept is easy.
01:48 PM Jan-: The *implementation is &scary**
01:48 PM xentrac: Right, it's just error-prone. Like string interpolation
01:50 PM xentrac: julius: the program is a functional interactive quasi-Minecraft clone, and also an ASCII-art picture of a creeper face, in 56 lines of code
01:50 PM Jan-: I don't even have that much of an issue with errors
01:50 PM Jan-: it's just expressing what I want it to do
01:51 PM Jan-: right now I could save a lot of time in an interrupt servicing routine if I used a ring buffer which I could quickly implement with pointers.
01:51 PM Jan-: but actually DOING that...
01:51 PM * Jan- holds head in hands and weeps bitterly
01:51 PM xentrac: nah, you'll figure it out. it just takes time to learn
01:52 PM Jan-: Basically, I'm decoding a serial stream. Every time I get a bit, I want to put it in the buffer ideally at the end.
01:52 PM Jan-: Right now I'm just shifting and combining bytes, in a loop, which is sort of slow as the buffer is 10 bytes.
01:52 PM xentrac: julius: http://ioccc.org/2015/dogon/hint.html
01:53 PM xentrac: Right, I remember
01:53 PM Jan-: Theoretically, I could use pointer arithmetic to create a ring buffer.
01:53 PM Jan-: Which would be lots faster.
01:54 PM Jan-: However I don't want to obsess too much as it works fine now.
01:54 PM xentrac: :)
01:55 PM Jan-: well the string indexing thing worked.
01:55 PM Jan-: should I typedef enum myname{etc}; or typedef enum{etc} myname
01:55 PM Jan-: both seem OK
01:55 PM xentrac: both are OK
01:55 PM julius: xentrac: ah ok
01:56 PM Jan-: I notice that the AVR instruction set has a rotate-with-carry instruction.
01:56 PM Jan-: I wonder if the compiler is using that to implement my buffer shuffling loop.
01:56 PM xentrac: C doesn't really do much type-checking of enums, so an enum myname walnuts; is an awful lot like int walnuts; /* myname */
01:57 PM Jan-: C seems super-primitive to me.
01:57 PM * Jan- is used to C# and javascript
01:57 PM xentrac: Yup, it is
01:57 PM xentrac: You can check to see what instructions it's generating! You can run the compiler with an argument to generate an assembly listing
01:57 PM Jan-: I have read about all the arguments for and against but I have to say, given the number of buffer overflow attacks and so on, that it might be getting just a bit too primitive for modern computers.
01:58 PM Jan-: I understand I am not alone in that view.
01:58 PM xentrac: Yeah, it might be possible to replace it with Rust or something similar soon, but right now there is no viable alternative for low-level code
01:59 PM julius: what could this be: EMPTY_INTERRUPT(USART_RXC_vect)
01:59 PM xentrac: I mean, except C++
01:59 PM xentrac: dunno, probably the avr-libc documentation will tell you though
01:59 PM Jan-: C++ seems like a brave first attempt at something better.
01:59 PM Jan-: Like most early attempts at things it is not... entirely... er...
01:59 PM * Jan- tries to be nice
02:00 PM Jan-: ...um?
02:01 PM xentrac: Yeah. Rust might be that "something better"
02:01 PM _ami_: julius: http://www.atmel.com/webdoc/avrlibcreferencemanual/group__avr__interrupts_1ga751c22101f7e8f2fbe792c64a81f8dba.html
02:02 PM Jan-: It's like Java and C#
02:02 PM xentrac: specing, of course, will tell you that Ada was what they were trying to achieve ;)
02:02 PM Jan-: I have written both
02:02 PM Jan-: I think C# is just better.
02:02 PM Jan-: Shoulders of giants etc
02:02 PM xentrac: Java and C# are of no use in attempting to implement a Java or C# virtual machine
02:02 PM julius: looking at how small "computers" can be these days (orange pi) for example and fast+low power the days of using c and avr might be counted. using python and a pi is also lots of fun
02:03 PM xentrac: julius: have you seen the ESP8266?
02:03 PM Jan-: julius I am using AVR for this because it needs to be battery powered and last ages in a pocket sized device. So 0.5 milliamp sleep mode is nice.
02:03 PM Jan-: so I think there will always be a need.
02:03 PM julius: very low power of course
02:03 PM xentrac: Jan-: there are even lower power ARMs nowadays
02:03 PM Jan-: when was AVR developed
02:03 PM xentrac: the AVR is surprisingly power-hungry
02:03 PM julius: just saying that maybe in 10 years, even a orange pi wont take much more
02:03 PM Jan-: and what sort of semiconductor process is used to make it?
02:04 PM Jan-: could they die shrink it? :D
02:04 PM xentrac: late 90s
02:04 PM xentrac: the 328 we most commonly use nowadays is from about 2007
02:04 PM _ami_: julius: let me tell you one thing.. Orange pi is utter CRAP!
02:04 PM xentrac: Atmel gave up on it and sold it off to Microchip
02:05 PM _ami_: its not easy to maintain and support a SBC
02:05 PM julius: _ami_: havent used it much
02:05 PM _ami_: its CRAP
02:05 PM Jan-: all I'll say is that without this stuff, I would not be able to do this.
02:05 PM Jan-: Although I guess you could port this to another sort of board. Just replace all the TCCR0A stuff etc.
02:06 PM julius: _ami_: as far as software goes, isnt it mostly changing the architecture and than recompiling the debian packages for example?
02:06 PM * Jan- holds a special place of hatred for TCCR0A for reasons she doens't like to talk about (sob)
02:06 PM _ami_: julius: the company is FRAUD.. they are like < 10 employees in total. how can u expect them to support?
02:07 PM julius: oh, i didnt know
02:07 PM julius: so they jumped onto the rpi train?
02:07 PM _ami_: and o pi runs 3.4+ kernel.. its too old for anybody!
02:07 PM _ami_: and most of drivers are binary blob
02:08 PM xentrac: Jan-: yeah, a lot of new Arduinos are non-AVR actually
02:08 PM julius: they released a ubuntu with 4.10
02:08 PM Jan-: One upside is that you can get atmega328s in DIL format.
02:08 PM _ami_: julius: who?
02:08 PM Jan-: So we can actually have some tiny chance of assembling the asterisking things.
02:08 PM julius: _ami_: the binary drivers are crap of course
02:09 PM julius: _ami_: armbian....ok, different people
02:09 PM _ami_: armbian are nice.. its just that they are pissed off from Allwinner company.
02:09 PM julius: _ami_: thats probably the reason the camera wont work...binary driver nor for newer kernel
02:10 PM xentrac: in DIP format?
02:10 PM _ami_: https://en.wikipedia.org/wiki/Allwinner_Technology#Linux_controversies
02:10 PM Jan-: This annoying format is in BCD. I find myself doing this a lot: uint8_t ff = (10*(rptr[1] & 0b00000011)) + (rptr[0] & 0b00001111);
02:10 PM Jan-: is there a less horrid way of doing that
02:10 PM julius: dec to bin?
02:10 PM julius: and the other way, yes there is
02:11 PM _ami_: julius: obviously you can run latest kernel.. problem is lots of stuffs won't work
02:11 PM _ami_: because the drivers are in binary format
02:11 PM Jan-: I guess it's not quite bcd
02:12 PM Jan-: because some of the numbers only have a maximum value of like 3, so they only have 2 bits.
02:12 PM Emil: xentrac: come on, mate!
02:12 PM xentrac: oh, I was trying to figure that out
02:12 PM xentrac: that makes more sense now
02:12 PM _ami_: On the other hand, rpi did a good job. i don't mind paying them extra since they do community work and the community arround rpi is just GREAT!
02:12 PM Emil: I only call things cancer if they are!
02:12 PM Emil: Jan-: and fuck off :D
02:12 PM Jan-: yo momma, you aspergers-riddled excuse for a human.
02:13 PM julius: _ami_: good to know. this was actually for a one time project, im gonna try their kernel
02:13 PM xentrac: I'm sure you two can up your insult level a bit
02:13 PM Emil: Jan-: what you were doing there in your example was literally cancer
02:13 PM Emil: the enum part was fine
02:13 PM Jan-: Furthermore, why doesn't the \r character actually return the cursor to the left hand side of the arduino serial monitor.
02:13 PM Emil: that wasnt the issue
02:13 PM xentrac: I think 10*rptr[1] might be adequate for the first bit of it
02:14 PM * _ami_ had too much fund with kicad today! :D
02:14 PM _ami_: fun*
02:14 PM Emil: the issue was how you stored and used and what for those string liteeals
02:14 PM Emil: enums are absolutely fine and good
02:14 PM Jan-: Calm down Emil, I'm doing with array indexing now.
02:14 PM * Jan- patpats Emil
02:14 PM xentrac: usually I write my binary constants in hex instead of binary: 0xf or 0x3 instead of using 0b, although maybe in part because 0b is new
02:15 PM Jan-: xentrac I'm doing that because that's how the reference paperwork is written.
02:15 PM Jan-: Obviously it could be boiled down into hex
02:15 PM Lambda_Aurigae: I've used 0b for years.
02:15 PM Emil: Jan-: because the arduino monitor is shit
02:15 PM xentrac: I mean I don't know when 0b was introduced but I'm pretty sure it wasn't present for the first 20 years of C
02:15 PM Jan-: it's like "bit 3 of word 2 indicates drop frame status" well OK.
02:15 PM Emil: xentrac: 0b is not new
02:15 PM Emil: but it is a gnu extension
02:15 PM xentrac: following the reference documentation is clearly a good idea
02:15 PM Emil: but a very sane one
02:15 PM xentrac: when did GNU add it, Emil? I agree that it's very sane and a good idea
02:16 PM Lambda_Aurigae: 0b is useful when building 8x8 fonts...hehe
02:16 PM Emil: xentrac: 0b is a gnu extension
02:16 PM Emil: granted most have also taken it on
02:16 PM Emil: since it is so bloody useful :D
02:16 PM Emil: xentrac: when they added it, dunno
02:17 PM xentrac: I bet it was recently
02:17 PM xentrac: like, within the last 20 years
02:17 PM Emil: what is "recently"
02:18 PM Emil: xentrac: I bet it was way before
02:18 PM Jan-: emil are you one of those people who always hate switch statements
02:19 PM Emil: no
02:19 PM Emil: why would I hate them?
02:19 PM Emil: they are really useful
02:19 PM Emil: they compile to quite efficient code
02:19 PM xentrac: it's possible
02:20 PM Emil: Jan-: 0.5mA sleep mode is a lot of current
02:21 PM Jan-: Oh. OK.
02:21 PM julius: this: #define EMPTY_INTERRUPT(vector) apparently generates a empty ISR handler...with this being used inside the code EMPTY_INTERRUPT(ADC_vect); but what good is a empty isr?
02:21 PM Emil: Jan-: avrs are capable of sub microamp sleep mode if you really optimise
02:22 PM Jan-: I'll look into it.
02:22 PM Emil: julius: the avr libc interrupt documentation explains it
02:22 PM Lambda_Aurigae: julius, dynamic interrupt vectors maybe?
02:23 PM julius: ah ok
02:23 PM Jan-: am I the only person who finds fast-paced electronic dance music good to code to
02:23 PM * Jan- tunes in
02:23 PM * Jan- zones out
02:23 PM Emil: Jan-: http://www.home-automation-community.com/arduino-low-power-how-to-run-atmega328p-for-a-year-on-coin-cell-battery/
02:23 PM Jan-: ...and suddenly difficult_function() is complete, and it is 3am :(
02:23 PM Emil: http://www.gammon.com.au/power
02:23 PM Lambda_Aurigae: Jan-, probably not but I wouldn't
02:23 PM Lambda_Aurigae: I like old country ballads to do woodworking to hough...bout the only time I listen to music.
02:24 PM Lambda_Aurigae: hough/though
02:24 PM Lambda_Aurigae: anyhoo,,,back to making sawdust!
02:26 PM Emil: Jan-: there was a recently surfaced study that concluded that your perf is optimised if you listen to your favourite music, regardless if genre
02:26 PM Jan-: well I don't really listen to dance music.
02:26 PM Jan-: I guess it's because no vocals.
02:26 PM Jan-: can't code when vocals are on
02:26 PM xentrac: yeah, same
02:26 PM * Jan- possibly can't code anyway, hence Emil's scorn :/
02:26 PM Emil: I dont really listen to any vocals at all
02:26 PM Emil: like the words
02:26 PM Emil: with any music
02:27 PM Jan-: can I have or clauses in cases for switch statements
02:27 PM Jan-: or should I just used ifs
02:27 PM xentrac: default:
02:27 PM xentrac: or do you mean case FOO: case BAR:
02:27 PM Jan-: I mean like case x | y
02:28 PM Jan-: I guess that would come off as logic then
02:28 PM Jan-: forget it, stupid question
02:28 PM Emil: Jan-: you "can" iirc
02:28 PM xentrac: that's case x: case y:
02:28 PM xentrac: without a "break" between
02:28 PM Emil: but dunno what standard supported it
02:29 PM Emil: Jan-: of course you can nest cases
02:29 PM Emil: that's standaes
02:29 PM Emil: standard behaviour
02:29 PM Emil: gcc also supports ranging
02:30 PM Emil: but you really have to re-evaluate refactoring if that is on the table
02:30 PM Jan-: oh, what, like switch(foo) case 3-5:
02:30 PM Jan-: actually I have a situation that could sort of use that
02:30 PM Emil: iirc 3..10
02:31 PM Jan-: I could use that here: https://pastebin.com/GvFb9vzC
02:31 PM Emil: you can find the gcc extension docs easily online
02:32 PM Jan-: ...could I use that there?
02:33 PM Emil: I wouldnt recommend it
02:33 PM Jan-: mmkay
02:35 PM Jan-: do we double && and || for C or is that just javascript? I'm driving myself crazy here.
02:35 PM Emil: matey :D
02:35 PM Emil: https://en.m.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B
02:36 PM Emil: use your favourite search engine first :D
02:36 PM Jan-: It's confusing because & and | also appear to work.
02:36 PM Jan-: blaah
02:36 PM Emil: double symbols for logicals
02:36 PM Emil: singles for bitwise
02:37 PM Jan-: of course bitwise also actually works in this scenario :)
02:38 PM xentrac: yeah, the most important difference is that && and || do short-circuit evaluation
02:39 PM Jan-: oh well yes.
02:39 PM Jan-: I guess that could save time in some situations.
02:41 PM xentrac: sometimes it saves crashes
02:42 PM Jan-: mmhmm
02:42 PM xentrac: has_more(stream) && next_item(stream) != '\n'
02:43 PM xentrac: don't worry about whether you "can code" or "can't code". worry about the code. it's not about you. programming is hard, you get better with practice and feedback, but it takes time
02:51 PM Emil: That's good advice
02:56 PM xentrac: it's easy to jump from "this is really hard for me" to "I must not be very smart" but that conclusion is not justified. it's really hard for everyone, especially early on, but always. similar comments apply to when someone says some code sucks. it's not about you, even if you wrote the code
02:56 PM xentrac: if it's not really hard then that's just because you're not challenging yourself enough ;)
02:58 PM xentrac: and under most circumstances code that cannot be improved in obvious ways has had too much time lavished on minor improvements at the expense of major improvements to other things
03:06 PM xentrac: I didn't expect I was going to learn much from watching this video but I just learned about the PINxn registers: https://www.youtube.com/watch?v=EVm0qVJ56II
03:06 PM xentrac: I must have seen them in the datasheet before but forgot
03:16 PM Jan-: So I'm telling Phil how I've written awesome code that can tell 24 frames per second from 23.976 frames per second.
03:17 PM Jan-: and I switch the frame rate on the input device, and it says "Resolving..." for a few seconds
03:17 PM Jan-: and he's immediately like "What's going on?!"
03:17 PM Jan-: grr
03:17 PM Jan-: I have to tell the difference between 24 and 24000/1001 using a fricken AVR
03:17 PM Jan-: "It's in the woods GATHERING PRECISION."
03:17 PM * Jan- waves her arms
03:17 PM xentrac: heh
03:18 PM xentrac: that's awesome
03:18 PM Jan-: what is
03:18 PM xentrac: being able to tell 24 fps from 23.976 fps
03:19 PM xentrac: the AVR makes you superhuman!
03:19 PM Jan-: welllll.
03:19 PM Jan-: don't be too impressed
03:20 PM xentrac: why, because I could have figured out how to do it too? that doesn't mean it isn't worthwhile :)
03:20 PM Jan-: no, because I did it so badly that it needs to average for 16 frames to be sure.
03:20 PM Jan-: well I guess that's just jitter
03:21 PM xentrac: that sounds okay to me
03:22 PM Jan-: actually it takes more than that becuase it has to average for 16 frames to get the frame rate, then it has to wait a certain number more frames to be satisfied that the numbers are incrementing sensibly.
03:22 PM Jan-: so like, 40 frames
03:22 PM Jan-: 1.8 seconds or something
03:23 PM xentrac: that sounds reasonable
03:23 PM Jan-: I could improve that by making it use a much rougher idea of the frame rate.
03:23 PM Jan-: although only by about 0.65 seconds so it barely seems worth it
03:23 PM xentrac: you could conceivably keep track of the total length of the last 10 or 20 frames and display whichever legal frame rate is closer
03:24 PM xentrac: btw you can do a ring buffer with just array indices for that ;)
03:24 PM xentrac: beware of division in ISRs though; division is super slow on the AVR
03:24 PM Jan-: that's what I'm doing
03:24 PM xentrac: heh, way ahead of me :)
03:24 PM Jan-: well that's why it's 16 frames
03:24 PM Jan-: not 10 or 20
03:24 PM xentrac: haha
03:25 PM xentrac: division is like 100× or more slower than just if (x == 10) x = 0;
03:25 PM Jan-: Well what's worse is that it's like 10,000 timer periods per frame.
03:25 PM Jan-: So if I want to average over more than a couple of dozen frames, I start needing really big types to store the total length.
03:26 PM xentrac: yeah, long instead of int
03:26 PM xentrac: or uint32_t if you use the <stdint.h> types, which is a good idea
03:26 PM Jan-: well I guess it's not that bad
03:27 PM Jan-: four bytes
03:27 PM Jan-: but it's not like I want to be doing long division on them
03:27 PM Jan-: on a basically-an-overclocked-z80
03:27 PM xentrac: hey now, the AVR is far from a Z80 :)
03:27 PM xentrac: the Z80 won't do one instruction per cycle no matter how much you overclock it!
03:28 PM Jan-: I am told that avrs overclock quite well.
03:28 PM * Jan- imagines the world's tiniest CPU heatsink and fan
03:28 PM * Jan- furthermore imagines a caclking nerd with a thermos full of liquid nitrogen
03:29 PM xentrac: I've never tried it; I wish there was an AVR equivalent of the SX chips
03:30 PM Jan-: I'm not sure what sort of semiconductor process is used to manufacture them.
03:30 PM Jan-: Maybe it's improved!
03:37 PM xentrac: I don't know, but I imagine they haven't done much development on it in the last 10 years
03:37 PM xentrac: the ATMega2560 was 2010
03:44 PM Jan-: I got one of those, in case this one ran out of puff.
04:16 PM Jan-: is there anything that could happen to an AVR to make its master clock suddenly go all wonky
04:20 PM Jan-: earlier, my precision timing code worked.
04:20 PM Jan-: now, it doesn't.
04:21 PM Jan-: now it's showing up slightly different numbers of timer periods per video frame.
04:23 PM * Jan- orders temperature-controlled crystal oscillator :/
04:25 PM Lambda_Aurigae: how are you clocking it now Jan- ?
04:26 PM Jan-: it's an arduino nano board, so whatever the crystal is on that
04:26 PM Jan-: a crystal, I guess.
04:26 PM Lambda_Aurigae: ok.
04:26 PM julius: anybody done some video capturing with raspberry pi or arduino?
04:26 PM Lambda_Aurigae: I know nothing about ardweeny boards.
04:26 PM Lambda_Aurigae: video capture with an ardweeny?
04:26 PM Lambda_Aurigae: HAHAHAHAHAH!
04:26 PM julius: i meant orange pi
04:26 PM Lambda_Aurigae: 1 frame per 10 seconds.
04:27 PM Lambda_Aurigae: if you are lucky
04:27 PM Lambda_Aurigae: do the boards have video input capability?
04:27 PM julius: Lambda_Aurigae: you can use a ardweeny with usbasp without the arduino libs/program
04:27 PM Lambda_Aurigae: julius, so?
04:27 PM julius: most of them have a csi port
04:28 PM xentrac: Jan-: I think the Nano uses a ceramic resonator instead of a crystal; ceramic resonators are less temperature-stable
04:28 PM julius: Lambda_Aurigae: just saying that it can be a "to go" avr with the external components attached
04:28 PM Lambda_Aurigae: that's a camera interface.
04:28 PM Lambda_Aurigae: julius, yes, it can, but by buying it I would be supporting arduino in some fashion...which I refuse to do.
04:28 PM julius: was video capturing the wrong word? let me check
04:28 PM Lambda_Aurigae: csi is camera interface...not a composite, vga, or hdmi video input..
04:29 PM Jan-: xentrac: ah.
04:29 PM xentrac: crystals come in metal cans. ceramic resonators are a lot smaller and have four pins because they integrate the oscillator capacitances
04:29 PM Lambda_Aurigae: one COULD build a device to attach to the csi port I suppose.
04:29 PM Lambda_Aurigae: probably already done.
04:29 PM xentrac: the Leonardo and Uno use crystals IIRC
04:29 PM Jan-: Perhaps we can replace it
04:29 PM Lambda_Aurigae: xentrac, I thought they had 3 pins.
04:29 PM julius: Lambda_Aurigae: yes there are cameras for the csi port
04:29 PM Jan-: hang on, I'll try to get Phil to find a picture that looks like the one we have
04:30 PM Lambda_Aurigae: julius, I meant video capture device...like, to take a composite video input and feed it to the csi port.
04:30 PM julius: just not some very good tested ones, quality can very between devices..blurry and so on
04:30 PM Jan-: http://actrl.cz/blog/wp-content/uploads/nano_ch340_1.jpg
04:30 PM julius: Lambda_Aurigae: ah ok...i just need a digital video at the end
04:31 PM Lambda_Aurigae: Jan-, that little thing to the right of the chip is the ceramic oscillator thingie most likely.
04:31 PM Jan-: I can't see the picture, but the question is whether it's a crystal or a ceramic widget
04:32 PM Lambda_Aurigae: can't really tell.
04:32 PM Jan-: ohdear.
04:32 PM Lambda_Aurigae: it looks like a small crystal...but
04:32 PM Lambda_Aurigae: no caps on it.
04:32 PM Lambda_Aurigae: they could be on the underside of the board though.
04:32 PM Jan-: Well, I had it working, I went for a sandwich, and then suddenly it was way out of calibration.
04:32 PM Jan-: would they be near the possibly-a-crystal
04:33 PM xentrac: Lambda_Aurigae: I think the part they use on the Arduino board has four pins, although I don't know if all three of them are used
04:33 PM Lambda_Aurigae: xentrac, possibly..most ceramic resonators I'm used to are 3 pin dohickies...but I don't deal with the SMT can ones.
04:34 PM Jan-: Hmm. Perhaps we need to get some real nanos.
04:34 PM Jan-: this is not okay, it's like 60 ish timer periods different
04:34 PM Jan-: where a timer period is 1/64 of 16mhz
04:34 PM xentrac: the real nanos use ceramic resonators too
04:34 PM Jan-: ohbugger.
04:35 PM Jan-: can we switch out the resonator for a crystal without needing a phd in being wonderful with a soldering iron
04:35 PM xentrac: if you want a crystal for prototyping, your best bet is to grab a Leonardo or Uno or other full Arduino
04:35 PM Jan-: but huge :(
04:35 PM xentrac: yeah
04:35 PM Jan-: we wanted this to be itty-bitty
04:35 PM xentrac: for prototyping
04:35 PM xentrac: for the final thing you can solder up a board that's smaller than the nano
04:36 PM Jan-: well we can't really
04:36 PM Lambda_Aurigae: or build something yourself.
04:36 PM Jan-: we want to just stick a nano in it
04:36 PM Jan-: argh this is going to kill us :(
04:36 PM Lambda_Aurigae: that can on that board is smt...gonna need a hot air rework station to remove it from the looks of it.
04:36 PM Lambda_Aurigae: then you need to put a crystal across the two xtal pins on the avr
04:36 PM xentrac: I mean all the ATMega needs to run is a battery
04:36 PM Lambda_Aurigae: then put a 22pf cap from each of the xtal pins to gnd.
04:37 PM xentrac: but yeah to get 0.1% timing accuracy I don't think a ceramic resonator is going to be good enough
04:37 PM Jan-: gaak.
04:37 PM Lambda_Aurigae: might for starters
04:37 PM Jan-: we knew we would have to hack one of them to use a temperature compensated oscillator if we wanted "jam sync" where you let it listen to the incoming timecode for a bit then stay in sync independently.
04:37 PM Lambda_Aurigae: but it will drift.
04:38 PM Jan-: But we were trying not to have to do that
04:38 PM xentrac: you could probably pull the resonator off the board without a hot air rework station given that it only has three or four pins
04:38 PM Jan-: actually we could have done that by connecting the t.c.x.o. to the timer input pin.
04:38 PM xentrac: but then you need to solder something else in its place :)
04:38 PM Jan-: urgh.
04:38 PM xentrac: a separate tcxo will probably solve your problem, yes
04:38 PM xentrac: actually so would a GPS ;)
04:39 PM Jan-: I had thought about using GPS to calibrate these things
04:39 PM Jan-: as that's basically the most accurate clock imaginable
04:39 PM xentrac: well, not imaginable
04:39 PM Jan-: but we can't really rely on a gps signal.
04:39 PM Lambda_Aurigae: but a GPS drifts so much! it's only good to +/- 10ns...
04:39 PM xentrac: but cheaply available yes
04:39 PM Jan-: at some point we would need to characterise the tcxo for its own tolerances.
04:39 PM xentrac: heh
04:39 PM Jan-: and the only way I can think of doing that is with a GPS receivr.
04:39 PM Jan-: GPS is super accurate from what I hear
04:40 PM Lambda_Aurigae: and if you move it around the clock moves!
04:40 PM xentrac: it's all a matter of perspective ;)
04:40 PM Jan-: GPS is accurate to what, 10 feet or so?
04:40 PM Lambda_Aurigae: about 4ns per meter
04:40 PM Jan-: so the clock must be accurate to however long it takes a radio signal to go 10 feet.
04:40 PM Lambda_Aurigae: Jan-, depends on how many sats it can track at once.
04:40 PM Lambda_Aurigae: 1ns is about 9 inches
04:40 PM Jan-: which is a grand total of...
04:40 PM Lambda_Aurigae: give or take.
04:40 PM * Jan- counts on fingers, mouth moving slightly
04:40 PM Jan-: ...not long?
04:41 PM Lambda_Aurigae: it's accurate to +/- 10ns
04:41 PM Jan-: I think that's OK for audio phase correctness.
04:41 PM Lambda_Aurigae: unless the military fucks with it.
04:41 PM Lambda_Aurigae: which they can, and do on occasion.
04:42 PM Jan-: oh well if north korea kicks off we'll be able to see how well it does. apparently they have jamming trucks, but then I think a particularly excited glow worm could probably jam GPS.
04:42 PM Lambda_Aurigae: you would be surprised how robust that signal is.
04:42 PM Jan-: I got the feeling it was not that great
04:42 PM Lambda_Aurigae: 11600 miles up and it still gets a usable signal to the ground.
04:42 PM Jan-: wasn't it one of the design concerns they had that it should have been a bit pokier, signal wise?
04:43 PM Lambda_Aurigae: I worked with GPS/NDS in the military in the late 80s/early 90s. Block 1, Block 2, and Block 2A
04:43 PM Jan-: it's very clever
04:43 PM Jan-: but super easy to jam
04:43 PM Jan-: I guess they didn't want to put supergiant solar panels on the satellites?
04:43 PM Lambda_Aurigae: enough radio noise and you can jam anything
04:44 PM Lambda_Aurigae: but the signal is very robust and continuous and the receivers today are built so they can pick that signal out of very high noise background.
04:44 PM Lambda_Aurigae: I find that my cellphone jammer doesn't affect gps singal and it's very broad spectrum rf noise.
04:46 PM Lambda_Aurigae: they also transmit on two frequencies simultaneously.
04:46 PM Lambda_Aurigae: both in the ghz ranges.
04:47 PM Lambda_Aurigae: 1.5 and 1.2 ghz, approximately.
04:49 PM Lambda_Aurigae: shit..they are up to 6 frequencies at once now!
04:49 PM Lambda_Aurigae: been a while since I researched the gps system.
04:49 PM xentrac: I think the more usual trick is to transmit a false GPS signal, rather than just emitting broad-spectrum noise
04:50 PM Lambda_Aurigae: yup.
04:51 PM Lambda_Aurigae: broad spectrum noise wouldn't be very effective really to cover it all from what I just read.
04:51 PM Lambda_Aurigae: they've made it waaay more robust than it was when I worked with it.
04:52 PM Lambda_Aurigae: and your gear would have to be very well done to transmit the data synced like it needs to be on multiple frequencies.
05:15 PM Jan-: I was thinking about advanced topics for the nrf24l01 chip
05:15 PM Jan-: could we write a spread spectrum library for it? That'd be awesome!
05:15 PM Jan-: (and probably slow)
05:16 PM Lambda_Aurigae: frequency agile system maybe.
05:16 PM Jan-: yeah.
05:16 PM Lambda_Aurigae: but I don't think you can really control the transmitter properly for spread spectrum.
05:16 PM Jan-: then it'd be less likely to interfere with other systems, and less likely to be interfered with.
05:16 PM Jan-: ok sure frequency agile with pseudo random hopping
05:16 PM Jan-: I'm not sure how fast they can really change frequency, though. there's a "pll settle" delat.
05:17 PM Jan-: delay too
05:17 PM Lambda_Aurigae: so use 2
05:17 PM Lambda_Aurigae: on each end.
05:17 PM Jan-: Well they're cheap enough.
05:17 PM * Jan- taps chin
05:18 PM Jan-: ...eeeenteresteeeng.
05:18 PM Jan-: also it would be a bitch to intercept. Since it's at microwave frequencies, we could call it Have Really Quick.
05:18 PM Lambda_Aurigae: comms on 1 and 2...if either seems to go away have it jump while the other stays where it is at.
05:18 PM * Jan- makes military terminology joke nobody will get
05:18 PM Lambda_Aurigae: yeah, even ex-military like me don't get it.
05:19 PM Jan-: HAVE QUICK (also HAVEQUICK, short HQ) is a ECM resistant / frequency-hopping system used to protect military Aeronautical mobile (OR) radio traffic.
05:19 PM Lambda_Aurigae: oh.
05:19 PM Lambda_Aurigae: I didn't get into that
05:20 PM Jan-: it sort of fits because it was an addon for then-new radio technology which used frequency synthesizers, so they could hop frequencies really quickly.
05:20 PM Lambda_Aurigae: just seismic, hydroacoustic, emp, x-ray, gamma ray, optical imaging and non imaging dc-to-daylight sensor systems.
05:21 PM Jan-: I think a frequency agile system for the nrf series would have to be quite carefully done
05:21 PM Jan-: you'd have to go to a frequency, listen, observe when the transmission came in and trim your timing expectations to suit
05:21 PM Jan-: that might mean you gave up quite a bit of bandwidth.
05:21 PM Lambda_Aurigae: it could be done though.
05:22 PM Jan-: I think so.
05:23 PM Lambda_Aurigae: local school system contacted me last week
05:23 PM Lambda_Aurigae: wanted to know if I wanted to help out with a new club they are trying to start up
05:23 PM Lambda_Aurigae: an Arduino club.
05:23 PM Lambda_Aurigae: no
05:23 PM Lambda_Aurigae: flippin
05:23 PM Lambda_Aurigae: way!
05:23 PM Lambda_Aurigae: supposed to teach kids programming and use of microcontrollers.
05:24 PM Lambda_Aurigae: they said it would go good with the little teaching club I run in the summers
05:24 PM Lambda_Aurigae: I told them it would be a major step backwards, downhill, in the dark, on a barbed wire encrusted mountain.
05:25 PM xentrac: haha
05:25 PM Lambda_Aurigae: then explained in detail what I teach the kids and how horrid the arduino environment is.
05:26 PM Lambda_Aurigae: just got sponsorship from microchip and they are sending me 10 pickit-3 programmers and a pile of pic32 gear.
05:27 PM Jan-: we have discovered the cryptonite to our timecode decoder's superman
05:27 PM Jan-: *dramatic chord* FREEZER SPRAY!
05:28 PM Jan-: we can make it change frame rate with a can of freezer!
05:29 PM Lambda_Aurigae: yup.
05:29 PM Lambda_Aurigae: pretty much any oscillator is going to behave like that.
05:29 PM Lambda_Aurigae: unless it has the ability to adjust for temperature
05:29 PM specing: Lambda_Aurigae: noooo fuck PICs
05:29 PM Lambda_Aurigae: and even then, dramatic high speed changes will mess with them.
05:29 PM specing: ok, pic32 are fine
05:29 PM Lambda_Aurigae: specing, pic32 rocks.
05:29 PM specing: but still, fck everything with PIC in its name
05:30 PM xentrac: <specing> unless it's running Ada
05:30 PM Lambda_Aurigae: specing, won't be long before avr has pic in the name I bet.
05:31 PM xentrac: Jan-: probably even a quartz crystal will vary by more than 0.1% if you freezer-spray it
05:31 PM specing: xentrac: that too
05:32 PM Lambda_Aurigae: even in "talks" with microchip about getting a server license for the xc32 compiler.
05:33 PM Jan-: And so... http://www.ebay.co.uk/itm/332124856285
05:33 PM Jan-: wow they're alarmingly expensive
05:34 PM xentrac: yeah, I'm not entirely sure why that is
05:34 PM Jan-: do those just output a 5 volt square wave then
05:34 PM xentrac: maybe I am misunderstanding the complexity of temperature-compensating a crystal oscillator
05:34 PM Lambda_Aurigae: steal one out of someone's computer.
05:34 PM Jan-: do computers have them
05:34 PM xentrac: not normally
05:35 PM Lambda_Aurigae: probably not a tcxo
05:35 PM Jan-: I was gonna say
05:35 PM Lambda_Aurigae: but I've gotten 20mhz can oscillators out of them.
05:35 PM Jan-: the only more accurate option is an oven-controlled oscillator, and they take way too long to warm up and consume way too much power.
05:35 PM Lambda_Aurigae: and that chip you are using can run at 20mhz
05:35 PM xentrac: £16.72 doesn't sound that expensive
05:35 PM Jan-: well, I was going to use Plan B, which is to continue clocking the AVR from the resonator, and just connect the tcxo to the timer input
05:35 PM Jan-: you can do that I believe
05:36 PM xentrac: I don't remember but I think so
05:36 PM Lambda_Aurigae: yeah...just have to modify your code to use the timer.
05:36 PM Jan-: I'm using the timer right now
05:36 PM Jan-: I just need to alter a couple of bits to set the clock source I think
05:36 PM Lambda_Aurigae: ok then.
05:36 PM xentrac: ooh look, Standard Handbook for Electrical Engineers: https://archive.org/details/standardhandbook00fowluoft
05:37 PM Jan-: I can make this thing mis identify frame rates by holding my finger on it.
05:37 PM Lambda_Aurigae: only 2178 pages there xentrac
05:37 PM Jan-: (that's bad)
05:38 PM Lambda_Aurigae: that's ardweeny!
05:38 PM Lambda_Aurigae: hehe
05:38 PM Jan-: be nice
05:38 PM Lambda_Aurigae: no
05:38 PM Jan-: if it wasn't for those, I wouldn't even be here
05:38 PM Lambda_Aurigae: I don' wanna!
05:38 PM Jan-: actually I must admit this is not entirely true
05:38 PM xentrac: * Lambda_Aurigae kicks the ground and screams
05:38 PM Jan-: my first AVR project was on something we plugged up on a breadboard with a programmer from Tom_itx
05:39 PM Jan-: and it was a pain in the ass to get serial debug out of it
05:39 PM Jan-: so I bought an arduino nano.
05:39 PM Jan-: *heavenly chorus*
05:39 PM xentrac: yeah, my first AVR project was pre-Arduino too
05:39 PM xentrac: Arduino definitely helps a lot
05:39 PM xentrac: despite having some deficiencies
05:40 PM Jan-: It's just a convenient way to get serial I/O, and to program it
05:40 PM Jan-: and then we can distribute them, and people can do firmware updates with a simple tool we can make around avrdude.
05:40 PM Lambda_Aurigae: never had problem with serial i/o on avr.
05:40 PM xentrac: Also it has libraries
05:40 PM xentrac: no, the problem isn't the AVR, Lambda_Aurigae
05:40 PM Jan-: lambda the biggest problem was not the AVR, it was finding a true usb to RS232 converter for the computer.
05:40 PM xentrac: it's that modern computers don't have serial ports
05:40 PM Jan-: ...what xentrac said.
05:40 PM Lambda_Aurigae: they don't?
05:41 PM Jan-: Tom_itx sold us a proper avr-to-rs232 dongle.
05:41 PM Lambda_Aurigae: this i7 laptop does
05:41 PM Jan-: then we had to find something that wouldn't fry it
05:41 PM Lambda_Aurigae: it's less than 6 months old.
05:41 PM xentrac: mostly no
05:41 PM xentrac: although also the bootloader is pretty convenient
05:41 PM Lambda_Aurigae: my quad core athlon that's 3 years old has both serial and parallel ports.
05:41 PM Jan-: is now a good time to zip my code up and email it to myself
05:41 PM xentrac: I recommend using git
05:41 PM xentrac: but zipping up your code and mailing it to yourself is a good second option
05:42 PM xentrac: the thing is that nobody does that several times a day, and it's easy to do the equivalent with git
05:42 PM xentrac: also more useful
05:42 PM Jan-: What are an git?
05:42 PM Lambda_Aurigae: github
05:42 PM Jan-: yeah I know I find it confusing
05:42 PM xentrac: you can use git without github!
05:42 PM Lambda_Aurigae: true.
05:43 PM Jan-: when I were a lass it were SVN
05:43 PM Lambda_Aurigae: svn still works.
05:43 PM xentrac: SVN is definitely a step up from zipping and mailing, but it's more of a hassle than Git
05:43 PM xentrac: hmm, this scan of the Handbook has some pages chopped
05:43 PM Jan-: I should make a widget that will automagically create a zip file and email it.
05:43 PM Lambda_Aurigae: what was that one that microsoft had?
05:43 PM Jan-: like every hour
05:44 PM Lambda_Aurigae: glub but that was a horrid system.
05:45 PM Lambda_Aurigae: when I worked for the software development company I moved them off the microsoft crap to a local SVN server and an auto-build server.
05:45 PM Jan-: something is a bit odd because if you do the math, a 25 frame per second rate should be 16e6 / 25 / 64 timer periods, which works out to 10416.67
05:45 PM Jan-: whereas in reality I have like 10200
05:45 PM Lambda_Aurigae: when someone would submit code to the repository it would automagically rebuild the software.
05:45 PM Jan-: is it possible the ceramic resonator is that far out?
05:45 PM Lambda_Aurigae: yes.
05:46 PM Jan-: I guess it's only 2 per cent
05:46 PM Jan-: also
05:47 PM Jan-: is the temperature-controlled oscillator likely to be really close to 16mhz, or just vaguely close, and less likely to drift?
05:47 PM Lambda_Aurigae: should be pretty dang close and not drift.
05:48 PM Lambda_Aurigae: they give you a percentage accuracy in the description
05:48 PM xentrac: Lambda_Aurigae: SourceSafe?
05:48 PM Lambda_Aurigae: that's the crap!
05:48 PM Lambda_Aurigae: hehe
05:49 PM xentrac: Jan-: the one you linked claims 0.3ppm
05:49 PM xentrac: that's ±0.00003%
05:49 PM Jan-: is that drift or accuracy
05:49 PM xentrac: not sure
05:50 PM xentrac: also I'm not sure if that's across its whole range or per degree
05:50 PM xentrac: even a crystal is probably better than 0.1% across a usable range
05:52 PM xentrac: heh, this handbook calls inductors "reactors"
05:53 PM NoHitWonder^2: http://dancingclown.tech/Midi-and-the-AVR.pdf
05:56 PM Lambda_Aurigae: xentrac, it's accurate
05:57 PM xentrac: it is
05:58 PM xentrac: it's just amusing
05:59 PM Jan-: OK so our last and final problem is: eight seven segment displays each one and a half inches high is a big expensive PCB.
05:59 PM xentrac: I was hoping to find information in here about copper-oxide rectifiers, but I guess they hadn't been invented yet
05:59 PM xentrac: Jan-: they'll also use a lot of power if they're LED
05:59 PM Jan-: that's okay
05:59 PM xentrac: okay
06:00 PM Jan-: I think the ones we ordered are 3 leds per segment
06:00 PM Jan-: this is a... well, google "timecode slate"
06:00 PM Jan-: the digits are only on when the sticks are open
06:00 PM Jan-: (and for 2 seconds thereafter)
06:01 PM xentrac: aha
06:01 PM Lambda_Aurigae: CUT!
06:01 PM Lambda_Aurigae: SNAP!
06:01 PM Jan-: welllllll. if you really want to know
06:01 PM Jan-: "turnover"
06:01 PM Jan-: "speed"
06:01 PM Jan-: "one-eighty-four-baker take one A-camera"
06:01 PM Jan-: "marker"
06:01 PM Jan-: "snap"
06:02 PM xentrac: it covers electrolytic rectifiers, amusingly
06:02 PM Jan-: https://www.youtube.com/watch?v=sDRgNYFNo_I
06:03 PM Lambda_Aurigae: and condensers rather than capacitors I bet.
06:03 PM xentrac: "The electrolytic rectifier, therefore, consists basically of two aluminum plates and a lead plate immersed in a solution of ammonium phosphate"
06:04 PM xentrac: indeed
06:05 PM xentrac: there's also a section on "induction coils" which is separate from the section on "reactors"
06:08 PM xentrac: although there is a cross-reference
06:08 PM Jan-: oh I'm being corrected
06:08 PM xentrac: "A primary-type coil is a reactor (Sec. 6) designed <missing> receive electrical energy, then convert it to magnetic energy, storing <missing> much of the latter as feasible, and finally to reconvert it in<missing> electrical energy."
06:09 PM Jan-: sometimes it's "speed" "one-seven-three-charlie-take-one, on the end"
06:09 PM Jan-: blah blah blah actors actors actors
06:09 PM Jan-: ..."snap"
06:10 PM xentrac: as far as I can tell it always says "e.m.f." instead of "voltage"
06:12 PM enhering: https://www.youtube.com/watch?v=K6geOms33Dk
06:13 PM xentrac: "Condensers having capacities as large as 100 microfarads, for experimental work, have been arranged by connecting a large number of small units in parallel."
06:19 PM xentrac: the weirdest part of this book for me is that it doesn't mention complex numbers
06:20 PM xentrac: it also predates, I guess, circuit boards
06:22 PM Jan-: stupid question but
06:23 PM Jan-: are ceramic resonators also unstable moment to moment, as well as over time?
06:23 PM Jan-: because I was quite shocked at how unstable it all seemed
06:23 PM xentrac: as far as I know it's just a matter of temperature
06:23 PM Jan-: OK, I'm reading an analog signal with noise and jitter, but it really was all over the place.
06:23 PM xentrac: I mean, also the Q of the oscillator is finite
06:23 PM Jan-: like 6-8 timer period variation.
06:24 PM Jan-: although I guess one timer period is only 16million divided by 64
06:24 PM xentrac: (ring the bell that still can ring — there's a crack in everything — that's how the light gets in)
06:24 PM xentrac: but I think the Q is in the thousands to tens of thousands, while the thermal variation can easily be a few percent
06:25 PM Jan-: Q?
06:25 PM Jan-: as in John de Lancie?
06:25 PM xentrac: check out "Q factor" in Wikipedia
06:25 PM Jan-: No, "Q Continuum"
06:25 PM xentrac: it's a deep and fascinating topic that actually is how the "light" gets into, and out of, the resonator
06:26 PM xentrac: connecting the physics of tuning forks, Tesla coils, and automotive suspensions
06:26 PM xentrac: and bells of course
06:27 PM Jan-: light.
06:27 PM xentrac: well, now of course we say "energy"
06:31 PM * Jan- listens to 80s movie anthems
06:53 PM JanC_ is now known as JanC
07:21 PM NoHitWonder^2: xentrac are you good with digital signal processing? like can you make for example filters with software easily?
07:26 PM specing: NoHitWonder^2: #dsp
07:26 PM specing: hmm, looks like the channel is ##dsp
07:29 PM NoHitWonder^2: neat, thanks
09:35 PM xentrac: NoHitWonder^: I've done like super basic DSP filters but I keep making basic errors. I'm like half a step beyond "has heard of DSP"