#avr | Logs for 2016-09-20

Back
[00:00:53] <eszett> hi
[00:01:55] <eszett> As a common pattern I see, most MCUs have a cap (around 2µF) at the VBUS line, and then several 0.1µF caps on all the VCC pins of the MCU.
[00:03:16] <eszett> what i dont understand is, why shall there be a 2µF at the VOUT33 pin too? voltage coming directly out of the MCU's voltage regulator should be free of EMIs ? or am i wrong?
[00:04:08] <Casper> the regulator may be slightly unstable, specially with fast varying load (switching inside the chip)
[00:04:25] <Casper> as in: slow to react
[00:04:45] <Casper> after all, it mostly work by regulating the current to maintain the proper voltage out
[00:05:10] <Casper> fast change in current mean lots of voltage change
[00:05:27] <eszett> ah, so the cap makes sense there, i see. but it is a bit less necessary than the one directly at the VBUS USB connector pad right?
[00:06:04] <Casper> it stabilise the supply
[00:06:12] <Casper> you can't stabilise too much
[00:06:13] <Casper> also
[00:06:21] <Casper> traces have inductance and resistance
[00:06:52] <eszett> ye
[00:07:30] <eszett> ok, im asking because some of my collegous dont have a cap there, even when the datasheet recommends it
[00:08:10] <Casper> it may work, or may work now but will fail when there is more load or more noise
[00:08:43] <eszett> ye, so i better put a footpring for this cap on my pcb. And i can later on decide whether to populate it or not
[00:08:49] <eszett> footprint
[00:09:08] <eszett> (im working in kicad at the moment..)
[00:10:54] <Casper> better put it there and not populate or kill it later on
[00:32:06] <eszett> ye thanks, casper!
[00:58:06] <eszett> I have 5 pins an my AVR that take 5V: VBUS, VCC1, VCC2, VCC3, VCC4. When i have 2µF cap on VBUS, does it need an 0.1µF too, like on the other VCC inputs?
[00:58:16] <rue_house> my 2.048Mhz crystals arrived
[00:58:44] <rue_house> eszett, yea, because the high freq impedence of the 2F SUCKS
[00:58:54] <eszett> rue: ah, alright!
[00:59:04] <rue_house> the 0.1uF cap will squash the high freq noise really good like
[01:00:18] <eszett> some people seem to have the strategy to replace 2µF+0.1µF on VBUS by one cap that is inbetween (1µF)
[01:00:34] <eszett> abit foul compromise i guess
[01:11:19] <eszett> what kind of frequency are more dangerous for the MCU, the higher or the lower?
[01:17:38] <Casper> define dangerous
[01:18:38] <Casper> but really, higher is harder to filter... the main issue is that the noise can cause undervoltage...
[01:22:08] <eszett> so it depends on the purpose of the circuit, whether it serves more as a high frequency device or not
[01:22:49] <eszett> EMI and ESD seems to be a science of its own..
[01:23:16] <eszett> you never know what really happens until you take a look with an oscilloscope
[01:23:57] <eszett> and even then its just a momentary view, and reality can change under different circumstances, like different locations, additionally devices in near proximity, etc.
[01:25:18] <Casper> yup
[01:25:27] <Casper> and sometime the extra probe capacitance make the stuff work again
[01:27:26] <eszett> ye, got it..
[06:16:30] <cousin_luigi> Greetings.
[06:17:19] * cousin_luigi is completely new to this and could use some nudge in the right direction
[06:17:44] <cousin_luigi> I have an attiny85 boards, how do I expose the GPIO lines as devices on linux?
[06:24:36] <_ami_> cousin_luigi: which attiny85 boards you have?
[06:25:10] <_ami_> cousin_luigi: digispark?
[06:27:40] <_ami_> Also it depends upon which firmware is installed on your board.
[06:30:48] <cousin_luigi> _ami_: yes digispark. I believe it should have micronucleus on it by default.
[06:31:18] <_ami_> micronucleas is the bootloader. not the flash program i think.
[06:32:06] <Lambda_Aurigae> cousin_luigi, how is this device connected to the linux box?
[06:32:28] <_ami_> usb, i think
[06:32:29] <cousin_luigi> _ami_: I suspect the distinction evades me.
[06:32:32] <cousin_luigi> Lambda_Aurigae: Yes, usb
[06:32:45] <carabia> don't think a lot of protoboards come with programs in them... _ami_?
[06:32:46] <Lambda_Aurigae> ok, that narrows it down to half a dozen ways..
[06:33:03] <Lambda_Aurigae> usb-cdc through an ftdi chip or similar? is it a v-usb device?
[06:33:04] <_ami_> i think it has vusb based bootloader
[06:33:22] <carabia> yes...
[06:33:36] <cousin_luigi> All that is flying high over my head...
[06:33:57] <Lambda_Aurigae> ok...so, one would have to write a program that interfaces between usb and the chip using the v-usb software to allow gpio control
[06:34:10] <Lambda_Aurigae> then one would have to write a program or device driver on the linux side to access that.
[06:34:36] <carabia> or just get a raspi and talk javascript to it over ethernet
[06:34:40] <_ami_> you probably need to write device driver for it
[06:34:43] <Lambda_Aurigae> what you are wanting to do is not a beginner level application.
[06:34:47] <carabia> 8)
[06:34:48] <_ami_> GPIO over USB
[06:34:52] <cousin_luigi> I see.
[06:35:02] <Lambda_Aurigae> learn what v-usb is
[06:35:09] <Lambda_Aurigae> learn how to write device drivers
[06:35:11] <carabia> Lambda_Aurigae: I don't think he has any interest in writing firmware for it
[06:35:19] <carabia> I think he wants an application out-of-the-box
[06:35:33] <Lambda_Aurigae> carabia, agreed...he wants someone to hand him a functional app for his board.
[06:35:43] <cousin_luigi> I can learn stuff, as long as I don't have to study assembly or something
[06:36:02] <Lambda_Aurigae> it can be done in C
[06:36:07] <cousin_luigi> Lambda_Aurigae: actually I don't even know what I need, I'm trying to get myself oriented
[06:36:08] <_ami_> or give that work to some expert ;)
[06:36:14] <carabia> 4 out of 5 top dentists recommend learning microcontrollers, c, and interfaces by IRC interrogation.
[06:36:15] <_ami_> and pay him :D
[06:36:28] <Lambda_Aurigae> the attiny85 is kinda short on memory so will be difficult to work with as a starter.
[06:36:36] <cousin_luigi> but I was led to believe there was something I could simply use or customise
[06:36:45] <cousin_luigi> perhaps I bought the wrong board then
[06:36:59] <carabia> Seriously why do everyone insist usbing with attinys/megas?
[06:37:02] <_ami_> cousin_luigi: problem is each board is different (because of firmware, connection to host etcs)
[06:37:08] <carabia> It's so stupid to say the least.
[06:37:19] <cousin_luigi> carabia: someone on ##electronics told me to buy that
[06:37:34] <carabia> you should probably leave that channel
[06:37:40] <cousin_luigi> Can you recommend something else?
[06:37:46] <carabia> Yeah. Get an arm.
[06:38:04] <Lambda_Aurigae> I want a HAND processor! :}
[06:38:07] <cousin_luigi> Is it so complicated? I just need to add a pushbutton and a led.
[06:38:20] <cousin_luigi> Do I need an arm cpu to interface to usb?
[06:38:23] <_ami_> cousin_luigi: you could refer this device driver which export GPIOs over USB: https://github.com/amitesh-singh/ldd/blob/master/usb/usb-gpio/usb-gpio.c
[06:38:23] <Lambda_Aurigae> cousin_luigi, reading a button and turning an LED on and off is easy.
[06:38:29] <_ami_> its a minimal example
[06:38:39] <cousin_luigi> Lambda_Aurigae: that's all I need
[06:38:46] <Lambda_Aurigae> communicating over usb with a chip that has no usb interface is a pain in the ass.
[06:38:48] <carabia> no you don't, but the usb hacks on avr are stupid. You can get around them, but by now if you had an arm dev board you'd already be done with this
[06:38:55] <cousin_luigi> :|
[06:39:20] <Lambda_Aurigae> attiny85 has no usb interface. that board uses v-usb, a bitbanged hack to get it to talk over usb.
[06:39:35] <carabia> I have no idea why people are insisting on using USB with atmegas (even the 32u4), ...
[06:39:38] <Lambda_Aurigae> v-usb takes a lot of space and a lot of processor power.
[06:39:45] <_ami_> Yup. also i don't find vusb work reliably on attiny85
[06:39:50] <Lambda_Aurigae> carabia, I use pic chips with hardware usb myself.
[06:39:57] <_ami_> it fails sometimes
[06:40:00] <carabia> a) avrs are expensive. 2) usb is not the application for them
[06:40:03] <Lambda_Aurigae> I don't find v-usb to work reliably on anything.
[06:40:08] <sabor> cousin_luigi: you could use a usb-serial chip and (ab)use its hardware-handshake as GPIO
[06:40:34] <carabia> That, you could do.
[06:40:36] <cousin_luigi> sabor: like a ft232h ?
[06:40:43] <sabor> yes
[06:40:43] <cousin_luigi> that was my first choice but I wasn't sure
[06:40:49] <Lambda_Aurigae> sabor, or use a usb-parallel chip like the ftdi ft242
[06:40:50] <cousin_luigi> I guess I crapped out.
[06:41:09] <Lambda_Aurigae> dunno if the 242 is even still available.
[06:41:26] <cousin_luigi> sabor: do you think it would be less problematic from a software point of view?
[06:41:27] <Lambda_Aurigae> http://www.ftdichip.com/Products/ICs/FT240X.html
[06:41:29] <Lambda_Aurigae> new version.
[06:41:40] <_ami_> or cp2112 chips which works well over hid.
[06:41:52] <cousin_luigi> no hid if I can avoid it
[06:42:01] <Lambda_Aurigae> cousin_luigi, with an ftdi chip that has gpio built in, you don't have to write any software for the chip..just for the linux side...and most of that is available out there somewhere.
[06:42:28] <carabia> and that's probably the best bet.
[06:42:40] <Lambda_Aurigae> hmm...ok..it wasn't the 242...it was the ft245 I was thinking of.
[06:42:45] <Lambda_Aurigae> that's the one I have on a board here.
[06:43:55] <cousin_luigi> Lambda_Aurigae: I guess I should have trusted my gut then.
[06:43:59] <cousin_luigi> buying one now
[06:44:27] <Lambda_Aurigae> there will still be a bit of a learning curve and some programming involved to use it.
[06:44:37] <carabia> hey, fret not, you can still blink a shit ton of leds 'n stuff with that avr.
[06:44:39] <Lambda_Aurigae> might want to show someone what you are buying.
[06:45:16] <carabia> cousin_luigi: also and if there's something to learn from this, is that you're better off not being in ##electronics
[06:45:30] <cousin_luigi> the adafruit ft232h breakout board seems overkill
[06:45:30] <Lambda_Aurigae> hehe.
[06:45:37] <carabia> which is kind of the cesspool of freenode. As is pretty much every else mcu/electronics channels in freenode.
[06:45:42] <cousin_luigi> carabia: what about it? Is that channel infamous or something?
[06:45:43] <Lambda_Aurigae> ##electronics was a fun channel,,15 years ago.
[06:46:00] <carabia> channel*
[06:46:12] <carabia> cousin_luigi: are you in the US?
[06:46:22] <cousin_luigi> carabia: nope
[06:46:24] <_ami_> ##electronics channel is pretty active channel though. sometimes they talk shit too. :P
[06:46:24] <carabia> EU?
[06:46:43] <carabia> s/active/crap
[06:46:50] <_ami_> carabia: :)
[06:47:00] <cousin_luigi> carabia: yes
[06:47:25] <carabia> if you'll ask someone about nodejs or web 10.0 / whatever, I'm sure they'll answer in swarms
[06:47:35] <carabia> cousin_luigi: alright, sec
[06:47:51] <cousin_luigi> carabia: http://i.ebayimg.com/00/s/NTkwWDU5MA==/z/We8AAOSw1h5XQcws/$_1.JPG what about this?
[06:47:54] <_ami_> btw, guys.. i was thinking.. is GPIO over IP/NET a good idea?
[06:48:06] <Lambda_Aurigae> _ami_, depends on the implementation.
[06:48:08] <Lambda_Aurigae> it's doable.
[06:48:26] <Lambda_Aurigae> have done it many times with an atmega1284p and enc28j60 combo
[06:48:59] <_ami_> Lambda_Aurigae: i was thinking to implement this in linux kernel as a driver. so all GPIOs on network could be exported to a server
[06:49:21] <Lambda_Aurigae> well, you can do serial over IP
[06:49:22] <_ami_> so the programs on server treats them as local GPIO
[06:49:38] <Lambda_Aurigae> and for some idiotic reason people keep doing two way audio over IP
[06:49:53] <Lambda_Aurigae> glub I fucking hate voip when people try to fax over it.
[06:50:04] <_ami_> yes, serial over IP - i use it quite often with odroid board
[06:50:06] <Lambda_Aurigae> anyhow, time to go to work and break things.
[06:50:50] <_ami_> Lambda_Aurigae: good luck! :)
[06:56:00] <carabia> cousin_luigi: yeah, you can use that and libftdi1 to bitbang
[06:56:50] <carabia> don't ask me about the specifics, I don't have experience with it. But I do know you _can_ do it.
[06:57:08] <cousin_luigi> carabia: as long as I don't have to write firmware and stuff I'm more than happy:)
[06:57:15] <carabia> just on the linux side.
[06:57:43] <cousin_luigi> that's good enough
[06:58:10] <carabia> It's something called "CBUS"
[06:58:58] <carabia> Oh but wait, hold on.
[06:59:47] * cousin_luigi is reading...
[07:00:01] <carabia> Does anyone know offhand whether usb can be used with the ft prog to write to the ftdi's eeprom?
[07:00:29] <cousin_luigi> to change the parameter mentioned at the top of the source?
[07:02:04] <carabia> you need to configure the chip with the ft prog, to set the pins as I/O
[07:02:19] <carabia> but yes, you can do that through USB. So go get one now.
[07:02:37] <carabia> and you can download "FT Prog" from ftdi's site.
[07:03:33] <cousin_luigi> perhaps my distro packages it somewhere, or I'll build it on the fly
[07:03:37] <cousin_luigi> ordering the gizmo, thanks
[07:03:52] <carabia> and then there's libftdi1 and ftdi's D2XX (I think i spelled that right) drivers
[07:04:38] <cousin_luigi> carabia: libFTDI is an open source library to talk to FTDI chips: FT232BM, FT245BM, FT2232C, FT2232D, FT245R, FT232H and FT230X <- I don't see FT232RL mentioned there though
[07:05:11] <carabia> well, then you use the D2XX drivers
[07:05:44] <carabia> the configuration utility is provided only as a windows-executable so you can try your luck wining it :)
[07:05:53] <cousin_luigi> what's the difference?
[07:06:09] <carabia> libftdi is third party
[07:06:12] <carabia> d2xx is ftdi's
[07:06:45] <carabia> actually, seems like it's third party too. Oh well.
[07:06:56] <cousin_luigi> not packaged though:|
[07:07:07] <cousin_luigi> I'd rather use libftdi so I'll search for a compatible board
[07:07:22] <cousin_luigi> carabia: what configuration utility were you talking about btw?
[07:07:31] <cousin_luigi> the one for changing that eeprom field?
[07:08:00] <carabia> http://www.ftdichip.com/Support/Utilities.htm#FT_PROG
[07:08:47] <carabia> You could do it by other means but... Well, google.
[07:09:02] <carabia> If someone's figured it out.
[07:09:15] <cousin_luigi> I see.
[07:09:22] <carabia> And here's the drivers:
[07:09:25] <carabia> http://www.ftdichip.com/Drivers/D2XX.htm
[07:09:32] <cousin_luigi> Not open source, I don't like that.
[07:09:41] <cousin_luigi> Will have to buy something else.
[07:10:54] <carabia> It's ftdi, what do you expect haha
[07:11:44] <cousin_luigi> aren't they the same ones who were playing tricks on counterfeit chips with their driver?
[07:12:35] <carabia> yeah
[07:13:29] <carabia> well, if not ftdi, then microchip's your friend
[07:13:35] <carabia> they're generally cheaper as well.
[07:13:38] <carabia> http://ww1.microchip.com/downloads/en/DeviceDoc/22228B.pdf
[07:13:52] <carabia> quick google for a breakout gave me this: http://dangerousprototypes.com/docs/MCP2200_breakout_board
[07:14:06] <carabia> dunno where dp ships from tho, china? can probably get cheaper (and closer) off ebay
[07:23:35] <twnqx> isn't the 232RL the same as the BM, just different package?
[07:33:52] <cousin_luigi> twnqx: I have no idea. Will have to check the datasheet
[07:34:53] <cousin_luigi> carabia: the breakout board is more expensive than the ft232h
[07:37:21] <cousin_luigi> twnqx: http://www.ftdichip.com/Products/ICs/FT232BM.htm#KeyHardwareFeatures http://www.ftdichip.com/Products/ICs/FT232R.htm#KeyHardwareFeatures look different enough
[07:42:13] <cousin_luigi> But perhaps libftdi supports the rl version after all. Will ask them. ttfn
[17:14:31] <nofxx> Anyone using the arduino PID lib? I prefer to keep things simple as in avrdude and a .c file but it looks well very used, lots of forks on github...