#avr | Logs for 2012-11-23

Back
[02:21:48] <ja2> How evil! Usart 9600 8E1 works but 7E1 send crap. What is wrong? The setting at uC and terminal program match at all times.
[02:26:33] <yunta> ja2: are you using usb2<->rs232 converter?
[02:28:33] <ja2> yunta: Yes, and I've been thinking about it. But the problem seem to occur even when I let two uCs talk to eachother.
[02:29:25] <yunta> do you have an oscilloscope ? to look at transmission
[02:30:01] <ja2> Only analog oscilloscope, so I dont catch the signal properly. :(
[02:31:03] <ja2> Hmm, maybe I can make it trigger better.
[02:31:19] <yunta> what about some additional microcontroller that you could use to peek on rs232?
[02:31:30] <OndraSter__> setting up trigger is an art sometimes
[02:31:35] <yunta> (on/at ?)
[02:32:31] <ja2> Yes, but this implementation IS the RS-232 peeker! :) I got two RS232 on it, so I just pass stuff. But while testing I ran into trouble and fell back to echo-test, finding out 7E1 wracks the whole thing.
[02:32:53] <ja2> Very strange.
[02:33:04] <OndraSter__> why are you trying to use 7e1 anyway?
[02:33:05] <OndraSter__> speed?
[02:33:21] <yunta> my point is to peek by reading logic levels, without using usart hw in uc
[02:33:44] <ja2> No, this will be a general rs232 tool, so I got a menu and config baudrate and parity etc.
[02:34:34] <ja2> yunta: Ok, I will see if I can find out exactly what is transmitted from each end.
[02:35:43] <yunta> also, for scope, maybe just: send same byte over and over again, and trigger by fixed frequency
[02:35:52] <ja2> u
[03:08:48] <ja2> Oh, dear. It IS the usb<->rs232 converter. Tried another one, and it seem to work diffrently. But that only solve half of the problem. When settings are different on both ends, e.g. 7N1 and 7E1, my prog ends up in forever rx interrupt .
[03:11:11] <yunta> ja2: you may want to switch to atxmega??u with hw usb connection straight to pc, without any rs232/uart on the way
[03:12:10] <ja2> Yes, or 32u4.
[03:13:13] <OndraSter__> 32u4/32u2 is more expensive :)
[03:13:16] <OndraSter__> than xmega
[03:14:31] <ja2> Good point. Thanks for the support guys!
[03:19:58] <yunta> ja2: http://mikoton.com/images/osc.png <- screenshot from rs232 transmission caught with custom made oscilloscope (2 days of building and coding)
[03:22:05] <yunta> s/custom/home/
[03:23:39] <ja2> yunta: Cool. The problem I had with analysing with oscilloscope was that the usb-rs232 converter send properly, but it does not receive correct when paritybit is set. How strange.
[03:25:04] <yunta> strange indeed. another reason not to trust them bloody usb converters :(
[03:35:42] <OndraSter__> Smart person: Goes to New Zealand to look for opportunities (as geodetist). Does not know English on usable level.
[03:38:21] <karlp> they don't speak english there anyway, they speak kiwi
[04:13:09] <ZinovaS> how should I write while(done<0x4fff); for it to work
[04:13:56] <ZinovaS> now, it never get past the loop. unless I do some printing to USART inside the loop
[04:15:38] <ZinovaS> done variable is increased (and prinded to USART) in the interupt so its value is as expected...
[04:22:42] <yunta> try marking done as volatile
[04:30:19] <ZinovaS> thanks yunta, that solved the problem
[04:35:57] <yunta> np
[05:56:48] <jadew> hey OndraSter
[05:58:24] <OndraSter> hey jadew
[05:58:54] <jadew> I remember you said you started to build a function generator around the ad9834
[05:59:04] <jadew> did you try the onboard comparator?
[05:59:19] <jadew> I'm wondering what kind of square waves its generating
[06:01:35] <OndraSter> I did only schematic and then started board
[06:01:43] <OndraSter> but I switched to xmega and needed some dev board with it
[06:01:47] <OndraSter> that's when I started xboard :D
[06:02:11] <jadew> ah
[06:02:47] <jadew> I only have one so I can't really use it to test stuff, since it's going to be a pain to desolder
[06:03:21] <jadew> I'm just testing the additional circuitry and I'm having trouble generating a square wave out of the sine wave at high freqs
[06:08:39] <jadew> actually, that'
[06:09:24] <jadew> that's not the real problem, the real problem is rectifying it, since I'm generating it with a fast opamp in comparator config, but it's swinging from -5 to +5
[06:14:36] <inkjetunito> i need to order a new dmm. is there a reason why one shouldn't buy a Fluke these days? i mean, is the quality still ok?
[06:18:27] <Horologium> I like Fluke...
[06:18:33] <Horologium> but mine are about 10 years old.
[06:20:21] <inkjetunito> yeah. sadly the local shops don't have any flukes to try out. i can only order one :S
[06:41:12] <Amadiro> Horologium, I hope you calibrate that every once in a while
[06:42:06] <Horologium> nope...but, don't use them for anything critical..mostly, is there juice here, what's my current draw there(on the clamp meter)
[06:42:30] <Horologium> if it registers around 5V when I want 5V and 110V or so when I'm checking mains I'm happy.
[06:43:17] <Amadiro> I don't really know which parts (current sensing, voltage sensing, ...) drift in particular, but I've heard they can drift fairly badly over long time if you don't re-calibrate them every once in a while
[06:44:15] <Amadiro> if the resistance sensing ended up being wrong by like 200 ohms or so, that'd certainly be really annoying
[06:44:31] <Horologium> yup.
[06:44:51] <Horologium> I generally use this ancient analog meter for small resistances...got it from my grandpa and it rocks.
[06:45:17] <Horologium> bakelite case is cracked and I've had to hack in a different battery because the old one in it I can't find anymore.
[06:45:29] <Amadiro> get some high-precision resistors and test the precision, I guess
[06:45:48] <Horologium> was his when he was doing phone work 50 years ago or so.
[06:46:01] <Horologium> that one I calibrate.
[06:53:25] <pingec> Anyone know what is the purpose of such wiring of a cat5 http://i.stack.imgur.com/MJms3.gif ?
[06:58:05] <OndraSter> read it :)
[06:58:07] <OndraSter> economiser
[06:58:14] <OndraSter> for 100Mbit you need two pairs
[06:58:25] <OndraSter> regular UTP cable has got four pairs
[06:58:46] <OndraSter> ergo you can use one cable to transfer two "computers"
[06:59:05] <OndraSter> of course on the other side it has to be done that way too
[06:59:41] <karlp> yeah, because the price of labour when you have to have anyone do any work on such a network will totally save you money
[07:00:03] <OndraSter> no
[07:00:13] <OndraSter> but it will save you having to run two sets of wires in the wall/anywhere
[07:00:21] <Horologium> problem is, you get some nasty crossover and data loss doing that at times.
[07:00:31] <Horologium> this I know from experience.
[07:00:34] <OndraSter> hehe
[07:00:41] <OndraSter> also no Gbit :P
[07:00:42] <Horologium> 10Mb/s works ok that way but 100Mb/s goes batshit at times.
[07:00:49] <Horologium> yeah...gigabit just won't work.
[07:01:13] <Horologium> splitting out pairs is great for phone but not for high frequency data.
[07:02:20] <pingec> OndraSter ah ok
[07:02:33] <pingec> the problem was that in my head i was emagining that diagram as being the whole cable
[07:02:36] <Horologium> and you know the different pairs are twisted differently.
[07:02:44] <Horologium> pingec, that diagram is a patch cable.
[07:02:47] <Horologium> you need 2 of them.
[07:02:54] <pingec> exactly
[07:02:56] <Horologium> one at either end of the plugs in the wall.
[07:03:01] <pingec> that makes sense
[07:03:14] <pingec> cool thanks
[07:03:19] <Horologium> it totally breaks the standard.
[07:03:29] <Horologium> and you get nasty things happening at high speeds.
[07:03:30] <OndraSter> rape the standards...
[07:07:05] <pingec> as logn as it works
[07:07:07] <pingec> im happy
[07:08:04] <OndraSter> pls don't let me fix any of your products later, thanks :)
[07:09:08] <pingec> well if you want you can come install an additional cable :D
[07:10:01] <OndraSter> :D
[07:10:05] <OndraSter> nothx
[07:10:16] <rue_bed> it it allready a netwrok line or is it a tel line?
[07:10:23] <karlp> yeah, fun times, works today, doesn't work on a different network card tomorrow
[07:10:24] <pingec> network
[07:10:32] <pingec> i need 2 x network connection
[07:10:33] <rue_bed> then why not just stick on a switch?
[07:10:46] <pingec> separate networks
[07:11:13] <rue_bed> then get a managed switch }:]
[07:12:14] <pingec> ill think about it
[07:12:18] <rue_bed> mhm
[07:12:36] <jadew> I'm not sure it's a great idea to use the same cable for two connections
[07:12:51] <rue_bed> its a fudge
[07:13:03] <pingec> i will try and see if it works
[07:13:07] <rue_bed> china sells 'splitters' for about $1
[07:13:39] <jadew> pingec, it will work, but you might end up with a slow connection at some point
[07:13:42] <pingec> cheaper than buying managed switches :)
[07:13:47] <jadew> when you're having traffic on both
[07:13:59] <pingec> jadew ill test it out
[07:14:00] <rue_bed> cheap? go wireless
[07:14:37] <jadew> gigabyte switches are cheap now
[07:15:01] <pingec> I need to get iptv over 1 cable
[07:15:06] <pingec> and internet over second
[07:15:08] <rue_bed> jadew, if he's insisting on different networks
[07:15:17] <pingec> I cannot use wireless for that
[07:15:17] <karlp> he's insisting on madness
[07:15:38] <karlp> use one cable.
[07:15:39] <rue_bed> its more ugly than mad
[07:15:54] <karlp> two managed switches and dot1q if you insist so much.
[07:16:03] <pingec> thats expensive
[07:16:13] <pingec> the cheapest solution is to split the cable
[07:16:26] <pingec> I will try, if it works cool, if not I'll look for a better solution
[07:16:47] <jadew> it will work
[07:16:56] <jadew> it's just a bad idea
[07:19:03] <jadew> on the other hand, I'm sure the network card or whatever you have there will be able to deal with it
[07:20:40] <pingec> how much does a managed switch cost?
[07:20:46] <pingec> I'd need two of them right?
[07:21:30] <jadew> I have a linksys wireless router on which I installed openwrt
[07:21:43] <jadew> once you have linux in there you can create two networks on the same device
[07:22:26] <pingec> I'd need to create vlans right?
[07:22:44] <jadew> no
[07:22:44] <pingec> I wonder about the performance
[07:23:09] <pingec> What then? I don't want the router to touch ip traffic
[07:23:15] <pingec> its multicast
[07:23:26] <jadew> it won't, you just tie together some ports
[07:23:41] <jadew> it's like saying "port 1, port 2, port 3" - that's one
[07:23:46] <jadew> "port 4 and port 5"
[07:24:09] <jadew> and then there won't be any cross talk between networks
[07:25:37] <rue_bed> are they different networks?
[07:25:49] <jadew> rue_bed, you're asking me or him?
[07:26:01] <pingec> yes completely
[07:26:02] <rue_bed> like they aren't both 192.168.0.* right?
[07:26:08] <pingec> one is IPTV network
[07:26:15] <pingec> the other is internet access network
[07:26:19] <rue_bed> are they both in privite ip address ranges?
[07:26:27] <pingec> no
[07:26:39] <pingec> one is, one is not
[07:26:53] <rue_bed> so one is 192 and the other isn't 10. or ... otherwise
[07:27:01] <rue_bed> I cant remember the 3rd range
[07:27:10] <rue_bed> 162.?
[07:27:49] <OndraSter_> 172.?
[07:28:03] <rue_bed> by the way, this is SO TOTALLY off topic for this channel...
[07:28:09] <rue_bed> yea, that one..
[07:28:40] <rue_bed> heh, my networking is getting rusty
[07:28:45] <Tom_itx> so why did you bring it up?
[07:28:52] <pingec> well, thanks for explaining the ehthernet splitter
[07:28:52] <Tom_itx> and feed it
[07:28:59] <rue_bed> why are you awake!?
[07:29:12] <Tom_itx> i been up for 4 hrs already
[07:29:31] <rue_bed> I fell asleep early and I'm awakeish
[07:30:07] <Richard_Cavell> Tom_itx: I've been using your little LUFA-based AVRISP for a while now. It's working well.
[07:30:10] <Tom_itx> i'm headin out in a bit
[07:30:17] <Richard_Cavell> I heartily recommend this event or product
[16:16:41] <jadew> lol, in an analog devices note there are a few quotes: "after it has worked successfully for two weeks, it will fail during the first public demonstration"
[16:16:52] <jadew> and the best: "equipment blows to protect fuses"
[17:06:25] <GuySoft> hey all, does anyone have a way here to convert a hex string "FF" to its true binary value? (in this case 255) ?
[17:07:16] <Richard_Cavell> strtoul
[17:09:06] <GuySoft> Richard_Cavell, um, I need its byte value
[17:09:10] <GuySoft> Richard_Cavell, not a long
[17:09:19] <slidercrank> GuySoft, to what value? to decimal (255) or binary 11111111?
[17:09:20] <Richard_Cavell> that's the correct answer
[17:09:26] <Richard_Cavell> cast to an unsigned int
[17:10:24] <slidercrank> oh, you want to convert a number as a text to an actual number
[17:10:27] <GuySoft> slidercrank, i need the string "FF" to be returned as an uint8_t
[17:12:00] <Richard_Cavell> (uint8_t) strtol("FF", NULL, 16);
[17:12:07] <Richard_Cavell> and #include <stdlib.h> at the top of your code
[17:17:59] <GuySoft> Richard_Cavell, thanks, lets try this
[17:18:31] <Richard_Cavell> if your input is always unsigned it might be slightly more correct to use strtoul instead of strtol
[17:22:47] <OndraSter_> There are only two hard problems in Computer Science: cache invalidation, naming things, and off-by-one errors.
[17:32:25] <Horologium> Richard_Cavell, I usually just write a simple one.
[17:34:04] <GuySoft> Richard_Cavell, hmm, does not seem to work, not sure why
[17:34:13] <Richard_Cavell> does it compile?
[17:34:57] <Horologium> little routine that looks at the first character,
[17:35:26] <GuySoft> ok got it :)
[17:36:29] <Richard_Cavell> don't reinvent the wheel. Use standard library functions
[17:37:35] <Horologium> for each character,,,if ascii code is > 47 and less than 57 then subtract 48 from ascii...else if ascii code is > 64 and < 71 then subtract 55 from ascii...then for first character multiply by 16 and add to second character.
[17:38:38] <Richard_Cavell> you're reinventing the wheel
[17:38:58] <Horologium> ayup.
[17:39:02] <Horologium> always do.
[17:40:58] <Tom_itx> or left shift a couple times
[18:01:20] <TechIsCool> I have a question about an atxmega32a4u. The TCx0 are output to PORTx does that mean that each one of the ports have a timer TCx0 or the timer is attached to all of them
[18:16:05] <Tom_itx> hmm. if you ever need an lcd sheet: http://www.beyondinfinite.com/library.html
[18:18:09] <TechIsCool> Tom_itx: Bookmarked worth having thx
[18:26:44] <Jan-> hihi
[18:27:04] <Jan-> we have an AVR device here which used to work OK, but has recently become flaky unless we manually reset the micro after powering on.
[18:27:20] <Jan-> We're not aware of having changed anything other than that it's now running on batteries rather than a bench PSU.
[18:28:14] <Jan-> It's an attiny13A and it's set to 9.6MHz clock, start up time is 14 clocks + 64ms
[18:28:17] <Jan-> any suggestions?
[18:29:20] <Horologium> bench supply was a regulated 5V supply?
[18:29:41] <Horologium> TechIsCool, looking into that..gimme a few to download datasheet.
[18:29:49] <Jan-> well no, it was a regulated 12V supply, but there's a 7805 on the board
[18:30:14] <Jan-> which seems to give us about 4.8v, but again, that was the same 7805 before and it didn't give trouble
[18:30:31] <Horologium> and you are now powering it with what voltage?
[18:31:00] <Jan-> 4S1P lithium ion
[18:31:09] <Horologium> not what batteries.
[18:31:11] <Jan-> but again, via the 7805, so...
[18:31:12] <Horologium> what VOLTAGE?
[18:31:31] <Jan-> Well it'll vary as the batteries do, but probably 15v when they're fresh
[18:32:18] <Horologium> and still getting 4.8V out of the 7805?
[18:32:28] <Jan-> I think so, I'll get him to check :)
[18:32:45] <Jan-> Weirdness: it seems to never ever fail on a power cycle while the programmer is plugged in.
[18:32:55] <Malinuss> evening
[18:33:12] <Horologium> TeknoJuce, nevermind my checking..I know squat about xmega..sorry...maybe someone else can look at it.
[18:35:17] <Jan-> 5.03 at the moment
[18:35:25] <Jan-> possibly plus or minus the 0.3
[18:35:51] <Horologium> within spec for the chip though.
[18:36:20] <Horologium> so, I'm clueless...as usual.
[18:36:22] <Jan-> hmm I think we may be on to something though
[18:36:28] <Jan-> with the programmer attached it's 5ish
[18:36:36] <Jan-> without it's 4.8
[18:36:59] <Jan-> and the trouble returns
[18:37:08] <Jan-> but isn't 4.8 in spec too?
[18:39:45] <Jan-> OK fine this particular 7805 doesn't like being fed with too high a voltage and that really does seem to be what's causing the problem
[18:39:52] <Jan-> it seems to over-regulate
[18:48:05] <Horologium> 7805 should be fine at 15V unless it is an LDO version.
[18:48:15] <Jan-> It isn't.
[18:48:41] <Jan-> I think part of the problem may be that when the thing is switched on, it's controlling, via a big fet, a large (24W) LED cluster
[18:48:56] <Jan-> which does flash for a brief moment as the micro powers up
[18:49:05] <Jan-> if we fire it up without that load connected, it's fine
[18:49:20] <Horologium> aahh.
[18:49:26] <Horologium> overloading the power supply then.
[18:49:39] <Horologium> your battery not able to provide the necessary current maybe?
[18:49:53] <Jan-> I guess it's just being browned-out somehow, but I'm surprised a) the brownout detection doesn't get it, b) the battery pack is somehow less able to dish out the goods than the 2A bench power supply, and c) the 7805 doesn't fix the problem.
[18:50:14] <Jan-> Well the battery is four 18650 cells in series, it should be pretty capable.
[18:51:20] <Horologium> that could be your problem.
[18:51:36] <Horologium> that LED cluster is likely drawing way more than the batteries are capable of providing.
[18:51:39] <Jan-> what's weird is that if we run it from a 7.2v battery, all is well
[18:51:45] <Horologium> lithium batteries do have a limited max current.
[18:51:52] <Jan-> I guess the LEDs have a really nonlinear current curve though
[18:52:05] <Jan-> so they'll be drawing way less than half current on half volts.
[18:52:40] <Jan-> I'd be absolutely astonished if a 4s1p lithium ion pack of laptop cells couldn't dish out 24 watts without drooping
[18:52:56] <Horologium> put an ammeter in line with the batteries and watch what it does.
[18:53:02] <Horologium> an analog ammeter is the best for that.
[18:53:17] <Jan-> that's gonna be hard, given the device is basically a strobe with very short output duration
[18:53:47] <Horologium> try this then....parallel 2 sets of 4 batteries.
[18:54:00] <Horologium> I know, not a good thing with lithiums...put diodes in line with each set.
[18:54:02] <Jan-> well, they're boxed battery packs
[18:54:12] <Jan-> we have nicds too
[18:54:18] <Jan-> they are really capable of chucking out current
[18:54:21] <Horologium> either way, parallel 2 sets and see what happens.
[18:55:03] <Horologium> went through this yesterday with someone who bought a lithium based replacement for his 20Ah 12V SLA battery for his mower.
[18:55:15] <Horologium> the mower would hardly spin.
[18:55:16] <Jan-> I think no matter what we'll probably end up putting a "reset" button on the box :)
[18:56:23] <Horologium> turns out the lithium cell pack was limited to 20A where his SLA was capable of putting out 300A and the mower was drawing waaay more than the lithium batteries could put out.
[18:56:25] <Jan-> Well these are realistically 2Ah li-ion cells
[18:56:42] <Jan-> and a 24W load is therefore only about 1C for them
[18:56:54] <Jan-> which they should be easily capable of, even if they're super cheap chinese cells (which they are)
[18:56:59] <Horologium> but what is their max load?
[18:57:44] <Horologium> try putting a big honking cap across the input side of the 7805.
[18:57:59] <Jan-> The thought had occurred :)
[18:58:27] <Horologium> like a 4700uF even.
[18:59:38] <Jan-> we don't have data for these exact cells but usually lithium ion is good up to 2C
[18:59:50] <Jan-> Wow that would be a bigger cap than the entire board :)
[19:00:16] <Horologium> do it as a temp test and see what happens.
[19:00:44] <Jan-> I suspect what'll happen, if the cap is discharged, is that it'll actually stop the micro even trying to start up until it's charged.
[19:00:50] <Jan-> and thus feasibly solve the problem
[19:01:27] <Jan-> hm you know what it may be
[19:01:39] <Jan-> these are "12V" LEDs, or rather LED strip with resistors for 12V.
[19:01:51] <Jan-> But this fresh li-ion battery is a few more volts than that
[19:02:05] <Jan-> so the instantaneous current may be considerably more than would be indicated by the 24W paper rating of the LEDs.
[19:02:51] <Jan-> Anyway I'm going to sleep
[19:02:53] <Jan-> nini all, and thanks!
[19:05:19] <jorgeing> Hi everyone, I have some problems with my project and I hope you could help me. http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=1013531#1013531
[19:05:40] <jorgeing> thanks you for your time
[19:11:08] <Horologium> jorgeing, no clue..looks like a windows permissions issue but I could be totally wrong.