#avr | Logs for 2015-06-04

Back
[00:12:03] <hypermagic> it is cool that if you move the object with micrometer precision in front of a camera you could create a very high resolution image
[00:12:30] <hypermagic> by summing multiple images
[00:34:54] <N1njaneer> Yep, though this has to do it in a couple milliseconds, plus do the vision recognition :)
[00:36:01] <hypermagic> N1njaneer, does it use an arm? ;)
[00:36:09] <hypermagic> what else
[00:36:31] <N1njaneer> No, though our Haas mill does :)
[00:36:36] <N1njaneer> Runs on XP Embedded
[00:36:37] <hypermagic> hehe
[00:36:38] <hypermagic> lol
[00:36:43] <hypermagic> xp for machine?
[00:36:54] <N1njaneer> In the pick and place, yes.
[00:36:56] <hypermagic> how about reliability?
[00:37:05] <N1njaneer> Absolute perfect.
[00:37:10] <hypermagic> kk
[00:37:13] <hypermagic> i wouldnt bet on it
[00:37:39] <N1njaneer> Considering if the machines go down, CM's lose thousands and thousands of dollars, no, they run pretty much flawlessly.
[00:38:01] <N1njaneer> Yamaha designs good stuff. This is a top tier machine :)
[00:50:06] <N1njaneer> FoxConn and similar giants have hundreds of these machines in a single building. Yamaha is the second or third largest producer of pick and places in the world.
[01:09:26] <rue_house> hey I made 3 robots last year
[01:09:38] <rue_house> I had 0 of them the year before
[01:09:53] <rue_house> whats a 300% increase per year
[01:10:07] <rue_house> at this rate I'll be number one in no time
[01:12:00] <Casper> rue_house: it do not compute
[01:12:09] <Casper> 0->3 is infinite increase!
[01:12:19] <rue_house> your right,
[01:12:32] <rue_house> by that logic, next year I'll be #1 in the universe
[01:14:47] <Valen> i bet my robot could beat up your robot
[01:14:50] <Casper> by that logic, you ARE the #1 !
[01:15:15] <Casper> next year you'll fall in the... what... millionth place? :D
[01:16:00] <Casper> bed time, took the tylenol muscle... let's not waste it, last ones.... need to buy more... grr
[03:55:03] <sebus> can someone explain me something? I'm using atmel studio 6.2 with avr8-gnu-toolchain 3.4.1061 and dev-c++ 5.11; Just copy-paste all linker/compiler options from atmel tool to dev-c++ and generated files are different in length for same .c source. Any ideas? Maybe I forgot about something?
[03:56:51] <Xark> sebus: Sounds pretty expected if you don't have exact same compile, options and link libraries. How different? Maybe check the -Wl,-Map file?
[03:57:27] <Xark> compiler*
[03:57:46] <sebus> same toolchain / avr-gcc used in two programs
[03:58:03] <Xark> Okay, then different options or link libraries.
[03:58:38] <sebus> and difference is just few bytes in length
[03:59:11] <Xark> Probably slight differences in startup code etc. Do a diff on the avr-objdump -d to know for sure.
[04:26:14] <sebus> Xark, http://pastebin.com/YxnRGYma vs http://pastebin.com/C57iVsqg elf files
[04:26:21] <sebus> yep, there are differences
[04:27:07] <sebus> first generated by atmel studio, second from dev-c++
[04:27:33] <sebus> i'll modify makefile
[04:27:50] <sebus> (i should do this at first, grrr)
[04:28:35] <Xark> Interesting. The difference is one compile used a shorter jump than the other. address 9x612: rjmp vs jmp.
[04:29:06] <sebus> look at the end
[04:29:14] <Xark> I believe this may be due to -mrelax (or not).
[04:29:15] <sebus> 0000064a <strrev>
[04:29:38] <sebus> movw? huh
[04:31:12] <Xark> Try adding -mrelax to the 2nd link.
[04:31:38] <Xark> (compile line that generated 2nd pastebin link)
[04:33:40] <sebus> wow :o
[04:33:43] <sebus> 1:1
[04:34:10] * Xark polishes his fingernails on his lapel. :)
[04:34:49] <sebus> ok, but wait...
[04:35:11] <sebus> checkbox in atmel studio is not marked to do such things
[04:36:16] <Xark> GCC can be compile with different defaults etc.
[04:36:20] <Xark> compiled*
[04:37:02] <Xark> -mrelax is kind of "non-kosher", but it usually works and saves a lot of space/speed on AVR.
[04:37:37] <Xark> "Try to replace CALL resp. JMP instruction by the shorter RCALL resp. RJMP instruction if applicable. Setting -mrelax just adds the --mlink-relax option to the assembler's command line and the --relax option to the linker's command line.Jump relaxing is performed by the linker because jump offsets are not known before code is located. Therefore, the assembler code generated by the compiler...
[04:37:38] <Xark> ...is the same, but the instructions in the executable may differ from instructions in the assembler code.Relaxing must be turned on if linker stubs are needed, see the section on EIND and linker stubs below. "
[04:42:50] <sebus> Thanks for explaining this thing. I owe you a beer (or two)
[04:44:08] <Xark> No prob. :)
[04:44:38] * Xark waves goodnight
[04:44:45] <sebus> o/
[05:15:57] <hypermagic> rue_house, does your robot make robots that make robots ?
[05:15:59] <hypermagic> :)
[05:29:05] <hypermagic> hey guys can you give me a hint?
[05:29:41] <hypermagic> how one would mill a complex 3d shape like a heart?
[05:30:18] <hypermagic> milling one side is simple, but the other ?
[05:31:02] <LeoNerd> Mmm?
[05:31:54] <hypermagic> i mean the thing would neeed to be flipped and held somehow and realigned and the other side milled
[05:32:36] <LeoNerd> Oh, you want to make a bowl-shaped object?
[05:32:59] <hypermagic> no i was thinking about making an object that would be milled from more than one side
[05:33:25] <LeoNerd> Hrm. I'm not sure I can picture the shape- maybe you can find an image of sometihng similar?
[05:33:40] <hypermagic> and preferably not containing a rod for example for an alpha axis
[05:34:06] <hypermagic> http://www.paprikashop.co.uk/girls-chiming-heart-necklace-ccgh/
[05:34:23] <hypermagic> for example, this is a 3d shape, not a planar thing cut out
[05:36:58] <osteri> anyone familiar with the LUFA bus powered devices? as i understand; i must implement the 500 uA 'suspend mode' using the suspend -event, as the LUFA itself doesn't provide any power saving features (other than PLL)? and then i have to implement reverse functionality for the wake-up event.
[05:37:39] <hypermagic> LeoNerd, http://wmmdesigns.co.uk/images/battered-heart-pendant-necklace.jpg a shape like this is only possible with an alpha axis that need to be trimmed after done milling ?
[05:37:50] <osteri> has anyone implemented under 500 uA current consumption with atmega32u4, what i have to do?
[05:45:40] <twnqx> 500µA active?
[05:50:30] <osteri> twnqx: read 'Suspend Current' http://www.beyondlogic.org/usbnutshell/usb2.shtml#Electrical
[05:51:03] <twnqx> i was asking if you wanted 500µA active or just in a low power mode
[05:53:38] <osteri> i'm no sure which mode i'll have to use, that is why i asked
[05:55:59] <osteri> ok, so LUFA let's you to choose 'unit load device', so the maximum suspend current for '5 unit load device' is 5 x 500 uA = 2500 uA
[05:56:18] <osteri> as i understand
[05:57:49] <LeoNerd> hypermagic: Surely that shape you can just do top-down; with the milling head going "into" the axis of the photo here
[05:57:55] <LeoNerd> Or did you need it doublesided?
[05:58:09] <twnqx> i am not sure if unit load applies to suspend current, according to your link
[05:58:17] <twnqx> or only to active consumption
[05:59:08] <twnqx> haha, i though my capacitance was violating usb spec - but it doesn't :D
[05:59:53] <osteri> active consumption per unit device is 100 mA
[06:00:24] <osteri> and with 5 unit devices, max active output is 500 mA
[06:00:55] <twnqx> yes
[06:01:13] <twnqx> but the unit multiplier does not apply for suspend current.
[06:01:25] <osteri> yes, this might be true
[06:01:25] <twnqx> so 0.5mA is your limit
[06:01:53] <osteri> the link text says "For a 1 unit load device (default) the maximum suspend current is 500uA."
[06:02:08] <osteri> from there i thought it might multiply
[06:02:37] <osteri> but i guess it's the same with 5 unit load devices
[06:06:42] <osteri> twnqx: the datasheet suggest to use clock switch controller for USB suspend
[06:07:09] <twnqx> ah
[06:07:27] <twnqx> i just ignore suspends.
[06:07:59] <osteri> yes, i'm thinking this too :)
[06:09:16] <osteri> i guess the most critical thing that could happen is that you'd have to plug usb again
[06:09:46] <osteri> "The modification may be needed when the device enters in USB Suspend mode. It then switches from External"
[06:09:49] <osteri> Clock to Calibrated RC Oscillator in order to reduce consumption and wake-up delay. In such a configuration,
[06:09:52] <osteri> the External Clock is disabled.
[06:12:52] <osteri> I assume that crystal = ext. clock and Calibrated RC Oscillator is the default clock
[06:13:45] <osteri> I always thought that crystal is using less power than RC Osc., i guess not then
[06:14:35] <twnqx> for the clock itself that's possible
[06:14:45] <Lambda_Aurigae> crystal and external clock are different sources.
[06:14:50] <twnqx> but the cmos switching losses for lower frequency make it worthwhilw
[06:23:12] <hypermagic> LeoNerd, that is not a one sided object.
[06:24:09] <osteri> "This feature can only be used to switch between Calibrated 8MHz RC Oscillator, External Clock and Low Power
[06:24:12] <osteri> Crystal Oscillator. The Low Frequency Crystal Oscillator must not be used with this feature."
[06:24:47] <pepijndevos> Are there some macros to deal with combining bytes to shorts and back? The manual bit shifting is so error-prone.
[06:24:59] <osteri> so if i have the 'low power crystal oscillator', is there any sense in clock switching?
[06:26:54] <hypermagic> LeoNerd, http://www.mathworks.com/matlabcentral/fileexchange/18754-heart-model-for-valentine-s-day so something like this
[06:28:19] <hypermagic> LeoNerd, so how you go about milling both sides of workpiece? :)
[06:29:11] <hypermagic> unfortuantely the material will not hold still and float in midair
[06:29:25] <osteri> twnqx: if you're interested, this is what the datasheet suggests: http://postimg.org/image/j55couoit/
[06:29:52] <LeoNerd> hypermagic: Ah; notsure. Not really a thing I've done before
[06:30:07] <osteri> twnqx: i have to wonder this by myself, it goes so deep
[08:07:02] <Valen> hypermagic: cut one side, flip it, cut the other leave some tabs in the source material
[08:07:15] <Valen> then snap it out and sand where the tabs were smooth
[10:08:38] <pepijndevos> Should an atmega328 work with 3.3v SPI while running at 5v?
[10:10:57] <pepijndevos> I have it running as SPI slave, and the clock line is definitely doing *something*, but the atmega doesn't see it.
[10:14:24] <pepijndevos> It's probably in the datasheet somewhere, but I'm not sure where.
[10:24:18] <pepijndevos> 0.6Vcc apparently
[10:24:33] <pepijndevos> so anything below 3.3v is tricky
[10:24:39] <pepijndevos> 3.0
[10:26:59] <LeoNerd> Beware also that the data *out* from the 5v mega328 will of course be referenced to 5V so that 3.3V master should be 5V-tolerant
[15:47:35] <kdehl> Hi. Uh, I just programmed my fuse bits using '-U lfuse:w:0b11100000:m', and now it doesn't respond anymore. I just wanted to use an external crystal. I can't see anything dangerous could be done by programming those bits, thoug.
[15:47:39] <kdehl> though
[15:47:53] <kdehl> I'm using a 1284p.
[15:48:13] <Xark> kdehl: Do you have a xtal hooked up?
[15:48:19] <kdehl> Xark: Yea.
[15:48:32] <Xark> kdehl: What speed?
[15:48:55] <kdehl> But shouldn't it respond when I try to reprogram it anyway? Or does that use external the external source as well?
[15:48:58] <kdehl> 20MHz.
[15:49:27] <Xark> kdehl: Fuses can easily make programming problematic.
[15:49:42] <kdehl> I see that. ;)
[15:49:45] <Xark> kdehl: If you enable xtal, then you must have one (and clock of programmer must be < 1/4 of this speed)
[15:49:59] <Xark> Decode what those bits do here http://www.engbedded.com/fusecalc/
[15:50:33] <kdehl> Alright.
[15:50:53] <Xark> Like if you disable SPI programming, or enable OCD etc.
[15:52:40] <kdehl> Nah, it belongs to the high byte.
[15:53:17] <kdehl> It's just Select Clock Source, Select start-up time, Clock output and Divide clock by 8
[15:53:24] <kdehl> Seem pretty harmless to me.
[15:55:26] <kdehl> This is strange.
[16:04:35] <kdehl> I really don't understand this. I just tested with another 1284p, which seems to be using an external clock source (if I disconnect the crystal it stops working!), and when I read the low fuse byte I get: 0b11110111. That makes no sense, the low nibble should all be zeroes for an external clock according to the datasheet.
[16:35:26] <kdehl> Okay, I figured it out. A clock generator is not the same as an oscillator!
[17:18:07] <hypermagic> pepijndevos, yes it could, if you put resistors in serias with ports the 5V will be clamped, and the input sensitivity will allow logic level recognition if you have good input signal
[17:44:15] <hypermagic> kdehl, it is almost the same
[17:44:42] <hypermagic> and oscillator though does not necessarily have fast rise and fall times, and 50% duty cycle
[17:45:32] <hypermagic> a clock generator is usually a square wave oscillator with fast rise and fall times, and it can be differential too, so 2 outputs in 180 deg phase
[17:52:07] <kdehl> Right. But when it is configured to use an "External Clock", you can't connect an oscillator and think it'll work.
[17:52:18] <kdehl> That is my lesson for today. ;)
[17:53:58] <hypermagic> oh
[17:54:11] <hypermagic> in the mcu, external clock means only to accept clock at the input
[17:54:22] <hypermagic> it might not work as an oscilaltor anymore
[17:54:48] <hypermagic> you need a st-not gate or something to make oscilaltion externally
[17:56:09] <kdehl> Right.
[17:56:33] <hypermagic> assuming it will free up xtal2 input/output to be used as gpio? ;>
[17:57:32] <hypermagic> kdehl, what are you creating?
[17:59:16] <kdehl> Heh. Well, I won't need that.
[17:59:50] <kdehl> I was inspired by this guy: http://jmp.no/blog/3-chip-computer and will create something similar.
[17:59:57] <kdehl> But differently. Heh.
[18:00:05] <hypermagic> :)
[18:00:29] <kdehl> We'll see where I land in a few days from now. But I will use a 6502 and a dual-port RAM to begin with.
[18:00:42] <kdehl> I have a few weeks off to play around. :)
[19:16:10] <kdehl> Hm. Shouldn't this line make sure to wait until it is safe to transfer another byte over the serial line: while(!(UCSR0A & (1 << UDRE0)));
[19:16:23] <kdehl> There seems to be a type on the manual for the 1284p.
[19:16:29] <LeoNerd> That doesn't soudn right
[19:16:42] <LeoNerd> UDREx is the Data Received interrupt Enable flag
[19:16:59] <LeoNerd> You want to look for the transmission status; so at the very least the flag name will have the letter 'T' in it
[19:17:08] <kdehl> Huh. Alright.
[19:17:37] <LeoNerd> The TXCx bit in control register A
[19:18:01] <kdehl> Right. TXC0.
[19:18:03] <LeoNerd> So while(!(UCSR0A & _BV(TXC0))) ; is what I'd do
[19:20:34] <kdehl> Hm. Me too. But it doesn't work.
[19:20:40] <kdehl> It hangs right there.
[19:21:23] <LeoNerd> Well... yes it will do unless you *actually* have a character pending for transmission :)
[19:22:33] <kdehl> I guess I'm misunderstanding something.
[19:24:00] <kdehl> No, it does work.
[19:24:49] <kdehl> Alright. Thanks!
[19:59:14] <rue_house> hypermagic, no