#avr | Logs for 2013-08-15

Back
[01:58:31] <MrTrick> why double-sided tape?
[01:58:40] <MrTrick> Casper: ? (sorry, delay)
[02:21:10] <megal0maniac_afk> MrTrick: 4 hour ping? :P
[02:31:29] <MrTrick> yes yes... I have this little thing called work.
[02:34:19] <soul-d> *warning found undefined property "work" in line 10450
[02:38:38] <Joggl> MrTrick, liar!
[05:30:51] <MrTrick> I want to hook up a photosensor to an AVR, to do serial comms. (eg listening to a flashing LED or section of computer screen)
[05:31:59] <MrTrick> Is there anything better than an ADC pin? Could I do something else, and get an interrupt whenever the level changes? Or otherwise convert the signal to discrete levels?
[05:33:51] <Valen> could use a comparator perhaps?
[05:34:04] <Valen> avr's have those
[05:57:50] <MrTrick> compare to what?
[05:58:10] <MrTrick> It sounds feasible, I'm just not sure what the best solution is, hardware and software.
[05:58:27] <MrTrick> I'm extremely space constrained, so the hardware can't be too complex.
[06:07:30] <Valen> i believe you can set the comparator input voltage to several levels internally at least
[06:14:19] <MrTrick> ah, that might do it.
[06:14:26] <MrTrick> So what about the hardware side of things?
[06:15:02] <braincracker> h
[06:15:42] <MrTrick> damn, what was the project that used this technique - you could hold it up to the screen to program it.
[06:16:38] <MrTrick> aha; http://www.wayneandlayne.com/blinky_programmer/
[06:18:35] * MrTrick looks up the hardware design
[06:20:45] <MrTrick> though it seems a bit silly to require two segments
[06:21:06] <braincracker> desktop pc: Core0 Temp: +34.0°C good? ;>
[06:37:56] <Valen> MrTrick: having a clock flash will help you set black levels
[06:38:10] <Valen> somebody in hackvana did it as well i believe, or looked at it anyway
[06:39:06] <MrTrick> It will. I'd design a preamble though - eg 8 or so rapid transitions before the message to give a clock speed and some sample levels.
[06:39:28] <Valen> look at NRZ coding schemes
[06:42:00] <Roklobsta> whatchoo trying to do?
[06:43:27] <MrTrick> actually, I was thinking of manchester or similar.
[06:43:41] <MrTrick> Anyway, the important thing *at this stage* is getting the hardware right.
[06:43:49] <MrTrick> Software is a 'can fix later' thing. ^_^
[06:44:19] <Valen> i believe the consensus was "tricky to get right"
[06:44:24] <MrTrick> yeah.
[06:44:48] <MrTrick> The simple thing is VCC - resistor - input pin - phototransistor - GND.
[06:44:56] <MrTrick> But not sure how well that'll work, or how hard it is to tune.
[06:45:20] <Valen> this mass market?
[06:45:34] <MrTrick> eventually, yes.
[06:46:39] <Roklobsta> what are you trying to do?
[06:46:40] <MrTrick> and yeah, no room for another ic component like a schmitt trigger - it's very squishy.
[06:46:49] <Valen> fiddly and mass market often arent a good combo yaknow
[06:47:11] <MrTrick> Roklobsta: add a photosensor to a small project, to be able to 'flash' data at it.
[06:47:29] <Valen> vusb not an option?
[06:47:38] <Roklobsta> ohm like those address book key fobs from 1999?
[06:48:29] <MrTrick> connect it to a USB cable? No, not likely. Not unless battery life ends up so unmarketably short that I need to switch to a rechargeable lipoly.
[06:49:14] <Valen> the big issue is gain control
[06:49:32] <Valen> ADC is good in that you can do that in software
[06:50:03] <Valen> Also you will want to be able to get a really good seal on the screen or something
[06:50:08] <Valen> ambient light will kill it
[06:52:02] <Roklobsta> i had a key chain thing back in 2000. you'd put all your phone contacts into a windows program, hold the key chain up to a black region on the screen which would end up flickering and programming the key chain with the data you entered.
[06:52:06] <Roklobsta> is this a similar idea?
[06:52:29] <MrTrick> well, are the input-compare lines on the AVR on the same pins as the regular analog inputs?
[06:53:12] <MrTrick> I'm wondering - if the computer were to do a calibration step (for frequency and brightness ranges) beforehand, how much the software could adapt to that.
[06:54:28] <MrTrick> Roklobsta: similar yes, though mainly proof-of-concept at this stage.
[06:54:44] <MrTrick> eg if I can get this working, then can think further about what's possible with it.
[06:55:13] <Roklobsta> google about you'll probably find circuits on it
[06:58:35] <MrTrick> I'm installing kicad now so I can review the blinkygrid / blinkypov schematics
[07:00:54] <MrTrick> hmm, theirs is very simple - just a photodiode and a resistor
[08:35:36] <ColdKeyboard> One quick question, is this circuit going to be able to drive this amount of LEDs and dimm them with PWM? -> http://snag.gy/LvmMX.jpg
[08:39:39] <avrdood> yes!
[08:40:07] <avrdood> but usually you put some resistor at the base
[08:40:35] <avrdood> so that Ic=beta*Ib
[08:43:01] <ColdKeyboard> Thank you, I put pull-up resistor on the base
[08:43:30] <avrdood> i meant in series with the voltaage source
[08:44:13] <bss36504> PWM->Resistor->Base
[08:45:13] <avrdood> ..and the transistor must be able to deliver the currents for all the leds..
[08:45:23] <bss36504> yes
[08:46:28] <ColdKeyboard> Ok, thank you
[09:45:23] <bss36504> abcminiuser: My issues have nothing to do with your lib, but thank you very much for your patient help. I have a very tricky to diagnose/solve PCB issue that is causing some intermittent USB link fails, thus the endpoint timeouts and data failures.
[09:45:45] <abcminiuser> Neato
[09:45:59] <abcminiuser> I fixed it via my psychic super powers of sleeping
[09:47:19] <bss36504> well, when I made the board layout, I left a whole bunch of unmasked vias underneath the ground pad of the 1287 (a ground pad I didn't know about at the time, or I would have fixed the vias). So my repair solution was to split down a piece of mica to put under the MCU, then solder it on. I think what is happening though is some sort of board flexing is causing the solder joints to fail.
[09:52:55] <bss36504> I wish there were some lower pin count Xmegas....These QFP100s are a little ridiculous.
[10:06:43] <Joggl> bss36504, you can cut out every 2nd pin :-)
[10:06:58] <Joggl> so you get less pins and more pitch
[10:07:58] <bss36504> Joggl: ha! I was thinking more space wise :P
[10:08:46] <Joggl> spacewise... ok, than use the bga-version
[10:09:00] <Joggl> or ask dean if he can grap some bare-dies for you ;)
[10:09:23] <bss36504> now THAT would be pro. Hand wire-bond a single die onto a custom PCB.
[10:09:38] <Joggl> self-etched pcb!
[10:10:47] <bss36504> How bad is soldering a BGA with hot air? I've soldered many things for many years, but never a BGA.
[10:22:17] <Roklobsta> bss36504: it's hard to get the soldering iron tip onto all the balls. It takes patience
[10:23:01] <bss36504> That I have. I can do tight pitch QFNs no problem, even some PGAs. But I thought there was something special to do with the balls of a BGA.
[10:23:29] <bss36504> PGA=pad grid array, not pin grid array
[11:40:01] <Casper> <MrTrick> why double-sided tape?
[11:40:28] <Casper> sorry delay too, the double sided could be used to hold it in place AND isolate from the case
[12:03:37] <bss36504> shine on you crazydiamond
[12:35:08] <megal0maniac> At least I knew what to do with the Arduino :P
[12:35:29] <bss36504> Have you done anything with FPGAs before?
[12:35:54] <megal0maniac> I haven't, no.
[12:36:48] <bss36504> It's not programming, and it takes a bit of time to wrap your head around what seems like it should be possible, and what is actually synthasizable. Do you know much about basic digital circuits?
[12:41:43] <megal0maniac> That's about as far as I've gotten - just understanding that VHDL isn't programming and the concept of an FPGA. I've got a bit of experience with digital circuits.
[12:48:11] <bss36504> In my digital classes at school, we did some neat labs. You could make a majority circuit (voting) (try to write it so you can expand it easily), an adjustable PWM, an ALU, an ECC unit. all sorts of stuff.
[12:48:55] <bss36504> if you dont need ultra high speed or very precise and predictable timing, just use an MCU.
[12:49:33] <megal0maniac> Awesome :) At the moment we're doing counters. Random sequence, up/down etc
[12:55:59] <inkjetunito> in addition to eagle, is there any other good schematic editor for gnu/linux?
[12:56:20] <megal0maniac> kicad is pretty good
[12:56:55] <inkjetunito> thanks
[13:15:54] <inkjetunito> i wonder how whether editing schemas with a 1024x768 pixel screen was always as painful as it is today
[13:15:58] <inkjetunito> -how
[13:54:25] <megal0maniac> Unlikely
[13:54:37] <megal0maniac> Displays have gotten so cheap
[13:57:23] <jacekowski> yet, laptops come with crap 1366x800 displays at best
[13:57:36] <jacekowski> unless you go for very expensive laptop with 1080p display
[13:58:41] <jacekowski> while 5 years ago, laptops came as standard with 4:3 SXGA or SXGA+ displays
[13:59:02] <jacekowski> and now you get widescreen shit that has half of vertical resolution of screens 5 years ago
[13:59:16] <jacekowski> and it's glossy
[14:10:50] <inkjetunito> the last time i did schematics on 1024x768 was likely more comfortable because the software was more expensive :p
[14:12:34] <N1njaneer> My Dell M4300 that's almost 5 years old now came with a 1920 x 1200 screen, same resolution as my 24" monitors. Works well for schematic layout, but I normally do it on the 2560x1600 here. :)
[14:12:56] <N1njaneer> I'll take a SpaceMouse over higher-res screen first, though. And they're cheap - like $100 on eBay these days :)
[14:13:57] <megal0maniac> Even my cheaper Dell D630 had a better resolution than my 2011 thinkpad
[14:14:18] <inkjetunito> i had to look quite long to find a laptop with 1920x1080
[14:14:42] <N1njaneer> Pretty standard on Dell's
[14:15:00] <inkjetunito> actually the situation got better this year. found a 1920x1080 for a friend withou ta problem
[14:15:43] <N1njaneer> eBay
[14:15:47] <bss36504> Would it be safe to clock an ATxmega128A4U at 32MHz at only 2-2.4V? (speed grade chart indicates 12MHz from 1.6-1.8, then linear to 32Mhz at 2.7 V, then flat at 32MHz to 3.6V)
[14:16:05] <N1njaneer> My laptop is up there for $114 and will run Altium Designer just fine :)
[14:16:32] <N1njaneer> bss: If it's not for a commercial product you can always try. :)
[14:16:57] <bss36504> I use Eagle pro for work (we're not in the PCB business, so it's fine for us) on dual 1920x1080s. it's great.
[14:17:01] <N1njaneer> It MIGHT work, but Atmel hasn't qualified it.
[14:17:16] <bss36504> I figured. Just wondering if anybody had any xp doing it.
[14:17:23] <N1njaneer> I've been laying out new footprints all morning here :)
[14:18:07] <bss36504> It's not technically commercial, but it is for some somewhat internal sampling to investors. TL;DR We're not selling it, but I want it to work somewhat reliably.
[14:18:23] <N1njaneer> Then why not use the correct voltage? :)
[14:18:36] <bss36504> because our chip is 1.8V.
[14:18:56] <N1njaneer> Which chip?
[14:19:32] <bss36504> It's a serial memory that my company makes. Still beta-ish stage of development. Thus, demos for investors.
[14:19:46] <N1njaneer> Use a level-shifter :)
[14:20:22] <bss36504> I do in my current system, but it takes up a lot of PCB space. (Lot as in a TSSOP14, so really not much, but I like sleek designs.)
[14:21:10] <N1njaneer> Are you willing to trade sleekness for stability?
[14:21:17] <bss36504> I use a TI SN74AVC4T245. It's a really excellent level shifter chip.
[14:21:27] <N1njaneer> And is this a serial or parallel interface?
[14:21:27] <bss36504> N1njaneer: Thats what I'm here to find out :)
[14:21:31] <bss36504> SPI interface
[14:21:58] <bss36504> has anybody overclocked these puppies at lower-than-reccomended voltages? What happens?
[14:22:08] <megal0maniac> bss36504: Usually nothing
[14:22:19] <megal0maniac> i.e. nothing out of the ordinary
[14:22:32] <bss36504> ^was just going to ask for clarification :)
[14:22:50] <megal0maniac> But it isn't guaranteed to work reliably
[14:23:11] <N1njaneer> bss: Just use a QFN or CSP level-shifter if you need to save board-space and only have a couple lines to deal with.
[14:23:43] <N1njaneer> Or just place some 120-ohm resistors on the MOSI, CLK, and CS lines.
[14:24:03] <bss36504> The issue isn't down shifting, it's getting that pesky SO line shifted back up. If I operate the xmega at less than 2.5 V, the 1.8 should trigger the input high threshold
[14:24:18] <N1njaneer> I'm surprised the chip ONLY goes to 1.8V. Most times I see it specified as the minimum voltage, but able to drive to 2.7V or 3.3V on the part.
[14:24:40] <bss36504> It hasn't really been qualified to that yet....
[14:25:18] <bss36504> It's designed to operate at 1.8. If you over voltage the I/Os, the internal diode clamp forces the 1.8 supply up, so the whole power system would cry.
[14:25:21] <N1njaneer> SO to the xmega at 1.8V shouldn't be a problem. Check the Logic '1' threshold on the xmega datasheet - it should be quite low.
[14:25:54] <bss36504> VIH is 0.7*VCC
[14:26:21] <bss36504> 1.8/0.7=2.5 ish, so I need to make VCC lower than 2.5
[14:26:33] <bss36504> and that's VIH minimum.
[14:27:06] <N1njaneer> Then use something like a 74UP1T158 in a SOT-23-6 package to boost it :)
[14:27:25] <N1njaneer> Put it on the bottom of your board if it's that ugly :)
[14:27:41] <bss36504> no results for that part no.
[14:27:52] <N1njaneer> Are you in the US?
[14:28:01] <bss36504> Yes.
[14:28:10] <bss36504> 74158 returns quad 2 input mux
[14:28:12] <bss36504> inverting.
[14:28:15] <N1njaneer> Sorry 74AUP1T58, DigiKey 568-4750-2-ND
[14:28:33] <N1njaneer> http://www.digikey.com/product-detail/en/74AUP1T58GW,125/568-4750-2-ND
[14:28:58] <bss36504> That would be perfect if the speed is good.
[14:29:02] <bss36504> Let me check here....
[14:29:17] <bss36504> I'm hoping for 16Mhz SPI clock out of that xmega.
[14:29:58] <inkjetunito> hms. kicad isn't exactly stable
[14:30:24] <bss36504> Thats why I stick with eagle (well stuck with it before I had access to a pro licence)
[14:30:55] <inkjetunito> yeah. i like eagle aswell, but i don't want to install it on this crappy backup machine
[14:31:10] <N1njaneer> bss: I would be extremely surprised if it won't handle 16 Mhz
[14:31:28] <N1njaneer> Power consumption will probably just go up a bit :)
[14:31:47] <megal0maniac> iirc, f_cpu/2 is maximum SPI clock
[14:32:24] <N1njaneer> mega: Yeah, he was asking about running the xmega at 32Mhz :)
[14:32:45] <megal0maniac> Exactly :)
[14:33:03] <bss36504> Yeah, power consumption is pretty low on my list of priorities. Our chip has an Isb of like 11mA. Compare that to: http://www.beilenet.com/download/MX25U1635E,%201.8V,%2016Mb,%20v1.3.pdf
[14:33:06] <megal0maniac> Oh, OndraSter_ overclocked an xmega to 80mhz and it... well it blinked an LED :)
[14:33:22] <bss36504> holy jesus. I bet that sucker got a bit warm.
[14:33:29] <megal0maniac> Nope
[14:33:34] <bss36504> nope?!
[14:34:58] <bss36504> N1njaneer: yeah, our 11mA standby current versus Macronix standby of 30µA
[14:34:58] <N1njaneer> bss: Custom silicon fab?
[14:35:11] <bss36504> We contract with IBM.
[14:35:20] <bss36504> they fab. we design
[14:35:24] <N1njaneer> Ahh :)
[14:35:42] <N1njaneer> We have some custom silicon here. It's always an interesting process :)
[14:36:33] <bss36504> Oh yeah...intesting is a word. IBM doesn't really care about us since we're so small, so we get wafers sometimes with litho shadowing, M1 shorts, etc. It's bad.
[14:36:42] <bss36504> Other times, we get nice wafers.
[14:41:44] <bss36504> N1njaneer: Thanks so much for that NXP chip. Looks good, only 2.7ns propagation delay.
[14:41:51] <bss36504> Also, just a generally cool chip.
[14:55:50] <bss36504> Since we were talking about overclocking: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=118755&start=all&postdays=0&postorder=asc
[15:09:08] <N1njaneer> bss: No prob, glad to help!
[15:09:36] <megal0maniac> Whoo! Blinky LED on an FPGA at 12mhz :P
[15:11:06] <bss36504> awesome!
[15:13:50] <megal0maniac> In a sense, yeah
[15:13:55] <megal0maniac> Baby steps
[15:16:19] <N1njaneer> mega: Xilinx?
[15:16:52] <bss36504> Off for the day, gentlefolk. See you round.
[15:19:02] <megal0maniac> N1njaneer: Yip. That one I linked to a while back. www.xess.com/prods/prod048.php
[15:19:15] <N1njaneer> Oh right. Good stuff!
[15:19:37] <N1njaneer> Love me some Xilinx.
[15:19:44] <megal0maniac> Arrived today. Really like the fact that you can load the bistream onto persistent flash :)
[15:20:45] <N1njaneer> Best advice I can give -- try as hard as you can to run everything from one clock. Crossing clock domains on FPGAs is a whole bunch of fun to get working reliably :)
[15:21:24] <megal0maniac> I only have one clock :P And I wouldn't have tried crossing clock domains on anything. Doesn't sound safe :P
[15:21:53] <N1njaneer> Yeah. The cool thing with the Spartans is that you can connect via JTAG, and then automatically upload an image that will program the bitstream in to attached SPI flash through the connections the FPGA already uses to talk to it, which is super handy for production. :)
[15:22:32] <asteve> did someone say fpga? :)
[15:22:47] <asteve> if you're in the DC (USA) area http://www.meetup.com/r-FPGA/
[15:23:22] <megal0maniac> asteve: I'm pretty damn far from the USA. Or anywhere else for that matter :(
[15:23:25] <N1njaneer> It's safe, but have a lot of subtlties with potential metastability issues you have to work around. I had to deal with a 12.288 Mhz (and phase-varying at that!) and 32 Mhz in the first design I'd ever worked on. That was trial by fire. :)
[15:23:48] <N1njaneer> +has
[15:25:01] <megal0maniac> Sheesh, I can imagine.
[15:27:12] <N1njaneer> It's also amazing how much variance you have in a quartz crystal oscillator that is +/-50ppm. Had to recently do a GPS-disciplined oscillator to maintain super-tight phase lock. You could breath on the quartz oscillator to change the temperature by a few degrees and watch the error term change, so I guess if you calibrated it you could have a thermometer as an added benefit :)
[15:34:24] <megal0maniac> I thought they were pretty solid around room temp. I know the atmega328 has a temp sensor on the ADC, but its uncalibrated. Little known fact, it seems
[15:38:34] <N1njaneer> They are, but you get +/-50ppm variance. That means you can gain or lose as much as 4.32 seconds per day compared to some other device.
[15:39:00] <megal0maniac> What is an accurate way of timekeeping then?
[15:39:10] <N1njaneer> Unless you go to a more expensive crystal, or oven-controlled crystal oscillator, or rubidium clock :)
[15:39:47] <N1njaneer> For long-term timekeeping you want a crystal that has less deviation possiblity - like a +/-10ppm for a tiny bit more
[15:40:22] <N1njaneer> Also keep in mind that most clocks will generally run at the same rate at the same temperature, but you have to accomodate for the widest varience possible for certain applications.
[15:41:15] <N1njaneer> Or in this case, we needed to have absolutely aligned phase that could not drift.
[15:45:20] <N1njaneer> Anyhow, I'm rambling :)
[15:45:36] <megal0maniac> At least I'm learning from it :)
[15:45:54] <megal0maniac> Good design practices and what not
[15:45:54] <N1njaneer> Just jump in and make the FPGA get up and dance XD
[15:46:05] <N1njaneer> Or at least now blink TWO leds!!
[15:46:24] <megal0maniac> The example is quite strange
[15:46:41] <megal0maniac> He's made a 22bit counter and attached the output to the highest bit
[15:46:54] <megal0maniac> So at 12mhz, you get ~0.7s period
[15:47:03] <N1njaneer> Easy way to do it.
[15:47:33] <megal0maniac> Seems like a 1s delay isn't so easy to achieve on these things
[15:47:50] <megal0maniac> Some DCM magic is necessary
[15:48:19] <megal0maniac> I'd guess :)
[15:48:27] <N1njaneer> You'd need to count specifically to 12,000,000 to get a 1 second granularity.
[15:49:08] <N1njaneer> But most times you really don't care about human units in the application. Usually the clock is more tied to something like UART speeds, video dot-clock rates, etc.
[15:49:36] <N1njaneer> Clock frequencies that are powers of 2 are usually very useful to have around. And then of course there's always the DCMs
[15:53:35] <megal0maniac> I could just make a counter which rolls over when it reaches 12000000, couldn't I? In the technology view, they show the counter made up of JK flip flops. Set a condition which will trigger a reset
[15:57:39] <megal0maniac> Now I'm rambling. Kind of. It is time for sleep, goodnight :)