#avr | Logs for 2016-12-12

Back
[02:32:33] <carabia> hello _ami_, how did that game project of yours turn out?
[02:53:30] <tunage> what tool can I use to view terminal output from an arduino following an image upload using avrdude?
[02:57:12] <megal0maniac> tunage: avrdude <params> && screen <port> <baud>
[02:57:53] <tunage> megal0maniac: thank you!
[05:23:04] <_ami_> carabia: hey, have n't tried yet. was busy in motor controller project.
[05:37:25] <sabor> _ami_: what's the motor controller doing, coming fine i hope
[05:37:45] <_ami_> sabor: yeah, all good. :D
[05:37:53] <sabor> cool :)
[05:38:01] <_ami_> will be adding Bluetooth or wifi support soon. :)
[05:38:24] <_ami_> touch display control seems to work fine till now.
[05:38:38] <sabor> very nice
[06:12:03] <skz81> Hello guyz
[06:13:26] <skz81> I want to power a 3.3V MCU in parrallel with DC motors and a darlington H bridge. To have enough power I will use a 1S Lipo and a voltage regulator
[06:19:57] <skz81> I want it rated 500mA minimum, not too expensive... saw LM1117 which is rated for 1A
[06:22:10] <skz81> is it a good choice to go with ?
[06:30:03] <sabor> the datasheet states that the dropout voltage is 1V typically, so you probably end up with 2.7V when the battery supllies 3.7V
[06:34:36] <sabor> skz81: http://electronics.stackexchange.com/questions/38782/regulated-3-3v-from-a-lithium-ion-or-lipo-battery
[06:56:58] <cehteh> you may consider unregulated operation too, just put the µC behind a LC filter and protection diode
[07:07:18] <carabia> sabor: no
[07:08:13] <carabia> a charged lipo cell is ~4.2V
[07:09:39] <carabia> you can get 500 mA regs down to like 300mV dropouts, probably even more than that. Well, advertised anyway. YMMV, check out the load vs voltage graphs in ds.
[07:10:23] <cehteh> depends on the vreg
[07:10:31] <carabia> of course
[07:10:32] <cehteh> and the 4.2V drops pretty fast
[07:10:49] <carabia> yeah, but that was just a remark
[07:11:09] <carabia> point is if you really want a voltage reg there you want an ldo
[07:11:12] <pwillard> But the charged to not charged voltage range on a lipo doesn't vary a lot
[07:11:14] <cehteh> the one vreg i am using here here has a odd thing: if input voltage goes too low then it draws excessive currrent
[07:11:34] <cehteh> some have this property, making them bad under such conditions
[07:11:44] <skz81> <carabia> a charged lipo cell is ~4.2V >> mmm AFAIK 3.7 is the mid-charge (aka "storage charge") for 1S Lipo. And charge cycle ranges from 4.2 downto 2.7V
[07:11:54] <cehteh> pwillard: 3.3V to 4.2V is a lot
[07:12:02] <carabia> pwillard: yes it does
[07:12:16] <carabia> skz81: wouldn't discharge lipos to 2v7, but whatever
[07:12:26] <cehteh> for modern cells you shold never go under 3.3, but also depends on the cell
[07:12:37] <carabia> i'd go for around threeish
[07:12:48] <carabia> leaving a margin, not wanting to at least drop below it
[07:12:48] <cehteh> power cells like on Copters should even stay above 3.5
[07:13:29] <cehteh> anyway for cell use, i'd really test going without regulator
[07:13:55] <cehteh> avr should be able to run stable on the full voltage range you get from a single lipo
[07:14:23] <carabia> hmm... i have ~45-60C (HK?) 1-2ah 3s packs that i've discharged to 3v1-3v2ish, had them for years, they are still in a very good shape.
[07:15:03] <carabia> cehteh: probably yeah, at least if you run them in-spec in that case, at 8mhz
[07:15:09] <cehteh> i bet you cant draw much current from them anymore
[07:15:10] <skz81> Once I got a 3S unit that was <2.7V for all cells but I guess I never received an initial charge. Could charge it by "hacking" the charge program (some program not related to lithium batteries) and very low current to get over 2.7V (like 3V) and then normal LiPo charge -- (checking it does get warm, and it did n't :)
[07:15:32] <carabia> cehteh: as a matter of fact i can. years = a year, my bad
[07:17:06] <carabia> well, could anyway. took a plane out to spin a month ago or so. flew 5 packs 3d, didn't see any noticeable performance drop. Didn't measure them obviously, but just as a ballpark sorta-kinda experiment
[07:17:10] <skz81> <cehteh> avr should be able to run stable on the full voltage range you get from a single lipo >> Not an AVR sadly, but people in the dedicated chan are like "huh ? wtf" when then question is unrelated to Arduino API. (esp8266 actually)
[07:17:36] <carabia> skz81: which avr, then?
[07:17:54] <cehteh> doesnt that one have a 3v3 vreg on board?
[07:18:05] <skz81> people here is stronger for PS / analog electronic
[07:18:22] <carabia> off the top of my head i see no reason why an avr wouldn't run stable at 8mhz over 3 ... 4v2?
[07:18:24] <skz81> cehteh, not the "naked" ESP8266
[07:18:47] <carabia> but maybe this is just lack of coffee
[07:19:00] <cehteh> anyway, there are some vregs with very low dropout, but powering from a single lipo may become a bit complicated
[07:19:08] <skz81> carabia, my question is NOT AVR related, the MCU is an esp8266 here. Take this coffee cup :)
[07:19:42] <cehteh> i tihnk even with the best vregs you get around 100mV dropout at least under optimal conditions
[07:20:05] <cehteh> so you have to be prepared what happens when the lipo drops below 3.4V
[07:20:35] <cehteh> like i saied, some draw excessive power, some cut off, etc
[07:20:56] <cehteh> how does the esp run on 3.1v for example
[07:21:08] <carabia> oh, esp.
[07:21:44] <carabia> one sec, let's see.
[07:22:13] <skz81> cehteh, the MCU is said to stand 2.7V at min and I probably can monitor the battery using the ADC and a megaohm divisor.
[07:22:15] <carabia> at least this esp ds i pulled off from google at random states the in-spec vrange at 3...3v6
[07:22:48] <cehteh> whats the max voltage? 3.4V?
[07:22:53] <cehteh> ah
[07:22:56] <cehteh> ok reading :D
[07:23:32] <cehteh> just study datasheets about what regulator handles such voltages, including undervoltage well
[07:23:47] <carabia> well, buck-boost regs...
[07:24:09] <carabia> but really overengineering. You're not pissing away almost anything by not discharging the lipo from 3 to 2v7
[07:24:27] <carabia> that, and the chip will probably operate with a slight undervoltage anywho
[07:24:30] <skz81> as long as I can send apower off "warning"
[07:24:51] <carabia> skz81: well monitor the voltage rail then
[07:25:22] <carabia> i wouldn't be really that worried on powering the chip per-se, more about filtering out the motor noise off your vrail
[07:26:01] <carabia> but, perhaps it's time for that coffee now.
[07:26:29] <cehteh> http://www.ti.com/lit/ds/symlink/lm2931-n.pdf i really like these vregs, but looks at figure 21 on page 8, then you know what i am talking about
[07:26:41] <cehteh> (and they need an oddly huge output cap :D)
[07:27:10] <skz81> carabia, good point I was not thinking of that, maybe I naively assumed the voltage regulator (and maybe a good decoupling cap near the MCU) would do the job
[07:27:14] <cehteh> but they are cheap and dont get hot like 7805 even when input voltage is higher
[07:27:29] <carabia> skz81: you need to cap the motor, too
[07:28:06] <carabia> before that coffee let me just google a god damn polished turd reg for you, ...
[07:28:14] <cehteh> thats not a proper vreg for your application, i only want to point out where to look at
[07:35:59] <carabia> here
[07:36:01] <carabia> http://www.st.com/content/ccc/resource/technical/document/datasheet/45/1a/7e/44/37/c8/43/d3/DM00063302.pdf/files/DM00063302.pdf/jcr:content/translations/en.DM00063302.pdf
[07:38:33] <carabia> in-stock at mouser, about €1 in 10 qty, ~€.8 in 100
[07:38:53] <skz81> carabia, thanks !
[07:39:33] <carabia> you might want to check the load graphs, i took them more or less at "face value" (;D) cause i'm kinda busy for me coffee
[07:42:30] <carabia> oh, and there's also this. http://www.st.com/content/ccc/resource/technical/document/datasheet/e4/a5/92/6d/21/2b/41/5b/CD00150600.pdf/files/CD00150600.pdf/jcr:content/translations/en.CD00150600.pdf
[07:42:41] <carabia> now, the coffee.
[07:48:57] <skz81> carabia, charts are looking promising. I'am still a bit puzzled by those quiescent current charts (I understand that the lower the better, and it grow with Iout and Temp, but quiscent current versus voltage seems witchcraft...)
[07:49:54] <skz81> Sadly it will be hard to use SMC on this prototype :(
[07:50:30] <skz81> (unless i find some little PCB module with DIP-like leads)
[07:53:42] <carabia> skz81: what? quiescent current vs supply voltage?
[07:55:09] <carabia> the ld39-something ds graphs iq vs vin, when vinh (enable pin) = vin
[07:55:22] <carabia> it shows how the standby-current (iq) is dependant on the input voltage
[07:55:34] <carabia> that's a very low quiescent current regulator, so i wouldn't worry about iq.
[07:55:37] <skz81> carabia, yes, it is even more puzzling (to me) on cehteh's link
[07:55:53] <carabia> let me see
[07:57:40] <carabia> what's so confusing about it? it just specifies the same graph with a few different load levels
[07:57:57] <cehteh> carabia: normally its nothing to worry about, but you have to look at the datasheets about such odities
[07:58:06] <carabia> as in, standby current is a bit of a misleading term for iq
[07:58:17] <carabia> it's more like... overhead.
[07:58:29] <carabia> skz81: better?
[07:59:00] <cehteh> when you hang that regulator on a lipo and power the esp down on undervoltage and the regulator starts drawing 25mA from a almost empty battery in powered down mode it matters a lot :)
[07:59:18] <cehteh> odball
[08:00:58] <skz81> <cehteh> when you hang that regulator on a lipo and power the esp down on undervoltage and the regulator starts drawing 25mA from a almost empty battery in powered down mode it matters a lot :) >>> Meh ? Even if not empty, I would worry to get a 25mA draw in sleep mode :]
[08:01:45] <cehteh> normally it doesnt do that, low quiescent vreg
[08:02:05] <cehteh> but it has this odd thing when input falls below regulation voltage
[08:02:41] <cehteh> if your design can avoid that (like you have 2 cell lipo) then its a great choice
[08:03:03] <cehteh> if you cant avoid it, its the wrong vreg
[08:04:34] <carabia> skz81: you aren't going to get any ultra ldo / low iq regs in like to92 or the likes, anyway
[08:04:48] <cehteh> like i saied its an example of the wrong vreg for your application, and what to check out when you pick a vreg
[08:05:09] <cehteh> yes most are smd
[08:06:52] <carabia> the 39080 to252-3 seems to be going obsolete, but I think you said it's a prototype, so get those. And later on if you start pumping real products, you can switch to the PPAK version
[08:07:22] <carabia> the 252-3 is quite straightforward to hand solder
[08:07:22] <cehteh> how much current can a esp draw at max?
[08:07:50] <cehteh> drop often increases with current
[08:07:58] <skz81> carabia, nope, I think I wont produce real products. 300mA max for esp8266
[08:08:11] <skz81> 500mA rated suplly advised
[08:08:27] <skz81> (beacause of current peaks when emiting)
[08:09:18] <carabia> dunno, refer to the ds. the 39080 has iomax 800 mA, with ~150mV dropout @ 800 mA iout
[08:09:29] <cehteh> that was my thinking, these can draw a lot for the wifi peaks
[08:10:19] <cehteh> on another note: why cant you go with 2 cells or another battery technology which has a little higher voltage level?
[08:11:02] <cehteh> that could make the things electrically a lot simpler
[08:11:15] <carabia> cehteh: no, just more complicated
[08:11:25] <cehteh> guessed so :)
[08:11:40] <cehteh> well, mobile phones run from 1 cell too
[08:11:44] <carabia> you'd probably want to go with an smps then, also
[08:11:55] <cehteh> but there is a lot shit there to massage the voltage
[08:12:22] <carabia> but seriously just overengineering it. Those 39080s are €1.5 a pop in ones. Not a huge investment for a one-time prototype
[08:17:44] <skz81> Well, I thought of LiPo because I played a bit with and I know they can provide lot of current, but actually I may not need as much "power". It's not an ESC driven quad...
[08:23:38] <carabia> well, don't think you will find a suitable cell type with a much higher voltage than that
[08:30:10] <skz81> With a 2S I was affraid of power loss in the regulator itself... Unsure how to calculate it
[08:30:34] <skz81> 8V-3.3V*0.3A is way too much
[08:30:43] <skz81> 0.1V * 0.3A is OK !
[08:31:07] <carabia> well first of all that's wrong!
[08:31:31] <skz81> :p
[08:32:09] <carabia> (8 V - 3-3 V) * 0.3 A
[08:32:42] <carabia> which is like what, ~1.5 watts
[08:33:53] <skz81> parenthesis were implied by unit consistency !! :p :p Being honest, I just forget them
[08:34:37] <carabia> to220 would do it, pretty sure
[08:35:21] <carabia> depending on additional load on the 3v3 line, you could go for an smps, like i said earlier
[08:35:49] <carabia> and in this day and age of motherfucking hippies, wasted energy is bad, mmkay
[08:36:39] <carabia> so go buy a tesla(tm)(r) and elonmusk-branded solar tiles(tm)(r) not to mention how much energy is wasted in the mf process and whatever other implications it has
[08:38:48] <skz81> <carabia> to220 would do it, pretty sure >> Yep I was searching for this packaging
[08:39:29] <carabia> if there's no additional load on the 3v3 line, you are pretty safe with something like an lm317, it has a tja of 23.5 C/W
[08:39:49] <carabia> if you really want to be difficult with it and avoid smd soldering haha :)
[08:40:38] <carabia> lm317 to220, that is.
[08:41:24] <carabia> and fixed voltage regs are expected to have similar characteristic, so take your pick.
[08:41:32] <carabia> characteristics, even
[08:44:52] <carabia> 1117 seems to have 50 C/W tja, so probably not that one, then :)
[08:47:13] <carabia> but go for the kcs-packages anywho. All this through hole business is having me thinking the phone's gonna ring soon and there'll be 1970 on the line
[08:57:25] <skz81> carabia >> dring ! dring ! 70's here, thanks you !
[08:58:24] <skz81> I need to learn to design custom PCM. I'm stuck with trough-hole soldering / protoboard yet
[08:59:51] <skz81> also, under 1/20 inch soldering is above my capabilties
[09:11:05] <carabia> well that's quite tricky. However the dpak pin pitch is nowhere near that small
[09:11:34] <carabia> it's like double that!
[09:11:53] <skz81> carabia, yep, noted that it was near the classic 1/10 inch
[09:13:29] <carabia> if i only had better eyes. Thankfully i have quite the sweet magnifying glass setup here where i can do even the occasional 0402 pain in the ass
[09:14:01] <carabia> but that's just for macgyverisms. Get your boards made and populated!
[09:15:26] <skz81> carabia, sure, planned for the future. It is just to have something at hand to keep me "busy" during Xmas holydays
[09:15:53] <carabia> i had to actually run that pin pitch number a few times in my head, cause I hate the imperial system. It's so sad that mils are the standard.
[09:15:56] <skz81> 10 days in the family I'll get many occasions to get bored and work on this stuff
[09:16:20] <skz81> so it has not to be electrically optimal :)
[09:16:52] <carabia> 10 days in the family sounds like a fight to me
[09:16:56] <skz81> crap, I forgot about the Inertial Measurement Unit ! Didn't even checks it's level
[09:17:04] <carabia> ymmv, again :)
[09:27:55] <skz81> ok that IMU it is 3.3V tolerant and <4mA draw... Not a big concern. A bit surprized to find out typical Vcc is 2.5V, though
[09:28:01] <skz81> (NB : MPU9250)
[09:28:16] <LeoNerd> Mmm.. 9520
[09:28:36] <LeoNerd> I still have a 6050 I've yet to play with
[09:29:10] <skz81> or maybe a 9255 unsure
[09:31:17] <skz81> can't find what is the difference anyway !
[09:34:03] <skz81> huh ? 9250 : "Automatic Activity Recognition 9-axis solution (WRIST WORN WEARABLES ONLY)" 9255 : "2nd Generation 9-Axis (Gyro + Accel + Mag) for mass market applications"
[09:34:05] <skz81> ok....
[11:53:48] <Evidlo> anyone have preferred methods for debugging the ATTiny85?
[11:56:02] <LeoNerd> Do you have a spare GPIO line? If so, maybe soft-UART it?
[11:56:15] <LeoNerd> If not, you're into dW territory
[11:56:21] <Evidlo> dW?
[11:56:34] <LeoNerd> debugWire
[11:57:30] <Evidlo> I have 2 free GPIO
[12:00:17] <LeoNerd> Ah, then you're fine
[15:22:23] <Vikinger> has anyone tried tri-state before ?
[15:42:54] <bss36504> Vikinger: What do you mean?
[15:47:52] <Vikinger> tri-state output to leds
[15:57:05] <bss36504> What would that do?
[15:57:18] <bss36504> Or rather I should ask, what are you trying to do?
[16:07:26] <carabia> < Vikinger> has anyone tried tri-state before ?
[16:07:45] <carabia> ^ shit just got real
[16:09:04] <carabia> tri-state? I heard the big boys mention it a couple of times. Rumor has it, it kills your gums and rots your teeth... *shrug*
[16:16:39] <bss36504> lol
[16:17:34] <bss36504> Vikinger: I'm gonna be leaving work soon so I'll just take a guess; You're misunderstanding what tri-stating the output does. If you tri-state an output no current will flow into or out of it, therefore you cannot light up an LED.
[17:36:02] <Vikinger> how can i change a pin direction while in the code is running, meaning after the setup
[17:36:05] <Vikinger> ?
[17:37:15] <Casper> DDRx
[17:38:07] <Vikinger> its not working, once i set a value in setup() it doesnt seem to change anymore
[17:38:17] <Vikinger> further along the code
[17:38:56] <Casper> if it do not work, stop using the stupid arduino library
[17:39:30] <Vikinger> im not
[17:39:37] <Vikinger> im on avr-gcc
[17:39:53] <Vikinger> arduino is for quick dirty stuff
[17:39:53] <Casper> how do you actually try to set it? and to what?
[17:40:32] <Vikinger> just DDRB &= 0x05; for example
[17:40:53] <Vikinger> bit 1 and 2 has outputs the rest unput
[17:40:55] <Vikinger> input
[17:41:04] <LeoNerd> 0 and 2
[17:41:09] <Vikinger> that sorry
[17:41:13] <LeoNerd> 5 == _BV(0) | _BV(2)
[17:41:28] <Vikinger> yes thats what i meant
[17:42:03] <Vikinger> im on tiny13a
[17:42:05] <Casper> you try to set it to input or output?
[17:42:21] <Vikinger> output in this case
[17:42:52] <Casper> DDRB |= (1<<PB0) | (1<<PB2); tried that?
[17:43:05] <Vikinger> nop
[17:43:20] <LeoNerd> Hang on, are you confusing |= with &= ?
[17:43:21] <Vikinger> later i need to change it to 0x03
[17:43:32] <LeoNerd> |= is for turning some bits *on*; &= is for turning them off
[17:43:42] <Vikinger> yes i got that
[17:44:05] <Casper> if that do not work, is it some pin used for some other peripherial, like UART ?
[17:44:12] <Casper> PWM?
[17:46:38] <Vikinger> nop
[17:47:01] <Vikinger> like i said
[17:47:46] <Vikinger> when i set up them on the begining of the code inside the setup() before the while(1) loop, then it works fine, i just can't change it later
[17:48:06] <Vikinger> kind of i only have one go at chanching DDRB
[17:50:38] <Casper> the setup() do nothing special
[17:50:49] <Casper> I don'T even use it
[17:51:24] <Casper> it have the advantage of making a more clear section about the initial setup, but it waste flash space, so I don't use it
[17:52:37] <Vikinger> it shoudnt its just a tag, the assembler and linker shoud pack everything together
[17:52:40] <Vikinger> but im no expert
[17:53:09] <Casper> it's a normal function
[17:53:16] <Casper> there is no special case for it
[17:53:53] <Vikinger> ok
[17:59:31] <Vikinger> no more ideas ?
[17:59:57] <Vikinger> probably no one does this i know
[18:08:48] <Vikinger> DDRB &= ~(1<<PB1); is this right to clear the bit ?
[18:09:39] <LeoNerd> Yup. Though usually written DDRB &= ~_BV(PB1); the _BV() macro comes up a lot
[18:10:20] <Vikinger> ok
[18:10:26] <Vikinger> this is working better now
[18:11:57] <Vikinger> one of the leds is a little faded though
[20:00:01] <jsoft> did you guys know that softbank I think they are own avr?
[20:00:05] <jsoft> sorry, arm?
[20:01:15] <Lambda_Aurigae> huh
[20:01:47] <Lambda_Aurigae> softbank owns the arm core technology, yes.
[20:02:31] <jsoft> Like the patent part ?
[20:02:36] <Lambda_Aurigae> many companies, including microchip/atmel license the core from them.
[20:02:41] <jsoft> Right
[20:02:51] <Lambda_Aurigae> yeah, the patent and intellectual property rights.
[20:04:39] <jsoft> I only randomly learnt that because I was watching some random trump video where he managed some deal where the softbank ceo struck some deal with trump/us for 50bn, and he mentioned he owned arm
[20:04:46] <jsoft> So there you go.
[20:04:56] <jsoft> Useless information for you :)
[20:05:14] <Lambda_Aurigae> they closed the arm purchase deal back in september this year.
[20:06:09] <Lambda_Aurigae> the ARM IP has been owned by someone else all along.