#avr | Logs for 2015-07-15

Back
[05:59:27] <LeoNerd> Woo :) Purple envelope. (well, white actually now, most odd). and now I have a QFN footprint to solder
[11:17:32] <redspl> hi guys
[11:18:25] <bss36504> howdy
[11:18:41] <Hexum064> mornin
[11:21:44] <redspl> I cannot find many info on the web; I want to use USB on atmega8, but i dont have 12mhz crystal. In one of mine usb keyboards i found 6mhz crystal. Could i use it in mine project? ( i want make an amiga/c64/nes/snes/atari joystick/pad converter to usb )
[11:22:32] <redspl> Now i have found a theard; a guy writes about usb and 2mhz crystal. Is it possible?
[11:22:34] <Hexum064> If the atmega8 has a built in PLL, you could
[11:24:47] <Hexum064> I don't think you'll be able to do full speed (12mbps) usb on the atmega8, but maybe the 1.5mbps.
[11:24:53] <Hexum064> USB low speed
[11:26:31] <Hexum064> Also, USB is not supported by hardware in the atmega8, so you would have to write or find code that would emulate USB (bit-bang the USB data). I know it exists out there but I don't have a link
[11:26:57] <LeoNerd> Just get yourself a 32U4 already
[11:27:13] <Hexum064> lol.
[11:27:46] <specing> just future proof yourself already and get a stm32f discovery
[11:28:15] <Hexum064> real designers don't need the stm32f
[11:28:22] <Hexum064> \s
[11:32:17] <redspl> 6mhz is low speed?
[11:32:21] <redspl> and what is that PLL
[11:33:26] <Hexum064> no, 6mhz is not low speed. By low speed, I am referring to the USB specification.
[11:34:06] <Hexum064> And PLL = phase locked loop. It's hardware that can multiply a clock source (in this situation).
[11:38:28] <redspl> i dont have pll, and i only have crystals: 6mhz, 16mhz, 8mhz, 18.432
[11:41:08] <Hexum064> Ya, I don't think the atmega8 has a PLL.
[11:42:39] <bss36504> redspl: It does not. Look into V-USB if you want a software USB implementation. Better option is to just get a [16|32]U4 and run LUFA on it.
[11:43:06] <Hexum064> Aah. Yes, that's what it was called. V-USB
[11:43:35] <Hexum064> redspl: You will need a 12mhz xtal to do USB on the atmega8.
[11:43:59] <redspl> http://brittonkerin.com/annotateduino/arduino-uno-schematic.png here it works on 16mhz
[11:44:48] <Hexum064> or V-USB code that can use the 16mhz source
[11:44:50] <Hexum064> ...
[11:45:15] <Hexum064> Yep. That pic pretty much confirms that.
[11:46:16] <Hexum064> oh. on closer inspection
[11:46:56] <Hexum064> the chip they are using on the USB side is not an atmega8, but an atmega8u2, which has built in USB hardware
[11:47:09] <redspl> woops, mine mistake. sry
[11:47:20] <Hexum064> np
[11:47:55] <Hexum064> Ya, and that 8U2 has that PLL thing I was talking about.
[11:48:12] <Hexum064> It's used to generate the 48mhz signal needed for USB full speed.
[11:48:20] <Hexum064> (12mbps)
[11:49:12] <Hexum064> hmm. Isn't that nice. It even has it's own RAM specifically for the USB.
[12:49:02] <redspl> Hexum064, could i make 12mhz crystal from 2x 6mhz?
[12:49:44] <bss36504> redspl: No, thats not how crystals work.
[12:52:28] <redspl> bss36504, anyway to decrease?
[12:52:48] <redspl> i have crystals lower and higher, but not equal 12mhz
[12:57:25] <bss36504> redspl: If you are using a software USB driver like V-USB, you could probably get away with a 16 or 20MHz crystal. If youre using hardware USB like in the U2 and U4 chips, you'll have to go by what the datasheet tells you for crystals.
[12:58:33] <bss36504> Crystals are highly precise oscilator sources, you cant just chain them together or divide them external to the micro. The whole point is that you can buy them in almost every necessary frequency for low cost.
[12:59:21] <redspl> i will use v-usb. so i could use 16mhz oscillator?
[13:00:32] <bss36504> I believe so. I personally have not used v-usb. I suggest reading the documentation on it to see what is appropriate. I'm not exactly sure how they set up the clocking for the usb channel in software.
[13:04:15] <bss36504> Really though, if you want good usb performance, I'd suggest just buying the appropriate chips. I realize that isnt possible in all situations, but v-usb is basically a hack designed for really low power or low pin count avrs to get USB capability. At that point, it's almost not worth the software overhead compared to using a UBS to Serial converter or a proper micro with real USB functionality.
[13:04:22] <Hexum064> There may be some kind of settings in V-USB that throw in some "NOP"s to take account for higher speeds. But in general, for V-USB, you'd need an actual 12mhz xtal.
[13:07:01] <redspl> OK, it could handle 16mhz. mine mistake
[13:07:43] <naquad> hi
[13:07:53] <bss36504> howdy
[13:11:04] <naquad> i have a problem of perfectionist. there's a 16 channel relay module, it has 16 pins and at2313a (because i'm too greedy to use anything else for just kicking pins based on serial input). the problem: 2313 has 15 free pins, 16th is reset, 2 more are for TX/RX. the question is: how do i control 16 pins with 15 available? is there some electronics magic that can help me? i know i can use some multiplexer, but its not that interesting :)
[13:11:46] <LeoNerd> naquad: Multiple ideas. One of which is HVPP'ing it so you get that 16th pin
[13:12:12] <LeoNerd> Or stick a couple of 74xx595 shift registers on to control the relays, and use a much smaller 'tiny
[13:12:36] <naquad> LeoNerd, what's HVPPing? you mean block the reset and use it as pin?
[13:12:59] <naquad> yup, googled that
[13:13:16] <specing> < bss36504> Crystals are highly precise oscilator sources
[13:13:18] <specing> lol
[13:14:05] <LeoNerd> Hah
[13:14:20] <LeoNerd> No, a Cs/Rb oven is a highly precise oscillator source. All the rest are just approximations
[13:21:41] <bss36504> LeoNerd: Oh well let me know when you strap one of those onto your AVR.
[13:22:02] <Hexum064> naquad: HVPPing is high voltage parallel programming
[13:22:17] <naquad> thanks, googled that
[13:22:26] <naquad> basically will make reset a standard pin
[13:25:21] <bss36504> naquad: Well, technically you could program the reset disable fuse serially...once.
[13:25:44] <Strangework> lol
[13:26:13] <specing> bss36504: does straping your AVR to it count?
[13:26:41] <bss36504> specing: Well I suppose it's sort of the same thing, eh?
[13:27:00] <LeoNerd> Yeah -technically- you don't need HVPP to burn the RSTEN fuse, you just need it if you ever want to reprogram the chip again :)
[13:27:06] <Hexum064> If you have a bunch of transistors lying around, you could build your own multiplexer
[13:27:17] <specing> bss36504: in that case it is very much possible
[13:27:51] <bss36504> specing: I wasnt denying the possibility
[13:27:55] <specing> also this is all madness
[13:28:18] <specing> those relays need more power than a tiny attiny can provide
[13:28:23] <specing> meaning a driver
[13:28:39] <specing> so why not use a 8-pin driver with an enable that can remember state or something?
[13:28:50] <specing> and you get 5 extra free pins
[13:29:06] <LeoNerd> You can get 595-style shift registers with opencollector high-current sink outputs
[13:29:10] <LeoNerd> I forget offhand what it's called.
[13:29:21] <LeoNerd> It's literally just a 595 with a bunch of big NPNs on the outputs
[13:29:41] <specing> uln 2303?
[13:29:53] <specing> well not shift, but 500mA "motor drivers"
[13:29:56] <bss36504> My impression was that naquad has a readymade driver+relay combo, just needs a micro to drive it.
[13:30:05] <specing> also does someone have a nice source of bistable relays?
[13:30:13] <specing> normal relays are unfun
[13:30:18] <specing> and take a lot of powa
[13:30:21] <LeoNerd> No, the 2303 is just the high-current buffer
[13:30:27] <naquad> http://img.dxcdn.com/productimages/sku_183372_1.jpg
[13:30:29] <naquad> yup
[13:30:52] <LeoNerd> naquad: Yeah, honestly I'd stick a couple of 595s on that to drive it
[13:30:58] <LeoNerd> (but then, I have a box full of them at home ;) )
[13:31:08] <LeoNerd> SPI is more-than fast enough to drive some relays
[13:31:09] <specing> naquad: ?
[13:31:15] <specing> ah ok
[13:31:25] <specing> naquad: are those normal relays or bistable ones?
[13:31:41] <specing> judging from "16 relays 16 inputs I'd say normal"
[13:32:20] <naquad> normal ones
[13:33:20] <specing> :S
[13:33:22] <LeoNerd> Oooh.. I think I've just thought up *a* way to drive 16 relays from 8 GPIO pins
[13:33:31] <naquad> ?
[13:33:38] <LeoNerd> Pair them up; you can drive two relays from a single GPIO with a couple of diodes, capacitors and transistors.
[13:34:00] <naquad> looks like there's one more ingredient here: madness! :D
[13:34:00] <LeoNerd> But the whole thing is therefore going to need 16 diodes, caps and transistors.. meaning that you'd be far easier to just stick a 595 on it ;)
[13:34:05] <Hexum064> LeoNerd: Are you ever energizing more than one relay at a time?
[13:34:15] <specing> you can also drive 16 relays from a single GPIO
[13:34:18] <specing> fun fact
[13:34:31] <Hexum064> specing: Shift reg?
[13:34:36] <LeoNerd> Arrange it so that if you pull the GPIO low, you charge a cap via a diode that turns on a transistor. Arrange the other high.
[13:34:41] <specing> Hexum064: no, toggling them at the same time lol
[13:34:47] <Hexum064> lol
[13:34:49] <LeoNerd> Now a high-frequency pulse on the GPIO will keep them both charged.
[13:34:59] <LeoNerd> you can turn either relay off by floating the pin hi-Z on half the cycle
[13:35:42] <Hexum064> LeoNerd: So again, would you only be turning on 1 relay at a time out of the 16?
[13:35:49] <LeoNerd> A bleed resistor carefully chosen along with the drive frequency will let you choose the control latency
[13:35:59] <LeoNerd> Hexum064: Nope, you can turn on either or both
[13:36:17] <LeoNerd> (well, up to the speed of the control signal)
[13:36:18] <Hexum064> But what is your design requirement?
[13:36:23] <Hexum064> How many have to be on at once?
[13:36:33] <LeoNerd> But yeah, this is silly as compared to just using a 595 ;)
[13:37:14] <LeoNerd> you can do two LEDs on a single pin that way though :)
[13:37:51] <LeoNerd> VCC - LED/res - GPIO - LED/res - GND. Pick the resistors such that there's basically no bleed current when the GPIO floats. Then pulling it low or high will illuminate one LED
[13:38:25] <LeoNerd> 1pin => 2LEDs, 2pins => 4LEDs, 3 or more pins => better off charlieplexing
[13:41:04] <Strangework> lol, charlieplexing?
[13:41:15] <LeoNerd> google
[13:45:30] <Strangework> loving the name
[14:02:26] <ldc> whoa
[14:02:36] <ldc> atmel actually shipped 2x attiny85 and 2x atmega328 for sampling
[14:02:50] <Hexum064> cool
[14:02:55] <ldc> even though I clearly stated "nonprofit lab" in the company address
[14:03:49] <Hexum064> They don't really make any money off of one-off products anyways. So they bet on someone using their samples in a PoC then doing mass production
[14:04:53] <ldc> I just hope customs don't mess up and show up with a 40 eur bill for 3$ in components
[14:05:02] <ldc> like what happened when I sampled from freescale :D
[14:05:10] <Hexum064> ouch!
[16:14:31] <LeoNerd> https://www.tindie.com/products/masihvahida/open-source-avr-based-vga-graphic-card-module <== is it just me, or does this "open source" product not, in fact, offer any source?
[16:16:54] <fridgefire> I can,t see the sourcecode. and 89 dollar for an atmega64!
[16:17:01] <LeoNerd> Yeeeah
[16:17:05] <LeoNerd> That's what got me ;)
[16:19:42] <bss36504> Not to be a hater, but seriously, switch to the QFN and some SMD resistors. Make that 3x3cm form factor into a 1x3. Also $89 is outrageous, its a VGA driver not a sentient AI.
[16:26:08] <Jartza> LeoNerd: wut :D and it looks like it only displays text?
[16:26:47] <Jartza> with atmega. I can display text with attiny85 on vga and it will be open source
[16:27:01] <Jartza> :D
[16:27:22] <LeoNerd> Ah there you are - I thought you'd be interested :)
[16:27:31] <bss36504> Yeah, his other creation wasnt super impressive either soooo i guess he just over-estimates his abilities or something...
[16:27:35] <Jartza> yea :D
[16:32:48] <bss36504> I know this chat tends to scoff at Java, but I like it and this is neat http://dmitry.gr/index.php?r=05.Projects&proj=12.%20uJ%20-%20a%20micro%20JVM
[17:27:29] <apo_> \o/ my synth can now do 6 channels, and the scope says that there are usually at least 25 cycles not spent in the interrupt, so that's plenty for parsing MIDI
[17:28:23] <Hexum064> good on ya mate
[18:35:52] <apo_> http://0au.de/~apo/riders.ogg Riders On The Storm :)
[19:00:03] <Hexum064> apo_:You play that on your synth?
[19:00:20] <Hexum064> You should post the code and design!
[19:00:28] <Hexum064> I'm off to walk home now.
[19:00:39] <apo_> Hexum064: https://github.com/Cat-Ion/atmega328-midi-synthesizer
[19:32:58] * twnqx never notices apo_ here before
[19:33:38] * apo_ always notices twnqx here before
[20:23:25] <Hexum064_2> Hey all. Think I asked this before but don't remember the response. Anyone used the ping-pong functionality in conjunction with multipacket on the xmega128a4u (or other USB enabled xmega) for the USB?
[20:23:55] <Lambda_Aurigae> Hexum064, you asked and nobody had any clue what you were talking about.
[20:24:18] <Hexum064_2> aah. That might be why I don't remember an answer
[20:24:58] <Lambda_Aurigae> someone asked what you were talking about
[20:24:58] <apo_> Hexum064: saw my link? :)
[20:25:02] <Lambda_Aurigae> and you never answered.
[20:25:12] <Hexum064_2> ooh... sry
[20:25:18] <Hexum064_2> apo_:which one?
[20:25:23] <Lambda_Aurigae> no clue what that means.
[20:25:29] <apo_> Hexum064_2: https://github.com/Cat-Ion/atmega328-midi-synthesizer
[20:26:34] <Hexum064_2> for multipacket, instead of just transferring 64 bytes in one transaction (max for bulk transfer) it can do up to 1024 and combines them in hardware per transaction.
[20:27:28] <Hexum064_2> ping-pong is supposed to "double-buffer" where it uses two chunks of memory and toggles between the two when filling them with incomming data.
[20:27:54] <Lambda_Aurigae> https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=5&cad=rja&uact=8&ved=0CD0QFjAEahUKEwjH8r2_ut7GAhUXFpIKHSdFAH4&url=http%3A%2F%2Fwww.atmel.com%2Fimages%2Fatmel-8331-8-and-16-bit-avr-microcontroller-xmega-au_manual.pdf&ei=KAOnVce-GZesyASnioHwBw&usg=AFQjCNFlpnX_ZMcunVTz66dxu6vvcKnOKg&bvm=bv.97949915,d.aWw
[20:28:07] <Hexum064_2> very cool apo_
[20:28:14] <Lambda_Aurigae> looks like xmega supports it.
[20:28:14] <apo_> thanks :)
[20:28:22] <Lambda_Aurigae> very few people around here use xmega though.
[20:28:33] <Hexum064_2> Lambda_Aurigae:ya, it does but it's not working right for me