#avr Logs

May 18 2017

#avr Calendar

12:11 AM day__ is now known as day
01:10 AM impulse: when i connect my spi accelerometer to my nano 328, it ruins the USB communication
01:10 AM impulse: i get errors like this in dmesg: usb 4-1: device not accepting address 52, error -71
01:10 AM impulse: did i wire it wrong or what could it be?
01:12 AM rue_bed: is it a real usb adapter or is it software usb
01:16 AM xentrac: https://www.arduino.cc/en/Main/arduinoBoardNano says it uses an FTDI USB-to-Serial chip, just like the Duemilanove it's based on
01:37 AM rue_bed: ok
01:37 AM rue_bed: so, then
01:38 AM rue_bed: hmm
01:38 AM rue_bed: your running it on 3.3 or 5?
01:47 AM impulse: hmm should be 5V
01:47 AM impulse: and it's not an FTDI
01:47 AM impulse: it's not an arduino but a nano 328. basically a nano knockoff
01:48 AM impulse: it's this one: https://www.creatroninc.com/product/nano-328-v30/
01:58 AM impulse: it's a CH-340 USB-to-Serial chip
02:28 AM xentrac: aha
02:32 AM impulse: lemme get a pic of the accelerometer board
02:32 AM impulse: because i'm not really sure where i should be plugging things into
02:42 AM impulse: http://imgur.com/a/sF096
02:42 AM impulse: i'm confused about the 5V, 3V3, and VS pins
02:43 AM impulse: which ones am i sposto hook up?
03:03 AM Emil: impulse: learn basic electronics
03:08 AM impulse: yea..
03:17 AM impulse: are the 5V and 3V3 pins to select the interface voltage?
03:19 AM Emil: Look at examples using that device / read the datasheet
03:19 AM Emil: the 5v pin probably goes to a regulator
03:19 AM Emil: to produce 3v3
03:22 AM impulse: i should check where those traces go. i only have the datasheet for the ADXL345 accelerometer, not the breakout board
03:25 AM Emil: google how to use
03:25 AM Emil: and that number
03:26 AM impulse: oh Vs can only be up to 3.6V. that makes it a lot less confusing
03:26 AM impulse: also i may have fried it
04:48 AM Emil: Hmm
04:48 AM Emil: How would you go about detecting when coffee is ready?
04:48 AM Emil: Finished brewing
05:00 AM Snert__: alot might depend on what you have to work with.
05:00 AM Snert__: like what kind of coffeemaker.
05:03 AM Snert__: and is it yours to take apart and toy with and experiment.
05:07 AM Snert__: 'cause I'd put it on ethernet with an ip addy if possible.
05:16 AM Emil: Snert__: No intrusive modifications
05:16 AM Emil: Should work with any coffeemaker
05:17 AM Snert__: plug it into a load sensor and sense when the brewer is pulling juice.
05:18 AM Snert__: it will pull X amount when brewing...X amount when not brewing.
05:18 AM Emil: Yeah
05:18 AM Emil: but that's boring ;) and costs more
05:18 AM Emil: also apparently sensing how much remaining would be nice
05:20 AM Emil: Loads cells seem to be the only solution
05:21 AM Snert__: I'm always into cleanliness and lack of wire mess.
05:21 AM Snert__: And so the things I do tend to cost more.
05:43 AM Emil: What would you use?
05:44 AM Emil: If you had to detect remaining coffee level
06:03 AM Snert__: if touching the hardware is not an option then I might try a cam.
06:06 AM Snert__: at this point, though...I question the viability of the whole idea given that you can't touch the coffee pot at all.
06:06 AM Snert__: why bother.
06:07 AM Snert__: look at the fucker.
06:07 AM Snert__: coffee level good? ok...get a cup of coffee. If not...go buy coffee at the store.
06:07 AM Snert__: I tend to drink coffee, not make it. But that's just me.
06:12 AM Emil: No that's not what I said
06:12 AM Emil: I said no intrusive modificaations
06:12 AM Snert__: I guess you'd know what the definition of intrusive is in your situation. I don't.
06:13 AM dunz0r: Emil: Hmm, How about an IR-thermometer aimed at the pot?
06:15 AM dunz0r: Emil: Or possibly a row of phototransistors, with a light on the other side
06:15 AM dunz0r: So you can detect "level"
06:15 AM Emil: dunz0r: yeah that's one idea I had
06:15 AM Emil: it's actually okay doable
06:16 AM dunz0r: IR-LEDs with "aiming tubes" and IR-phototransistors on the other side.
06:16 AM dunz0r: And if LED0 is lit, it's empty, LED1 it's almost empty, and so on :)
06:16 AM dunz0r: It would only work with glass pots though :/
06:17 AM Emil: are there other types?
06:17 AM dunz0r: I've had ones with a thermos-pot made of metal
06:17 AM dunz0r: But I don't think those are very common.
06:18 AM * dunz0r is going to start moving his AVR-powered french press coffee maker from the drawing board to prototype this summer
06:18 AM dunz0r: Speaking of making coffee in complex ways :D
06:18 AM Lambda_Aurigae: only glass on my coffee pot is the little thing on the top where you see the coffee bubbling up when it percolates.
06:18 AM dunz0r: I am seriously considering using a pour-over method instead though, so much mechanics for a french press
06:19 AM Lambda_Aurigae: percolated, over an open fire...the ONLY way to make real coffee.
06:19 AM dunz0r: Lambda_Aurigae: Eh, percolated is meh :)
06:19 AM dunz0r: Usually burns the coffee
06:19 AM dunz0r: Shouldn't go over 94°C!
06:20 AM Lambda_Aurigae: bah..has to get hot enough to boil!
06:20 AM Lambda_Aurigae: if it's not percolated for 20 minutes it's not strong enough to tarnish silver immediately.
06:20 AM dunz0r: Haha
06:20 AM dunz0r: I like percolated coffee though, but I prefer french press :)
06:21 AM Lambda_Aurigae: if I can pour it in a clear glass and see a spoon in the glass,,,it's weak pisswater.
06:21 AM dunz0r: But sooo much mechanics for an automated frenchpress...
06:21 AM dunz0r: Lambda_Aurigae: Well duh...
06:21 AM dunz0r: :D
06:26 AM Lambda_Aurigae: and it has to have that nice little oil sheen on top.
06:26 AM Lambda_Aurigae: but, I make iced tea darker and stronger than most people make coffee.
06:27 AM Lambda_Aurigae: my father-n-law is a coffee drinker and he has to cut my coffee by half with water because it's too strong for him.
06:29 AM * dunz0r uses 120ml of coffee per 1 liter of water
06:29 AM dunz0r: Roughly of course
06:30 AM Emil: Lambda_Aurigae: :D
06:34 AM Emil: I don't drink coffee
06:34 AM Emil: but I love the smell
06:39 AM dunz0r: My dream is to make this fully automatic frenchpress and have it wake me up with the smell of coffee in the mornings...
06:39 AM dunz0r: But most likely it will just wake me up by breaking in some extravagant way
06:39 AM Snert__: Lambda_Aurigae: coffee grounds in an old sock, toss it into the pan over the open fire...yea!
06:48 AM Lambda_Aurigae: why the sock?
06:49 AM Lambda_Aurigae: filter the grounds with your teeth!
06:49 AM Lambda_Aurigae: only time I make coffee is when I'm camping.
06:51 AM Lambda_Aurigae: will use the keureg to make coffee flavored water when I cook country ham and want redeyed gravy.
11:50 AM enhering: Brazilian politics is on fire.
11:50 AM enhering: Another president will fall soon.
11:50 AM enhering: amazing.
11:55 AM learath: oh?
11:56 AM xentrac: yeah
12:08 PM enhering: Brazilian stock market felt 10% up to now...
12:10 PM enhering: Big crisis coming...
12:22 PM Emil: ooh
12:22 PM Emil: I hope you shorted ;)
12:28 PM enhering: I was waiting for this moment.
12:56 PM enhering: Good news! Mine, and other 400+ projects got some seedfunding from Hackaday prize. https://hackaday.io/project/11724-yauvc-yet-another-unmanned-vehicle-controller
12:56 PM Emil: nice!
12:56 PM Emil: How much did you get?
12:56 PM enhering: Happy!
12:57 PM enhering: dunno. Probably 100 bucks. But it is amazing for me!
01:23 PM pitastrudl: so if a device has a 1000Hz microprocessor, and the prescaler is set to 1:4096, can a 10 bit timer overflow? will it get incremented, since the counter would get incremented with a frequency of 0.25Hz
01:24 PM pitastrudl: it is part of an assigment i have, and i already calculated the right answer, but i feel like something might be off
01:24 PM xentrac: a 1kHz microprocessor?
01:25 PM pitastrudl: hypothetically
01:25 PM xentrac: maybe you mean the timer is incrementing at 1kHz, rather than that the processor clock is 1kHz? because 1kHz is, like, pre-vacuum-tube speeds
01:25 PM pitastrudl: the system clock has a period of 1ms
01:25 PM pitastrudl: so the frequency is 1000Hz
01:26 PM xentrac: so the prescaler increments a timer every 4096 pulses of the system clock?
01:26 PM pitastrudl: yes
01:26 PM specing: Emil: ^ :D
01:26 PM pitastrudl: im wondering also if in the RISC arcihetctures, if a prescaler's max value can be bigger than the integer value of the system clock
01:26 PM xentrac: so how long will it take for a 10-bit counter to overflow
01:26 PM pitastrudl: 4000 seconds
01:26 PM pitastrudl: around
01:26 PM xentrac: right
01:27 PM xentrac: RISC refers to the architecture of the CPU; it doesn't have anything to do with the design of peripherals like a timer
01:27 PM pitastrudl: i see
01:27 PM xentrac: system clocks don't have integer values
01:27 PM xentrac: they just generate pulses
01:27 PM xentrac: I mean you could say that at any given moment the value of the clock line is 1 or 0
01:27 PM xentrac: which are integers
01:28 PM xentrac: but I think that wasn't what you meant
01:28 PM pitastrudl: yeah
01:28 PM pitastrudl: im just wondering if a prescaler can be set that high
01:28 PM pitastrudl: relative to the system clock frequency
01:28 PM pitastrudl: for example the max i saw on the amtega16u2 is 1024 iirc
01:28 PM pitastrudl: and it has 16mhz
01:28 PM xentrac: depends on the prescaler; certainly you can build one with as many bits as you want
01:28 PM pitastrudl: ah okay
01:30 PM xentrac: AVRs typically have a few different prescalers for different things
01:31 PM xentrac: on the 328, for example, the system clock itself is generated from a prescaler from some possibly higher-frequency clock
01:31 PM pitastrudl: okay
01:31 PM pitastrudl: thanks for the help :]
01:32 PM xentrac: which can divide by values from 1 to 256
01:32 PM xentrac: the watchdog timer runs off a prescaler that can divide by values from 2048 to 1048576
01:33 PM Emil: pitastrudl: clock frequency has nothing to do with how the peripherals work
01:33 PM Emil: as long as slew rates are controlled for everything is fine
01:33 PM xentrac: I'm amused by this assignment to calculate things about a 1kHz CPU
01:34 PM xentrac: it's like getting story problems about a man who can lift 100 grams of weight, or a car that weighs 1kg
01:34 PM pitastrudl: ¯\_(ツ)_/¯
01:34 PM pitastrudl: it does not make much sense indeed
01:35 PM Emil: specing: hm?
01:35 PM xentrac: I mean you *can* run modern processors down at speeds like that, all the way down to DC, but it's easier not to
01:35 PM specing: Emil: "can it overflow"
01:35 PM Emil: specing: of course it can overflow
01:35 PM xentrac: older processors actually wouldn't work at low speeds because of using dynamic logic to save transistors
01:35 PM specing: Emil: thats the point
01:36 PM Emil: xentrac: yeah
01:36 PM xentrac: your mom can overflow
01:36 PM Emil: xentrac: but modern CMOS logic with controlled slew rates can run at arbitrary slow clocks
01:36 PM pitastrudl: lol
01:36 PM xentrac: yup
01:37 PM xentrac: I was interested to learn about the problems of slew rates being too low when feeding fast logic, a couple of weeks ago
01:37 PM Emil: well, basically if there's hysteresis in the clock circuitry you don't even really have to control slew rates that much
01:38 PM xentrac: it hadn't occurred to me that feeding a slowly changing voltage into a logic input could result in small noise pushing it back and forth over the threshold if the Schmitt-trigger action is nonexistent or too small
01:39 PM Emil: heh
01:39 PM xentrac: (a Schmitt trigger being what you use to get hysteresis on the logic input; I haven't found Schmitt's original paper on it, but it was with vacuum tubes)
01:39 PM xentrac: I rigged up a Schmitt-trigger oscillator in the falstad circuitjs last week, did I show you that?
01:40 PM xentrac: I suspect that the simulation is not good enough to tell me if I'm doing something stupid
01:40 PM xentrac: like, its transistor model has no parameter for "transition frequency"
01:43 PM xentrac: I was trying to find a way to reduce the circuit to two BJTs (plus passives), but so far three is the best I can do
01:53 PM Emil: xentrac: no you didn't link it
01:57 PM Emil: xentrac: you want a a square wave oscillator?
02:03 PM Emil: You can do that with to bjts
02:33 PM xentrac: yeah, a square-wave oscillator is what I was going for, but I'm not picky about the waveform. https://is.gd/fastvco is what I've come up with so far, but I don't fully understand it
02:39 PM xentrac: emil: how do you do it with two BJTs?
02:40 PM xentrac: I guess I should specify I was trying to avoid inductors. it's pretty easy to make an oscillator with one BJT if you use an inductor
02:41 PM JanC is now known as Guest79336
02:43 PM xentrac: maybe an inductor would be okay if its value is small enough that it doesn't need a core, and the frequency is still voltage-controllable over a reasonable range
03:04 PM Emil: wellll
03:04 PM Emil: what frequency are you after?
03:56 PM xentrac: somewhere in the 100MHz to 800MHz range
03:59 PM Emil: well yeah that should be doable with air/nocore
03:59 PM xentrac: so how would you do it?
04:00 PM xentrac: this three-BJT design reaches only about 0.38 octaves of frequency variation
04:00 PM xentrac: I think it can betweaked to get a whole octave, which would be nice
04:00 PM xentrac: I don't care much about the linearity of the frequency variation
04:35 PM cehteh: how about a 555?
04:35 PM Tom_L: how about 2 555
04:35 PM Tom_L: 556
04:44 PM Jartza: 1110
04:45 PM cehteh: oops didnt seen the 100-800mhz range
04:46 PM day__ is now known as day
04:59 PM xentrac: heh, a 555 :)
04:59 PM xentrac: yeah, that's uh not gonna work
05:00 PM xentrac: also the 555 is very carefully designed to do the opposite of what I want, even in the frequency range it handles
05:01 PM xentrac: it's designed for its frequency to not depend on supply voltages or anything like that, only the values of the timing components you program it with. although there's probably some way to hack it!
05:02 PM xentrac: I mean you could use an external FET in linear mode, for example
05:02 PM xentrac: instead of a resistor
06:09 PM Emil: xentrac: there's examples on the falstad page
06:09 PM Emil: but this one produces nice results
06:09 PM Emil: http://www.learnabout-electronics.org/Oscillators/osc41.php
06:10 PM Emil: It will oscillate irl
06:10 PM Emil: but to get it oscilating here just temporarily remove one line
06:15 PM Emil: https://emil.fi/jako/linkit/oscillator
06:29 PM xentrac: cool! thanks! :)
07:02 PM xentrac: Emil: this circuit is awesome!
09:23 PM Thrashbarg_ is now known as Thrashbarg
10:58 PM JanC is now known as Guest104
10:58 PM JanC_ is now known as JanC
11:36 PM day__ is now known as day