#avr | Logs for 2014-04-09

Back
[00:52:06] <rue_more> no, all the current goes to blue, cause its the coolest, the rest look like they are glowing because blue is just that cool
[01:08:04] <twnqx> Casper: just use the nice readymade chinese stuff :P
[04:31:20] <sabesto> on an xmega a3bu i'm trying to select and enable the 32kHz external crystal so that i can use it with the DFLL to tune the 32MHz internal RC Oscillator, but XOSCRDY in OSC.STATUS never turns to 1
[04:31:58] <sabesto> xmega a3bu xplained board btw, has a 32,768kHz crystal on the TOSC pins
[04:32:06] <sabesto> http://pastebin.com/4AW8wgFv
[04:32:15] <sabesto> hangs on the while-loop
[04:32:43] <sabesto> anyone know if this is some error?
[06:54:04] <OndraSter_> sabesto, are you sure you have it on the right pins? There are two locations for the 32kHz xtal
[06:54:09] <OndraSter_> and they can be remapped
[06:54:10] <OndraSter_> IIRC
[06:54:19] <OndraSter_> (at least I think, I had a3u, not a3bu)
[08:07:26] <sabesto> OndraSter_: its on the TOSC1&2 pins, and ive tried the fuse that sets TOSC to "alternate" and "shared" with xtal
[08:07:40] <sabesto> on an xmega128a1 it seems to work
[08:07:53] <sabesto> xoscrdy it set to 1
[12:14:16] <Duality> hi
[12:14:31] <Duality> I want to use an 16mhz external crystal, but don't know what to choose
[12:16:51] <Tom_itx> http://www.engbedded.com/fusecalc/
[12:16:57] <Tom_itx> that should help
[12:18:57] <Duality> Tom_itx: the reason I appear to already have Bricked 3 chips by selecting the wrong clock settings ? or is that even possible ?
[12:28:19] <Tom_itx> sure it is
[12:28:27] <Tom_itx> it's one of the most common errors
[12:29:05] <Tom_itx> however if you have an external clock source (like my programmer has) you should be able to recover them
[12:34:30] <mog> Tom_itx, which programmer do you use?
[12:34:53] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/boards/USBTiny_Mkii/USBTiny_Mkii_index.php
[12:34:56] <Tom_itx> mine
[12:35:03] <mog> good answer
[12:35:49] <mog> ive been wanting something to save my borked avrs
[12:36:25] <Tom_itx> it has a pad by the blue headers you can see
[12:36:29] <Tom_itx> for the clock source
[12:37:04] <Tom_itx> labelled 'CLK;
[12:38:15] <Duality> what do i select for a external crytal ? ext rc osc or external clock; ?
[12:38:21] <Tom_itx> osc
[12:38:29] <Tom_itx> not external clock
[12:38:31] <mog> Tom_itx, but you cant access it when its in that nice blue case?
[12:38:33] <Tom_itx> that's TTL
[12:38:47] <Tom_itx> mog, you have to open it up
[12:39:31] <Tom_itx> you could solder a pin header on it and drill a hole i suppose
[12:39:59] <Tom_itx> originally i put the clock out the PDI header clock pin
[12:40:10] * mog nods
[12:40:33] <Tom_itx> but we were afraid that might interfere ( i never had any problems with it )
[12:40:43] <Duality> i just discovered i can scroll down way more, and select external crystal
[12:40:44] <mog> so tempting
[12:41:07] <Tom_itx> it works with all 8bit avrs
[12:41:13] <mog> i need to get a high voltage programmer at some point
[12:41:15] <Tom_itx> save the USB ones that you program with FLIP
[12:41:24] <Tom_itx> this isn't HVPP or HVSP
[12:41:27] <mog> but the most common cause for needing that is a bad clock setting
[12:41:34] <Tom_itx> yup
[12:41:55] <mog> so having a nice programmer like that with a clock to just pin to a port might be enough
[12:42:21] <Tom_itx> i only have a few left. not sure i'm gonna make another batch or not just yet
[12:43:01] <mog> if you dont mind me asking how many did you move?
[12:43:14] <Tom_itx> btw, my site will be moving at month's end
[12:43:20] <Tom_itx> a few hundred
[12:43:47] <Tom_itx> dyndns sent me notice the other day
[12:44:01] <mog> oh yes i read about their change
[12:44:11] <Tom_itx> so i need to find another free one
[12:44:35] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/index.php
[12:44:40] <Tom_itx> i'm trying that one for a bit
[12:50:43] <Casper> how expensive it is to do logatithmic math on avr?
[12:51:16] <Tom_itx> $100/hr
[12:52:01] <Casper> but cpu wise and ram and space
[12:52:42] <Casper> I'm planning to do something that need log, but I'm unsure if I use a table or do the math
[12:53:02] <Tom_itx> no idea
[12:53:10] <Tom_itx> tables are usually faster
[12:53:31] <Casper> it's an rgb led fader
[12:53:36] <Casper> so table is fine
[12:53:45] <Casper> but filling it up may be a problem
[13:07:42] <Duality> do i need to select the ckopt option if i use an external crystal ?
[13:09:40] <Casper> Duality: no
[13:09:43] <Casper> err
[13:09:45] <Casper> maybe
[13:09:50] <Casper> is it more than 8MHz?
[13:09:52] <Casper> if so yes
[13:09:59] <Duality> yes a 16mhz crystal
[13:10:11] <Casper> then do use it full swing oscillator
[13:10:30] <Casper> ... I hate vnc... parentesis somehow do not work o.O
[13:10:40] <Casper> back to work, bbl
[13:14:23] <Duality> i don't understand and i am confused, websites i read say ckopt should be 0 and the fuse calculator says it's 1 ? if i select or don't select it ?
[13:16:57] <Duality> i selected the ckopt and now i am not able to comunicate anymore
[13:20:57] <Casper> there is alot of confusion about those fuses
[13:21:14] <Casper> ckopt select between a low power oscillator and the full swing oscillator
[13:21:25] <Casper> by default it's the low power
[13:21:41] <Casper> which at high speed can cause issues, like not oscillating, or unstable
[13:22:22] <Duality> which meens my avr is bricked?
[13:22:25] <Casper> the problem is that 1 = unprogrammed flash... so some places took it as "enable at 0"
[13:22:40] <Casper> do you have another slow speed crystal?
[13:22:50] <Duality> no
[13:23:25] <Casper> another avr?
[13:23:32] <Duality> yes
[13:29:18] <Tom_itx> you can toggle a pin to get a clock from it
[13:29:53] <Tom_itx> it needs to be 4x the SPI programming frequency
[13:30:26] <Tom_itx> min
[13:33:44] <Duality> but i can go really low on spi programming frequency in gui :)
[13:35:54] <Duality> my clock is oscilating
[13:35:59] <Duality> my scope shows :)
[13:36:05] <Duality> but why can't i communicate with it ?
[13:36:45] <Duality> my powerline however shows 2.7 volts
[13:41:25] <Duality> look https://www.flickr.com/photos/72811375@N07/13743186663/
[13:41:30] <Duality> 16mhz
[13:50:02] <Duality> ok put an external powersupply on it
[13:50:08] <Duality> it now communicates!!
[14:06:34] <Duality> 1 bricked and 2 fixed :)
[19:23:48] <tzanger> https://www.youtube.com/watch?v=rp8hvyjZWHs
[21:09:19] <tzanger> ok, I have an electronics question... I need someone to just run through my math with me to make sure I'm not doing anything stupid
[21:09:33] <tzanger> AT90CAN128, I'm using a few port pins to drive p-channel FETs
[21:09:54] <tzanger> the FETs have a pullup to 6V (needed for what the FETs are driving)
[21:10:45] <tzanger> the AVR of course is on a 5V supply, so when I want the FET off I drive high but when my 6V supply is sufficiently high and the 5V supply/Voh is sufficiently low, the FET is on anyway
[21:11:13] <tzanger> AVR (and almost every IC) has protection diodes on all I/O pins which shunt excesive voltage to the rails
[21:12:27] <tzanger> so... if I were to turn the port pins into inputs when I want the FET off (and just let the pullup do its job), the current draw through the protection diode would be 6V - 5V or 1V divided by the pullup resistor value whcih is 10k, which means my diode current would be 1V/10k or 100uA
[21:12:33] <tzanger> am I missing anything?
[21:13:22] <tzanger> it'd actually be less since the diode would be dropping about a half a Volt
[21:14:17] <tzanger> I can't find a spec on the maximum current through those internal protection diodes but I'd expect that that's plenty low
[22:20:43] <Casper> tzanger: it's right, however you also need to take into consideration that the gate will be at VCC+0.3V
[22:20:48] <Casper> so 5.3V
[22:20:59] <Casper> (the internal diodes have a vforward of 0.3V based on atmel)
[22:28:59] <tzanger> hm. so basically it's not allowing the gate of the FET to go up to 6V, and is only limiting the current (making an input and letting the diode clamp vs actually driving the pin to 5V)
[22:29:11] <tzanger> the question becomes whether 0.7v is enough to trigger the BSS84 or not
[22:34:11] <Casper> you could use a npn to pull down your fet too
[22:37:23] <tzanger> yes, but if I'm going to add a semiconductor to solve the problem I may as well just use a diode in series with the fet gate (so the AVR can only pull it down)
[22:38:57] <Casper> won'T work
[22:40:47] <tzanger> why not? AVR pin is low, diode conducts, dropping maybe a half volt, gate sees 100uA from 5V and a low impedance to 0.5ishV
[22:41:01] <tzanger> pin goes high/floats, diode no longer conducts
[22:41:01] <tzanger> er
[22:41:02] <tzanger> no
[22:41:04] <tzanger> you're right
[22:41:07] <tzanger> exact same problem
[22:41:28] <tzanger> diode has 5V on one end, 6V on the other and yay, conduction!
[22:41:56] <tzanger> the only thing that might save it is that the fet's vgs is sufficiently high that the diode drop leaves it without enough voltage to turn on
[22:42:03] <tzanger> using a transistor is the best solution
[22:42:16] <tzanger> thank you for running the numbers with me, and for the suggestion
[22:44:39] <Casper> actually
[22:44:42] <Casper> with 6V...
[22:44:50] <Casper> 6-0.7-0.3=5V
[22:45:13] <Casper> so the gate would be almost at your 6V IF you have 6V
[22:59:13] <pajoke> Hi, I'm work on port AVRISP-MKII clone with LUFA to a ATxmega32A4U base board, anyone know how XMEGA USB switch one endpoint direction between IN/OUT mode, Thanks.
[23:03:14] <tzanger> well it's been quite some time since I've seen a discrete diode drop 0.7V unless there was significant current draw
[23:03:20] <tzanger> most are 0.4-0.5V
[23:03:47] <tzanger> pajoke: the only endpoint which swaps direction is EP0 to my knowledge
[23:03:56] <tzanger> no other endpoint swaps direction
[23:04:18] <tzanger> not without switching to an alternate interface first I guess, but even then EP1 becomes EP81