#avr | Logs for 2012-06-26

Back
[01:02:21] <ziph> Microboter: It's probably included in one of the AVR headers.
[01:03:48] <Microboter> thanks, guessing the material I am reading is old and it has been fully integrated into main stream.
[01:53:42] <_Tom> Hey
[02:19:47] <grummund> #include <stdint.h> is the correct header to use
[05:21:25] <theos> hi
[05:21:56] <theos> can atmega8 store the input voltage ? can it sense it's voltage?
[05:22:19] <theos> like some inbuilt function or through adc pins
[05:22:34] <theos> how much Vcc its getting
[05:23:14] <grummund> if it has ADC then there will be a way to monitor supply volts
[05:23:50] <theos> but adc uses vref to calibrate no?
[05:24:30] <theos> so if the input voltage decreases, then he calculations go wrong
[05:24:48] <theos> the*
[05:25:10] <grummund> vref should be fixed, either using external source or internal bandgap reference
[05:25:50] <theos> yes. but if the source has variable voltage, then it wont work correctly
[05:26:11] <grummund> i said *fixed* :D
[05:26:21] <theos> hence, i need to know if there is a way by which the atmega8 can read it's input voltage
[05:26:37] <theos> yes thats the issue. the voltage isnt "fixed" :D
[05:27:25] <grummund> yes, either Vref must be fixed, or if Vref is proportional to Vcc then use the ADC to measure a fixed source
[05:28:29] <grummund> atmega has internal bandgap reference which is one possibility
[05:30:57] <theos> :/
[05:39:55] <OndraSter> theos, use divider
[05:39:57] <OndraSter> 5:1
[05:40:02] <OndraSter> or 6:1 to be sure
[05:40:05] <OndraSter> divide the input voltage
[05:40:05] <theos> ?
[05:40:07] <OndraSter> and tie it to one ADC
[05:40:12] <OndraSter> use bandgap reference
[05:40:17] <OndraSter> of about 1.2V or whatever is in that mega
[05:40:19] <Richard_Cavell> what about attaching a voltage regulator to the inputs of the AVR and then using the AVR to separately measure the voltage
[05:40:58] <theos> hmm
[05:41:12] <OndraSter> I like my solution
[05:41:18] <theos> i like both
[05:41:40] <theos> voltage dividers get weird when the load increases though
[05:41:43] <OndraSter> or use xmega, they have internal vcc/10 divider and can select it as ADC source :P
[05:41:59] <OndraSter> with 12bit ADC
[05:42:07] <theos> xmega must be twice as costly as mega i bet
[05:42:59] <OndraSter> not really
[05:43:03] <OndraSter> xmega is often cheaper actually :)
[05:43:08] <OndraSter> but there are no DIP versions
[05:43:16] <theos> the thing is, if the voltage decreases, then everything messes up again
[05:43:28] <OndraSter> how come?
[05:45:19] <theos> lets say i have 5v. i use a voltage divider. and after sometime it decreases to 4.5v, the ratio will change
[05:45:24] <OndraSter> no
[05:45:28] <OndraSter> it is fixed divider
[05:45:35] <OndraSter> let's say 500k and 100k resistors
[05:45:41] <theos> unless i have military grade components
[05:45:44] <OndraSter> ?
[05:45:50] <OndraSter> the ratio will not change
[05:45:54] <OndraSter> it is goddamn resistor :P
[05:45:54] <OndraSter> not diode
[05:46:04] <theos> resistors have error margins :P
[05:46:09] <OndraSter> yes
[05:46:11] <OndraSter> but they will be the same
[05:46:14] <OndraSter> no matter what voltage
[05:46:20] <theos> >.>
[05:46:21] <OndraSter> unless you are going down to 0.x level
[05:47:50] <theos> hmm
[06:17:30] <WormFood> http://www.csgnetwork.com/vswrlosscalc.html <-- is their math on this right? They say a 3:1 VSWR is 25% power loss...then say if you output 100 watts, you'll lose 20 watts, and have 80 real watts of output.....shouldn't that be 25/75 watts of loss/output?
[06:18:58] <jacekowski> WormFood: it's relative
[06:19:08] <WormFood> *everything* is relative :P
[06:19:09] <jacekowski> WormFood: they may be calculating loss based on amount of delivered power
[06:19:23] <WormFood> 25% loss on 100 watts would be 25 watts
[06:19:33] <WormFood> 25 watts lost, 75 watts out
[06:19:59] <jacekowski> nah, that means 100W is 125%
[06:20:13] <WormFood> at 1:1 VSWR their math is correct
[06:20:57] <WormFood> how can you lose 20 watts out of 100 watts, and say that is 25% loss?
[06:21:02] <WormFood> notice they say "Loss in %"?
[06:21:54] <jacekowski> you are working on output power
[06:22:00] <jacekowski> not whatever you have before it
[06:22:12] <WormFood> PowerOut=10*log10(Output_Power());
[06:22:47] <jacekowski> but hmmm
[06:23:18] <jacekowski> nah, that looks fine
[06:23:44] <WormFood> document.LossVSWR.PowerOut.value= formatvalue(((10*log10(PowerOut))+30), 5); <-- and why are they adding 30 there?
[06:25:08] <WormFood> http://www.wcerc.org/swrlosschart.asp chart, shows what I calculated
[06:25:28] <WormFood> are they calculating different things?
[10:22:21] <theos> hey is there a way to stop execution after a command without an endless loop?
[10:27:23] <OndraSter> sleep mode
[10:27:29] <OndraSter> disable CPU clock :)
[10:27:53] <OndraSter> but you will need infinite loop that enters sleep mode :D
[10:28:05] <OndraSter> otherwise when it jumps out from interrupt routine it will not suspend the core again
[10:28:11] <OndraSter> unless you give it "sleep" again
[10:53:45] <theos> thanks :D
[10:53:59] <theos> something other than sleep?
[10:55:06] <Corwin> why you dont like endless loops ?
[10:56:22] <`Wedge> because they remind you about infinity, a thing you can never reach or touch or feel, and that you are mortal
[10:57:19] <Corwin> good reason
[11:00:04] <OndraSter> I'd use different word
[11:04:38] <Corwin> im bored
[11:04:46] <specing> Me too
[11:05:17] <Corwin> im still waiting for usb thingy to arrive... i have nothing to play with now....
[11:05:20] <Corwin> just lot of leds
[11:07:10] <Corwin> maybe connecting 120 leds together and power it directly from 230V AC :)
[11:08:10] <Corwin> OndraSter, how about your xmega boards?
[11:08:34] <CapnKernel> That's so like, like Chinese folks make Christmas lights :-)
[11:08:55] <Corwin> CapnKernel :)
[11:09:13] <jacekowski> Corwin: some xmas light do that
[11:09:39] <Corwin> and that 50hz would result in nice flickering..... or cause epilepsy
[11:10:27] <jacekowski> you can't see that
[11:10:35] <jacekowski> you can see like a flicker
[11:10:40] <jacekowski> but at the same time you don't see it
[11:12:11] <theos> hmm
[11:13:17] <OndraSter> Corwin, still in Eagle
[11:13:53] <Corwin> you sent eagle with the design to pcb manufacturer? wouldnt email be faster?
[11:15:38] <OndraSter> :)
[11:17:36] <OndraSter> time to go
[11:17:37] <OndraSter> bb
[12:10:20] <GuShH> Corwin: he usually goes by mule, so an eagle is a step up.
[12:20:18] <grummund> mules can be pretty fast
[12:47:16] <amee2k> GuShH: http://www.co2air.de/wcf/images/avatars/avatar-5784.jpg << I HAZ PIX OF FROGS \o/
[12:49:04] <CapnKernel> amee2k: Seek help.
[12:49:20] <amee2k> CapnKernel: what?
[12:50:23] <RikusW> grammer ;)
[12:50:30] <RikusW> *grammar
[12:50:38] <RikusW> and spelling too
[12:50:49] <amee2k> grammaritis
[12:51:05] <RikusW> spellitis..
[12:51:16] <amee2k> exactly that animal
[12:51:58] <RikusW> textites: a common disease amoung im users
[15:00:27] <poohbear82> is this forum about AVR? the chips?
[15:45:28] <Tom_itx> Poo\
[21:16:17] <ylere1> hi, how can I recover a atmega328p with wrong fuse settings? I think I accidentally set the wrong clock settings. Unfortunately, it's a QFN package and the atmege is connected to a 16Mhz oscillator. A solution where I don't have to desolder everything would be appreciated therefore. I have access to the ISP header and a few pins.
[21:17:37] <Tom_itx> so do you know what you set it to?
[21:18:27] <Tom_itx> you can make an oscillator from another avr and clock the xtal pin after you remove the oscillator
[21:18:42] <Tom_itx> it may work with it there but it may not
[21:19:07] <ylere1> what frequency do I need?
[21:19:09] <Tom_itx> it needs to be 4x your isp program frequency
[21:19:14] <Tom_itx> so set that low
[21:19:22] <Tom_itx> default is 125khz iirc
[21:22:16] <ylere1> ok, so if I create a 1mhz signal with another avr and connect it to xtal(1?), maybe I can reprogram it? I think I've set it to either low power or low frequency oscillator, since these are the options next to the one I wanted to use.
[21:22:43] <Tom_itx> it should work, check your data sheet to make sure it's xtal1 or xtal2
[21:23:04] <Tom_itx> it will tell you which one can be used for external clock input
[21:23:29] <ylere1> ok, I will try this. thank you very much. are there any options if this fails?
[21:23:51] <Tom_itx> hvpp
[21:26:55] <ylere1> google tells me this needs pins I that are not accessible by the pin headers I have. let's hope the first option works. thank you for your help!