#avr | Logs for 2016-11-20

Back
[07:09:08] <LeoNerd> Anyone familiar with those cheap ultrasonic distance meter boards..? I have some questions about them
[07:09:35] <LeoNerd> Mostly: How easily would I be able to put a multiplexer on the circuit, in order to swap the transmit/receive transducers? I want to use one as an air-flow meter
[07:10:31] <LeoNerd> To do that you need to swap the direction of the transmitter and receiver, to measure the time of flight in both directions. The simple cheap boards are fixed
[07:22:49] <Lambda_Aurigae> get two of them and set them side by side with one inverted.
[07:22:56] <Lambda_Aurigae> they are cheap.
[07:23:33] <LeoNerd> Eh. Ialready need two in fact, so that would be four. :/
[08:06:28] <Jartza> hallo
[08:07:19] <LeoNerd> OK so it turns out those boards are really stupid in a number of ways anyway, so I'll take them to pieces and rebuild a better thing
[08:13:58] <Lambda_Aurigae> just looked at the ones I have and they are hard wired tx and rx sides.
[08:14:10] <Lambda_Aurigae> but the transducers are both the same.
[08:15:52] <LeoNerd> Yah
[08:15:58] <LeoNerd> Well, moreover the circuit is generally stupid
[08:16:04] <LeoNerd> Needs ripping up and remaking
[12:41:19] <proteus-guy> Anyone have any recommendations for simulating AVRs under Linux?
[12:43:00] <specing> you install modelsim and then load an AVR core into it
[12:43:05] <specing> and then load your program
[12:45:11] <Lambda_Aurigae> also simavr, simulavr
[12:45:39] <Lambda_Aurigae> seems that question gets asked about once a week lately.
[12:57:03] <proteus-guy> haha thanx guys.... it doesn't show up high in google. Perhaps we need a FAQ? :)
[12:58:16] <Lambda_Aurigae> simulavr and simavr are both in the top 3 hits on google for me.
[13:28:16] <proteus-guy> specing, modelsim isn't opensource is it?
[13:28:37] <specing> nope
[13:29:16] <specing> I got the impression that it was the best digital logic simulator out there
[13:39:05] <Lambda_Aurigae> for an fpga simulator, yeah.
[13:42:52] <specing> xD
[18:34:25] <Eszett> hi
[19:28:01] <Lambda_Aurigae> iH
[19:38:16] <Eszett> There is a weird logic on mouser.com When i set the search filter to show parts with "500mA" it gives me 16 hits, but when i set it to show parts with "0.5A" it gives me 143 hits o_O
[19:45:07] <Emil> Eszett: yes, it is stupid, that's why you always have to go through the entire list
[19:45:13] <Emil> Also, they are often maximum ratings
[19:45:24] <Emil> so you should also select everything from 500mA upwards
[19:45:50] <Emil> Would't want to disqualify 600mA parts, now would you?
[19:52:04] <Eszett> Ye, I'm trying to source a transistor, which allows up to 500mA throug collector-emitter, when a transistor is specified there as "500mA" this means that in practical terms I should not use it above 400mA (100mA safety margin), or how large would you estimate the safety marginÄ
[19:55:57] <Casper> Eszett: they do textual search, not absolute numeric search...
[19:56:41] <Emil> Eszett: eh?
[19:56:58] <Emil> The 500mA is maximum continues specified by the manufacturer
[19:57:07] <Emil> That is
[19:57:19] <Emil> they guarantee that it works at 500mA without any issues
[19:57:25] <Casper> Emil: you never go to the continuous rating
[19:57:41] <Eszett> oh, then I misunderstood that, and I can use the part with full 500mA
[19:57:42] <Casper> and it is not a long term guarante that it will last for long
[19:57:48] <Casper> just that it will not overheat
[19:57:54] <Casper> DO add some margin
[19:58:09] <Eszett> Casper: uhm, ye that was my question how large the safety margin should be
[19:58:19] <Emil> Eszett: max 10%
[19:58:24] <Casper> 0-20%
[19:58:28] <Eszett> =)
[19:58:43] <Casper> and no maximum...
[19:58:54] <Casper> commercial devices will go with 10%, because money
[19:58:57] <Eszett> ok, so I should not use the part with more than 450mA, if the datasheet speficies it with 500mA
[19:59:05] <Casper> hence why everything fry so often..
[19:59:06] <Emil> Eszett: FALSE
[19:59:37] <Emil> Current ratings are not like flimsy capacitance values of capacitors.
[19:59:50] <Emil> Current values are expected to hold without issues
[20:00:01] <Casper> Emil: you know what? stop giving bad advices, go to school and learn the proper way to specs parts. First course will be: never use parts to their limit
[20:00:34] <Emil> Casper: You know what? YOU stop giving bad advice and go to school.
[20:00:49] <Emil> Adding unnecessary costs and overengineering is NOT okay
[20:01:18] <Eszett> ok no need to get in a quarrel, I have no problem adding a safety margins, this will cost me only a few cent extra, if at all
[20:01:19] <Emil> We are not talking about absolute maximum ratings that many manufacturers specify. We are talking about general max values one should use
[20:01:50] <Emil> If the manufacturer specifies a device with same lifetime at 500mA then you can safely and without any issues go at 500mA.
[20:01:58] <Casper> I did my courses and passed without issue. You obiviously failed to understand part of your courses, or is one of the reason why everything break nowadays
[20:02:00] <inflex> Check the thermals, that usually lets you know pretty quickly if you're going crazy or not
[20:02:19] <Casper> LOL Emil! NO!
[20:02:22] <Emil> Casper: you probably never added thermals so that's why everything you design fails.
[20:02:44] <Casper> my designs don't fail
[20:02:52] <Casper> unless I short something out...
[20:02:56] <Emil> Because they cost 3 times as much as they should :)
[20:03:38] <Casper> nope, it don't cost much more
[20:04:53] <inflex> meh, my experience with manufacturing data sheets is that at best, they're slightly optimistic. At worst, alarmingly so, though always explained/justified away by saying "that's just what the junction can take"
[20:04:55] <Casper> when a compagny do their stuff, they check the cost per millions of unit, and they still can save a penny here and there...
[20:05:09] <inflex> like IRF MOSFETS in TO220 claiming to cope with 200A+ *groan*
[20:05:23] <Casper> exactly what I was going to say
[20:05:45] <Casper> continuous drain current... 200A... yeah, sure...
[20:05:54] <Levitator> Damn, yo, why is there so much latency between a counter match and the interrupt.
[20:05:57] <Casper> which one was it? fairchild irfz44?
[20:06:10] <Levitator> I'm seeing somewhere around 60 cycles.
[20:06:15] <inflex> IRF940 I think was a big culprit... can't recall exactly now
[20:06:38] <Casper> 60??? that is too much... but I'ld expect around 20 cycles...
[20:06:57] <Emil> ... Well, obviously you guys cannot read datasheets then
[20:07:17] <inflex> Emil, oh braaavo, bravo.
[20:07:55] <Levitator> Yeah. Takes me about eight cycles to read a 32-bit counter I set up. When I subtract that out, it's still like 60 cycles just to arrive in the ISR for the counter match.
[20:08:10] <inflex> Seriously, I read them very carefully when designing stuff, but so many people get caught out looking at the "bling bling" specs and get caught out - that's the whole point.
[20:08:13] <Emil> Levitator: you mean interrupt?
[20:08:25] <Emil> sorry, yes you said interrupt
[20:08:31] <inflex> "Ooh look, this MOSFET says 20A, I only need 19.5A, it'll be good"
[20:08:33] <Levitator> ISR == Interrupt Service Routine
[20:08:52] <Emil> because gcc autogenerated code saves everything to ram when interrup strikes
[20:09:20] <Levitator> It shouldn't save "everything". Just stuff which is modified.
[20:09:21] <Casper> not everything, but a few registers
[20:10:22] <Emil> Look at the assembly then
[20:10:39] <Casper> I think it's 3 cycles for the jump, I think around 6 push, I think it also set other stuff... then code, then the same 6 pop, and I think RETI is 4 cycles
[20:10:57] <Casper> been a while since I checked the pseudo assembler it generate
[20:11:20] <Emil> Push instructions are 2 each, and like 10 registers at least are saved
[20:11:55] <Levitator> I guess that accounts for it. There are 32 registers, and two cycles to push each is 64.
[20:12:34] <Levitator> Probably a Heisenberg overhead because printf() trashes more registers.
[20:12:45] <Emil> hrrr, printf
[20:15:11] <Casper> atleast printf is less costly than float math with sin :D
[20:15:30] <Levitator> I wasn't timing the printf. It was just for debugging.
[20:17:37] <Casper> I once was trying to debug a piece of code... and added some printf...
[20:17:53] <Casper> ... oh my did I screwed up royally on that...
[20:18:02] <Casper> ... my printf line had text....
[20:18:08] <Casper> ... that text was long...
[20:18:19] <Casper> ... and that piece of text alone couln't fit in the ram! :D
[20:18:35] <Casper> and of course, I didn't used the progmem version
[20:20:22] <Emil> :D
[20:20:53] <Emil> It is imho super silly that AVR-GCC doesn't place const strings by default to progmem
[20:21:26] <Levitator> Would be nice if vtables were progmem, as well.
[20:21:35] <Levitator> Because then C++ support wouldn't be nearly as crippled.
[20:25:40] <Casper> Emil: yeah that I agree with you, it is silly, specially since the strings are ALREADY in flash...
[20:26:24] <Emil> yaaaap
[20:26:27] <Levitator> I read somewhere that GCC does not have full support for address spaces.
[20:26:33] <Levitator> It's intended for a flat memory model.
[20:27:23] <Levitator> It's smart enough to pick specific addresses differently (like 16-bit TMP-buffered registers), but it doesn't seem to understand that certain ranges are accessed differently.
[20:27:41] <Levitator> Smart enough to treat specific addresses differently, I mean.
[20:28:09] <Casper> ... 15 photo in 1 minute... I'm always surprised how fast those flash charge back
[20:28:39] <Casper> I remember those old camera where the flash took like 30 seconds to charge... and was that weak...
[21:12:40] <inflex> They were fun to listen to charging up
[21:15:18] <Casper> yeah
[21:15:48] <Eszett> I have a question for the scenario of having a basic circuit with an Atmega powered by USB. Do I have to place the bulk capacitor close to the Atmega or close to the USB connector? Some people say so, others say so... ?
[21:15:57] <inflex> I always wondered, what causes the audiable "pop" when you trigger the flash?
[21:16:18] <Casper> thermal dillatation of the bulb I think
[21:16:38] <inflex> Eszett, "it depends" I suppose :)
[21:16:58] <Eszett> inflex: oh no "it depends" ;-)
[21:17:16] <inflex> so long as the AVR has its own decoupling cap on Vcc then the bigger one can be pretty much anywhere on the Vcc rail
[21:17:19] <Casper> usually, the bulk is at the input, and a bypass cap at the avr
[21:17:26] <inflex> ^--- what he said
[21:17:59] <inflex> I usually have 10uF 1206 on the input, 100nF on the AVR
[21:19:27] <Eszett> Capser: so the bulk cap would be close to the AVR's UVCC pin?
[21:20:04] <Eszett> sorry, what is meant with "input"?
[21:21:22] <Emil> Eszett: as long as the avr has its own ~100nF bypass, your other major energy reservoir can be pretty much anywhere
[21:22:04] <Eszett> Yea Emil that makes sense. Its just that some people say "should be close to output" others say "should be close to input", that confuses me
[21:22:15] <Emil> Where what?
[21:22:37] <Eszett> ok let me quote
[21:22:49] <Emil> Do you have a voltage regulator somewhere there?
[21:23:00] <Emil> Follow the specifications for it defined in its datasheet
[21:23:29] <Eszett> Emil no voltage regulator.
[21:23:56] <Eszett> The datasheet doesnt tell about where the decoupl. caps shall be placed. At least not the bulk one.
[21:24:14] <Emil> ...
[21:24:44] <Emil> Like others already said, just have the 100nF bypass very close to the avr input pins and then all other caps can be anywhere on the circuit pretty much
[21:24:53] <Emil> (if they are for power stabilisation that is)
[21:34:34] <Eszett> Emil, alright Ill take your answer as true =)
[21:34:53] <Emil> Sigh
[21:35:06] <Eszett> although every source says something different
[21:36:15] <Emil> Eszett: look, mate, if you want to do things perfectly go to a school and study it there. If you really want to model things perfectly go for it. The gains on avr level circuits are on the order of non existent.
[21:36:33] <Emil> With RF they absolutely matter, though
[22:04:45] <Eszett> re
[22:12:03] <Casper> mi
[22:15:55] <Emil> Do
[22:16:01] <Emil> ;)
[22:16:24] <Emil> C-c-c-combobreaker
[22:18:01] <Eszett> do re mi, that was some kind of chiffre language in the 19th century no?
[22:18:11] <Eszett> can't remember prperly anymore
[22:18:59] <Emil> do re mi fa so la ti do
[22:21:11] <Eszett> something like that yes
[22:26:27] <Eszett> correctly it is: Do (the note C), Re (the note D), Mi (the note E), then Fa, then Sol, then La, and lastly Si.
[22:29:01] <Eszett> And the system is older than I thought, the father of the solmisation is Guido of Arezzo who lived in the 10th century