#avr | Logs for 2014-09-20

Back
[00:19:02] <evil_dan2wik> Casper, opto-isolators?
[00:21:08] <Casper> too slow
[00:21:46] <Casper> the issue is that I2C use bidirectional open-drain lines
[01:53:05] <evil_dan2wik> Casper, magic level conversion.
[02:01:18] <nofxx> Casper, ADuMs ?
[02:25:55] <rue_mohr2> theBear,
[02:25:57] <rue_mohr2> theBear,
[02:26:02] <rue_mohr2> yo
[02:26:04] <rue_mohr2> hey
[02:26:06] <rue_mohr2> theBear,
[02:26:23] <rue_mohr2> where is rifraf
[03:59:06] <anton02> what is a good way to establish conductive contact with a wire when the contacting wire is going to be moving and following the length of the stationary wire?
[08:47:08] <Casper> <nofxx> Casper, ADuMs ?
[08:47:09] <Casper> ????
[08:48:20] <Lambda_Auriga_> Active Directory micro Mutts?
[08:51:32] <Thrashbarg> perhaps a cat walked across the keyboard
[11:39:17] <mheld> when I put my avr into sleep mode and it gets woken up via an RTC callback -- do i have to put it back into sleep mode?
[12:11:15] <ivanshmakov> mheld: Once your AVR is awake, – it only goes asleep on command.
[12:11:32] <mheld> ok, that makes sense
[12:12:31] <mheld> ivanshmakov: so I should call sleepmgr_enter_sleep() once I've done what I need to do, yeah?
[12:13:12] <mheld> I dunno why I have that wrapped in a while loop
[12:13:20] <mheld> while(1) sleepmgr_enter_sleep()
[12:15:06] <mheld> ivanshmakov: http://pastie.org/private/rsnr3mphegqbvwxm8sdya something like that?
[12:23:00] <ivanshmakov> mheld: I know nothing of sleepmgr_enter_sleep (). At the very least, there seem to be no such function in AVR Libc, so it’s, well, specific to the library you use. (Are you sure it’s /AVR/ you’re programming, BTW?)
[12:34:39] <mheld> Yup it's the special ASF stuff
[12:34:59] <mheld> (atmel studio)
[12:37:12] <ivanshmakov> mheld: Sorry, I have no experience with that myself. But assuming that your code is purely interrupt-driven (so to say), your main loop may indeed contain only a ‘sleep’ instruction. Then, however, you won’t need such instruction anywhere else in the code.
[12:37:53] <ivanshmakov> mheld: That is: after the interrupt routine is over, the control is returned to the main loop, which immediately issues one another ‘sleep’ perfectly by itself.
[12:38:26] <ivanshmakov> (I have a personal preference /against/ such a coding style, however.)
[12:44:21] <Bushman> ave
[12:45:35] <Bushman> what can be the reason that UART is causing interference on PWM on a timer1?
[12:46:10] <Lambda_Auriga_> do you have an oscope?
[12:47:05] <mheld> ivanshmakov: how would I figure that out?
[12:47:46] <ivanshmakov> mheld: What specifically?
[12:48:00] <mheld> ivanshmakov: whether or not it goes back into sleep mode?
[12:48:31] <mheld> oh hmm
[12:48:38] <mheld> apparently it sleeps itself
[12:48:41] <mheld> if it's in that while loop
[12:48:58] <ivanshmakov> mheld: Assuming that your interrupt handler gets fired less than a few of times per second, you can toggle a LED from your main loop.
[12:49:19] <mheld> I don't have one to toggle :-(
[12:49:22] <mheld> it's all good though
[12:51:31] <ivanshmakov> mheld: Then you can measure the power consumption (as in: the Vcc or Gnd current) with and without ‘sleep’.
[12:54:39] <Bushman> Lambda_Auriga_: no, i don't. :(
[12:54:57] <Lambda_Auriga_> then it might be difficult tracking it down.
[12:55:01] <Bushman> Lambda_Auriga_: but i've tried to get rid of interference...
[12:55:14] <Lambda_Auriga_> do you have a nice decoupling cap by the power and ground pins of the avr?
[12:55:21] <Bushman> i've added few filtering capacitors on VCC close to both, the mcu and the 485 interface and i've also run the servo from external power... to no avail.
[12:55:26] <Lambda_Auriga_> and plenty of current capacity?
[12:55:30] <mheld> ugh, I respect all y'all embedded HW/firmware guys
[12:55:34] <mheld> this shit is *hard*
[12:55:39] <Lambda_Auriga_> it's not hard.
[12:55:51] <Lambda_Auriga_> no different from programming commodore vic-20 back in the 80s.
[12:55:52] <mheld> eh, I'm just functionally retarded
[12:56:05] <Lambda_Auriga_> simpler even as we have more powerful tools to do it with.
[12:56:33] <Lambda_Auriga_> more like you got used to bigger computers and just have trouble wrapping your head around the smaller stuff.
[12:56:35] <Bushman> Lambda_Auriga_: i have 7805 for just the MCU and RS485 interface. should be a whole lot plentifull
[12:56:38] <ivanshmakov> Lambda_Auriga_: Lucky me, – we’re programming Spectrums here in our locality almost right into the 2000ies.
[12:57:13] <Lambda_Auriga_> awesome little toys there ivanshmakov
[12:57:31] <Lambda_Auriga_> had a sinclair ZX81 in the day...with the 16KB expansion!
[12:58:01] <Bushman> Lambda_Auriga_: the servo + is directly from battery so should not interfere with VCC
[12:58:13] <Lambda_Auriga_> should...
[12:58:17] <Lambda_Auriga_> operative word there.
[12:58:41] <Lambda_Auriga_> what voltage is the battery?
[12:59:54] <Bushman> 3cell lipo
[12:59:59] <Bushman> 12.4
[13:00:14] <Bushman> 12.6 sorry
[13:00:25] <Lambda_Auriga_> over 7.2V at least.
[13:00:35] <Bushman> sure thing!
[13:00:49] <Bushman> the v-reg has lots of spare voltage
[13:01:00] <Lambda_Auriga_> too often people try to feed 6V into a 7805.
[13:01:05] <Bushman> heh
[13:01:12] <Bushman> in that case i'd use LDO
[13:01:30] <mheld> I can't figure out how to kill power consumption on my board
[13:01:32] <Bushman> but no, it's standard 7805 in TO220
[13:01:34] <mheld> this is irking the hell out of me
[13:01:39] <Lambda_Auriga_> without a scope to look at the lines it might be difficult to see what's going on.
[13:01:54] <Lambda_Auriga_> mheld, got a schematic?
[13:02:04] <Lambda_Auriga_> mheld, how are you powering it?
[13:02:20] <Bushman> Lambda_Auriga_: the PWM works fine untill i plug in the 485 line
[13:02:27] <mheld> Lambda_Auriga_: I do and 3.7V battery pack
[13:02:57] <mheld> I mean, I can't change the design right now
[13:02:57] <Lambda_Auriga_> Bushman, sounds like some kind of feedback from the 485....you using an isolator chip or what?
[13:03:09] <mheld> because I have about 100 of these boards that I need to ship out tomorrow
[13:03:22] <mheld> just need to figure out how to get GPS/GSM to play nice
[13:03:25] <Bushman> sp485ec
[13:03:31] <Lambda_Auriga_> mheld, most often excess current draw is a hardware issue.
[13:04:23] <Bushman> http://pdf.datasheetcatalog.com/datasheet/sipex/SP485EEN.pdf
[13:05:10] <Lambda_Auriga_> hmm.
[13:05:12] <Lambda_Auriga_> no isolation.
[13:05:25] <mheld> Lambda_Auriga_: https://dl.dropboxusercontent.com/u/63726/schematic.png
[13:06:15] <Bushman> Lambda_Auriga_: well, no opto, but it's battery powered and not grounded, optionaly grounded by DMX line
[13:06:37] <Bushman> XLR pin 1
[13:06:46] <Lambda_Auriga_> if it's not grounded, how do you get power to it?
[13:06:51] <Lambda_Auriga_> VCC and GND are your power.
[13:06:57] <Bushman> yes
[13:06:59] <mheld> maybe I can save some power by completely shutting down the GSM module
[13:07:10] <Bushman> oh...
[13:07:11] <mheld> GPS seems to use up the same amount of power no matter what I throw at it
[13:07:46] <Lambda_Auriga_> and that lm3940 is a linear regulator...that's just bleeding off excess power as heat.
[13:08:43] <Lambda_Auriga_> even if it is an LDO
[13:08:52] <Bushman> Lambda_Auriga_: i power it from battery and 7805. but it's not grounded literally
[13:09:29] <Lambda_Auriga_> Bushman, grounding is such a relative term, specially in DC non-RF applications.
[13:09:37] <Bushman> yea
[13:10:08] <Lambda_Auriga_> again, without a scope to look at the noise and such on the lines, no way to know, at least for me..
[13:10:24] <Bushman> i was just not sure you were talking to me or mheld so i've specified it just in case
[13:11:01] <Lambda_Auriga_> and for rs485 I always go with optoisolation...fits the specifications much better.
[13:11:13] <Lambda_Auriga_> I use chips with opto built in.
[13:11:47] <Bushman> i see
[13:11:59] <Bushman> any specific chip?
[13:12:35] <Lambda_Auriga_> looking. I haven't done any rs485 in 8 or 10 years.
[13:13:34] <Lambda_Auriga_> http://www.maximintegrated.com/en/products/interface/transceivers/MAX1480A.html
[13:13:46] <Lambda_Auriga_> looks like what I used in the past...newer version though.
[13:15:56] <Bushman> just curious, is it self powered or do i need to provide power for the other side?
[13:22:09] <Bushman> Lambda_Auriga_: i can't see a reason why it wouldn't work on such short distances... other people succesfully use just the amp with no optos and everything works for them :(
[13:23:18] <Bushman> i can understand interference on long lines but i'm siting RIGHT NEXT TO my dmx console
[13:34:38] <mheld> I'm like || this close to tears
[13:34:41] <mheld> gah
[13:39:16] <Bushman> mheld: i'm the same, just mentaly thou.
[13:39:27] <Bushman> gah!
[13:43:48] <Lambda_Auriga_> Bushman, without having circuit to play with, no clue.
[13:44:25] <Lambda_Auriga_> but from you have said, it sounds like some kind of ground loop or feedback of something from the rs485.
[13:54:30] <Bushman> i've tried without ground and with ground from DMX cable
[13:54:35] <Bushman> same results
[13:55:06] <Bushman> also... why would a hardware counter be influenced by something from serial interface?
[13:55:35] <Lambda_Auriga_> electrical noise.
[13:55:40] <Lambda_Auriga_> or, something in the code.
[13:55:43] <Lambda_Auriga_> no clue which.
[13:55:53] <Lambda_Auriga_> need proper diagnostic equipment to figure it out.
[14:00:26] <Bushman> ok... let's start guessing... let's assume i have a scope and i can't see anything wrong on VCC or UART input...
[14:00:49] <Bushman> wcan you look at the code if there is something messing with timer?
[14:01:07] <Bushman> interrupts shouldn't influence the timers, right?
[14:01:26] <Lambda_Auriga_> shouldn't....timer should run independently of anything else....
[14:01:39] <Bushman> that's what i thought
[14:01:51] <Lambda_Auriga_> timer can trigger an interrupt obviously but that won't interfere with PWM signal.
[14:02:10] <Lambda_Auriga_> this is why we need to see the signal on the usart and pwm pins simultaneously.
[14:04:19] <Bushman> i'll try to get a hold of a scope and test it in some future...
[14:04:49] <Bushman> the problem is, where i have access to scope, i don't have DMX console and vice versa
[14:05:13] <Lambda_Auriga_> this is the problem with trying to do this kind of work without the proper tools.
[14:05:21] <Lambda_Auriga_> when things work, good and good.
[14:05:28] <Lambda_Auriga_> when they don't, you need the tools to fix them.
[14:05:49] <Bushman> in the mean time... here's the code if you feel like taking a glance at it:
[14:05:51] <Bushman> http://pastebin.com/LrVi7SnS
[14:06:45] <Lambda_Auriga_> what port and pin is the PWM on?
[14:07:26] <Bushman> i was told the usart.h looks standard but i have it from an example: http://pastebin.com/yMgrYMKM
[14:07:40] <Bushman> pwm is on oc1a
[14:07:47] <Bushman> PD5
[14:08:10] <Lambda_Auriga_> then I don't see anything obvious.
[14:08:20] <Lambda_Auriga_> but, I am about 3 drinks into drinking myself stupid today.
[14:08:43] <Bushman> that's the best kind for debuging XD
[14:09:18] <Lambda_Auriga_> if removing problems from a program is called debugging, what is it called when you put problems into a program?
[14:09:26] <Lambda_Auriga_> programming!
[14:11:29] <Bushman> haha XD
[14:11:49] <Bushman> do you know the programming murphie's laws?
[14:12:22] <Bushman> if your code right away works like expected you should be extremely suspicious.
[14:12:26] <Bushman> or
[14:12:58] <Bushman> if your code does not work like it should you should call it ver 1.0
[14:13:08] <Lambda_Auriga_> or windows
[14:13:26] <Bushman> hahah
[14:14:01] <Bushman> do you know what do you call a programmer person?
[14:14:19] <Lambda_Auriga_> if they work for microsoft, many four letter words.
[14:14:26] <Bushman> coffee-to-code compiler.
[14:14:39] <Bushman> or that too XD
[14:18:05] <Lambda_Auriga_> and that should be caffeine-to-code converter
[14:18:13] <Lambda_Auriga_> not all coders drink coffee.
[14:18:32] <Bushman> true
[14:18:42] <Lambda_Auriga_> hell, unless I fire up the campfire and pull the percolator pot out, I can't find decent coffee anywhere.
[14:18:45] <Bushman> i drink lost of CocaCola or pepsi
[14:18:46] <Bushman> :D
[14:19:10] <Lambda_Auriga_> diet coke, dew, or dr pepper here.
[14:19:11] <Lambda_Auriga_> or tea.
[14:19:20] <Lambda_Auriga_> and my tea tends to be darker than most people's coffee.
[14:19:50] <Bushman> i hate all the energy drinks or diet cokes.
[14:19:56] <Bushman> taste horrible to me
[14:20:11] <Lambda_Auriga_> I got used to diet stuff about 12 years back when I was diagnosed diabetic.
[14:20:12] <Bushman> i also like strong tea.
[14:20:17] <Lambda_Auriga_> but energy drinks are useless.
[14:20:21] <Bushman> but with a lots of sugar
[14:20:33] <Lambda_Auriga_> heck, caffeine is useless to me...I just drink soda for the flavor.
[14:21:29] <Bushman> hmm...
[14:23:17] <Lambda_Auriga_> I can drink a 2 liter of mt dew and go right to sleep.
[14:23:31] <Lambda_Auriga_> although it does help to keep the headaches at bay.
[14:31:52] <Bushman> if i enable internal pull-ups on an input port, can i simply ground the pins for 0 or is it not healthy?
[14:32:02] <Lambda_Auriga_> yup, you can.
[14:32:21] <Bushman> cool, now i need to find a dipswitch :P
[14:39:19] <Lambda_Auriga_> and, I'm off to grill hotdogs and hope I don't blow anything up..
[14:44:29] <Bushman> blowing up is fun!
[14:44:37] <Bushman> just eat the hot dogs first
[15:11:25] * theBear blows up, for fun
[16:03:45] <Lambda_Auriga_> Bushman, remove the rs485 transciever and hook up another AVR to that USART and program it to send commands like the other system would.
[16:04:07] <Lambda_Auriga_> then, if you get jittery on the servo with that talking it's most likely software, or a glitch in the chip.
[16:04:22] <Lambda_Auriga_> if no jittery that way, then it is some kind of rs485 power or ground loop issue.
[16:06:50] <theBear> did someone say disco lights ? your rs485 ground should only be connected one end and used as purely a noise shield, and if only long distances jitter you need a new 27146 or wtf that rs485 tranceiver is called... something in their output stages often gets "weak" with abuse or age... that's a protip right there
[16:07:22] <Lambda_Auriga_> theBear, he is using some non-isolated rs485 buffer chip.
[16:07:43] <Lambda_Auriga_> and when he hooks up the dmx connection the servo on the microcontroller goes nutso.
[16:08:02] <Lambda_Auriga_> sounds to me like some kind of ground loop.
[16:08:18] <theBear> there should be no common ground
[16:08:56] <Lambda_Auriga_> agreed.
[16:09:33] <Lambda_Auriga_> but he is obviously getting some kind of noise that is interfering with the hardware pwm on the chip...that or just feeding extra pulses to the system causing the servo to hickup.
[16:28:21] <theBear> agreed :)
[16:28:48] <Lambda_Auriga_> which is why I suggested a fully isolated rs485 transceiver.
[16:29:30] <theBear> it's not just a timing issue perhaps ? throwing out the servo drive routine due to what he is trying to send or not
[16:29:45] <Lambda_Auriga_> don't think so because he is using hardware pwm
[16:29:54] <Lambda_Auriga_> so it shouldn't jitter no matter what else is going on in the chip.
[16:29:58] <Lambda_Auriga_> "shouldn't"
[16:30:11] <theBear> and fully isolated ain't a bad thing, but so long as there ain't a common ground it'd take a HUGE potential difference and lots of nasty clamping at both ends to get a groundloop kinda issue
[16:30:26] <Lambda_Auriga_> yeah.
[16:30:31] <Lambda_Auriga_> and no oscope to look things over either.
[16:30:40] <theBear> mmm, if he doing it in a way the pwm can just cycle away on its own with no assistance i agree
[16:31:07] <Lambda_Auriga_> yeah..he is using a timer pwm.
[16:31:20] <theBear> a meter set to ac would likely spot that issue, look for 240 or 415vac or something silly like that between the not-connected signal lines and the place they would plug into the light
[16:31:49] <theBear> also testing with series resistance on the 485 data lines might fix/diagnose it
[16:32:26] <Lambda_Auriga_> possibly...I'm not a guru on rs485 or dmx...only played with dmx once and rs485 always with fully optoisolated interfaces.
[16:34:45] <Lambda_Auriga_> I think I need large doses of the food of the gods....POPCORN!
[16:35:56] <theBear> mmm, last few years i was able to work i was doing fulltime disco light and desk etc repairs punctuated only by going out to do gigs and things... towards the end i was 80% of the av dept, 100% of the audio dept and 100% of the repair+r/d dept (admin and teching), so there was less repairing then i spose... stupid management
[16:36:09] <theBear> you bastard ! how dare you say that when i got no popping corn
[17:08:26] <twnqx> this was hell.
[17:08:28] <twnqx> and fun.
[17:08:48] * twnqx assembled an OpenVizsla
[17:35:29] <mheld> anybody here work with ublox stuff before?
[17:37:21] <jeremyab1l> nope
[17:37:26] <jeremyab1l> or at least, I haven't :P
[18:02:45] <Bushman> Lambda_Auriga_: i'm home now...
[18:03:00] <Bushman> and i've brought a DMX console with me
[18:03:02] <Bushman> :D
[18:03:04] <Lambda_Auriga_> and I'm not drunk.
[18:03:08] <Lambda_Auriga_> much.
[18:03:09] <Lambda_Auriga_> but,
[18:03:18] <Bushman> well, you're not doing good job then
[18:03:30] <Lambda_Auriga_> ran out of ouzo.
[18:03:37] <Bushman> i've got two of my friends drunk in the mean time and you're still not drunk
[18:03:53] <Bushman> well, you're not doing good job :D
[18:03:59] <Bushman> anyway...
[18:04:09] <Lambda_Auriga_> too drunk to drive...but no alcohol left at home.
[18:04:22] <Bushman> i'll try to hook it up in a minute and i will see if i have any noise on the lines
[18:05:20] <Lambda_Auriga_> ok.
[18:06:23] <Bushman> need to haul down the scope to my room and build a proper test enviroment... brb
[18:30:46] <Bushman> i see nice square wave without any apparent noise on the uart input
[18:31:37] <Bushman> while the PWM is clean too, it obviously changes time value
[18:34:36] <Bushman> very slightly
[18:34:48] <Bushman> but the servo is sensitive enough to pick it up
[18:46:45] <Bushman> Lambda_Auriga_: well, i don't see any electrical interference on the UART RXD nor on PWM output
[18:47:12] <Tom_itx> does that mean it's fixed now?
[18:48:23] <Bushman> no, that means yet another posible reason was busted and the problem remains
[18:49:45] <Lambda_Auriga_> do you have a pullup resistor on the reset pin?
[18:50:29] <Bushman> yes
[18:52:04] <Bushman> and a capacitor to the ground
[18:54:27] <Lambda_Auriga_> so the pwm output changes frequency? or there are extra pulses in there?
[18:54:40] <Bushman> umm...
[18:55:02] <Bushman> i'm not sure about frequency... let me see if i can even notice it...
[18:56:13] <Bushman> can't really say
[18:56:23] <Bushman> the scope is really wobly :P
[18:57:10] <Bushman> but when i look only on the up part of the timer i can see it changing lenght (time)
[18:57:39] <Bushman> maybe if i'd reduce the timer to the same as the up time....
[18:57:53] * Bushman looks for the programing cable
[19:05:54] <Bushman> hm...
[19:06:51] <Bushman> it seems when i've reduced the timer MAX and TOP value the problem has vanished or have become a lot less apparent
[19:07:02] <Bushman> but the servo won't work on those values
[19:11:28] <Bushman> seems like if frequency changes too
[19:12:19] <Bushman> it's pulsing about 2 times per second
[19:14:10] <Bushman> when i disconnect the UART the pulsing is gone
[21:16:50] <mheld> is there a way to see how many ticks are left in a timeout?
[21:20:56] <learath> where
[21:42:58] <ColdKeyboard> Does anyone have a cheap source for NFC tags?