#avr | Logs for 2012-08-23

Back
[01:01:05] <grosso> hi
[01:01:30] <grosso> can I run an atmega328p with internal 8MHz clock?
[01:02:59] <grosso> i mean, if I connect an atmega328p just out of the box, without any crystal, it works?
[01:07:17] <Microboter> yes, but it has the divide by 8 set so it runs at 1 mhz
[01:10:18] <grosso> ok, I get it... but, if I connect an external 16MHz crystal it run at 16MHz from the beginnin or it still run at 1MHz until I change fuses?
[01:10:33] <Microboter> got to change the fuse
[01:10:53] <Microboter> and read up on it. you can brick it if you set the fuses wrong
[01:11:11] <grosso> yes, of course
[01:12:05] <grosso> so, until I change fuses, it run at 1MHz no matter what crystal I put, is it right?
[01:13:27] <Microboter> correct. the fuse keeps the internal clock connected and disables the crystal input
[01:15:18] <grosso> so, I connect an atmega328p without any crystal, and then i disable "divide by 8" bit through ICSP, then I have a pretty 8MHz mcu, it is right?
[01:16:27] <Microboter> correct. however it is not recommended to use fast serial baud rates with the internal crystal the clock is not very accurate
[01:19:30] <grosso> ok... 2 more questions... 1) there exist any kind of 16MHz internal clock? 2) can I run it @16MHz with 3.3V power supply? 3) can xbee work with more than 3.3V supply?
[01:21:48] <Microboter> that is 3 questions :) 1. no. 2. depends on the chip some will not run that fast at 3.3, #3. yes but you must use level converters. you can have a 5 mcu and a 3.3 xbee but level converters must be used
[01:23:44] <grosso> so, if I want 115200 xbee I must use 16MHz crystal and 5V supply, then a 3.3V regulator for xbee... is it right?
[01:24:58] <Microboter> yep, and level converters for the data lines
[01:25:44] <grosso> well, level converter is a couple of resistors
[01:28:49] <grosso> thank you for the answers
[01:29:04] <Kevin`_> grosso: there's avr chips that will work at 32mhz with a 3.3v supply
[01:29:33] <grosso> sure? what chips are these?
[01:29:56] <Kevin`_> grosso: most of the xmega series, some of the atmega series
[01:31:15] <Kevin`_> grosso: xmega is especially useful if you want to do it without an external oscillator
[01:32:08] <Kevin`_> although I think there's a few other devices that would run at 16mhz from the internal oscillator
[01:32:15] <grosso> oh, well, but i have no experience with xmega, I'm an arduino user in fact
[01:34:08] <grosso> I'm tryin to make a cheap remote device, battery powered
[01:34:25] <grosso> with the minimun components
[01:34:28] <Kevin`_> grosso: xbee is anything but cheap
[01:34:37] <grosso> yeah
[01:34:50] <Kevin`_> grosso: for the cost of that module you could build the entire device with different choices
[01:35:36] <grosso> well, i believe, but I'm not know much options...
[01:36:41] <grosso> sorry my terrible english
[01:36:46] <Kevin`_> grosso: rfm22b from china can be had for about $5 (forget the number exactly)
[01:37:49] <grosso> rfm22b? it is just like xbee? transparent? simple? fast? robust? bi-directional? 2.4GHz?
[01:39:47] <Kevin`_> grosso: it's not a transparent rs232 link, you have to handle some amount of framing, but it's simple enough. ~256kbit/sec depending on selections, bi-directional, NOT 2.4ghz, the lower frequency ism bands
[01:39:59] <Kevin`_> grosso: why do you want 2.4ghz?
[01:41:51] <grosso> oh, i see it is a 900MHz radio.... no, I don't want 2.4GHz, I just believe that 2.4GHz radios have a standard set of features, like xbee or bluetooth
[01:45:55] <grosso> but i see these modules are pretty useful, there exist an arduino library even... thank you
[03:14:18] <Worsedah> hi, i have been reading a bit about delays and am more confused than when i started, anyone willing to help me out?
[03:22:58] <CapnKernel> Worsedah: yes
[03:23:29] <CapnKernel> Does this help? http://www.nongnu.org/avr-libc/user-manual/group__util__delay.html
[03:23:49] <Worsedah> that's where i've been stuck
[03:23:55] <CapnKernel> Go on...
[03:24:23] <Worsedah> the "The maximal possible delay is 262.14 ms / F_CPU in MHz." so at 1.2mhz that means max delay is 218.45 ms?
[03:25:53] <CapnKernel> Why not try it on a board and see what happens?
[03:27:23] <Worsedah> well i'm confused because i'm also reading that timers are a far better way to do delays, i need about a 30 second delay total
[03:27:43] <CapnKernel> You can ask for a delay of 30000 msec no problem
[03:28:24] <CapnKernel> But above that expression, it will be done in increments of 1/10msec, which is good for you, because 30 seconds is an exact multiple.
[03:29:40] <CapnKernel> Oh, you may need to do it as five delays of six seconds.
[03:48:29] <theos> does alf come here?
[03:55:42] <Worsedah> CapnKernel, what is the best way to do that? loop a _delay_ms(6000) five times?
[04:06:52] <CapnKernel> Give it a try.
[04:06:57] <CapnKernel> Gotta go now, bye.
[04:17:57] <elektrinis> hi
[04:18:04] <elektrinis> question about attiny45
[04:18:29] <elektrinis> if reset is disabled, can this pin be used as output? or is it input-only?
[04:23:07] <jadew> elektrinis, both
[04:24:03] <jadew> has anyone built hardware to work with this? http://www.lxtreme.nl/ols/
[04:25:16] <megal0maniac> open workbench logic analyzer should work with it
[04:26:06] <jadew> I know but I'm interrested in simpler things
[04:26:44] <jadew> I notice it can't use the same byte as being a succesive bit samples for the same channel
[04:27:58] <jadew> instead it considers each bit to be a sample from a specific channel, which is not optimal when sampling one channel only
[04:29:40] <megal0maniac> OLS seems pretty generic, you could just search for OLS compatible hardware?
[04:30:02] <megal0maniac> Then again, whatever protocol OLS uses might require the samples to be taken this way
[04:30:22] <megal0maniac> Meaning that it's a protocol limitation rather than a hardware one
[04:30:56] <jadew> I just took a look inside the source, I think I can modify the "generic io" device to do my bidding
[04:31:36] <jadew> was hoping someone already went trough this and found a different way of doing it, other than changing the code
[04:41:25] * megal0maniac shrugs
[04:41:40] <megal0maniac> Sorry, don't know much more about it other than what I've said already :)
[04:41:51] <jadew> :)
[04:42:16] <megal0maniac> Quite keep on getting one but I keep spending my money on new AVRs :/
[04:42:21] <megal0maniac> *keen
[04:43:33] <jadew> hehe, I wanted to buy one too, but now I want to see how well I can make my own device work with it
[04:49:03] <jadew> I managed to sniff at 627,488 Hz on one channel, that's enough to sniff 0.5 uS signals, which is quite good
[04:50:43] <jadew> that means it can easily do 1-wire and should be able to do i2c at least at 100khz
[05:59:35] <megal0maniac> jadew: What exactly is your device?
[07:07:04] <jadew> hey guys, any idea why cu would give Permission denied when trying to connect to a serial port?
[07:15:32] <OndraSterver> you have gotta love czech post. Minimum size for package? 145x90mm. What I want to send? 70x30mm
[07:15:33] <OndraSterver> arrgh
[07:17:59] <Erlkoenig> plenty of space for packaging! \o/
[07:18:27] <OndraSterver> yes
[07:18:30] <OndraSterver> you spend a LOT on packaging
[07:19:09] <OndraSterver> hmm I could send it as "letter" in bubblewrapped mail, but that is around the same price as this package lol
[07:20:02] <Erlkoenig> it's always nice when dealers package basically unbreakable items that might even fit in a mail envelope into a large box and fill it with paper...
[07:21:58] <OndraSterver> well
[07:22:06] <OndraSterver> it is PCB with parts on it
[07:22:22] <OndraSterver> but it wouldn't fit the 2cm maximum for regular post though, if I were to solder on headers
[07:22:38] <OndraSterver> (including the bubblewrap)
[07:22:39] <OndraSterver> oh well
[07:22:41] <OndraSterver> BIG PACKAGE IT IS!
[07:22:51] <OndraSterver> 2.2€ is shipping then for czech republic
[07:22:57] <OndraSterver> about 4 - 5€ international
[07:22:58] <Steffanx> 2.2 what?
[07:23:00] <OndraSterver> eur
[07:57:06] <elektrinis> m, strange thing. attiny45 operating at 3V
[07:57:16] <elektrinis> reset pin is configured as IO
[07:57:38] <elektrinis> but it gives 2.5V instead of 3V
[07:57:54] <elektrinis> is this normal?
[08:01:29] <Erlkoenig> the reset pin can drive less current - what did you connect to it?
[08:01:50] <elektrinis> just voltmeter, nothing else
[08:02:01] <elektrinis> how much current can it give?
[08:02:14] <elektrinis> I need at least 200uA there
[08:02:30] <Erlkoenig> dunno, look at the datasheet
[08:02:36] <elektrinis> ok
[08:03:02] <Erlkoenig> you used the Fuse to configure it as a IO, right?
[08:03:42] <OndraSterver> there should be 10mA on reset pin
[08:03:44] <OndraSterver> tops
[08:03:47] <OndraSterver> 20mA on any other IO
[08:03:51] <OndraSterver> (that is from datasheet)
[08:04:02] <OndraSterver> if fuse RSTDSBL is not set and it is reset
[08:04:04] <OndraSterver> it has internal pullup
[08:04:09] <OndraSterver> about 100k or 1M?
[08:04:29] <OndraSterver> it is in the datasheet as well
[08:06:37] <megal0maniac> 20K usually
[08:07:17] <Erlkoenig> "so much that you need an external pullup" :D
[08:10:32] <OndraSterver> megal0maniac, hmm that is quite small, I thought it was at least 100k
[08:11:28] <megal0maniac> What chip is this?
[08:11:59] <OndraSterver> 30 - 60kOhm on reset
[08:12:06] <OndraSterver> 20 - 50kOhm on regular pins
[08:13:33] <elektrinis> http://www.atmel.com/Images/doc2586.pdf
[08:13:35] <elektrinis> page 190
[08:13:39] <elektrinis> that is strange
[08:17:07] <elektrinis> looks like internal diode
[10:46:31] <monobit_> hang 10 on the flip flop
[10:46:51] <monobit_> the D flip-flop!
[10:46:56] <monobit_> *badump tsch*
[11:04:52] <MotionObserver> anyone up for answering questions about radiation?
[11:05:30] <OndraSterver> it is dangerous
[11:05:46] <MotionObserver> that depends what kind :3
[11:06:02] <OndraSterver> everyone is potentionally dangerous
[11:06:19] <MotionObserver> is it a question of amount of exposure then?
[11:31:19] <ziph> MotionObserver: Amount, kind, where, how long.
[11:31:39] <ziph> MotionObserver: Swallowed something you shouldn't have? :)
[11:32:09] <CapnKernel> RikusW: There?
[11:36:05] <MotionObserver> no no i was just curious about how energy intensive emitting different ranges of EM are, but another channel cleared it up for me ^ ^
[11:36:50] <RikusW> CapnKernel: hi there
[11:55:35] <plutox> MotionObserver, i guess it's E=h*f=\hbar \omega
[11:56:02] <MotionObserver> can you talk me through that plutox?
[11:57:05] <plutox> what do you mean? E is the energy of a photon of frequency f and h is Planck's constant
[11:57:55] <plutox> thats this de Brogli relation - wave particle dualism
[11:59:08] <plutox> but there is also non em "radiation" like alpha particles for example
[13:13:07] <RikusW> http://arstechnica.com/security/2012/08/passwords-under-assault/
[14:13:48] <Blecha> Can i use itoa(FF, shiftString, 16);
[14:14:00] <Blecha> to get a string I can iterate for my shift register function.
[15:29:46] <moimoi> [atmega2560, 5v] -- Would it be possible to gang-up a few IO pins (40ma each?), using current-equalizing resistors, and throw in a voltage-limiting zener diode, to modulate a laser diode (180mA, 1.5v)?
[15:30:32] <Erlkoenig> why not just use a FET?
[15:30:54] <moimoi> Erlkoenig, I want nanosecond modulation.
[15:31:34] <Erlkoenig> the diode and the controller can do that?
[15:34:08] <moimoi> Erlkoenig, well the controller runs at 20mhz, so why not?
[15:34:43] <Erlkoenig> so you theoretically could toggle the pins every 50ns...
[15:34:54] <moimoi> Erlkoenig, right on.
[15:35:05] <Erlkoenig> but are you sure your diode can do that?
[15:35:30] <moimoi> Erlkoenig, the laser diode? Yeah, they can be modulated up to Ghz.
[15:35:46] <Erlkoenig> oh good
[15:36:07] <Erlkoenig> so perhaps look for HF bipolar transistors
[15:36:14] <moimoi> *googles
[15:37:05] <moimoi> Erlkoenig, these? http://www.ebay.com/itm/HP-Low-Noise-Silicon-Bipolar-Transistor-DC-6-GHz-AT41410-/280587837729#ht_2414wt_1186
[15:37:40] <Erlkoenig> wat, i think that's a *bit* exaggerated :D
[15:38:11] <Erlkoenig> well "HF" might me exaggerated...
[15:41:27] <moimoi> Erlkoenig, pardon my electro-noobiness, but how would you hook that up to an avr?
[15:41:48] <Erlkoenig> i'd use a resistor. :D
[15:42:47] <OndraSterver> what happens when you feed AC motor with DC square wave? (aka 0 - something rather 0-something-0-minus something)
[15:42:53] <OndraSterver> does it ... still work? :D
[15:42:56] <OndraSterver> I presume not
[15:46:38] <moimoi> Erlkoenig, my brief reading suggests that the bipolar transistor may be used to switch DC. You're suggesting that I hook it up to the micro and a power source, whereas the micro simply enables the flow of current from the power source to the laser diode?
[15:48:47] <Erlkoenig> exactly. for example, when using an NPN transistor, connect it's Emitter to GND, the collector to the diode's cathode, the diode's anode to +1.5V, and the transistor's base to a portpin using a resistor, whose size is determined by the max base current of the transistor and the voltage of the pin.
[15:49:37] <Erlkoenig> although you might consider driving the LED using a constant-current-source...
[15:51:02] <moimoi> Erlkoenig, it's a laser diode. Yes, constant-current is definitely needed, otherwise these things blow up. Can I use a simple resistor to limit the current going into the LD?
[15:51:32] <OndraSterver> that is current limiting, not constant current :)
[15:51:41] <Erlkoenig> i don't know exactly... probably a current-current-source using transistors is a better option
[15:51:53] <Erlkoenig> wah
[15:51:56] <moimoi> OndraSterver, capacitor + resistor? :)
[15:51:58] <Erlkoenig> constant-current-source
[15:52:04] <OndraSterver> capacitor?
[15:52:08] <OndraSterver> transistor(s)!
[15:52:27] <moimoi> well yes, in case current momentarily drops, they can feed back the circuit, nay?
[15:53:11] <moimoi> oh no, an inductor stores current.
[15:54:36] <OndraSterver> inductor in DC = burrrrrn baby burrrrrn
[15:54:46] <OndraSterver> (if we are talking quite some amps)
[15:55:13] <OndraSterver> use LM317T for example
[15:55:19] <OndraSterver> it can be turned into constant current source
[15:55:40] <moimoi> I see.
[15:56:18] <moimoi> OndraSterver, why would an inductor have destructive effect on a DC circuit? Isn't its function to convert the magnetic energy back into current when the latter fades?
[15:56:37] <Erlkoenig> hm, can you turn the LM317 on/off fast enough for modulating a LED?
[15:56:56] <OndraSterver> moimoi, when you are doing 1 Amp
[15:57:04] <OndraSterver> there is some DC resistance
[15:57:12] <OndraSterver> and that resistance makes some voltage drop
[15:57:29] <OndraSterver> => power dropped on the coil
[15:57:40] <Erlkoenig> shorting a battery with a coil is nice <3
[15:57:41] <OndraSterver> too much amps at too much volts can make the coil smoke
[15:57:44] <OndraSterver> heh
[15:57:49] <OndraSterver> modulating? :o
[15:57:50] <OndraSterver> no idea
[15:58:02] <Erlkoenig> i managed to induct 2300V this way. :D
[15:58:14] <OndraSterver> heh
[15:58:18] <OndraSterver> you all know flybacks from TVs, right?
[15:58:26] <OndraSterver> well, they have nasty habit of having internal capacitor
[15:58:30] <OndraSterver> I didn't realize that
[15:58:31] <moimoi> ye
[15:58:33] <moimoi> ouch
[15:58:48] <OndraSterver> in order to find secondary I quickly shorted primary on like 1V power supply to generate some magnetic field
[15:58:49] <Erlkoenig> unfortunately i don't have one... there were old TV's in the street lately, but someone took all the electronics from them :p
[15:58:54] <OndraSterver> and watch which pin goes REALLY high
[15:58:59] <OndraSterver> well
[15:59:01] <OndraSterver> I found it
[15:59:09] <OndraSterver> then I grabbed the flyback from the bottom side...
[15:59:12] <OndraSterver> and shorted it via my hand :D
[15:59:37] <OndraSterver> (no need to say I probably didn't find the real secondary coil)
[15:59:53] <OndraSterver> or some other winding shorted through my hand. But believe me, I felt it :D
[16:00:11] <Erlkoenig> when playing with large coils, always keep one hand behind your back *G*
[16:00:15] <OndraSterver> heh
[16:00:19] <OndraSterver> this was just in one hand of course
[16:00:41] <OndraSterver> anyway, I have three flybacks and one MOT waiting here for some fun
[16:00:56] <Erlkoenig> http://2g2s.de/elektronik/spule2-induktiv+strom.png ... look at the scale below....
[16:01:18] <Erlkoenig> one square = 500V...
[16:01:21] <OndraSterver> heh
[16:01:37] <OndraSterver> what is the input pulse though?
[16:02:10] <Erlkoenig> i just connected the coil via a 150 Ohm Resistor to a 12V Lead battery
[16:02:14] <OndraSterver> like I said, I used 1V or less on bench PSU, otherwise it was tripping current protection
[16:02:19] <OndraSterver> oh
[16:02:22] <Erlkoenig> the yellow line is the voltage of the resistor
[16:03:21] <Erlkoenig> ... that means, the spark between the coild and the battery conducted 1.5A through the air
[16:03:27] <OndraSterver> if I ever built my FHV PSU it will have bleeders of course.
[16:03:32] <OndraSterver> build*
[16:04:00] <Erlkoenig> FHV?
[16:04:09] <OndraSterver> Fu**ing High Voltage :)
[16:04:13] <Erlkoenig> ah haha :D
[16:04:23] <OndraSterver> aka anything above 1kV usually
[16:09:41] <moimoi> Erlkoenig, does this look right to you? LM317 (+V) --> Laser diode (anode); Laser diode (cathode) -> NPN-Transistor's collector; Transistor's emitter -> GND; Transistor's base -> MCU.
[16:10:24] <Erlkoenig> you need to connect the LM317's ADJ pins somehow... but i doubt the LM317 works with the 20Mhz Frequency...
[16:10:25] <OndraSterver> what is the lm317 then there for?
[16:11:04] <moimoi> OndraSterver, supply laser diode with constant current, when needed?
[16:11:10] <OndraSterver> oh
[16:11:18] <OndraSterver> I thought you wanted to do the constant current with the NPN
[16:11:34] <moimoi> Erlkoenig, but it's not the LM317 that we're modualting, in this case, it's the NPN, nay?
[16:12:16] <OndraSterver> one has to wonder what will happen to LM317 though
[16:12:19] <OndraSterver> when you cut off the current
[16:12:49] <Erlkoenig> moimoi: but the lm317 will have to turn on/off as the npn is allowing/blocking the current
[16:14:27] <Erlkoenig> you probably need some sort of combined current source and modulator
[16:15:14] <Mr_Sheesh_AFK> Or short across the laser diode when you want it off, with the NPN?
[16:16:36] <moimoi> Mr_Sheesh_AFK, mmm?
[16:16:38] <Erlkoenig> then one would need a cooler for the NPN...
[16:16:51] <Erlkoenig> but that might actually be the best solution
[16:17:33] <Mr_Sheesh_AFK> Or some way like that - Alternating switch a pair of NPNs one has a resistor, the other the laser diode?
[16:18:08] <Erlkoenig> ha, great ;)
[16:18:30] <moimoi> hm, I'll have to draw this up.. my electro-visual skills are noobish.
[16:20:05] <moimoi> nope, I still don't see it.
[16:21:09] <moimoi> One NPN's base connects to the other's collector?
[16:21:55] <Mr_Sheesh_AFK> Turn transistor A on for the laser to emit - when it's time for the laser to stop emitting, turn transistor B on as you turn A off, B has an equivalent load to the laser but it's a dummy load; that or drive the two off opposing ends of an inverter
[16:31:42] <moimoi> Mr_Sheesh_AFK, the dummy load suggestion seems neat. Would neat to use 2 IO pins, eh? Would the 2d proposition also require 2 IO pins?
[16:31:51] <moimoi> 2nd*
[16:32:21] <Mr_Sheesh_AFK> Yeah, 2 IOs one to each transistors' base seems to make sense there?
[16:32:51] <moimoi> need*, arr.
[16:32:53] <Mr_Sheesh_AFK> If you had a coil in series with the LM317 that'd keep the current pretty stable through the LM317
[16:33:14] <moimoi> Interesting.
[16:34:32] <moimoi> Do you see any potential delays or should NPNs be fast enough to enable modulation of laser diode at micro's frequency?
[16:34:59] <Erlkoenig> probably not every NPN, but there are certainly ones that are fast enough :)
[16:38:01] <Mr_Sheesh_AFK> Yep just a fast enough NPN, IDK how you'd get a fast enough uC tho :p
[16:38:32] <moimoi> Mr_Sheesh_AFK, well atmega @ 20mhz + fast npns would give ~50ns modulation, right?
[16:39:19] <Erlkoenig> you won't be able to push data out of an ATmega with constantly 20 MHz, though :D
[16:40:55] <Mr_Sheesh_AFK> Could toggle a bit on/off in a function tho, for say 10 or 50 cycles for 1s or 0s? Or something
[16:41:32] <moimoi> Oh yeah, this modulation is very momentarily.
[16:41:58] <moimoi> It won't be for constant communication or something like that.
[16:46:33] <moimoi> So say I want to fire the laser for *one* burst -- I should (while npn_dummy is off): (1) enable npn_diode [50ns], (2) enable npn_dummy [50ns], (3) disable npn_dummy [50ns] -- The burst would last, what, 50ns?
[16:47:57] <Mr_Sheesh_AFK> They'd be exclusive or i.e. you always have the dummy on, except when you want to emit via the laser
[16:48:29] <Mr_Sheesh_AFK> the other way would be to get a constant current controller that *can* handle 50nS bursts
[16:48:46] <Mr_Sheesh_AFK> Which isn't something I've done but maybe someone else?
[17:08:05] <jevin> has anyone here played around with 6LowPAN? My raven kit has been collecting dust since I got it and I thought it would be fun to do some around-the-home sensor network stuff
[17:10:14] <moimoi> Mr_Sheesh_AFK, so why have the diode's NPN at all? I mean, if you have a line between the LM317 and the diode, and you intersect that line with the dummy load's NPN, can't turning this off redirect the current from the dummy to the diode?
[17:11:43] <Mr_Sheesh_AFK> So long as the laser diode doesn't transmit partially while the dummy load's active I guess
[17:12:00] <moimoi> So make a heavier dummy?
[17:32:50] <Mr_Sheesh_AFK> Or a dummy that is just below the threshold where the laser emits or something?
[17:38:14] <Amadiro> I've found a random board with some ARM-based SOC on it, and it exposes a (4-pin)JTAG interface, can that be reprogrammed with a JTAGICEmkII programmer or so, even though it's not really an Atmel chip?
[17:38:48] <Amadiro> Just a stab in the dark, really