#avr | Logs for 2015-04-13

Back
[13:31:12] <DanGarcia595> hey guys so I'm on linux do I need a programmer to flash a AtMega328P or can I use usb?
[13:50:31] <LeoNerd> 328P can't natively talk USB, no. So you'll need some kind of programmer; most likely an ISP widget of some description
[14:01:12] <malinus> DanGarcia595: you can however rest in peace, knowing that the whole avr-toolchain is free as freedom!
[14:03:03] <malinus> DanGarcia595: you can get a ISP programmer for like $4 on ebay
[14:08:43] <N1njaneer> It's Monday! Do you know where you AVR is?
[14:09:25] <N1njaneer> +your
[14:15:17] <megal0maniac> 2x on my desk, countless in the cupboard :D
[14:19:54] <N1njaneer> A good place to keep them!
[14:25:04] <megal0maniac> How goes it N1njaneer ?
[14:34:42] <N1njaneer> Too busy, but good!
[14:34:46] <N1njaneer> You?
[14:35:19] <N1njaneer> Had to order more equiptment here today to keep up with production demands, which I guess is a good problem to have. XD
[14:45:22] <Jartza> hallo
[15:01:18] <LeoNerd> I ordered 5 more from Germany but they've not arrived yet
[15:01:23] <LeoNerd> I need to replace the one I popped last week
[15:22:58] <malinus> N1njaneer: what are you producing?
[15:25:38] <N1njaneer> A bunch of different stuff. :)
[15:25:47] <malinus> such as?
[15:26:00] <N1njaneer> This in particular is plastic cutting thousands of parts, so had to get another CO2 laser cutter in here tomorrow.
[15:26:24] <N1njaneer> We do a lot of lighting, control, and special effects stuff primarily, so varied work. :)
[15:27:10] <N1njaneer> We do as much in house as we can so we can move faster.
[15:30:38] <malinus> cool
[15:30:42] <malinus> anything embedded?
[15:35:15] <N1njaneer> Pretty much everything we do, yes :)
[15:36:41] <N1njaneer> New pick and place hopefully here before the end of the month. Significant upgrade to the SMT line. Very excited - the existing stuff is okay, but needs much the babysitting to keep running.
[15:44:34] <N1njaneer> If anyone needs medium volumes of PCBs run in the near future I'll be able to start offering that service :)
[15:44:48] <N1njaneer> I would currently but changeovers take too long on the existing machines.
[16:02:35] <DO9XE> does anyone know a good 5V clocksource with a 25MHZ square wave Output which is SMD and nocht really big? I need a nearly perfekt shaped rectangle clock :)
[16:02:55] <malinus> N1njaneer: why no prototype runs :(?
[16:07:20] <N1njaneer> DO9XE: There are many on DigiKey. Try CTX parts :)
[16:07:50] <N1njaneer> malinus: Depends on the run size - most times the thing that kills it is the $300 stencil charger for the SMT parts if you're only doing a couple boards. :/
[16:07:52] <DO9XE> I got one, but in reallife it looks like a sin-wave :(
[16:08:04] <DO9XE> ill take a look at CTX parts :)
[16:08:28] <N1njaneer> DO9XE: You won't find any with perfectly square square-waves - the sine wave is normal, and is done for emissions reasons. It's slew-rate limited
[16:09:03] <N1njaneer> If you need it perfectly-perfectly square wave, you'll probably need to pump it through a TTL buffer or similar to quantize.
[16:09:11] <N1njaneer> Why does the waveshape matter?
[16:10:20] <DO9XE> my AD9833 is not giving any output. I made shure everything is connected properly and the transmitted date is right multible times. on my breadbord it worked, on my prototype PCB its not :(
[16:11:26] <N1njaneer> Sine-wave output shouldn't affect that - as long as it's passing through the normal thresholds voltage-wise the AD9833 will see it as a correct clock source.
[16:13:09] <N1njaneer> I would start by probing all of your pins at the chip to see if you are getting the expected signals in/out, check for shorts, etc. Also make sure you don't have any floating signals that are missing a pull up/down -- when things get borderline with working/not working, floating signals can manifest that kind of strange behaviour :)
[16:15:28] <DO9XE> I allready made that shure :) It's my final project :)
[16:15:53] <malinus> N1njaneer: no way you can compete with something like dirtypcb though :(
[16:16:10] <N1njaneer> Recheck again. Look for solder-bridges, etc.
[16:16:53] <N1njaneer> malinus: Which is why we prototype all in-house stuff and may look at running production for other people. Generally we just use it for running our own stuff, though, but with how much faster and easier the new stuff is I'm happy to keep it busy :)
[16:18:41] <DO9XE> N1njaneer, allready did. even changed the part. I've been on this mistake for ~2 workdays now :/ Also I got a connection from AGND to GDND through the AD9833 which should not occure. I am working with seperated GNDs. I Coupled them with two antiparallel shotkey diodes.
[16:19:44] <N1njaneer> Why are your grounds seperate? They should be combined at some point.
[16:20:18] <DO9XE> yes, with two antiparallel diodes.
[16:20:34] <N1njaneer> Where do you see it documented that you should do that?
[16:21:15] <N1njaneer> If grounds aren't at the same potential (as they would never be due to the diode drops) you can have Bad Things happen.
[16:21:34] <N1njaneer> I have never seen that approach nor have ever used it when I've had to have split ground planes.
[16:21:38] <DO9XE> nowhere, but it is the only logical way for me th combine two different ground pads and make shure the Vdiff is lower than 0,3V
[16:22:18] <N1njaneer> You will usually have a digital and analog ground planes that are physically seperate, but they will ALWAYS be coupled together at some location, and usually "stitched" via decoupling capacitors on the boundaries.
[16:22:28] <N1njaneer> I would tie the grounds directly together and see if your circuit starts working.
[16:23:15] <DO9XE> N1njaneer, ill try, but the AD9833 Datasheet says its okay, if there is a Vdiff < 0.3V
[16:25:44] <N1njaneer> DO9XE: See page 22 in their datasheet for their Eval board -- pins 4 and 9 (AGND and DGND) are both bonded.
[16:26:50] <Jartza> what's up people?
[16:26:54] <N1njaneer> Their eval board is a multilayer board so the ground planes are split for signal noise integrity issues, but they are still bonded at the common point at the chip and then decoupled to each other via C7, C8, C9, C10 as is often general practice.
[16:27:05] <N1njaneer> Hi Jartza!
[16:27:16] <Jartza> hi N1njaneer!
[16:27:24] <Jartza> how's life?
[16:27:36] <DO9XE> N1njaneer, and I like to reffere to page 5 :) AGND to DGND Voltage :/ they make it possible ;)
[16:28:54] <DO9XE> I'll try to combine the masses tomorrow ;)
[16:30:14] <Jartza> it's been wild spring
[16:35:15] <Jartza> N1njaneer: https://docs.google.com/file/d/0B2dTzW9TMeBxcHRtSmZ3UGNNTnc/edit?usp=docslist_api
[16:35:33] <Jartza> that's what the little device evolved to ;)
[16:39:33] <Jartza> first production run is starting rsn
[16:46:36] <N1njaneer> DO9XE: Yes, and as per page 5 that means the AGND and DGND need to be within 0.6V of each other. Which means ideally tie them together so there's NO difference between them.
[16:47:00] <N1njaneer> Again, also refer to the layout of their EVM.
[16:47:26] <N1njaneer> Unless the ground planes are correctly bonded to each other at some point they will NOT be at the same potential.
[16:47:51] <N1njaneer> Any may explain why your board is nor working.
[16:48:09] <N1njaneer> Jartza: Ooh very nice!! :D
[16:52:38] <N1njaneer> +And
[16:55:48] <Jartza> yeah. long time in the making and huge learning process
[16:56:05] <Jartza> but the whole thing has opened some very nice doors
[16:56:18] <Jartza> :)
[16:59:06] <Jartza> so, at least for a year I'll be working for Suunto :)
[17:04:04] <Jartza> anyhow, I'm off to bed. night all!
[17:09:56] <N1njaneer> Awesome!! Have a good night!
[21:24:45] <m4t> hey, in this code http://pastebin.com/Rc5wx1hA there is a function startExcitationSignal. can someone explain how exactly works? and how it relates to the cpu clock? i think it's supposed to generate a square wave?
[21:24:59] <m4t> line 64
[21:38:43] <m4t> i got another question, set_sleep_mode(SLEEP_MODE_ADC); sleep_mode(); is hanging forever
[22:29:26] <Xark> Perhaps -> "Note that unless your purpose is to completely lock the CPU (until a hardware reset), interrupts need to be enabled before going to sleep."
[22:32:47] <m4t> yeah that fixed it
[22:33:02] <m4t> but i'm running into other issues now
[22:33:10] <m4t> namely getting a proper ADC reading back over i2c
[22:33:25] <m4t> i might have to put this into free running mode...
[22:33:59] <N1njaneer> I2C is a bit of a bitch at times - VERY useful to have a logic analyzer which can decode it for you for debug.
[22:34:00] <Tom_itx> you need to discard the first couple readings
[22:34:25] <N1njaneer> Make sure you can pass known data over the I2C reliably before you tackle the ADC portion.
[22:34:39] <N1njaneer> So you can isolate your potential gotcha areas :)
[22:35:55] <m4t> the first reading is being discarded
[22:36:44] <m4t> and yeah i can pass data over i2c. though maybe it's taking too long to get a reading
[22:37:25] <N1njaneer> The ADC does take a finite amount of time to aquire a reading. Make sure it's also not clocked too quickly else you will get unreliable readings.
[22:38:53] <m4t> i might switch it to have the adc do constant readings in a while(1) {}
[22:39:06] <m4t> and update a global variable that the isr from i2c can access
[22:39:17] <m4t> rather than polling the adc after an i2c command is received
[22:40:32] <timemage> m4t, what does the code look like now?
[22:42:48] <m4t> like doodoo :-)
[22:43:12] <m4t> not really i'm using a different i2c lib now
[22:43:18] <m4t> that supposedly implements clock stretching
[22:44:50] <timemage> m4t, are you using globals to communicate with an isr now?
[22:44:58] <m4t> yes
[22:45:00] <m4t> http://pastebin.com/3p37xGUV
[22:45:11] <m4t> its not working but i think it's because the system is in adc sleep all the time
[22:45:22] <m4t> i'm going to try free running mode...
[22:45:26] <m4t> if i can figure it out
[22:45:52] <m4t> ideally though it *would* only do a conversion when asked to
[22:53:13] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/how_to/atmega168/mega168_adc_index.php
[22:53:25] <Tom_itx> i don't remember if that's free running or not
[22:54:28] <m4t> read_adc() in a loop
[22:54:40] <m4t> main.c:87:54: error: ‘ADFR’ undeclared (first use in this function)
[22:55:16] <m4t> hmm
[23:05:46] <m4t> heh free running works :|
[23:10:50] <m4t> is it really necessary to discard the first measurement if you're doing like sysclk/128?
[23:11:58] <N1njaneer> Follow the directions in the datasheet. They are specifically accurate :)