#avr Logs

Sep 26 2019

#avr Calendar

12:36 AM soreau: and now I find out the only platform that has drivers for this thing is linux
04:28 AM vmt: soreau: for what?
08:14 AM jadew`` is now known as jadew
09:36 AM polprog: morning rue_mohr
09:38 AM vmt: what's that crazy old fart up to now?
11:16 AM soreau: vmt: composite audio class device + communications class device
11:21 AM cehteh: soreau: even AVR's can sample by timer all in hardware, you handle the sampling result by intrerupt then. this gives consistent timing. it would surprise me if STM32 cant do that, actually it may even write into your buffer by dma w/o any software/cpu cycles involved ... while using analogRead() would be really ugly for that, there is truckloads of machinery involved with that call, timing wont be exact as it may be interrupted, has branches and stuff you'll get
11:21 AM cehteh: jitter and aliasing
11:22 AM cehteh: even if stm32 is fast enough to call analogRead() at 20khz, thats no waysane
11:24 AM soreau: cehteh: Well I tried to do just that with dma irq, and the results were garbage. With analogRead, at least I get a consistent result with none of the potential issues you describe
11:29 AM soreau: it's very possible that I was just doing it wrong but I tried a few different ways and it just wasn't working at all
11:29 AM cehteh: you certainly did it wrong, and its really hard to do it more wrong than using analogRead for that :D good lick
11:29 AM cehteh: luck
11:29 AM soreau: Is there a chip out there that is designed for this by chance? USB high speed device with built in radio receiver and some way to control it?
11:29 AM Fuchikoma: https://www.adafruit.com/product/1497 Like this kind of radio?
11:35 AM soreau: It doesn't even say what the sample rate or usb speed is on the tech specs on that page
11:36 AM Fuchikoma: It's a radio
11:36 AM Fuchikoma: Nobody give a shit
11:54 AM cehteh: you can google the datasheets for the respective components
12:36 PM nohit: soreau: are you going wireless now?
12:37 PM soreau: nohit: what do you mean?
12:38 PM nohit: "? USB high speed device with built in radio receiver and some way to control it?"
12:39 PM soreau: nohit: Well I have a composite device consisting of a bluepill and a si4703 currently, so I'm kinda already wireless if that's what you're saying
05:11 PM bitmask: hey
05:12 PM bitmask: looking at designing my first pcb for a mcu that doesnt just have holes to plug in an arduino nano or something. Looking to use the atmega644pa. probably not relevant to my question though
05:13 PM bitmask: whats the difference between the AIN and ADC pins?
05:14 PM LeoNerd: On what chip?
05:14 PM bitmask: look up
05:17 PM LeoNerd: Oh, on the 644? Probably ADC vs. anacomp?
05:17 PM bitmask: anacomp huh? i'll have to look that up
05:17 PM bitmask: analog comparator or something im guessing you mean
05:18 PM LeoNerd: analog comparator, yes
05:19 PM bitmask: ahh I see thanks
05:22 PM cehteh: do you use the analog parts?
05:22 PM LeoNerd: I find it's quite rare indeed that I'll use the anacomp. I think only ever once so far
05:22 PM cehteh: then dont forget about AVCC filtering and cap on AREF
05:23 PM cehteh: i used it once, but it could be more useful when it had some configureable trigger hystersis
05:23 PM bitmask: I just need the 8 ADC channels
05:23 PM bitmask: the comparator wont be useful for this
05:24 PM cehteh: then add the AVCC filter and add proper things to AREF, either external reference or cap see datasheet
05:24 PM bitmask: k
05:25 PM bitmask: ive never looked into pwm configuration on avr stuffs. can you set the frequency? I planned on just manually doing pwm to control mosfets since the frequency only has to be around 1Hz
05:26 PM cehteh: yes you can set freq in some ways, but extremely slow frew might be a problem
05:26 PM LeoNerd: You set the period, but yes
05:27 PM bitmask: why is slow a problem
05:27 PM bitmask: the counter doesnt go that high?
05:27 PM bitmask: that kinda thing?
05:27 PM cehteh: main clock/1024 is the highest divider, depends on if you want to use a 8 bit or 16 bit counter for that
05:28 PM cehteh: just do some math whats reachable
05:28 PM cehteh: while for 1hz you can likely do that with sofware, unless you need it very accurate
05:29 PM cehteh: avr's have a lot different waveform generation modes, see datasheet
05:30 PM LeoNerd: Doubly so for the newer 1-series chips
05:30 PM cehteh: if doable you should prefer the hardware way of course
05:30 PM LeoNerd: I'm still getting my head around the timers there. Totally new and different to any of the older stuff
05:30 PM bitmask: 20000000 / 1024 =~ 20000, 1/20000 = 0.00005, so 8 bit = 0.0128 S and 16 bit = 3.2768 S?
05:30 PM bitmask: not sure I did that right
05:30 PM cehteh: i ithnk i give up on avrs soon .. ordered some red pills, will arrive in december or so, chaper and much more powerful and free
05:31 PM cehteh: bitmask: dunno if thats exactly right but looks like its in the correct ballpark
05:31 PM bitmask: k
05:32 PM bitmask: doesnt have to be accurate so software would be fine too, i'll think about it
05:32 PM cehteh: for a heater with 10sec interwal i did that in software as well
05:32 PM bitmask: yea its for heaters
05:33 PM bitmask: v2 of my heated jacket
05:33 PM cehteh: lol
05:33 PM cehteh: ok
05:33 PM cehteh: add some safetys :D
05:34 PM bitmask: doing my best, any suggestions?
05:34 PM bitmask: I check temperature and if it doesnt seem right it turns off, adjustable time out if you forget to turn it off
05:35 PM cehteh: for my oven i did some safety:
05:35 PM cehteh: broken sensor -> the old temperature gets just incremented then, eventuall running into the nextz
05:35 PM cehteh: overtemperature, shut completely down with uttlery priority when it goes over some temperature
05:36 PM bitmask: yea thats part of "doesn't seem right" checks
05:36 PM cehteh: timeoout, when heater is 'ON' but temperature doesnt rise within some timespan then something is wrong
05:36 PM bitmask: yup
05:36 PM cehteh: thermofuse .. if everything else breaks, the fuse blows and cuts it hard
05:37 PM bitmask: thats tough with separate heaters
05:37 PM cehteh: no
05:37 PM cehteh: treat each induvidually, maybe add sensing back, depends on what levle of safety you want
05:37 PM bitmask: I have a thermistor in each heating panel, uses PID control
05:38 PM cehteh: but i bet you could ignute some clothing when you accidantalyl dont turn the heaters off
05:38 PM cehteh: (and(or the sensors face ambient temperature and not the hesting elements)
05:38 PM LeoNerd: unbalanced parent
05:38 PM LeoNerd: unbalanced paren
05:38 PM cehteh: i also have cascaded pids, but that may be not necessary for you except you can build safety on that
05:39 PM cehteh: s/d[(]/\//
05:39 PM bitmask: yea, v1 works great, just a bit bulkier than I'd like, v2 will be much better in that regard
05:40 PM cehteh: i did some heater by using clas/carbon fabric, tested it but never gone into production
05:40 PM cehteh: that could be interesting for you, because its very smooth and thin
05:40 PM cehteh: mhm i have a pic moment
05:41 PM cehteh: https://pbs.twimg.com/media/CoTKze7XYAUhMok.jpg:large
05:42 PM bitmask: I'm using carbon fiber embedded in silicone
05:42 PM cehteh: ah that should be fine too
05:42 PM bitmask: was trying to make it more durable and spread out the heat but fabric might have been the better option
05:43 PM bitmask: it should work fine either way
05:43 PM bitmask: fabric is just easier to work with
05:44 PM cehteh: not that i need heatable jackets :D
05:45 PM bitmask: :)
05:45 PM bitmask: https://i.imgur.com/J9G6MX0.png
05:45 PM cehteh: and if, then this old style glowing coal ovens are nice
05:45 PM bitmask: not as pretty as yours
05:45 PM cehteh: well for bicycling i have some iron/oxidizing heat packs for the shoes in winter
05:48 PM bitmask: each panel is about 25 W
05:48 PM * cehteh thinks thats a pretty inefficient way to use electricity
05:48 PM cehteh: well electricity to heat is 100% efficient .. but getting the electricity there isnt :)
05:50 PM bitmask: what do you mean
05:50 PM cehteh: charging accu packs isnt very efficient, generating the electricity for those neither and then energy densisty is not as well
05:52 PM bitmask: I see, what is accu pack though? I'm curious how long the batteries will last in real world use.
05:53 PM cehteh: err battery pack ...
05:53 PM cehteh: akku is the german word for rechargeable batteries
05:53 PM bitmask: ahh
05:54 PM bitmask: I actually just bought some new batteries for this, saw them on sale for $4.50 each so I picked up 4 to create the pack and have a spare (3S), they are 8Ah pouch cells
05:55 PM bitmask: should last quite a few hours
05:55 PM cehteh: mkay
05:55 PM cehteh: add undervoltage protection/cutoff else you damage the cells
05:55 PM bitmask: yea definitely
05:56 PM bitmask: just ordered a bms balance board
06:05 PM nohit: akku
06:06 PM nohit: is also finnish
07:54 PM rue_mohr: morning polprog
11:54 PM day__ is now known as day
11:57 PM soreau: cehteh: you'll be happy to know I got adc working