#avr | Logs for 2016-03-21

Back
[06:12:09] <julius> hi
[06:56:19] <twnqx> so looking at OSH Park prices, the biggest issue is the unusable units for measuring
[06:57:06] <Lambda_Aurigae> have you looked at dirtypcb.com ?
[06:57:24] <Lambda_Aurigae> hmm.
[06:57:25] <Lambda_Aurigae> wrong url
[06:57:49] <Lambda_Aurigae> dirtypcbs.com
[06:59:46] <twnqx> makes me wonder about shipping to europe
[06:59:52] <twnqx> but i'll taker a look
[07:00:53] <twnqx> oh, shipping from china, pricing in USD. weird.
[07:00:55] <Tom_itx> hackvana
[07:01:19] <twnqx> i'll use easter days to make some PCBs :)
[07:01:24] <twnqx> design, that is
[07:01:32] <Lambda_Aurigae> twnqx, it's a US based company that oursources to a chinese board house and they ship straight from the board house.
[07:02:19] <Tom_itx> i thought laen got them back and snapped the boards apart then shipped em to you
[07:02:31] <Tom_itx> that's how he used to do it
[07:02:40] <Lambda_Aurigae> I think they changed stuff over time.
[07:03:02] <Tom_itx> hackvana is decent too
[07:03:14] <twnqx> i only ever used seeed so far
[07:03:18] <twnqx> kinda happy with them
[07:03:56] <Tom_itx> i've used seed, hackvana, goldphoenix, laen and a few others
[07:04:04] <Tom_itx> didn't like seeed
[07:04:10] <Tom_itx> crappy boards
[07:06:18] <twnqx> i've seen worse
[07:07:06] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/scope/DSC_0001.JPG
[07:07:11] <Tom_itx> lrg pic
[07:07:14] <Tom_itx> so have i
[07:07:42] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/scope/DSC_0002.JPG
[07:07:45] <Tom_itx> another lrg pic
[07:08:20] <Tom_itx> looked like a fingerprint across the traces
[07:09:11] <twnqx> http://i.imgur.com/wMvna4P.jpg oneof what i get typically
[07:10:41] <Tom_itx> that looks ok
[07:11:33] <twnqx> and the mask registration is better than some other companies
[07:12:00] <Jartza> I've been happy with hackvana boards
[07:12:03] <Jartza> and the community :)
[07:12:10] <Jartza> like, /join #hackvana
[07:12:14] <Tom_itx> yeah mitch is ok
[07:12:16] <Jartza> irc-support is pretty nice thing to have
[07:12:40] <Jartza> twnqx: and shipping to europe haven't been any problem.
[07:12:55] <Jartza> even HK post seems to bring boards approx. in 9 days to finland
[07:12:59] <Jartza> and if I need faster, then there's DHL
[07:18:45] <Jartza> twnqx: https://drive.google.com/file/d/0B2dTzW9TMeBxMlYtQWZKS1Exems/view?usp=sharing
[07:19:04] <twnqx> hasl :/
[07:19:10] <twnqx> stopped using that
[07:20:18] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxX2VmQmw3aXhWUDA/view?usp=sharing
[07:20:47] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxTl9YMkwzc0FCakk/view?usp=sharing
[07:22:43] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxTnFwZjdkcjI3cDA/view?usp=sharing
[07:25:40] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxS0x4V0VxS3ZEXzQ/view?usp=sharing
[07:25:49] <Jartza> some hackvana boards :)
[07:27:23] <twnqx> looking good, indeed
[07:29:16] <Jartza> yeah. I've been very happy with those. And the irc-channel.
[07:31:16] <Jartza> twnqx: I didn't even really know how to make PCBs when I joined the channel. I got very valuable hints and tips and I've learned a lot :)
[07:31:29] <Jartza> so it's also about community of people who make stuff, not just selling PCBs :)
[07:34:40] <Jartza> (and I'm in no way affiliated with hackvana, except being a customer)
[08:57:56] <julius> looking at this mosfet driver: http://www.st.com/web/en/resource/technical/document/datasheet/CD00001244.pdf on page 4, wouldnt pin 9 to ground be a short?
[09:02:19] <julius> oh wait, pin 8 is gnd. but where to connect pin 9 to?
[09:03:42] <julius> ah yes, according to this: 9 is vcc http://www.electronics-tutorials.ws/io/output-interfacing-circuits.html
[09:07:36] <twnqx> http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/lpc-cortex-m-mcus/lpc-cortex-m0-plus-m0/lpc800-series/low-cost-32-bit-microcontroller-mcu-based-on-arm-cortex-m0-plus-core:LPC810M021FN8
[09:07:43] <twnqx> now that's a cutesy arm
[09:15:35] <Jartza> huge
[09:16:24] <Jartza> http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/kinetis-cortex-m-mcus/l-series/kinetis-kl03-48-mhz-small-form-factor-high-integration-ultra-low-power-microcontrollers-mcus:KL03
[09:16:28] <Jartza> here's cute :)
[09:17:10] <Jartza> 2 * 1.61 * 0.56 mm
[09:21:53] <julius> the smt32 or something is <5€ from china
[09:22:04] <julius> with a small test board, its like 3x1cm
[09:25:28] <lorenzo> twnqx: I like LPC11U35
[09:26:07] <lorenzo> ~3 eur
[09:28:44] <twnqx> Jartza: <20$? lol
[09:28:52] <julius> integrated usb, nice
[09:28:52] <twnqx> for that price i can get a cavium
[09:31:42] <Jartza> twnqx: wut?
[09:32:07] <twnqx> cavium CN7020
[09:32:26] <Jartza> there's also QFN-16 version of the NXP KL03
[09:32:27] <twnqx> PCI express, USB 3.0/2.0 host, sata, ...
[09:32:31] <Jartza> http://www.mouser.fi/ProductDetail/NXP-Freescale/MKL03Z8VFG4/?qs=sGAEpiMZZMtqO%252bWUGLBzeFTiWLnX7Jk2WnTIq7zzrFc%3d
[09:32:55] <twnqx> uh, 70ct...
[09:32:56] <twnqx> hmmmm
[09:33:25] <Jartza> but that's huuuge, 3 x 3 mm :)
[09:34:40] <twnqx> meh, .4mm pitch with BGA
[09:36:06] <twnqx> that requires the expensive 1mil PCB manufacturing
[09:46:27] <julius> ah crap, i confused up/down on the uln2002a. any idea what happens if there +5v on the input and GND on output?
[09:46:35] <julius> thats a short right?
[09:48:58] <liwakura> if the output had pull-up activated, yes
[09:49:15] <liwakura> iirc
[09:55:03] <julius> weird, my current supply did just keep on running
[09:55:10] <julius> usually the finest short kicks it out
[09:57:42] <julius> anyway, can the uln be damaged by that?
[10:03:22] <liwakura> maybe, i just checked some pictures from google
[10:03:37] <liwakura> and i don't see some circuit route that would burn out
[10:14:21] <Jartza> twnqx: what's wrong with QFN?
[10:14:54] <twnqx> not too much
[10:15:08] <twnqx> i only need 4 pins anyway - power and I2C :P
[10:16:11] <julius> liwakura, thank you
[10:16:25] <liwakura> don't trust my skills
[10:16:35] <julius> its a second opinion
[10:22:56] <liwakura> julius: thumb rule: emmited magic smoke is bad
[10:23:03] <julius> :)
[10:23:20] <julius> crap, its the uln2002a. for 14-24v cmos devices
[10:23:33] <julius> should have taken a closer look at the datasheet
[10:26:18] <julius> the uln2003a would have been the right one
[10:48:00] <LeoNerd> 9600baud serial line. opto isolator. Would a 4N25 be fast enough? It says 2µs rise/fall time.. so I make that 250kHz fastest switching time.. Sounds OK?
[10:51:59] <twnqx> i think i have seen a design like that in a network capable 8 port relais board
[10:52:32] <twnqx> just be careful around the current limiting for the voltages. might also need extra diode on the receiving end.
[10:52:48] <LeoNerd> Mm..
[10:53:09] <LeoNerd> So, what it is, is a unit that has a USB-UART converter separate from its main logic board. Literally bridged by a Tx/Rx/GND cable
[10:53:25] <LeoNerd> I want to put an optoisolator in there, so the rest of the unit floats wrt. the USB port
[10:53:35] <twnqx> won't do, where do you get the 12V or whatever on the other end?
[10:53:37] <LeoNerd> So it's only 5V TTL UART
[10:53:43] <LeoNerd> Both ends can source power
[10:53:53] <LeoNerd> There's a 5V pin on either side, that isn't actually being used for the link
[11:14:03] <julius> LeoNerd, isnt it 1/0.000002 = 500khz?
[11:14:28] <LeoNerd> julius: rise time, but thne it has to fall again. so a whole cycle is 4µs == 250kHz
[11:14:37] <julius> ah yes
[11:17:54] <twnqx> but that's now missing hold time, rise + fall will barely yield a triangle, nowhere near a square :P
[11:18:31] <LeoNerd> Wellsure.. All I meant was that if you can justabout get a 250kHz triangle out of it, it shoudl be plenty sufficient for a <10kHz serial signal
[11:19:01] <twnqx> there's always an ADUM if you need more :P
[11:19:15] <LeoNerd> Yah.. those things are cute
[11:19:44] <LeoNerd> I might have to get me a few... on a separate project I need some more.. 2 out, 1 in
[11:22:15] <LeoNerd> They have some with a built-in DC converter too... so that'll help because I need to put a max481 on the other side
[11:25:09] <twnqx> i have a project upcoming that uses the I²C version of it
[11:57:24] <LeoNerd> Ugh.. ADUm5401 is what I want, but looks to be about £17 :(
[11:57:25] <LeoNerd> For one chip
[11:57:44] <LeoNerd> That can't be right
[11:58:53] <LeoNerd> Ah there we go. £6.60 / chip on Farnell. Still a bit of a lot. I wonder if the regular 4401 + a DCDC converter is cheaper
[12:11:32] <twnqx> i had the misfortune of ordering from farnell recently
[12:12:35] <twnqx> unlike mouser or digikey they don't sell to hobbyists. had to go through some reselling company
[12:13:02] <LeoNerd> I usually buy from them OK
[12:13:34] <twnqx> wouldn't let me withpout tax id
[12:13:37] <twnqx> without*
[12:15:24] <Jartza> LeoNerd: I've used 4N25 for 38400 uart and it worked ok :)
[12:16:09] <LeoNerd> Mmmm OK
[12:16:23] <Jartza> no, sorry, 31250bps :P
[12:16:28] <Jartza> anyway... for MIDI
[12:43:27] <antto> MIDI - much musical, very digital, wow!
[12:44:07] <Tom_itx> Musical Instrument Digital Interface
[12:45:24] * antto sends Tom_itx a "sysex message of death"
[12:45:35] <julius> http://electronics.stackexchange.com/questions/223889/mosfet-driver-uln2003 any idea why the motor wont start running?
[12:46:45] <Tom_itx> does the 2003 have an enable pin?
[12:46:58] <julius> let me check
[12:47:08] <Tom_itx> most of em do
[12:47:30] <julius> https://www.sparkfun.com/datasheets/IC/ULN2003A.pdf page 2 is a circuit diagram
[12:47:33] <julius> i dont see it
[12:48:11] <Tom_itx> pin 8
[12:48:24] <Tom_itx> maybe not
[12:48:29] <Tom_itx> it's just labelled sucky
[12:49:49] <julius> i thought 8 is vcc?
[12:50:11] <Tom_itx> maybe but it should say VCC
[12:51:45] <julius> http://www.eleccircuit.com/wp-content/uploads/2008/05/uln2003-control-stepper-motor-by-parallel-port.jpg theres another picture
[12:52:00] <julius> hm, there its ground
[12:54:35] <julius> no wait, 8 ground and 9 vcc is right
[12:54:47] <julius> do you mean that by "enable pin"?
[13:31:14] <Casper> wow man what an horrible schematics on sxc...
[13:48:01] <julius> it was made with love
[13:48:19] <julius> suggestions casper?
[13:52:38] <Casper> yes, add ground symbol and ground the avr and power it! :D
[13:52:55] <Casper> err the driver
[13:53:39] <julius> is there a symbol for the avr?
[13:53:47] <julius> or a way to rename the "custom part" symbol?
[13:55:27] <Casper> no idea, but you should atleast add the ground symbol, and ground the driver... that way it is clear that both use the same ground, and how you grounded stuff
[13:55:53] <Casper> right now, it is ambigous on how stuff are grounded, and look like an isolated supply with no common ground
[13:56:02] <julius> ah ok
[13:56:04] <julius> added that
[13:56:05] <Casper> which, of course, wouln't work
[13:56:49] <LeoNerd> Bah.. stupid scope. In "slope" trigger mode, it quotes slope rates in MV/s
[13:57:06] <LeoNerd> Yes.. that's technically true, but I'd find it more useful to see that written as V/µs
[13:57:15] <LeoNerd> Since, yaknow, we're talking actual volts and actual microseconds here
[13:58:33] <julius> what do you capture with "slope" ?
[13:58:56] <LeoNerd> LEDs being switched on
[13:59:27] <LeoNerd> So my channel actually measures current; more accurately I'm looking at A/µs of current draw by an LED
[13:59:39] <LeoNerd> I'm watching a PWM controller
[13:59:51] <julius> and how high is the starting current compared to normal?
[14:00:05] <LeoNerd> Slope is better than straight level triggering, because I don't know exactly what the quiescent level will be initially.. which is why I'm measuring it
[14:22:07] * julius nicks like he knows
[14:38:31] <julius> on a mosfet driver the voltag ucesat is the one at the output when the thing is off?
[14:41:47] <LeoNerd> huh?
[14:52:01] <julius> ah, its inverting the output
[14:52:13] <julius> thats why its all weird with the pwm duty cycles
[15:07:14] <WormFood> [02:26:43] <julius> WormFood, other peoples code always looks ugly, just saying <-- I think you'd disagree if you saw my asm code.
[15:07:31] <julius> i dont like asm, cant code with it really
[15:07:36] <julius> so cant comment on your style
[15:11:47] <inkjetunito> imo, asm should be intended with 2 spaces
[15:11:56] <inkjetunito> *indended
[15:12:15] <inkjetunito> ted
[15:12:29] <inkjetunito> englisch hard
[15:13:50] <julius> i would even trash c if it wasnt needed for the uc
[15:13:58] <julius> python or java would be really nice on a avr
[15:26:43] <julius> any hints on what you need in a multimeter? i go for: auto off, automatic range, can stand at 45 degress or more, hold, big display
[15:27:45] <LeoNerd> autorange, mA if not µA current range, max-hold
[15:28:06] <LeoNerd> My latest one I bought because of 5digit (22000 count) and optoisolated PC connection
[15:28:44] <LeoNerd> I don't trust things like capacitance testing in general purpose meters.. I already have a dedicated LCR meter for that
[15:29:12] <LeoNerd> I don't like overly integrated "do 20 different things" tools.. I prefer to have more tools that do One Thing Well
[15:31:45] <inkjetunito> julius: µA, computer connection can be handy
[15:32:53] <inkjetunito> having a broader bandwidth can't hurt either
[15:34:08] <inkjetunito> no, sorry, it WILL hurt :P
[15:52:07] <LeoNerd> Bandwidth on a multimeter?
[15:52:19] <LeoNerd> Anything above about.. er.. 1Hz and I'll be using my 'scope
[15:52:32] <LeoNerd> Oh.. also useful features: bargraph display
[15:52:49] <LeoNerd> I chose my UT-61E on the basis of prettymuch that feature alone.
[16:02:45] <jacekowski> julius: depends on your application and budget as well
[16:03:24] <jacekowski> julius: fluke 289 is great if you can justify it
[16:04:14] <LeoNerd> 50k count. True RMS
[16:06:15] <LeoNerd> Hmm.. looks cute. Claims 0.025% basic DC volt accuracy too.. which is approaching bench-levels of accurate
[16:07:37] * LeoNerd looks at price "Hah.. order-of GBP500."
[16:08:07] <LeoNerd> Yeeah.. Somewhat out of the range of most hobbyists I think. I paid £50 for my Uni-T
[16:09:20] <jacekowski> thing is i've had my 189 for 8 years now
[16:09:23] <jacekowski> 289
[16:09:51] <julius> max hold sounds interresting, ua - yes the avr can do that....will check. 50k count?
[16:10:20] <LeoNerd> My Uni-T does 22k count (which is therefore about half the Fluke), and max hold
[16:10:35] <jacekowski> so the £500 over 8 years (and probably a lot more) becomes around £60/year
[16:10:42] <julius> LeoNerd, like this one: http://www.amazon.de/XINTE-Intelligent-Multimeter--Detektor-Instrument/dp/B00J7HK26Y/ref=sr_1_1?ie=UTF8&qid=1458593030&sr=8-1&keywords=ut-61e ?
[16:11:13] <LeoNerd> julius: Yah that's the one. The E
[16:11:28] <LeoNerd> Make sure to distinguish the E though - the 61E is a lot different to the 61A to 61D models.
[16:11:34] <jacekowski> i've got a guy at work that refuses to buy a decent meter, he's been buying a new meter every few months each time spending about £50 on it
[16:12:04] <LeoNerd> The only bad thing I'd say about the Uni-T is the probes it comes with are /rubbish/. Cheap plastic horrible scratchy things with terrible PVC insulation
[16:12:05] <jacekowski> so his total spend over 8 years is just about as much as mine
[16:12:13] <LeoNerd> Throw them away and buy yourself some decent silicone ones.
[16:12:25] <LeoNerd> They let the meter down 'cause otherwise it is actually really nice
[16:12:35] <jacekowski> nothing like good old fluke TL71 probes
[16:12:50] <LeoNerd> I bought some cheap silicone £5 things off Amazon that turned out to be really nice
[16:13:08] <LeoNerd> It can be a bit hit-and-miss, but at £5 I thought hey, if they're rubish, I'll just buy some good ones anyway
[16:13:21] <julius> looks quite affordable
[16:13:32] <LeoNerd> These ones have rightangled plugs (good), and have little endcaps on the points
[16:13:35] <jacekowski> considering that very often that bit of silicone is the only thing between me and 1000V i don't buy cheap probes
[16:13:38] <LeoNerd> Useful for not stabbing myself all the time
[16:13:48] <LeoNerd> Ah - I'm rarely above 20V really
[16:14:00] <LeoNerd> I wouldn't suggest this Uni-T for kV work anyway
[16:14:08] <LeoNerd> It *claims* 1kV insulation and that is a total ie
[16:14:09] <LeoNerd> lie
[16:14:19] <julius> im also interrested in <20v
[16:14:21] <LeoNerd> It has like.. sub-2mm trace separations between V+ and COM
[16:14:30] <jacekowski> i've had my fluke up to nearly 2kV
[16:14:35] <julius> the biggest thing currently connected is a laptop power adapter, using the 19.4v dc
[16:14:44] <twnqx> just get over it and get a 30ghz scope
[16:14:45] <LeoNerd> Put a kilovolt across the Uni-T and you can take bets on how far across the room the pieces of plastic will fly when it explodes
[16:15:41] <jacekowski> there was a video on the interwebs of someone doing that
[16:15:46] <LeoNerd> Dave I believe
[16:15:47] <jacekowski> but i think it was more than 1kV
[16:15:58] <LeoNerd> Yah they put the 10kV insulation testing monster across it
[16:16:10] <LeoNerd> The thing you can hear the capacitors charging up first :)
[16:16:30] <julius> LeoNerd, anthough theres still ua/ma/A rang to choose from
[16:16:42] <julius> couldnt that be automated?
[16:16:42] <LeoNerd> Mm?
[16:16:45] <LeoNerd> Not really
[16:16:56] <LeoNerd> The different current ranges are selected by putting different shunt resistors in place
[16:17:02] <LeoNerd> Usually really small ones for the Amps range
[16:17:12] <julius> i mean you have to manually turn the wheel+
[16:17:14] <LeoNerd> You don't really want to use FET switching for that
[16:17:35] <LeoNerd> The switches add extra resistance and that reduces accuracy
[16:17:36] <julius> not realiable?
[16:17:39] <jacekowski> https://www.youtube.com/watch?v=M-FZP1U2dkM
[16:17:42] <twnqx> resiatance of a FET is too dynamic
[16:17:44] <julius> ah ok
[16:20:14] <julius> what about this one: http://www.amazon.de/Mastech-21-010-101-01-MASTECH-MS8229-Digital-Multimeter/dp/B000JKMTDM/ref=sr_1_7?ie=UTF8&qid=1458589363&sr=8-7&keywords=multimeter
[16:20:29] <julius> i hope amazon redirects you guys to the english page
[16:20:53] <LeoNerd> Easier just to quote "MASTECH MS8229" and I'll look it up myself ;)
[16:21:00] <julius> ok
[16:21:04] <julius> hm, one led place less
[16:21:37] <LeoNerd> Eh. it's got extra fancy bits... the lux meter, humidity, temperature...
[16:21:54] <LeoNerd> I mean they're not *bad* things to have, but they add extra cost that detracts from the core functionallity
[16:22:18] <LeoNerd> So you have to consider that price (£34 in the UK case) is going on those features as well as everything else
[16:22:35] <julius> youre looks more expensive, i mean just the look is better. more professional
[16:23:00] <LeoNerd> Adn yeah, it's only 4 digit
[16:23:56] <LeoNerd> Though, if it displays the temperature all the time that could be useful... Can be handy to have ambient temperature with a measurement
[16:24:06] <LeoNerd> Though typically you're up in the 6 digit bench meter territory before that becomes useful
[16:24:23] <LeoNerd> Yah; 0.7% basic DC accuracy
[16:24:28] <LeoNerd> I wouldn't buy this personally.
[16:28:07] <LeoNerd> Ahyes; the Uni-T 61E is currently at £39 on Amazon UK; so a mere £5 more than this Mastech one and in my opinion a much better meter
[16:28:24] <LeoNerd> Fewer actual features, but the things it does do (the basic DC/AC voltage, current, resistance) are just better
[16:30:16] <LeoNerd> True RMS, and bargraph.
[16:30:21] <LeoNerd> Honestly that bargraph is so useful
[16:56:30] <julius> ye
[16:56:36] <julius> yep, already ordered. thx :)
[16:57:10] <julius> LeoNerd, theres a newer model with 5 digits
[16:57:18] <julius> oh, you mean the green one.
[16:57:48] <julius> still. also the unit gets sold with 4 and 5 digits currently
[16:57:57] <julius> same product name...kinda weird
[17:00:38] <Jartza> evening
[17:03:15] <twnqx> my meter is i so old, my parent bought it for me as a gift :X
[17:03:21] <twnqx> parents*
[17:03:27] <twnqx> makes it around 25 years old
[17:04:44] <twnqx> METEX Corp OEM, doesn't tell me anything
[17:05:40] <twnqx> my other one is a random 10€ peaktech
[17:09:22] <LeoNerd> My second meter is a £20-from-15-years-ago electronics store own-brand thing. I mostly just use it for occasions when I need two at once
[17:09:25] <julius> i bet it captures the peaks very well ;)
[17:09:38] <LeoNerd> It serves well as the ameter in "home-made-SMU" setup :)
[17:11:24] <twnqx> i use the second one e.g. for current measurements while reading voltages with the other, yeah
[17:11:41] <LeoNerd> Yup
[17:12:02] <twnqx> what do you guys do with excess electronic components you buy? :S
[17:12:04] <LeoNerd> At some point I'm going to make myself a little home-made SMU.. but for now I hack it up manually (and terribly slowly) with two meters and my PSU
[17:12:09] <LeoNerd> Store them in boxes
[17:12:14] <LeoNerd> I'm sure I'll use them sometime. I have looooads
[17:12:15] <twnqx> :X
[17:12:30] <twnqx> that's what i always think
[17:12:31] <twnqx> and never do.
[17:12:37] <LeoNerd> I find that a certain arrangement of takeaway food boxes fits neatly in 9l Really Useful Boxes, and those stack neatly on my workshop racking
[17:12:42] <LeoNerd> So I have a rather dense storage system :)
[17:12:46] <twnqx> e.g. there's this TC9164N
[17:12:59] <twnqx> which i probably bought...15 years ago
[17:13:02] <LeoNerd> It's rare I order single components these days. Usually strips of 10 from eBay or whatever
[17:13:09] <twnqx> i needed one, so i bought two
[17:13:13] <twnqx> typical pattern for me
[17:13:15] <LeoNerd> I figure if I ever have a need for a thing, I'll likely need another one in a year or so
[17:13:30] <twnqx> not really
[17:13:37] <twnqx> this one is an audio switch
[17:13:49] <twnqx> that i used to replace something in a now... 25 years old stereo amp
[17:13:57] <twnqx> which i haven't turned on the past 10 years
[17:14:01] <|DM|> Hello. I remember there was a list of all the names avr libc uses for each register, but I cant find it
[17:14:19] <|DM|> ie that it maps OCr1A to this or that register
[17:14:39] <LeoNerd> Hrm? OCR1A /is/ the name of the register
[17:14:54] <LeoNerd> Output Compare Register for timer 1 channel A
[17:15:14] <|DM|> Yes, I know it is. But this was a table saying which register specifically
[17:15:20] <|DM|> ie r23 or whatever
[17:15:24] <julius> twnqx, storing
[17:15:34] <twnqx> but... how
[17:15:40] <|DM|> The reason I want this is to check if ADCW is a thing in avr libc
[17:15:45] <twnqx> i need to stop just throwing things in hige boxes :X
[17:15:47] <julius> twnqx, my current water pump experiment got a 35ma 40x cdrom motor for testing
[17:16:08] <julius> get boxes you can staple
[17:16:14] <twnqx> "oh, look. a random single 4.1943mhz crystal"
[17:16:27] <LeoNerd> Mm.. 4.1943.. how precise
[17:16:34] <LeoNerd> I wonder what that's used for
[17:16:41] <twnqx> no idea
[17:16:50] <LeoNerd> |DM|: Huh? r23 is not OCR1A.. r23 is r23. :)
[17:16:55] <LeoNerd> You're asking questions that don't make sense
[17:17:57] <twnqx> actually, 4.194304mhz +-30ppm
[17:18:24] <|DM|> You're right. I fucked up
[17:18:54] <|DM|> I confused registers with memory mapped sfrs
[17:19:09] <|DM|> In any case, I found what I was looking for
[17:19:11] <|DM|> :)
[17:19:34] <twnqx> sadly, in a lot of cpu architectures, the registers are ALSO memory mappped sfrs :D
[17:19:53] <LeoNerd> " Typical Application: 1CM7038a Microcprocessor "
[17:19:56] <LeoNerd> Says the crystal
[17:20:01] <LeoNerd> Sounds a really strange value
[17:20:39] <twnqx> ahhh
[17:20:46] <LeoNerd> Oh.. duh. It's just 4 * (1024*1024) MHz
[17:20:47] <twnqx> it's one for clocks
[17:21:00] <LeoNerd> Soyeah... divide it by 2^22 to get 1Hz
[17:21:25] <eszett> hi
[17:21:39] <LeoNerd> I prefer clock divisors to get me down to miliseconds.. or better
[17:21:56] <eszett> oh you again :-)
[17:22:04] <LeoNerd> Me? I'm always here
[17:22:25] <eszett> remember to have met you on another channel, dont know anymore
[17:22:54] <eszett> anyway... im struggling with setting up my atmega32u4-au
[17:24:18] <eszett> i can't get into bootloader mode, and wanted to ask if someone can give me a hint
[17:24:44] <LeoNerd> There's usually a physical button to press if it's on a breakout board
[17:24:52] <LeoNerd> E.g. my Adafruit board has a dedicated "boot" button
[17:25:03] <eszett> i set up a breadboard circuit with the atmega as DIP
[17:25:43] <eszett> the circuit is working, the LED is blinking, so far so good. I can flash the atmega. fine. But the problem is my OS doesnt detect it as device
[17:25:53] <LeoNerd> "detect it"
[17:25:55] <LeoNerd> What's "it"?
[17:26:03] <eszett> the circuit with the atmega
[17:26:11] <LeoNerd> What should it detect?
[17:26:15] <twnqx> SIL resistor networks with 9 resistors and a common pin. what...
[17:26:28] <LeoNerd> twnqx: incase 8 just isn't /quite/ enough for you?
[17:26:37] <LeoNerd> Also surely that just means they can come in TSSOP-10 packages?
[17:26:37] <eszett> LeoNerd: there is usually a sound in Windows 7 that tells me it detects a new USB device plugged in
[17:26:46] <LeoNerd> but what /kind/ of device?
[17:26:53] <LeoNerd> What device type were you expecting? What did you tell your AVR to be?
[17:27:00] <eszett> any USB device
[17:27:04] <twnqx> no, they come in 10pin SIL, 2.54mm pitch...
[17:27:06] <LeoNerd> There isn't an "any" device
[17:27:21] <LeoNerd> The 32U4 gives you the USB PHY in hardware, but it's up to *you* to make it reply correctly
[17:27:37] <LeoNerd> If you don't service any of the USB hardware interrupts, your device won't look like a USB device to the host computer, so it'll ignore it
[17:27:41] <eszett> im not sure about it
[17:27:48] <twnqx> i am :P
[17:27:59] <twnqx> there is no usb device until you tell it to be one
[17:28:10] <eszett> how can i tell it to the atmega?
[17:28:21] <twnqx> by writing the right program for it
[17:28:26] <eszett> argh
[17:28:43] <twnqx> go and check LUFA for some exmaples if you want
[17:29:01] <eszett> I dont think so. a colleague plugged his atmega32u4 iin and out of the box it was detected
[17:29:11] <LeoNerd> That'd depend what program was running on it
[17:29:15] <twnqx> they can ship with a USB bootloader, yes
[17:29:21] <eszett> yes, with the USB bootloader
[17:29:35] <LeoNerd> Chips like the FTDI FT232s, for example, have one _fixed_ function over USB. That's hardcoded into them. They do that and that one thing alone
[17:29:49] <LeoNerd> The 32U4 gives you the USB PHY, lets you do /whatever/ USB things you want, but you have to program it
[17:29:49] <eszett> and my atmega is, according to the datasheet, shipped with this preprogrammed bootloader too
[17:30:02] <LeoNerd> OK so it might appear like that in bootloader mode
[17:30:07] <LeoNerd> Have you connected the BOOT pin appropriately?
[17:30:18] <eszett> LeoNerd. is there a easy way to check, if the bootloader is actually there?
[17:30:32] <eszett> the Boot pin? hmm, i dont think so
[17:30:41] <eszett> You mean the HWB pin
[17:30:45] <LeoNerd> Er.. that one, yes.
[17:30:49] <LeoNerd> I forgot what it was called ;)
[17:30:49] <twnqx> also, do you have the external crystal? iirc the standard bootloader requires an external 12mhz crystal to work, it doesn't run on internal
[17:30:58] <eszett> ok, yes HWB is activated,
[17:31:07] <eszett> yes i have a fully working external crystal
[17:31:16] <eszett> 16mhz
[17:31:22] <LeoNerd> 16 != 12
[17:31:41] <eszett> but the bootloader doesnt require any certain mhz value
[17:32:06] <twnqx> yeah, might work with 16 too, can't exactly remember
[17:32:10] * eszett one second, telefone
[17:32:23] <LeoNerd> Surely the bootloader would need to know what the xtal frequency was, at least?
[17:32:42] <twnqx> nah, it's about feeding the pll for the usb hardware
[17:33:26] <LeoNerd> Sure
[17:33:32] <LeoNerd> But it still needs to know *what* it is
[17:33:37] <twnqx> no
[17:33:47] <twnqx> i don't think so
[17:33:57] <twnqx> just don't run software delay loops :P
[17:34:08] <LeoNerd> Otherwise how would it know? A PLL can only lock to some *given* ratio of the reference frequency
[17:34:11] <LeoNerd> It has to know what that ratio is
[17:34:38] <LeoNerd> Otherwise it has no possible basis to judge time
[17:34:41] <twnqx> i have seen quite some chips that don't really rare
[17:34:58] <|DM|> USb cares though
[17:34:59] <LeoNerd> There's USB PHY chips with internal oscillators, sure
[17:35:09] <twnqx> but i think they also use weird setups like clock -> VCO - PLL
[17:35:14] <LeoNerd> They might even be partial PLL based on the USB clock itself
[17:35:25] <LeoNerd> Use the USB clock as a tuning reference to keep the internal PLL synced
[18:08:02] <|DM|> Hey since this seems like a slow time, can I pastebin some code and ask wtf im doing wrong?
[18:08:13] <LeoNerd> Sure?
[18:08:58] <Lambda_Aurigae> what you are doing wrong is asking if you can ask a question as by asking you already asked.
[18:10:07] <|DM|> Different questions, and ive seen communities where just blatantly asking for a codecheck isnt so polite :D
[18:10:21] <|DM|> http://pastebin.com/F9HW0Gr9
[18:10:51] <LeoNerd> I'd prefer not using pastebin.com however ;) I quite like pastie.org
[18:11:15] <|DM|> I have a rheostats middle tap attached to portb3, which the admux is set to select. But it doesnt seem like the Sweeper variable ever updates
[18:11:25] <|DM|> I've manually checked that the voltage going to portb3 is changing
[18:11:27] <LeoNerd> Stylistically I'd rename BUZZPORT, since it isn't a port
[18:11:28] <|DM|> sure, ill repaste
[18:11:35] <LeoNerd> BUZZPN maybe? short for Pin Number
[18:12:03] <LeoNerd> ADCSRA = 0xC7; terribly ugly
[18:12:11] <LeoNerd> Use the _BV() macros to build that up symbolically out of wellknown names
[18:12:19] <LeoNerd> So people don't have to look up what all the bitflags mean
[18:12:33] <|DM|> http://pastie.org/10769179
[18:12:49] <|DM|> Aha, true. That was a bit offhand of me
[18:13:18] <LeoNerd> For any of the hardware things, I usually build myself up a set of C library code I can drag around
[18:13:28] <LeoNerd> So for me that'd be adc_setup(ADC_PRESCALE_whatever, ...);
[18:13:37] <LeoNerd> Much easier to read at a glance :)
[18:13:54] <LeoNerd> Also for things like timers where bitfields are split across densely packed control registers, muuuch easier
[18:14:04] <LeoNerd> (stupid WGM bits)
[18:15:34] <|DM|> I mean, this is all helpful but the bug remains :D
[18:15:51] <LeoNerd> Ah, so you're not waiting for the ADC to finish
[18:15:54] <LeoNerd> .. or possibly even starting it
[18:16:16] <|DM|> I am starting it in freerunning mode
[18:16:27] <LeoNerd> Ah
[18:16:29] <|DM|> And I thought in freerunning you could just sample whenever you want?
[18:16:42] <|DM|> because of the sample and hold cap
[18:16:43] <LeoNerd> See above under: 22:46 <LeoNerd> So people don't have to look up what all the bitflags mean
[18:16:45] <LeoNerd> ;)
[18:16:51] <|DM|> yeah im fixing it now :)
[18:17:04] <LeoNerd> OK I'm not so familiar with freerunning mode.. maybe that works
[18:18:15] <twnqx> aaaaaaargh overbuy snydrome kicking in again
[18:18:44] <twnqx> "hey, a raaco magazine with 48 drawers looks like a good starting point for storing all the electronic stuff"
[18:18:58] <twnqx> "hmmm 60€ a pop... well, start with one"
[18:19:17] <twnqx> "omfg this guy has four on sale, used, for 30€ each, i should get ALL OF THEM"
[18:19:25] <|DM|> I just found a plastic shop nearbuy and bought the stuff people usually use to store small clothes
[18:19:32] <|DM|> :D
[18:21:27] <|DM|> http://pastie.org/10769192 cleaned up. Buzzpin still indifferent to adc
[18:21:35] <|DM|> Any input on stuff to check would be welcome
[18:22:42] <LeoNerd> Hm. what chip?
[18:22:48] <|DM|> attiny45
[18:23:58] <LeoNerd> Hmm...
[18:24:10] <LeoNerd> I'd write the registers directly, for the "setup" style code. So = rather than |=
[18:24:25] <LeoNerd> on ADCSRA and ADMUX
[18:25:31] <|DM|> Alright, but they all default to 0
[18:26:00] <|DM|> At least it shaved off two lines of assembly
[18:26:03] <|DM|> :D
[18:26:14] <LeoNerd> They should do yes, but it's nice just to set them to be sure
[18:28:10] <LeoNerd> Ah.. you didn't set the ADATE bit
[18:28:14] <LeoNerd> So you're not in autotrigger mode
[18:28:29] <|DM|> Is that necessary?
[18:28:46] <LeoNerd> Without that bit you're in single-shot mode.. so you get a conversion once when asked, then it goes quiet
[18:28:55] <|DM|> Oh.
[18:29:02] <|DM|> woops
[18:30:11] <LeoNerd> also you definitely want to perform all the setpu before you finally ask it for a conversion
[18:30:42] <LeoNerd> So don't set the ADSC bit yet.. set the other values in ADSCRA and ADMUX then finally hit ADSCRA |= _BV(ADSC); just before the while loop
[18:31:01] <|DM|> I moved aden to its own line
[18:31:14] <|DM|> Oh, I guess you're right I should move sc
[18:31:20] <|DM|> so that its ready to roll asap
[18:31:28] <LeoNerd> Yah... ADEN and the other configuration can be done all at the same time
[18:31:37] <LeoNerd> Just don't trigger a conversion yet until it's all set up ready
[18:31:53] <|DM|> And now my speaker is making tunes that remind me of C-Movie sound effects
[18:31:54] <|DM|> Perfect
[18:31:57] <|DM|> Thanks!
[18:31:58] <LeoNerd> :)
[18:34:44] <LeoNerd> Hehe.. gotta love Engrish hardware manuals
[18:34:53] <LeoNerd> apparently my function generator has "Duel TTL outputs"
[18:34:57] <LeoNerd> I wonder what they're fighting over
[18:36:24] <Lambda_Aurigae> outputting
[18:43:13] <LeoNerd> Bah.. is it just me, or does http://www.dalbert.net/ this guy not actually publish his email address on his site?
[18:43:21] <LeoNerd> He says to send him an email. OK.. To where?
[18:48:39] <twnqx> bunnie from bunniestudios told me "i don't publish my email, it's a test if you can guess it" :D
[18:50:49] <twnqx> otherwise:
[18:50:51] <twnqx> Admin Email: DAVIDANTHONYALBERT@GMAIL.COM
[18:51:44] <LeoNerd> Hrm
[19:18:23] <eszett> I have a simple line Print "Hello World" in my Bascom code, but somehow the microcontroller doesnt sent the text string to my terminal window, the terminal window stays empty, what's wrong there?
[19:21:56] <Lambda_Aurigae> umm...you reversed the polarity of the neutron flow
[19:22:42] <Valen> need more graviton particles Lambda_Aurigae
[19:23:15] <Lambda_Aurigae> without seeing the code the configuration of the terminal, the hardware setup, and such, no way to know what is wrong.
[19:24:33] <eszett> http://pastebin.com/0GTCREmi
[19:24:46] <eszett> the terminal is configured to 9600 baud as well.
[19:25:01] <eszett> the hardware setup is a working basic circuit with a atmega32u4-au
[19:25:47] <eszett> there is only one existing COM port and thats COM1
[19:26:03] <eszett> what else is important?
[19:26:13] <Lambda_Aurigae> looks ok but I'm not really familiar with bascom...never used it actually.
[19:26:31] <Lambda_Aurigae> as for "basic circuit",,,,there is no such thing.
[19:26:35] <Lambda_Aurigae> how is it connected to the PC?
[19:26:46] <eszett> with usb cable
[19:26:58] <eszett> VCC, GND, D+, D-
[19:27:35] <Lambda_Aurigae> so there is some kind of usb-serial adapter or is the usb-serial built into some base software on the avr using the avr's usb hardware?
[19:28:50] <eszett> well, now that you ask for it, it could be that the AVR's usb hardware interface may simply not work
[19:29:11] <Lambda_Aurigae> is there a part of bascom that does the usb serial adapter?
[19:29:16] <Lambda_Aurigae> I'm not seeing it offhand.
[19:29:27] <eszett> its the atmega that should do the USB by itself
[19:29:33] <Lambda_Aurigae> no
[19:29:45] <Lambda_Aurigae> the avr needs code to communicate over the usb.
[19:29:59] <Lambda_Aurigae> it doesn't do it magically by itself.
[19:30:15] <eszett> the atmega got an integrated USB controller
[19:30:24] <Lambda_Aurigae> yes
[19:30:35] <Lambda_Aurigae> and that needs software on the avr to make it work.
[19:30:44] <eszett> oh, then this is what im missing
[19:30:58] <Lambda_Aurigae> bascom avr doesn't appear to support the usb interface.
[19:31:18] <eszett> argh......
[19:31:19] <Lambda_Aurigae> there appears to be a usb addon though.
[19:32:22] <eszett> found some for 30$
[19:32:23] <Lambda_Aurigae> http://avrhelp.mcselec.com/index.html
[19:32:31] <Lambda_Aurigae> under asm libraries and add-ons
[19:32:51] <Valen> eszett: you probably want to look at using gcc and LUFA
[19:33:09] <Valen> grab the usb-serial demo and go from there
[19:33:10] <Lambda_Aurigae> looks like there is a free one in there.
[19:34:08] <Lambda_Aurigae> eszett, and,,,read the entire section before trying anything with it or you won't understand it.
[19:34:09] <eszett> Lambda: it says "The USB Add On is a commercial add on which is available from the MCS Electronics Web Shop."
[19:34:44] <eszett> Valen: well, i just got comfortable with Bascom.
[19:34:45] <Lambda_Aurigae> aaahh...yes, seeing that as I type.
[19:34:52] <Lambda_Aurigae> bascom is very VERY limiting
[19:35:06] <Valen> then be happy and keep paying for it ;->
[19:35:14] <eszett> I may change over to Atmel Studio
[19:35:23] <Lambda_Aurigae> what you will need to do is get a usb-serial adapter and connect to the usart txd and rxd pins.
[19:35:24] <Valen> which is gcc
[19:35:34] <Lambda_Aurigae> that's what you are setting up with your serial port configuration.
[19:36:04] <eszett> hm, i see.
[19:36:08] <Lambda_Aurigae> you will need a usb-serial adapter with ttl level i/o
[19:36:27] <Lambda_Aurigae> or you will need an rs232 level shifter if you use a usb-serial-rs232 adapter.
[19:37:05] <eszett> well, im at least glad to know, that it wasnt not my own incompetence, but the limitation of Bascom
[19:37:15] <Lambda_Aurigae> well
[19:37:24] <Lambda_Aurigae> to use usb you need usb software
[19:37:44] <Lambda_Aurigae> it's not so much incompetence as lack of knowledge.
[19:38:11] <eszett> im a beginner in AVR things, so yes lack of knowledge
[19:39:33] <Lambda_Aurigae> I never could understand paying for a basic compiler when there is a perfectly good free C compiler out there.
[19:39:45] <Lambda_Aurigae> but, to each their own.
[19:39:56] <eszett> you are refering to gcc or atmel studio?
[19:40:12] <Valen> atmel studio is an IDE, it uses gcc to do the compilation
[19:40:16] <eszett> ah, ok
[19:40:27] <Lambda_Aurigae> gcc
[19:40:35] <eszett> it didnt install for some weird reason, but i try it a second time now
[19:40:36] <Lambda_Aurigae> atmel studio is windows only and won't run on linux.
[19:42:37] <|DM|> the avr open source toolchain is why I picked it over pics in the first place
[19:43:46] <eszett> Lambda: yep
[19:49:01] <eszett> there is another question i have
[19:50:03] <eszett> bought a USBasp isp programmer, and it gives me 2.24v when the jumper is on "5v" and 1.48v when i put the jumper on "3v", how can that be?
[19:50:24] <eszett> practically, this means the isp programmer delivers almost exactly half the voltage it should be
[19:51:42] <Valen> I'm guessing you have a bunch of load hanging off it
[19:52:12] <eszett> i plugges off several USB devices from my pc
[19:52:23] <eszett> and there is no load hanging on the ISP programmer itself
[19:52:37] <|DM|> measure what voltage you're getting off the USB port itself?
[19:53:07] <eszett> i did. other usb cables give ~5v
[19:53:23] <eszett> as it should be.
[19:55:05] <|DM|> are you sure those are outputs not inputs?
[19:56:28] <eszett> yes
[19:57:40] <eszett> the isp programmer came with a 10 pin cable. i replaced it by a 6 pin cable (VCC, GND, MOSI, MISO , SCK, RST) but that should matter
[19:57:49] <eszett> should not matter
[19:58:19] <|DM|> and the 5v/3v pins arent near the programming cables anyways
[19:58:23] <|DM|> from what I see
[19:58:30] <eszett> yes
[19:58:52] <|DM|> odd
[19:58:55] <|DM|> no clue
[19:59:05] <eszett> =)
[20:44:18] <LeoNerd> Hah! So I worked out why (at least one reason) the FY3224 is so rubish at higher frequency... Its buffer opamp on the output stage is a 4558. A chip that quotes a unity bandwidth of 3MHz, and a slew rate of a mere 1.7V/µs
[20:44:33] <LeoNerd> For a 24MHz 20Vpk output
[20:44:39] <LeoNerd> Hummmm
[20:45:05] <LeoNerd> I feel a need to swap that out for something a little better
[21:30:45] <eszett> LeoNerd: In BigBangtheory there is Leonard Hofstadter, and this guy comes to my mind, when I see you =)
[21:31:19] <eszett> hope you dont mind hrhr