#avr Logs

Jun 07 2017

#avr Calendar

12:31 AM day_ is now known as daey
02:00 AM jaggz_ is now known as jaggz
02:07 AM Emil: xentrac: 8r if you have no drive
02:08 AM Emil: xentrac: switching betweeen high z and pull up
02:52 AM Emil: the output voltage doesn't really change
02:52 AM Emil: especially if you are connected to just another cmos input
04:35 AM remkooo1 is now known as remkooo
06:01 AM remkooo1 is now known as remkooo
06:09 AM remkooo1 is now known as remkooo
07:35 AM remkooo1 is now known as remkooo
09:15 AM rue_house: ooh, maybe tahts what I should do, just use an open collector output
09:15 AM rue_house: or open drain
09:16 AM rue_house: http://ruemohr.org/~ircjunk/tutorials/elex/hobbyservo2/p1080888.jpg
09:16 AM rue_house: no that wont work
09:19 AM cehteh: with the resistor in series its more like current limiting than detecting :D
09:19 AM noHitW_work: your keyboard is quite dirty
09:19 AM rue_house: the resistor is a shunt
09:19 AM rue_house: it shunts the EB diode in the transistor
09:19 AM cehteh: 10ohms shunt?
09:19 AM rue_house: noHitW_work, yea, sorry
09:19 AM rue_house: yes
09:20 AM cehteh: quite a lot
09:20 AM cehteh: do you need exact measurements or only want to detect overcurrent situations?
09:20 AM rue_house: so its only a 0.7V drop
09:20 AM rue_house: no you can totally get the servo load percentage from that
09:21 AM rue_house: the ouput goes high ONLY when the motor is on
09:21 AM cehteh: yes but drop and waste
09:21 AM rue_house: so you get the duty of the motor, which is proportionate to its load
09:21 AM rue_house: caue of the servo loop
09:21 AM rue_house: you only lose 0.7v
09:21 AM cehteh: and when you use a shunt before the servo, why dont you just measure the voltage there directly?
09:22 AM rue_house: well do a better circuit then!
09:22 AM rue_house: I'm using it for force feedback
09:23 AM rue_house: you dont need to know the actual current
09:23 AM cehteh: how much current can the servo draw?
09:23 AM cehteh: small one?
09:23 AM rue_house: you just need to differentiate the idle draw from it running the motor
09:23 AM rue_house: cehteh, hey, your designing it now :)
09:24 AM cehteh: in another circruit i just taped at the driving fet, using the fet's internal resistance as shunt
09:24 AM cehteh: not really precise, but shunt for free
09:24 AM rue_house: http://ruemohr.org/~ircjunk/tutorials/elex/hobbyservo/images/servocurrent.jpg
09:25 AM rue_house: but you would have to do two taps, one on each side of the motor
09:25 AM rue_house: and you do NOT need to know the actual current
09:25 AM rue_house: you just need to measure how long the motor is on
09:26 AM rue_house: 0ms = 0% load, 20ms = 100% load
09:26 AM cehteh: hah .. thats easier
09:26 AM rue_house: then you dont need filtering, averaging, etc etc
09:27 AM rue_house: there is a deadzone in the controller, so it jumps between 0% to about 10%
09:27 AM rue_house: from the 10% up its linear
09:28 AM cehteh: cant you tap the motor, with 2 diodes
09:28 AM rue_house: yes
09:28 AM rue_house: later I tapped the motor anyhow, to get direction
09:30 AM rue_house: part of the goal of that first circuit was to not have to open the servo
09:30 AM rue_house: you end up with the origional 3 servo wires, +1 from the pot for position, +1 from one side of the motor for direction
09:30 AM rue_house: =5
09:30 AM rue_house: your proposing 6
09:31 AM cehteh: ok
09:31 AM rue_house: fro the 6th wire, you gain the 0.7V to the servo
09:32 AM cehteh: i just wondered why you use that transistor and the high ohm shunt
09:32 AM rue_house: the shunt is set to knock off the idle current of the servo
09:32 AM cehteh: 1ohm shunt or less should be good, feed that directly to a analog input of an avr
09:32 AM rue_house: but its limited to 0.7V by the transistor
09:33 AM cehteh: either ADC .. or when you only want to check for 'on' then analog comparator
09:33 AM rue_house: adc = slow and noisy
09:33 AM cehteh: then you can even use interupts when the motor is on
09:33 AM rue_house: you can, if you tap both sides of it
09:34 AM rue_house: ah, you just made me realize a code error
09:34 AM cehteh: dont need to
09:34 AM rue_house: thaks
09:35 AM rue_house: how do you propose to get the motor drive time from one side of the motor?
09:36 AM cehteh: with or without direction?
09:36 AM cehteh: for direction you need to open the servo anyway
09:37 AM rue_house: you need to know the motor runtime pulse regardless of direction
09:37 AM rue_house: in part 2, you need to know direction, (so yea, have to open servo)
09:38 AM cehteh: well like you do, but only 1ohm or less shunt, maybe RC filter, directly to the analog comparator, then a trimmer (or voltage divider) for the analog comparator reference .. and iirc you can even use the analog comparator to trigger the timer capture unit
09:38 AM cehteh: then you get exact motor timing all in hardware
09:39 AM rue_house: right, so your a lot more than just 1 transistor
09:39 AM cehteh: eh? 3 resistors (filter aside, you dont had one either)
09:40 AM rue_house: and the RC filter will slow down the responce time
09:40 AM rue_house: I meant active components
09:40 AM cehteh: no active component
09:40 AM rue_house: <cehteh> well like you do, but only 1ohm or less shunt, maybe RC filter, directly to the analog comparator...
09:40 AM cehteh: that only needs these 3 resistors (2 of them maybe a trimmer)
09:40 AM cehteh: analog comparator is build into AVR's
09:41 AM rue_house: ok...
09:42 AM rue_house: now can it all be fit into a tiny13.... :)
09:42 AM cehteh: and RC filter wont slow down when dimensioned right its only for filtering noise at higher frequency than the motor PWM
09:42 AM rue_house: the motor pulses are actaully incredibly clean
09:42 AM cehteh: oh then you dont need a filter, but i admit my solution needs 2 pins
09:43 AM rue_house: what I didn't tell ya, is that, it turns out the motor lead floats when its not being driven
09:43 AM cehteh: one sense input and one reference
09:43 AM rue_house: so, you CAN doit if you can work out if the 1 motor lead is being driven high or low
09:43 AM rue_house: (and I dont know if all servos drive the motor in that same way)
09:44 AM rue_house: definitly the sg90
09:44 AM cehteh: likely not
09:44 AM rue_house: everyone seems to like to use the same controller chip
09:44 AM cehteh: well was talking about your schematic, without opening the servo
09:44 AM rue_house: dont recall the number on it
09:45 AM rue_house: well 1 ohm is 0.4V, according to that old scope check
09:45 AM rue_house: which is lots of signal
09:45 AM cehteh: and tiny13 .. mkay, i've almost forgotten what features it has
09:45 AM rue_house: :) no hardware uart (#$%@#!@#%$)
09:46 AM cehteh: i was more thinking about analog comparator and timer capture .. iirc the later isnt present on tiny13
09:47 AM rue_house: 2 ANIN pins...
09:47 AM rue_house: pin change interrupt on everything
09:48 AM rue_house: with a timer and an interrupt you can make the pulse capture
09:49 AM rue_house: I have to go to work
09:50 AM cehteh: pinchange is fast enough?
09:50 AM rue_house: ? should be
09:50 AM rue_house: for an 8 bit timer?
09:50 AM rue_house: 20ms/256?
09:50 AM cehteh: dunno, what PWM freq do you have and what resolution/precision do you need?
09:50 AM rue_house: the pulses are 20ms long
09:51 AM rue_house: max
09:51 AM cehteh: when you switch to tiny25 you get a 16bit timer which can run up to 64mhz and main clock at 16Mhz ... :D
09:51 AM rue_house: 50Hz, its a hobby servo
09:51 AM cehteh: ah
09:51 AM cehteh: that pulses
09:51 AM cehteh: duh
09:51 AM rue_house: the motor starts when the control pulse finishes
09:51 AM cehteh: i had the impression you want to measure the motor PWM
09:51 AM rue_house: it runs a max of 20ms (100% duty)
09:52 AM cehteh: yes i know and done that
09:52 AM cehteh: also on tiny13 with pcint
09:52 AM rue_house: you are, there is 1 motor pulse per control pulse
09:52 AM cehteh: works, not very precise but good enugh
09:52 AM rue_house: I'm doing force feedback
09:52 AM rue_house: the motor pulse time = motor load = applied force
09:52 AM rue_house: +- intertia
09:52 AM cehteh: huh i thought the motors hare much higher frequency pwm
09:53 AM rue_house: nope
09:53 AM cehteh: anyway, with input capture you get much much more precise results
09:53 AM rue_house: http://ruemohr.org/~ircjunk/tutorials/elex/hobbyservo/servo101.html
09:54 AM cehteh: (and can do other stuff uninterrupted)
09:54 AM rue_house: http://ruemohr.org/~ircjunk/tutorials/elex/hobbyservo2/p1080887.jpg top trace is motor run (under some load) and the bottom is control pulse
09:54 AM rue_house: (the scope is out of horiz cal, sorry)
09:54 AM cehteh: okok
09:55 AM * cehteh going to do somethin else too
10:01 AM remkooo1 is now known as remkooo
10:16 AM remkooo1 is now known as remkooo
10:54 AM mark4: does the avr gnu assembler support the lo8(x) hi8(x) etc modifiers?
11:07 AM mark4: err yea it does.. helps if you dont have typos :P
11:27 AM Jan-: hihi avr people
11:27 AM Jan-: has anyone here ever used a temperature compensated crystal oscillator with an atmega328
11:28 AM Jan-: I'd like to hear experiences, if it worked, and what the proper settings for the clock on the microcontroller are.
11:54 AM cehteh: Jan-: just use a RTC
11:55 AM cehteh: many RTC's can output a highly accurate 32k clock which can be used on the 328 to drive one timer
12:00 PM Jan-: unfortunately, I need more than 32khz.
12:00 PM cehteh: for what?
12:00 PM Jan-: I think there are limitations on the external timer clock inputs. I seem to recall concluding it wasn't OK.
12:01 PM cehteh: what are you trying to do?
12:02 PM Jan-: Long story. Yes, the precision is definitely required.
12:02 PM Jan-: http://cvp.com/index.php?t=product/timecode-systems_ts-tcb.ce_intellislate&gclid=CJy2xrWUrNQCFcWVGwodNVYMAw
12:04 PM cehteh: precision .. yes, but whats wrong with 32khz?
12:05 PM Jan-: I need to time video frame synchronising pulses to the point where I can stay in sync for hours.
12:05 PM Jan-: I need the smallest possible time slice to do that.
12:05 PM cehteh: you mix something up, you need a timebase which is precise without drifts and glitches
12:06 PM Jan-: I need it to be very stable, and I need a reasonably small time slice.
12:06 PM cehteh: but a frame is about 20ms, even if you go serveral magnitudes faster, 32khz are more than enough
12:07 PM cehteh: clock stability is measured in ppm .. and good (not knockof) RTC's can deliver pretty low ppm drifts, few seconds a year or so
12:07 PM Jan-: temperature compensated modules go to about 1 ppm
12:07 PM Jan-: that's all anyone can be using so I guess that's fine
12:08 PM cehteh: i dont see that you need that much precision, but even if, that has nothing to do if you time signal is 1 per second, 32khz or 16Mhz
12:08 PM Jan-: eh, I have explained this a lot to people
12:09 PM Jan-: we need to time how long the frames are, so we can stay in sync accurately for long periods of time without a connection.
12:09 PM cehteh: yes
12:09 PM Jan-: anyway, the query is more about connecting a T.C.X.O. to an AVR. Anyone done that?
12:09 PM cehteh: sure , then pick some module whith low ppm
12:09 PM Jan-: there's heaps on ebay
12:09 PM Jan-: getting the module isn't so hard.
12:10 PM Jan-: many of them are 3.3v but I'm not sure if the avr will accept a 3.3v clock input
12:10 PM cehteh: most knockoffs dont hold their promises :D
12:10 PM cehteh: you can run the whole avr at 3.3v
12:10 PM cehteh: otherwise datasheet will tell you more
12:11 PM Jan-: I'm not sure what the tcxo outputs.
12:11 PM Jan-: would we set the avr to "external clock" and just connect the tcxo output to one of the clock inputs?
12:12 PM cehteh: your design decision
12:13 PM Emil: >wants overengineered timing
12:13 PM Emil: >buys from ebay
12:13 PM cehteh: i'd consider to run the avr asynchronously from a normal 16Mhz crystal and have a high accurate clock (that 32khz thing) for timekeeping, driving the 16 bit timer
12:13 PM Emil: Top kek matey :D
12:13 PM cehteh: yeah
12:13 PM Jan-: I'll repeat: we need to time the duration of the incoming frames very accurately. A 32khz clock is not adequate.
12:14 PM cehteh: and i am pretty sure you dont know what you are talking about :D
12:14 PM Jan-: Yeah, I get that a lot. I've explained this a lot of times.
12:14 PM Jan-: Every time I bring up this project, someone goes "you don't need that," then I explain what it has to do, and they go "...oh yeah."
12:15 PM Jan-: You do not understand the use case.
12:15 PM cehteh: i know video stuff somewhat well
12:15 PM Emil: How do you expect us to help then :)
12:15 PM Jan-: Well I'd happily explain but the question was "has anyone ever used a tcxo to clock an avr" or similar.
12:15 PM cehteh: and i understand that you want the least possible drift
12:16 PM Jan-: In order to have minimum drift I need to time how long another device thinks a frame is. That's the timing issue.
12:16 PM Jan-: Usually that's done by timing hundreds of frames and averaging it out.
12:17 PM Jan-: To do that I need a timer with a fast clock. 32khz is nowhere even vaguely near enough.
12:17 PM Jan-: At 60 frames per second that's only 533 clocks per frame. That's lots of ppm.
12:17 PM Jan-: See the problem?
12:18 PM cehteh: you saied 100s frames, averaged out
12:18 PM Jan-: that's like 1800 parts per million.
12:18 PM Jan-: yes usually they listen for tens of seconds.
12:18 PM Jan-: to characterise the incoming timing
12:19 PM cehteh: and you constantly sample that rolling average or so? any device may have more or less drift, no matter how accurate you can measure these 10 seconds, your measurement is only accurate for those 10 seconds measured, not for the next
12:20 PM cehteh: studios often have a global clock transmitted somehow to each device to sync
12:20 PM Jan-: this is for a timecode slate
12:20 PM Jan-: it's a mobile, hand held device
12:20 PM cehteh: yes
12:21 PM Jan-: I have written code to do a radio link (using nrf24l01) which is OK, but of course it may be unreliable.
12:21 PM Jan-: the other alternative is GPS which is very very accurate, but again, not always available.
12:21 PM Jan-: so you see the issue. It really does have to be pretty good.
12:22 PM cehteh: that still doesnt mean that 32khz isnt enouhg .. and maybe (likely) there are chips which output an accurate 1mhz or faster clock
12:23 PM Jan-: yes, tcxos :)
12:23 PM cehteh: so check datasheets, try that
12:23 PM Jan-: if you did it with a 32khz clock you'd have to time that incoming signal for a very long period.
12:23 PM cehteh: well RTC's are temperature and aging compensated
12:23 PM Jan-: so yes you could do it but it would be not very practical
12:24 PM cehteh: i think i could program that what you want with a 1 tick per second signla
12:24 PM cehteh: as long that signal is accurate
12:24 PM Jan-: sure as long as you were willing to time the incoming signal for hours :)
12:25 PM cehteh: nah 10 seconds
12:25 PM Jan-: OK, assume 60 frames per second, you have then seen roughly 600 frames plus or minus 1
12:25 PM Jan-: your error is 1/600 which is just way way too much
12:25 PM cehteh: then your programming is wrong
12:27 PM Jan-: sure OK you could write a PLL or something
12:27 PM Jan-: but anyway, the query was: has anyone ever clocked an AVR from a tcxo and did you encounter any wrinkles?
12:27 PM cehteh: no one responded, but i'd bet someone may have done that
12:28 PM Jan-: and yes, I am to some extent selecting that solution because it makes the code simpler.
12:28 PM Jan-: plan B is to reference an external RTC.
12:32 PM cehteh: not referencing it, but use it as async clock generator for you internal timer
12:33 PM cehteh: and looking at the datasheet: you can run a 3v3 clocksource on a 5v 328
12:33 PM Jan-: kickass
12:33 PM cehteh: read the datasheet by yourself
12:33 PM Jan-: Either way this will require some careful code
12:33 PM Jan-: so as not to end up interrupting critical stuff
12:34 PM cehteh: thats the problem i've first seen, with running the timer asynchronously you can make the coding much easier than beans counting code
12:35 PM Jan-: Not sure what you mean by beans counting code, though I like the turn of phrase :)
12:35 PM cehteh: back to start: RTC 32khz -> timer1 (16bit) ... once started, never touch it
12:35 PM cehteh: run the core on a cheap 16 or 20Mhz crystal
12:36 PM cehteh: use hardware (input capture) to time frames
12:36 PM Jan-: Yes, I can do that, but it would require timing things for very long periods to avoid enormous inaccuracies.
12:36 PM cehteh: have (almost) all time in the world to handle these things
12:37 PM cehteh: no, that would be the most accurate
12:37 PM Jan-: Well, no, because if I need (say) 1 part per million accuracy, I would only get about 1800 parts per million accuracy per frame, so I would need to time 1800 frames.
12:37 PM Jan-: Which is one minute, fifteen seconds at 24 frames per second.
12:38 PM cehteh: you dont understand
12:38 PM Jan-: Don't I.
12:39 PM Emil: wtf :D
12:39 PM Jan-: I mean I can see ways to do it, but you'd end up writing code to have the thing characterise its own clock versus the RTC.
12:39 PM cehteh: you keep the timer running, possibly (yes you want that) handing its overflows incrementing another counter to extend its range
12:39 PM Jan-: Yes, I'm already doing that.
12:39 PM Jan-: Then you time for something like 2000 frames and you'd be maybe OK.
12:39 PM Emil: lolololo
12:40 PM Jan-: But that's crazy. Much better to time the frames more accurately and use fewer.
12:40 PM cehteh: you can trigger on single frames, but nohing but yourself keeps you from timing 100, 1000 10000 frames
12:40 PM Jan-: Nothing except that it then takes minutes on end to get sync, which is not OK.
12:40 PM cehteh: prolly integrate/rolling average over time
12:40 PM Emil: Jan-:
12:40 PM day_ is now known as daey
12:40 PM Emil: you have no idea what you are doing
12:40 PM cehteh: you just integrate
12:40 PM Jan-: Don't I really/
12:40 PM Jan-: that's amazing
12:41 PM Emil: Looking at you talk and ignoring all help cehteh is trying to give you
12:41 PM cehteh: when you have only 1 second then its all you have, the longer it runs the more accurate it gets
12:41 PM Emil: it is just sad
12:41 PM Jan-: I really need to write up a readme on this to explain exactly what it's required to do.
12:41 PM Jan-: Every time I bring it up, I go through this same conversation.
12:41 PM cehteh: on a 16mhz avr you can already a shitload of math
12:41 PM Emil: Jan-: have you entertained the thought
12:41 PM Emil: that
12:41 PM Emil: you might be wrong?
12:41 PM Emil: If everytime you bring it up people tell you are wrong
12:41 PM Emil: Have you even considered the alternative?
12:42 PM cehteh: you can keep stats since start, rolling averate over different time periods, anytihng inbetween
12:42 PM Jan-: Sure. But then I've reexamined the situation, and realised that no, I'm right, it's just that you don't understand my use case.
12:42 PM Emil: :DDD
12:42 PM Emil: Allrighty
12:42 PM Emil: Well
12:42 PM Emil: I'll watch some netflix
12:42 PM cehteh: well i think i give up here
12:42 PM Jan-: This thing needs to stay in synchronisation, over a lot of time, without an external sync signal.
12:42 PM Jan-: Timing things down to one in 32,000 of a second will not do that because mathematics.
12:42 PM cehteh: yes, but thats completely unrelated in your timer speed
12:43 PM Emil: Jan-: matey
12:43 PM cehteh: it only matters on how accurate your timer is
12:43 PM Emil: pls
12:43 PM Emil: you are hurting everyone's intelligence on this channel
12:43 PM Emil: mostly yours
12:43 PM Emil: A clock can be extremely accurate even if you get one pulse per day
12:43 PM Emil: That has nothing to do with its accuracy
12:43 PM Emil: or drift
12:43 PM cehteh: even if your timers have only one tick per day, week, month, year .. as long this ticks all come at the same time it is ok (thats accuracy)
12:43 PM Jan-: cehteh the accuracy requriement for this is ideally something like one frame in eight hours, worst case is 60 frames per second, that's one in 1,728,000
12:44 PM cehteh: yes
12:44 PM cehteh: sure
12:44 PM Jan-: that's probably impossible even with a temperature compensated oscillator.
12:44 PM Jan-: But it's a target.
12:44 PM cehteh: there are atomic clocks in chip form :D
12:44 PM JanC_ is now known as JanC
12:45 PM Jan-: Even as a matter of basic mathematics, if you want that degree of accuracy with a 32,000 hz clock, you need to time for 54 seconds, which is way too long.
12:45 PM day_ is now known as daey
12:45 PM cehteh: you can add a IR transmitter one as master everyone else as slave, add GPS .. whatever .. to bring the RTC's in sync,
12:46 PM Jan-: now personally I think that 1,728,000 divided by 32,000 is 54.
12:46 PM Jan-: you seem to disagree.
12:46 PM cehteh: yes
12:46 PM cehteh: you can time fractional frames too
12:46 PM Jan-: commercial options tend to synchronise in about ten seconds and you could reasonably do that with a faster clock.
12:47 PM Jan-: so, once again, does anyone have any experience clocking AVRs from a temperature compensated crystal oscillator :)
12:47 PM cehteh: shrug
12:47 PM Jan-: Oh dear. Have we realised we were wrong :/
12:48 PM Jan-: bear in mind I've explained this about a billion times and it always ends like this.
12:48 PM Emil: Jan-:
12:48 PM Emil: no
12:48 PM Jan-: it's getting really bloody tiresome.
12:48 PM Emil: it ends with people not wanting to hear your shit anymore
12:48 PM Jan-: I'm not an idiot, I have thought about this, I understand the problem.
12:48 PM Emil: top fucking kek
12:48 PM Emil: I must frame that
12:49 PM Jan-: I don't mean to be an ass here but I'm getting really tired of being told that I don't understand the project I'm working on. Jeez you'd expect me to understand it better than you do!
12:49 PM Emil: How do I submit stuff to bash.org
12:50 PM Emil: Jan-: then go away :)
12:51 PM cehteh: anyway my main point was that you want the timer asynchronously that eases the programming, you can do some math about how accurate you get with 32khz clock over 10 sec, when you feel thats not enough, then use some faster clock
12:51 PM Jan-: That's what I'm aiming to do.
12:51 PM Jan-: That's what I suggested when I first arrived here.
12:51 PM cehteh: iirc max async clock is 1/4 of the main clock but read datasheet
12:51 PM Jan-: Yes I know.
12:51 PM Jan-: This is why I'm interested in clocking the chip from a tcxo.
12:51 PM Jan-: Which is what I asked for.
12:52 PM Jan-: Now can we discuss that without you telling me I should do it some other way?
12:52 PM cehteh: i saied not clocking the chip from a tcxo :D
12:52 PM cehteh: well just do
12:52 PM cehteh: should work too
12:53 PM cehteh: doesnt add much benefits, but well
12:53 PM Jan-: it does allow me to run the timer from the 16mhz system clock.
12:54 PM Jan-: That would give me 1/16ppm quantization error
12:57 PM Emil: Which you don't need
12:57 PM Emil: because you don't understand the requirements
12:57 PM Emil: but whatever
12:57 PM Jan-: Emil if you can explain why I'm listening. Honestly. It's fine.
12:58 PM Jan-: But please don't just sit there and call me an idiot then refuse to go into detail.
12:58 PM Emil: cehteh: has already explained it like 3 times
12:58 PM Jan-: I probably don't need a full 16mhz clock, it could probably be 4.
12:58 PM cehteh: 32khz came only up when i mentioned RTC's .. you may pick any any other acurate clocksource too
12:59 PM Jan-: It does need to be more than 32khz.
12:59 PM Jan-: Otherwise yes sure.
12:59 PM Emil: You don't need ppm level accuracy :D
12:59 PM Jan-: I need to time something to within one video frame at 60 frames per second in ideally eight ours.
01:00 PM Emil: sorry, accuracy wrong word
01:00 PM Jan-: there's almost 1.8 million 60 hertz frames in eight hours.
01:00 PM Emil: You don't need ppm level precision
01:00 PM Emil: Mate
01:00 PM Emil: just
01:00 PM Emil: stop
01:00 PM cehteh: i havent done the math, just calculate by yourself what frequnecy you need
01:00 PM Jan-: Emil, there are sixty seconds in one minute, sixty minutes in one hour, and sixty frames in each second.
01:01 PM Jan-: Eight hours is nearly 1.8 million frames.
01:01 PM Emil: Jan-: so?
01:01 PM Jan-: Ideally I'd want 1/1.8ppm overall.
01:01 PM Emil: top kek
01:01 PM Emil: You have no idea what you are talking about
01:01 PM Jan-: That's probably impossible without using some super exotic timing device, so I'll do what I can.
01:02 PM Jan-: Do you understand what multiplication is?
01:02 PM Jan-: I'm not sure why you're struggling here.
01:03 PM Emil: This laughing at your idiocy is getting quite tiresome. The fun derived from it is quickly diminishing and idiocy that you spread hurts constantly
01:04 PM DKordic: Jan-: I find it hard to follow :) . So You essentialy need start and stop times of some pulse?
01:04 PM cehteh: Jan-: you forget what i saied earlier, when you sample 10 secs, that sampling is accurate for only that 10 sec
01:05 PM cehteh: even when you have a 100% accurate clock 0ppm .. the device you sampled may drift/glitch
01:05 PM Jan-: DKordic: The plan is that we listen to some timing for some number of seconds. We establish how long that external device thinks a frame is. Then, when disconnected, we try to run in synchronisation with that for as long as we can.
01:06 PM Jan-: And yes, the device we sampled will also drift. That's life.
01:06 PM cehteh: anyway do the math, run the timer at whatever MHz you determine
01:07 PM cehteh: and most of it will boil down to correct programming, preferably run the timer asynchonously, but once it runs, never stop it
01:08 PM Jan-: Sure. That's absolutely the plan.
01:08 PM cehteh: use the input capture to time things
01:08 PM Jan-: I already have code which does that, it works as well as it can with an unstable clock.
01:08 PM Jan-: right now it can't tell the difference between 24 and 25 frames per second if you put your finger on the ceramic resonator :)
01:09 PM Emil: ...
01:09 PM Emil: /ignore Jan-
01:09 PM Emil: Can't take that shit anymore
01:09 PM cehteh: if its that bad then your code is somehow broken :D
01:10 PM Lambda_Aurigae: external clock can go to maximum of the cpu speed on avr.... Jartza runs attiny85 chips with external clock at 20MHz..running multiples from single clock source.
01:10 PM cehteh: even internal OSC should cope with that
01:10 PM Emil: It seems Jan- can't even use a parts search if he thinks 1ppm precision is somehow "top of the line
01:11 PM xentrac: Emil: hush
01:11 PM Emil: xentrac: hm?
01:12 PM xentrac: Emil: you're not adding anything
01:12 PM Emil: xentrac: neither is Jan-
01:12 PM xentrac: Jan-: yeah, ceramic resonators are not that accurate. a thing to keep in mind is that the best you can do is the drift on whatever device is controlling the actual video rate
01:13 PM xentrac: which is probably a non-temperature-compensated quartz crystal
01:14 PM cehteh: on professional equipment it might be temperature compensate, or have some RTC (which does all kinds of compensation) for correction
01:14 PM xentrac: Emil: she built a prototype circuit and is now trying to get it to work better; both of those are real contributions. ridiculing them is not
01:14 PM cehteh: making the requirement for the main clock being compensated isnt really required
01:15 PM xentrac: cehteh: I don't know that much about professional video equipment; is that a normal thing to do?
01:15 PM xentrac: I mean if the video frame rate you're trying to track has 100ppm of error over some period of time, then even if your own clock is 0.01ppm error, you will have 100ppm of tracking error
01:15 PM cehteh: often you have a dedicated time generator and plug (or send) that signal around the studio/set
01:15 PM xentrac: (as cehteh was saying)
01:15 PM cehteh: each device syncs with that
01:15 PM xentrac: that makes sense. and it's sometimes a tcxo?
01:16 PM cehteh: dunno, doesnt matter then, point is to have anything in sync, prolly they use top notch things, professional equipment is quite expensive
01:17 PM Jan-: yes, I'm aware that resonators are not accurate.
01:17 PM Jan-: this is just a test rig right now
01:17 PM cehteh: but with a central shared clock you could sync on a woodpecker, as long every one sees the same ticks its ok
01:17 PM Jan-: I don't think that commercial timecode slates can be using anything other than a temperature compensated crystal.
01:17 PM Jan-: the next step up is oven controlled and they take way too much power and take way too long to stabilise.
01:17 PM cehteh: maybe even atomic clocks, gps receivers
01:18 PM xentrac: and as long as the woodpecker's slew rate doesn't go out of your PLL's tracking bandwidth
01:18 PM Jan-: GPS is an option but like the radio link, it is not always there.
01:18 PM cehteh: but as soon you have one (1!) central clock, it doesnt matter so much
01:18 PM Lambda_Aurigae: I would think new gear would use GPS for sync...or even a local GPS time relay signal.
01:18 PM xentrac: what's the error spec on TCXOs?
01:18 PM cehteh: do you have some domestic time signal in the us as we have in in the EU?
01:19 PM cehteh: https://en.wikipedia.org/wiki/DCF77
01:19 PM xentrac: there are stations that broadcast time signals, yeah
01:19 PM xentrac: I'm not sure how sharp the edge is
01:20 PM Lambda_Aurigae: I'm seeing them listed as +/- 0.5ppm to +/- 2.5ppm on various sites.
01:20 PM Jan-: you can get 1ppm without spending a fortune.
01:20 PM Lambda_Aurigae: cehteh, yes..we have acouple of those.
01:21 PM Jan-: We did think about using GPS.
01:21 PM Jan-: But it is pretty flaky indoors or whatever.
01:21 PM cehteh: yes
01:21 PM Jan-: we might use GPS to set them up, or even include a GPS module so they can self calibrate.
01:21 PM xentrac: so with a TCXO you can probably meet your spec most of the time
01:21 PM cehteh: hey you could even sync on overal present mains frequency
01:21 PM Jan-: ooh no, mains frequency slides around during the day
01:22 PM xentrac: that can vary by several ppm, yeah
01:22 PM Jan-: and it's battery powered :)
01:22 PM cehteh: well if you use that as master clock :D
01:22 PM cehteh: anyway thats another thing
01:22 PM xentrac: if yours is ±0.5ppm and the original time generator is ±0.5ppm then you're at 0.7ppm, which barely meets your one-frame-in-8-hours spec
01:22 PM cehteh: get your TCXO and start playing with it
01:22 PM Lambda_Aurigae: gps local relay.
01:22 PM Lambda_Aurigae: the survey guys use them all the time.
01:23 PM Jan-: xentrac: Yes, it's possible we can't do that.
01:23 PM Lambda_Aurigae: box that receives gps signal and rebroadcasts time constant for other gear.
01:23 PM Jan-: However, most movies shoot at 24 frames per second.
01:23 PM Jan-: So that makes it a lot easier.
01:23 PM xentrac: yup!
01:23 PM xentrac: over a long period of time the mains frequency has a very small total error, but within a single day it can vary substantially
01:23 PM cehteh: while i think it would be better to have something to sync with, prolly the original video source, if only you can plug in a composite wire once a while to re-sync
01:23 PM Jan-: lambda, this thing actually has a 2.4ghz radio link in it
01:24 PM Jan-: so when it can hear the radio signal, great, everything is easy.
01:24 PM Jan-: but of course that can be flaky.
01:24 PM xentrac: are you passing time data over the radio signal?
01:25 PM xentrac: if it's 802.11 keep in mind that that can have substantial jitter due to collision avoidance and stuff
01:25 PM Jan-: it's an nrf24l01 with the retries turned off.
01:25 PM Jan-: :)
01:25 PM xentrac: ha, nice
01:25 PM Jan-: yes, there is delay in it, yes the delay is reasonably consistent.
01:25 PM cehteh: wont that add some latency?
01:26 PM cehteh: ah
01:26 PM Jan-: yes but we can characterise ti.
01:26 PM Jan-: it's really not fricken much
01:26 PM Jan-: they're pretty fast
01:26 PM cehteh: ideally you have some carrier frequency already in sync with the clock
01:26 PM cehteh: IR transmitter? ... :D
01:26 PM Jan-: the spi transaction for the "transmit" command takes many many times longer than it actually takes to transmit.
01:26 PM Jan-: those things are pretty speedy
01:27 PM cehteh: do these -NRF things have some firmware and retransmissions etc?
01:27 PM cehteh: never used them
01:27 PM cehteh: that all adds unpredictable latency
01:27 PM xentrac: as she said, she's turned off the retries, so I guess they must have some :)
01:28 PM cehteh: then sending has some massaging already, filling buffer, prolly wait for a free slot/beacon etc
01:28 PM cehteh: thats where analog stuff shines, just blast things out as is
01:29 PM xentrac: yeah
01:29 PM xentrac: there might also be some bitstuffing that adds some amount of jitter
01:29 PM xentrac: Jan-: how much is the jitter?
01:29 PM cehteh: see the DCF77 article i posted above, the signal is digital, but the carrier frequency is already synced with atomic clocks
01:29 PM xentrac: haha, nice
01:29 PM cehteh: it just sends exactly
01:30 PM cehteh: no delay, no if's
01:30 PM xentrac: I didn't know about this atomic-clock-on-a-chip thing
01:30 PM cehteh: expensive :)
01:30 PM xentrac: it seems like that could be a useful enabler for time-domain radio
01:31 PM xentrac: I mean for time-domain radio communications you need some minimal pulse rate to maintain sync, right? but that would depend on the drift of your clock?
01:31 PM cehteh: the DCF atomic clocks are synced with the main atomic clock for the german time normal
01:31 PM cehteh: even if its drifts, its by law :D
01:32 PM xentrac: haha
01:32 PM cehteh: https://www.microsemi.com/products/timing-synchronization-systems/embedded-timing-solutions/components/sa-45s-chip-scale-atomic-clock
01:32 PM cehteh: there you get 10Mhz .. for your arduino :)
01:32 PM Jan-: we haven't looked at exactly what the jitter is.
01:32 PM Jan-: Not much.
01:33 PM Jan-: one of the issues we have is having good enough test equipment to measure this stuff.
01:33 PM cehteh: Prices begin at $1500 each in small quantity.
01:33 PM Jan-: in any case, the issue is not so much whether we have half a millisecond of jitter in one frame, it's whether we slowly run out by whole frames over time.
01:34 PM cehteh: instead aiming for higher accuracy clocks you should better aim for any means of re-syncing
01:34 PM Emil: cehteh: you haven't change your opinion?
01:34 PM Emil: Please tell me you have not
01:34 PM cehteh: heh
01:34 PM Jan-: bear in mind that the timecode we're showing is not frame synchronised to the camera, it's frame synchronised to the recorder. So the display may change during the camera exposure.
01:34 PM Jan-: so, very small jitter per frame is OK so long as it is not cumulative.
01:34 PM xentrac: right
01:35 PM Jan-: and cehteh, the idea is it will resynchronise whenever it has radio reception. But sometimes we might not be allowed to use radio (it can interfere for instance with sound equipment, radio mics) and it may need to be done manually, hence this issue.
01:35 PM cehteh: Emil: no i understand that problem, and he still tries to optimize it at the wrong end
01:37 PM cehteh: Jan-: add any other means. has the recorder some dead simple composite output? tap the sync there, maybe with some external box transmitting a analog radio signal or IR transmitter
01:38 PM Jan-: the output is in SMPTE-12M linear timecode format.
01:38 PM Jan-: it's designed to be recorded on an audio track and is therefore sort of an audio signal.
01:38 PM cehteh: shared/global clock is the solution, more accurate clocks will only help you when *all* clocks are same accuracy (and perhaps still drift in differnt directions, increasing the error)
01:38 PM Jan-: and yes, that's what we're doing, that's how this work.
01:38 PM Jan-: however sometimes the radio may not be available because of interference or permissions issues.
01:38 PM Jan-: so we need a fast, accurate clock.
01:39 PM Jan-: anyway I have to go
01:39 PM Jan-: dinnertime!
01:39 PM cehteh: the tricky part is about the software to keep it in sync
01:40 PM cehteh: you never ever want to stop/correct the timer itself, you need to keep some correction parameters for your calculations
01:40 PM cehteh: touching the timer causes glitches
01:40 PM Jan-: Oh I'm aware
01:40 PM cehteh: ok
01:40 PM Jan-: right now I just interrupt on the compare match
01:41 PM Jan-: the timer runs
01:41 PM cehteh: compare match?
01:41 PM Jan-: oh not compare match
01:41 PM cehteh: :D
01:41 PM cehteh: overflow and input capture
01:41 PM Jan-: it's a comparator trigger event, whatever that's called
01:41 PM Jan-: when the smpte-12m signal transitions
01:42 PM cehteh: too bad the 328 doesnt have more input capture units
01:44 PM cehteh: 328pb has!
01:45 PM Jan-: I have a mega2560 board somewhere
01:45 PM Jan-: though I think I will run out of ram before I run out of pins
01:46 PM cehteh: for very exact timing you almost always want the input capture unit
01:46 PM Jan-: of course it's an analog signal so there is quite some jitter.
01:46 PM cehteh: and since you have 2 sources, timecode and frames you may want to have 2 of them, or mux them
01:46 PM Jan-: I have one source, the smpte-12m signal.
01:46 PM Jan-: we capture that, decode it, transmit it.
01:46 PM Jan-: if the other end can't hear the radio signal, it has to freewheel.
01:46 PM cehteh: ok
01:47 PM Jan-: Or, you can decide not to use the radio link, and plug the remote end into the signal.
01:47 PM Jan-: It listens to the signal for a bit, determines the timing, and then you can unplug and it will freewheel for as long as it can (hours).,
01:49 PM Jan-: anyway I really do have to go
01:49 PM Jan-: later all
01:49 PM Jan- is now known as Jan-dinner
01:51 PM polprog: maybe youll know what make is the mixing console in 0:25 https://www.youtube.com/watch?v=XEjLoHdbVeE&list=PLSjZxbjDqywjcEYeqWrWQBtbasa-YqPhq&index=162
01:51 PM polprog: the retro leds are awesome
01:51 PM polprog: and the wooden chassis... that's the kind of design i want to make my projects have
01:52 PM polprog: damn just look at that spectrum analyzer
04:01 PM Lambda_Aurigae: video not available in my country
04:02 PM Emil: It's Abba Gimme Gimme Gimme
04:03 PM Lambda_Aurigae: if you say so.
04:03 PM Lambda_Aurigae: no clue what that is.
04:03 PM Emil: Matey
04:03 PM Emil: How can you NOT know :D
04:04 PM * DKordic nods.
04:04 PM Lambda_Aurigae: I'm guessing it's some kind of music.
04:04 PM DKordic: Elementary.
04:04 PM Lambda_Aurigae: Abba is what my wife's great niece calls her instead of Aunt Beth
04:04 PM Lambda_Aurigae: beyond that..no flippin clue.
04:04 PM Emil: Interestin
04:04 PM Emil: Lambda_Aurigae: on a scale from 4 to 10, how Redneck would you rate yourself?
04:04 PM Lambda_Aurigae: I listen to both kinds of music
04:05 PM Lambda_Aurigae: country and western
04:05 PM Lambda_Aurigae: generally nothing newer than 1980.
04:05 PM Emil: Abba is older than that ;)
04:05 PM Lambda_Aurigae: mostly old country ballads.
04:05 PM Emil: https://en.wikipedia.org/wiki/ABBA
04:05 PM Lambda_Aurigae: Johnny Horton, Johnny Cash, Marty Robbins.
04:06 PM Emil: No Guns and Roses?
04:06 PM Emil: AC/DC?
04:06 PM Lambda_Aurigae: Big Balls and Hells Bells
04:06 PM Lambda_Aurigae: that's about the extent of my heavy metal listening.
04:06 PM Emil: lHow about Led Zeppelin?
04:06 PM Lambda_Aurigae: I've heard of Guns and Roses but couldn't tell you what they sang.
04:06 PM Lambda_Aurigae: heard of that too but no clue what they did.
04:06 PM Emil: very interestin
04:06 PM Tom_L: white snake
04:07 PM Lambda_Aurigae: I don't listen to music in general.
04:07 PM Tom_L: megadeth
04:07 PM Lambda_Aurigae: as I said, mostly old country ballads.
04:07 PM Tom_L: abba
04:07 PM Tom_L: queen
04:07 PM Tom_L: jonnie cash
04:07 PM Lambda_Aurigae: Cash is one of my favorites.
04:07 PM Lambda_Aurigae: he got very morbid in his later years though.
04:08 PM Tom_L: ed sheeran
04:08 PM Lambda_Aurigae: I do like old alabama
04:08 PM Tom_L: that
04:08 PM Lambda_Aurigae: their newer stuff isn't as good.
04:08 PM Lambda_Aurigae: Dolly, some Reba
04:08 PM Lambda_Aurigae: Patsy Cline
04:08 PM Lambda_Aurigae: but, I can go weeks without listening to music.
04:08 PM Tom_L: zz top
04:09 PM Lambda_Aurigae: I'm an old fart who listens to music that was listened to by old farts when I was a kid.
04:09 PM Lambda_Aurigae: and not into rock or pop
04:10 PM Tom_L: Emil listens to bread
04:10 PM Lambda_Aurigae: and easy listening music is for elevators.
04:10 PM Emil: Tom_L: hm?
04:10 PM Emil: Tom_L: your reference or joke has flown right past my head
04:10 PM Tom_L: google it
04:10 PM Tom_L: i bet you'd like it if you like abba
04:10 PM Emil: Please attempt again should you wish to convey a wanted meaning
04:11 PM Tom_L: chicago
04:11 PM Emil: Ah
04:11 PM Lambda_Aurigae: rock and roll is my mother's biscuits...never know if they are gonna be nice soft rolls or hard as rocks.
04:11 PM Emil: that "listen_s_" thre me off
04:11 PM xentrac: I imagine you don't like bytebeat either, Lambda_Aurigae: http://canonical.org/~kragen/bytebeat
04:11 PM Lambda_Aurigae: never heard of bytebeat
04:11 PM xentrac: ain't country, that's for sure
04:11 PM Emil: Tom_L: also, I just said the name of that song which is on polprog's link
04:11 PM Emil: I'm no real fan of Abba
04:12 PM Tom_L: oh
04:12 PM Lambda_Aurigae: xentrac, ain't music far as I can tell from that video on that page.
04:12 PM xentrac: my grandpa didn't listen to music because he grew up in the country and his family didn't make music
04:12 PM Lambda_Aurigae: not as bad as rap or hiphop,,which sound the same to me but are apparently different things.
04:13 PM Lambda_Aurigae: xentrac, my grandpa learnt to make his own radio as a kid.
04:13 PM Lambda_Aurigae: he learnt me how to do it too!
04:13 PM Emil: Hmm
04:13 PM Emil: I'd say the Redneck level is quite high
04:13 PM Lambda_Aurigae: extremely.
04:14 PM Lambda_Aurigae: my grandfather was literally a card carrying member of the KKK
04:14 PM Emil: :D
04:14 PM Emil: You have the hood?
04:14 PM Emil: And the costume?
04:14 PM xentrac: making your own radio is awesome
04:14 PM Lambda_Aurigae: nope...one of my brothers has it I think.
04:14 PM Lambda_Aurigae: I wasn't around when he died.
04:14 PM Emil: Ah
04:15 PM xentrac: I don't think rap and hip-hop are really different things
04:15 PM Lambda_Aurigae: only thing I wanted of his was the still.
04:15 PM Emil: Tom_L: not bad, that Bread band
04:15 PM Lambda_Aurigae: but grandma had it trashed.
04:15 PM xentrac: I mean they often refer to the same music
04:15 PM xentrac: bummer!
04:15 PM Emil: Lambda_Aurigae: still?
04:15 PM Lambda_Aurigae: that still made shine for close to 50 years with only minor modifications
04:15 PM Lambda_Aurigae: best shine I ever tasted too.
04:15 PM Emil: Ah
04:15 PM Emil: Tislauslaite
04:16 PM Lambda_Aurigae: moonshine
04:16 PM Lambda_Aurigae: white lightning
04:16 PM Emil: How many %?
04:16 PM Lambda_Aurigae: gramps ran shine in his teen years.
04:16 PM Lambda_Aurigae: no clue.
04:16 PM Emil: Guestimate?
04:16 PM Lambda_Aurigae: but it was clear and smooth and kinda sweet and would knock you on your ass.
04:17 PM Lambda_Aurigae: last time I had any I was 18.
04:17 PM Emil: Sounds like less than 50%
04:17 PM Emil: Kids play
04:17 PM Lambda_Aurigae: 31 years ago.
04:18 PM Emil: Pontikka has a quite dangerous reputation in Finland
04:18 PM Emil: because of the methanol that forms
04:18 PM xentrac: yeah, but that's kind of a known problem
04:18 PM xentrac: for thousands of years I think
04:19 PM Lambda_Aurigae: so you only go a little blind!
04:22 PM hetii: Maybe some of you have idea how to run DMA transfer from USART in stm32? https://pastebin.com/Pj3hW4q2
04:22 PM Lambda_Aurigae: nope.
04:23 PM Lambda_Aurigae: at least, not I.
04:23 PM Emil: hetii: ask in #stm32
04:23 PM Emil: They do know how to do that
04:23 PM Lambda_Aurigae: I'm sure I could figure it out if I bothered to read the datasheets.
04:24 PM hetii: Emil, try that already without success till now :)
04:24 PM Lambda_Aurigae: well, you do have to prove that you don't use or like linux or anything open source before they will do anything but berate you in that channel.
04:25 PM NoHitWonder^: you are using std peripheral library? that's basicly obsolete
04:25 PM NoHitWonder^: use cube
04:27 PM hetii: NoHitWonder^, I try by using std peripheral library as well without it, and test most everything... I`m only able to receive data when configure NVIC to use USART1_IRQn
04:27 PM hetii: Lambda_Aurigae, what`s wrong for them with linux o_0 ?
04:35 PM Lambda_Aurigae: the term "open sores" comes up a lot over there.
04:35 PM Lambda_Aurigae: someone is prejudiced I guess.
04:58 PM NoHitWonder^: https://github.com/fboris/STM32Cube_FW_F4/tree/master/Projects/STM324xG_EVAL/Examples/UART/UART_Hyperterminal_DMA
05:02 PM hetii: NoHitWonder^, thx will investigate it :)
05:02 PM zopsi_ is now known as zopsi
05:05 PM anonnumberanon is now known as aberon
05:39 PM Emil: https://emil.fi/jako/dokumentit/kupari.pdf
05:39 PM Emil: Welp, this is what I'll do today then
06:23 PM mark4: has anyone else noticed that sometimes when doing a build with avr studio it makes a noise?
06:24 PM mark4: kind of like a beep but not quite lol
06:24 PM mark4: more like a meerrrrp
06:32 PM Lambda_Aurigae: nope
06:32 PM Lambda_Aurigae: but
06:33 PM Lambda_Aurigae: avr studio doesn't run on my computer.
07:30 PM mark4: yes it can :P
07:30 PM mark4: just not on your os maybe :P
07:49 PM rue_shop3: how do you pll control a woodpecker?
07:49 PM FL4SHK: make a robotic one
07:49 PM rue_shop3: VCW?
07:49 PM rue_shop3: (Voltage Controlled Woodpecker)?
07:50 PM Tom_L: feed him some crack and he'll really go to town
08:20 PM xentrac: rue_shop3: you might be able to do that, but I was talking about syncing a PLL to the woodpecker, i.e. using the woodpecker as input
08:43 PM aberon is now known as jackHighwood-aus
08:45 PM rue_bed: oh
08:46 PM jackHighwood-aus is now known as aberon
09:12 PM aberon is now known as anonnumberanon
09:12 PM anonnumberanon is now known as aberon
10:44 PM day__ is now known as daey
10:56 PM day__ is now known as daey