#avr | Logs for 2013-04-27

Back
[00:00:28] <metalliqaz> well i'm actually using an address
[00:00:33] <metalliqaz> 0x0aff
[00:08:40] <grummund> assuming that's the correct address then yes
[00:09:01] <grummund> should be start of stack
[00:13:37] <MrTrick> muahaha....
[00:13:42] * MrTrick perverts gcc
[00:15:03] <MrTrick> So, if I read SP in main, and call a recursive function, then at a certain depth set SP = SP_main - 2, then the next line after the function returns is the original point in main().
[00:18:57] <MrTrick> it still requires something in main to return, so it's not perfect... though I suppose my interrupt lives on the same stack pointer, doesn't it? So I can do this trick, then cli(), then it's like I was in main the whole time?
[00:36:35] <MrTrick> hmm, I wonder if a clearer way would be with a goto statement, and have it go to a main label that clears the stack and interrupts.
[00:44:45] <MrTrick> though it won't let me do that...
[00:45:08] <MrTrick> (If I put a label in a different function, it says "label toHere used but not defined")
[00:45:23] <Casper> MrTrick: doing that would cause memory leak
[00:45:46] <Casper> when you enter a function (or an interrupt) it push some registers into the stack
[00:45:51] <MrTrick> not in this case, because the target will be immediately resetting the stack pointer.
[00:45:58] <Casper> doing a goto outside the function would cause those to stay allocated
[00:46:50] <MrTrick> again, what allocation? The stack pointer would be returned to the top.
[00:47:27] <MrTrick> I know it can be horrendous. In this case though, I mean to do it. Otherwise, I could use the technique I describe above - it certainly works.
[00:59:15] <MrTrick> Casper: grummund: https://gist.github.com/MrTrick/5472030
[00:59:38] <MrTrick> and grummund you can use the constant RAMEND in your code for better portability.
[01:00:53] <MrTrick> (sorry, that was meant to be at metalliqaz)
[01:05:44] <langoliers> is this shit common here?
[01:07:31] <MrTrick> langoliers: abusing the C language? No, I don't think so.
[01:07:34] <langoliers> [051614] * ZIHohSNfsID has quit (Excess Flood)
[01:07:34] <langoliers> [051615] * RxBFSzPRiyiv has quit (Excess Flood)
[01:07:34] <langoliers> [051615] * EQIDMcr has quit (Excess Flood)
[01:07:35] <langoliers> ...
[01:09:11] <MrTrick> Oh. :-) I have the status messages displaying in a different section than the conversation, so I didn't see them. No idea, to be honest.
[01:09:51] <langoliers> it was some spambots joining and flooding the channel
[01:43:32] <OndraSter> who set +r flag?
[01:43:35] <OndraSter> and why?
[01:56:07] <MrTrick> How many AVR instructions does it take to decrement a value, branching if it's zero? In PIC it's 1; 'decfsz'. AVR seems to be, five? load, decrement, store, test, brne? Are there better patterns to follow?
[01:58:31] <langoliers> hey OndraSter
[01:58:47] <langoliers> it was floodbots spamming chan
[01:59:03] <OndraSter> ah
[01:59:25] <OndraSter> MrTrick, if it is in reg then it is 1 to decrement, and then 2 to branch
[02:00:36] <MrTrick> yep, fair enough. If you're writing C with some inline ASM, how do you 'reserve' a register? or have it reserved in some places but not others?
[02:33:28] <langoliers> it is a bitch to desolder IDE connector from motherboard ;/
[03:22:32] <langoliers> hmm, large dev board ? http://www.zbasic.net/images/ZX-24n_sml.jpg
[06:25:57] <megal0maniac> Couldn't connect to my wireless because the certificate is "not yet valid"
[06:26:20] <megal0maniac> Which means it will start working tomorrow. Stupid Windows :)
[06:54:30] <dpy> hmm... I'm trying to create a RGB Ledstrip controller PCB here... I notice that regardless of using a P-Channel mosfet + Common cathode strip, or using an N-Channel mosfet + Common anode strip, the drain is always connected to the R, G, B, of the strip
[06:54:52] * dpy wonders if he can pull it off, to make the PCB common anode and common cathode compatible
[07:24:11] <dpy> Does anyone understand the Vss naming thing?
[07:25:07] <dpy> If Vss is supposed to mean, the voltage on the source side of a MOSFET, then, in http://i.stack.imgur.com/QUrc7.png , for (3) Vss would mean GND, and for (2) Vss would mean 400V ??
[07:25:23] <dpy> Is that the way you are supposed to interpret Vss?
[07:27:39] <twnqx> if anything that would be from a complete cmos pole perspective
[07:28:13] <twnqx> but no, i never even thought about that, vdd/vss would at least fit that
[07:28:49] <twnqx> cmos inverter i mean
[07:30:22] <twnqx> http://encyclobeamia.solarbotics.net/articles/vxx.html says roughly that
[07:40:27] <dpy> *confused*
[07:46:31] <twnqx> why do you even care
[07:46:45] <twnqx> just replace it with +5V/3v3/whatever and gnd
[07:51:51] <OndraSter> what are we talking about?
[08:03:04] <twnqx> <dpy> Does anyone understand the Vss naming thing?
[08:04:32] <OndraSter> ah
[08:05:03] <OndraSter> it is used probably from the old BJT days
[08:05:08] <OndraSter> where Vcc was ment for collectors
[08:05:21] <OndraSter> Vee for emitters, Vdd to FET drains and Vss for FET sources
[08:05:30] <OndraSter> :)
[08:05:40] <OndraSter> now we just use +5V/+3V3 etc
[08:09:56] <RikusW> megal0maniac_afk: seems U2S is working fine on w7 x64 :)
[08:10:06] <RikusW> ugh
[08:16:26] <dpy> ok
[08:16:50] <dpy> but I want to name a net that is connected to the source of a mosfet
[08:17:15] <dpy> on another part of the schematic, I'm either connecting +12V or GND to that net through a jumper
[08:17:49] <dpy> now, I was naming the net R_Vss, G_Vss and B_Vss
[08:17:52] <dpy> is that correct?
[08:18:11] <dpy> or should I refrain from using the Vss postfix
[08:20:00] <twnqx> i wouldn't use it
[08:39:47] <dpy> ok
[08:40:25] <dpy> Is there a, preferrably european, schematic symbol for a jump (SPDT style) ?
[08:42:47] <dpy> jump=jumper
[08:48:00] <dpy> duh, I'm just realizing I need only one net name
[08:48:20] <dpy> all three would be the same for a given configuration (common anode/common cathode)
[08:55:57] <jacekowski> SPDT style jumper?
[08:56:01] <jacekowski> you mean switch?
[09:01:53] <specing> jumper == 3 pins 100 mils apart
[09:03:07] <Tom_itx> jumper = crazy man on top of building
[09:05:56] <Tom_itx> dpy, in eagle?
[09:06:02] <Tom_itx> look in switch lib
[09:06:19] <Tom_itx> there's also pad jumpers
[09:07:07] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/boards/atmega32u4/atmega32U4_3.jpg
[09:07:08] <dpy> yes, I used the jumper lib
[09:07:18] <Tom_itx> like just below the regulator on the bottom side of that board
[09:07:26] <Tom_itx> bottom board on the right side
[09:07:52] <Tom_itx> s/below/beside
[09:08:32] <Tom_itx> and i ran a trace to 2 of them as a default
[09:08:43] <Tom_itx> so it would need to be cut for the other option
[09:09:01] <Tom_itx> megal0maniac, working with xilinx?
[09:09:18] <dpy> k, tnx
[09:10:14] <megal0maniac> zlog
[09:10:38] <Tom_itx> <megal0maniac> Couldn't connect to my wireless because the certificate is "not yet valid"
[09:10:47] <megal0maniac> Tom_itx: No, not yet. Haven't found an excuse to spend the cash on a dev board
[09:10:48] <Tom_itx> oh i misread that
[09:10:56] <Tom_itx> wires wireless
[09:11:19] <megal0maniac> Tom_itx: I've set up a radius server on my router. It'll work tomorrow :P
[09:12:13] <Tom_itx> haha of all the packages ordered the same day from china CapnKernel's will arrive last
[09:12:33] <Tom_itx> the only 'registerd mail' one
[09:13:16] <hackvana> Tom_itx: Hey, I shipped your boards in three days!
[09:13:26] <Tom_itx> i'm not complaining
[09:13:39] <Tom_itx> just thought it was ironic
[09:13:41] <hackvana> Were the others by courier or something?
[09:13:49] <Tom_itx> HK post
[09:14:01] <Tom_itx> normal methods
[09:14:09] <Tom_itx> one arrived over a week ago
[09:14:30] <Tom_itx> yours is stuck in New Jersey
[09:15:37] <Horologium> classified as "bomb making materials" and "subversive learning materials"
[09:16:19] <Tom_itx> shhhh
[09:16:36] <Horologium> one wonders when "THEY" are going to outlaw RC cars and planes....due to the fact that one of those was used to detonate the bombs in boston.
[09:17:00] <Horologium> or will they just outlaw hacking of existing electronics devices?
[09:17:23] <Horologium> everybody with a soldering iron is going to have to register it as a dangerous weapon.
[09:17:36] <Tom_itx> they are
[09:17:45] <Tom_itx> i burn myself rather often
[09:18:14] <Horologium> that's just your masochistic impulses forcing you to touch yourself with the hot pointy bit.
[09:18:33] <Horologium> ((what a conversation to pop in to....))
[09:18:44] <dpy> is the 8MHz internal oscillator reliable enough for 9k6 baud software serial (simplex, RX only)?
[09:18:50] <dpy> of a tiny
[09:19:03] <dpy> (don't know if that matters any)
[09:19:07] <Horologium> dpy, if you don't mind adjusting occasionally for drift, yeah.
[09:19:12] <Tom_itx> dpy, try it
[09:19:23] <Horologium> it is an RC oscillator...so will drift due to temp and voltage.
[09:19:24] <dpy> what do you mean adjusting?
[09:19:44] <Horologium> so you might have to adjust your baud rate setting on the USART once in a while.
[09:19:50] <megal0maniac> OSCCAL
[09:19:57] <Horologium> it is not exactly 8MHz...it varies from chip to chip just a bit..
[09:19:57] <dpy> all I want is 4 byte transmissions, and I can wait, say 1ms between transmissions
[09:20:25] <dpy> uh, the tiny will RX, not TX
[09:20:38] <megal0maniac> dpy: Check this out too: http://www.wormfood.net/avrbaudcalc.php
[09:20:40] <Horologium> baud rate still must match.
[09:20:58] <dpy> so, I was thinking, the 1ms can be used to reset the timings
[09:21:03] <megal0maniac> It's best to start with a baud rate that plays nicely with your clock speed in the first place
[09:21:10] <Horologium> megal0maniac, isn't that right out of the datasheets only with pretty colors?
[09:21:34] <megal0maniac> Otherwise your error will compound with the drift and nothing will work
[09:21:56] <megal0maniac> Horologium: I don't think so..? It isn't mine, I just refer to it often :)
[09:22:17] <Horologium> looks an awful lot like the tables in the datasheets.
[09:22:24] <Horologium> but, those can be calculated.
[09:22:44] <megal0maniac> 8mhz is a crappy clock speed for serial to begin with
[09:22:48] <twnqx> no
[09:22:52] <megal0maniac> no?
[09:23:00] <twnqx> works great for 2mbit/s rs232
[09:23:30] <megal0maniac> That is... well, not as common as 9600 and his friends :)
[09:23:42] <dpy> megal0maniac: 8Mhz is the internal osc., it keeps component count low
[09:23:44] <megal0maniac> Do avrs even support that?
[09:23:52] <twnqx> with 16mhz, yes
[09:23:59] <megal0maniac> dpy: I know. I'm just pointing out that there are better choices :)
[09:24:19] <Horologium> megal0maniac, yeah, you can clock that usart waaaay up there.
[09:24:44] <twnqx> /8 is the fastest it can go i think
[09:24:50] <dpy> I think I'm going to experiment a bit with this...
[09:24:53] <twnqx> i'd like 4mbit/s :P
[09:25:09] <twnqx> fastest the ft230x can do
[09:25:39] <Horologium> when running the usart with internal rc oscillator I usually run an autobaud routine to sync up with the device at the other end.
[09:25:55] <twnqx> how so?
[09:25:58] <megal0maniac> twnqx: xmega runs at 32mhz :)
[09:26:04] <dpy> it's easier, if I can just use one wire with simplex digital serial comm, instead of two wire analog, with two low-pass filters
[09:26:07] <twnqx> xmega has no CAN embedded
[09:26:27] <megal0maniac> Eh.
[09:26:39] <megal0maniac> Nor does my car, but I'm not complaining :)
[09:26:45] <twnqx> what, really
[09:26:54] <dpy> megal0maniac: the alternative to communicate two bytes from one Attiny44 to an Attiny10
[09:26:56] <twnqx> CAN-less cars do still exist? :P
[09:27:23] <Horologium> twnqx, my father in law has one...well, a truck, 1975 dodge.
[09:27:50] <twnqx> wow
[09:27:52] <Horologium> doesn't even have an ECU.
[09:27:56] <RikusW> megal0maniac: using w7x64 now :)
[09:28:00] <twnqx> mine has 27 :/
[09:28:03] <RikusW> two U2S works fine :)
[09:28:04] <megal0maniac> twnqx: It probably has a CAN interface, but it's only for the digital cluster (mileage, service light)
[09:28:05] <Horologium> points and plugs
[09:28:09] <megal0maniac> RikusW: GOOD!
[09:28:13] <twnqx> 27 ECUs...
[09:28:20] <RikusW> COM3+4
[09:28:24] <megal0maniac> Horologium: Mine is 2005 and has points and plugs and a carb :)
[09:28:26] * RikusW feels relieved
[09:28:34] <Horologium> megal0maniac, what is it? I want one!
[09:28:36] <megal0maniac> RikusW: Also good
[09:28:39] <Horologium> maybe.
[09:28:43] <RikusW> yep
[09:28:56] * RikusW blames the crappy XP CDC driver...
[09:29:26] <twnqx> RikusW: i plugged a usb serial into my windows VM and got COM21...
[09:30:26] <megal0maniac> Horologium: VW Citi Golf 1.4
[09:30:28] <Horologium> not a lot of software even handles that high a com port.
[09:30:28] <megal0maniac> Lovely car
[09:30:33] <Horologium> aahh...yeah..
[09:30:38] <Horologium> bit small for my uses though.
[09:30:52] <megal0maniac> I think I'm at COM60 something on my old laptop
[09:31:00] <megal0maniac> If not that, than even higher..
[09:31:04] <Horologium> knew a guy who converted a VW rabbit from gas to diesel...same engine block..
[09:31:30] <megal0maniac> That's madness. And I wouldn't want it in diesel :)
[09:31:50] <Horologium> he ran it on mcdonalds waste grease.
[09:32:19] <twnqx> lol
[09:32:23] <Horologium> in the 3 years that I knew him after that conversion he never bought fuel for it.
[09:32:52] <Horologium> small car wouldn't do so well for me these days with what I do.
[09:33:11] <Horologium> I have a 2007 ford ranger pickup and it's full, both the bed and the passenger seat.
[09:33:12] <twnqx> building large electronics? :P
[09:33:15] <Horologium> parts and tools.
[09:33:20] <Horologium> I fix copiers for a living.
[09:33:28] <twnqx> ah
[09:33:35] <megal0maniac> No hope for you
[09:33:41] <Horologium> and carry about 5000 dollars worth of bits and pieces in my truck.
[09:33:45] <megal0maniac> (Having a citi golf)
[09:33:52] <Horologium> but, the company pays for my gas so,,
[09:34:07] <Horologium> I want to get another metro convertable though.
[09:34:28] <Horologium> used to have a fire engine red one that got 42MPG
[09:35:02] <WormFood> [22:07:02] <megal0maniac> dpy: Check this out too: http://www.wormfood.net/avrbaudcalc.php <-- I'm may move this page in the near future, but I'll put in a redirect if I do.
[09:35:55] <megal0maniac> WormFood: I've heard rumours that it's copied from a datasheet :P
[09:36:56] <twnqx> it can also calculate arbitrary values
[09:37:06] <twnqx> also, how would you get different values :P
[09:39:38] <megal0maniac> I need the multiplug that my router is plugged into. Cheers )
[09:39:38] <WormFood> those tables are actually dynamic. It has a list of frequencies in the source code
[09:40:09] <WormFood> the tricky part was figuring out their method for calculating the error rate, but obviously I got that figured out years ago
[09:40:10] <megal0maniac> WormFood: I use it often. Thanks :)
[09:40:26] <WormFood> your welcome. I'm glad to know that people appreciate it.
[09:40:53] <WormFood> I wrote it for the specific purpose of finding a crystal, that would give me a specific non-standard bit rate
[09:42:03] <megal0maniac> It does what it says on the box ;)
[09:43:38] <twnqx> isn't the error not just the difference between the frequency you actually get from your settings and the one you aimed for?
[10:52:18] <rue_bed> WormFood, error is actual/desired*100
[10:52:25] <rue_bed> er no
[10:52:28] <rue_bed> -
[10:52:33] <rue_bed> no /
[10:52:42] <rue_bed> ok, Im not awake enought right now to tell
[10:53:24] <rue_bed> WormFood, its great for hte non-standard crystal thing
[10:53:34] <rue_bed> ok , I need to get up
[10:59:27] <WormFood> sorry, I had to go out, and get a haircut before all the shops close up...
[10:59:51] <WormFood> there are several different ways to calculate the error rate. Hold on a sec, and I'll look at the source code, and see which one I used.
[11:01:27] <WormFood> My comments from the source code --> There are 2 different ways to calculate the percent of error between two different bit rates. I use the relative percent of error formula, because that is what Atmel uses in their data sheets. error=(abs(desired-measured)/measured)*100
[11:02:14] <WormFood> maybe they give you that now, in their datasheets, but when I wrote my program, I just had to figure it out by trial and error.
[11:04:54] <WormFood> of course, that wasn't too much work...there is only so many different ways you can calculate the error rate
[12:19:55] <amee2k> i'm fixing a power supply but the fuse was obliterated so badly in the failure that the old rating isn't readable anymore (glass tube fuse without end caps and no rating on the silkscreen). the device is rated for an input current of 0.5A. i've got a 500mA fast blow, or an 800mA slow blow fuse. which one is the better choice?
[12:21:15] <xorly> what kind of power supply?
[12:21:39] <amee2k> 36W power brick... single ended forward converter
[12:21:42] <OndraSter> what device?
[12:21:51] <OndraSter> fast ones ... not sure if they are a good for SMPS converters
[12:22:24] <OndraSter> because of the inrush current to the cap
[12:22:29] <amee2k> input capacitor is 470uF and it has an NTC labeled "NTC 10D-9"
[12:23:02] <amee2k> exactly... and i'm wary because the closest slow blow ones i have are 250mA and 800mA
[12:23:09] <xorly> input capacity would blow fast fuse, slow is neede
[12:23:28] <amee2k> then the 800 one it is
[12:23:44] <amee2k> thanks :D
[12:24:17] <xorly> I agree, when something scews up, it doesn't matter if there was 800mA or 500mA fuse
[12:25:14] <amee2k> the fault was weird to begin with... the switching transistor failed short
[12:25:41] <amee2k> it totally obliterated the fuse in the power supply *and* blew the 4A fuse in the surge protector on the power strip
[12:27:23] <OndraSter> nic
[12:27:23] <OndraSter> e
[12:27:23] <OndraSter> throw it in the bin
[12:27:59] <amee2k> i was ordering parts anyway... got a new switching transistor and new controller IC for 2$
[12:28:40] <Tom_itx> order me some thruhole 330 ohm... i forgot i was out
[12:29:12] <amee2k> thats miles cheaper than a replacement power brick... this thing has weird voltages on it
[13:56:35] <rue_shop2> who +r d the channel?
[13:56:56] <rue_shop2> Tom_itx, something goin on?
[13:58:21] <OndraSter> spam bots
[13:58:23] <OndraSter> were here
[13:59:00] <rue_shop2> were they spamming?
[13:59:38] <OndraSter> no idea, I was not here
[13:59:42] <vsync_> :D
[14:00:32] <xorly> yeah, +r was surprise for me too
[14:01:11] <vsync_> rated r for mature
[14:01:28] <OndraSter> :)
[14:01:31] <OndraSter> rated r for redheads
[14:01:59] <xorly> rated r for retar** :-|
[14:02:30] <vsync_> retard is not a naughty word
[14:02:37] <vsync_> momma told me that
[14:03:26] <xorly> :)
[14:06:07] <RikusW> what +r for ?
[14:06:25] <OndraSter> <OndraSter> spam bots
[14:06:26] <OndraSter> <OndraSter> were here
[14:06:31] <OndraSter> you have to login at Nickserv
[14:06:39] <RikusW> ah, must register ?
[14:06:44] <OndraSter> if you are not, yes
[14:07:24] * RikusW played cnc3 with a crappy mouse, got a sore finger now :|
[14:07:32] <OndraSter> hehe
[14:07:35] <RikusW> changed back to my old mouse...
[14:07:39] <OndraSter> I don't like the new C&Cs
[14:07:43] <OndraSter> I much prefer the old Red Alert
[14:07:46] <OndraSter> + Yuri's Revenge
[14:07:46] <RikusW> its slower, but a better shape and ps2
[14:07:55] <xorly> I like C&C3 :TW
[14:07:56] <OndraSter> PS2... duh... :)
[14:08:15] <RikusW> its just old with 3d nothing much changed actually....
[14:08:26] <RikusW> except more clicking :S
[14:08:34] <RikusW> my pc got only one ps2 port...
[14:08:44] <OndraSter> yeah
[14:08:45] <RikusW> green+purple
[14:08:54] <OndraSter> who uses nowadays PS2 for keyboard or mouse..
[14:08:58] <OndraSter> I just shove it into USB
[14:08:59] <RikusW> though it wouldn't boot using a ps2 keyboard..
[14:09:01] <OndraSter> which I am running out of
[14:09:05] <RikusW> heh
[14:09:32] * RikusW got 3 usb3 ports now :)
[14:09:47] <RikusW> possibly 4 but the fourth isn't brough out...
[14:10:01] <RikusW> case only connects one to the blue cable
[14:10:21] <RikusW> unfortunately my external hdd's are usb2...
[14:10:33] <RikusW> got one with usb+esata
[14:12:10] <RikusW> g2020 cpu runs cool :) 24C
[14:12:22] <RikusW> compared to my old p4 running at 50C
[14:13:07] <vsync_> um thts almost roop temp i guess
[14:13:19] <vsync_> room*
[14:13:28] <vsync_> so... runs very cool then
[14:13:48] <RikusW> yes
[14:14:07] <RikusW> clocks at 1.6GHz when idle
[14:14:13] <RikusW> up to 2.9
[14:14:44] <RikusW> case temp 26C cpu 24C :)
[14:14:45] <inkjetunito> desktop or laptop/mobile?
[14:14:52] <inkjetunito> ahh, desk
[14:14:55] <RikusW> desktop intel G2020 cpu
[14:15:23] <RikusW> cost about 50Euro
[14:18:34] * RikusW wonders how the logic can work at only 0.84V...
[14:32:40] <rue_house> carefully
[14:33:05] <karika200> hi
[14:34:00] <karika200> I'm using an ATmega8. I set the PB1 as output and I'm using it. Can I somehow get the current status of the port in my program?
[14:34:07] <karika200> If it is set to 1 or 0?
[14:34:20] <twnqx> read back PORTB or just PINB?
[14:34:22] <rue_house> read PORTB
[14:34:26] <rue_house> instead of PINB
[14:34:41] <twnqx> uh, pinb should even work, no?
[14:34:51] <twnqx> but yes, portb is definite
[14:34:53] <rue_house> PINB is the pin status by voltage, PORTB is the pin status by output setting
[14:35:09] <twnqx> pinb allows you to see if you have a short circuit :P
[14:35:28] <karika200> thx
[15:47:54] <dpy> damn
[15:48:17] <dpy> I just printed the PCB with the SOT23 Tiny10 and two SSOT6 MOSFETs
[15:48:28] <dpy> that's friggin' tiny!
[15:52:48] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/temp/tiny/tinyboard1.jpg
[15:52:51] <Tom_itx> tiny10
[15:53:03] <Tom_itx> laser toner transfer
[16:10:58] <langoliers> h
[16:11:33] <langoliers> OndraSter<= redalert can be played through without hacks ?
[16:11:55] <langoliers> OndraSter<= i use ps2 mouse for example...
[16:12:09] <langoliers> what is bad in ps2 ? ps2 is better than usb
[16:18:50] <kdehl> o
[16:18:55] <xorly> eg. PS2 has too low bandwidth for high-res mices AFAIK
[16:21:13] <langoliers> xorly<= i think it is fine
[16:21:24] <langoliers> anyway for keyboard you can say nothing.
[16:21:38] <langoliers> what do you do ? 1 keypress per second?
[16:22:41] <xorly> langoliers: maybe better latency and time precission, gamers can appreciate it
[16:23:07] <langoliers> i think you are shooting in the air blind, no ducks around
[16:23:36] <xorly> my own experience
[16:23:46] <langoliers> usb is shit in latency
[16:23:50] <langoliers> 1ms+
[16:24:15] <langoliers> that is not better than ps2
[16:24:38] <xorly> a haven't seen any PS/2 mouse with laser sensor and resolution around 2000dpi
[16:25:16] <langoliers> i guess because that requires so much processing power and since usb is 'cool' they use that
[16:25:30] <langoliers> mouse does not send 2000dpi over usb.
[16:25:36] <langoliers> it just senses movement
[16:27:35] <xorly> but USB mouse with 2000dpi will notice smaller movements than some 800dpi PS/2 mouse => much more info about position -> higher data rates
[16:28:15] <langoliers> dreaming is good
[16:29:00] <xorly> :D
[16:29:12] <langoliers> btw did i say usb is shit today ?
[16:29:26] <xorly> IDK, reason?
[16:29:29] <twnqx> you did
[16:29:47] <twnqx> i just don't know a better simple 480mbit/S interface
[16:29:56] <langoliers> because of the latency, and the 500ppm clock precision required
[16:30:20] <langoliers> and lameness like pull this pin up with 224uA+-5%
[16:30:22] <twnqx> i am more annoyed that there are no useful usb 3.0 interface chips
[16:30:28] <langoliers> with unclear statements
[16:31:08] <langoliers> i will be annoyed if usb 3 gets any consumer use
[16:31:47] <twnqx> why
[16:32:01] <twnqx> usb3 hdds/flash memories are nice
[16:32:18] <langoliers> and sata 3 ?
[16:32:18] * xorly has to disconnect his external HDD quickly !
[16:32:28] <langoliers> no good anymore eh ?
[16:32:41] <twnqx> sata is internal stuff
[16:32:49] <twnqx> and esata is the stupidest idea indutry ever had
[16:32:58] <twnqx> alons for it requires an external power supply
[16:32:59] <langoliers> no, sata is hot-pluggable stuff
[16:33:01] <twnqx> alone*
[16:33:06] <twnqx> so is usb
[16:33:17] <langoliers> ok, why need usb then ?
[16:33:26] <twnqx> ... because sata is internal
[16:33:30] <xorly> USB is Universa Serial Bus, Universal...
[16:33:37] <twnqx> because sata ha no power
[16:33:39] <twnqx> has*
[16:33:43] <twnqx> it's data only
[16:33:48] <langoliers> aham... how about less crap on mb, and sata connector at back tooo?
[16:33:55] <twnqx> because i can't plug a logic analyzer to it
[16:34:02] <xorly> yep ^^
[16:34:05] <twnqx> <twnqx> and esata is the stupidest idea indutry ever had
[16:34:05] <twnqx> <twnqx> alons for it requires an external power supply
[16:34:26] <twnqx> no, the bullshit esata backside ports are just that, stupid bullshit
[16:34:27] <langoliers> i can plug various things in my parallel port too.
[16:34:39] <twnqx> yeah, but not at interesting data rates
[16:34:54] <langoliers> often works is enough
[16:35:13] <twnqx> try a 64channel logic analyzer at 66mhz
[16:35:18] <twnqx> enjoy your parallel port
[16:35:48] <twnqx> and no, usb 2.0 sucks for that too
[16:35:53] <langoliers> you will laugh on this then, they make oscilloscope for parallel port.
[16:36:17] <twnqx> and i firmly believe that scoped below 300mhz are justtoys
[16:36:29] <twnqx> at least i wouldn't buy one
[16:36:29] <langoliers> the oscilloscope has nothing to do with any of your pc's shitty lagging usbs or any ports.
[16:36:39] <twnqx> so?
[16:36:40] <langoliers> it just transfers data to be displayed
[16:36:49] <twnqx> can you record an hour or so so?
[16:36:59] <langoliers> sure, put 1GB ram in it
[16:37:14] <twnqx> at the usually 1gs/s?
[16:37:20] <langoliers> then transfer over 1 bit of the parallel port
[16:38:05] <langoliers> twnqx<= fpga does that, not the pc.
[16:38:13] <twnqx> does... what
[16:38:33] <twnqx> i don't have a several hundred GB ssd on my fpga
[16:38:44] <twnqx> i have a few TBs at 100MB/s though
[16:38:57] <langoliers> fpga does all processing, records to memory, then transfers information to be displayed over whatever port
[16:38:59] <twnqx> guess i could just use gbit ethernet
[16:39:08] <twnqx> you do realize
[16:39:24] <langoliers> i realize it is meaningless to reason you
[16:39:25] <twnqx> that at any decent sampling rates you're talking gbytes in a few seconds
[16:39:44] <twnqx> even if you compress that it won't last long
[16:39:56] <langoliers> i should tell you i never use a scope
[16:40:06] <twnqx> yeah, i never did as well
[16:40:18] <xorly> yes and one 1Gs/s means over 8GBytes to transfer
[16:40:18] <twnqx> i was very close to finally shelling out the two grand recently
[16:40:46] <langoliers> for what ?
[16:40:50] <twnqx> but i found an alternative solution, luckily
[16:40:55] <twnqx> for a decent scope
[16:41:16] <langoliers> did you know that your oscilloscope does dot display 10TB of information on a 640x480 screen ?
[16:41:36] <langoliers> and it will not update in 1ns ?
[16:41:37] <twnqx> i was looking at usb scopes
[16:41:43] <twnqx> with longterm recording options
[16:42:08] <twnqx> basically, highspeed triggered A/D converters
[16:42:19] <twnqx> with compression.
[16:42:20] <langoliers> usb does not need an ad conerter.
[16:42:37] <langoliers> this is what they say talking bullshit i believe
[16:42:48] <twnqx> err
[16:42:52] <twnqx> what i was saying is
[16:43:13] <twnqx> that the PC-usb-based oscilloscope basically is an external highspeed a/d converter
[16:43:27] <twnqx> streaming data to the pc
[16:43:41] <langoliers> yeah that is shit then
[16:43:56] <twnqx> i'
[16:43:58] <twnqx> ll agree
[16:44:03] <langoliers> you get bursts of useless data without time information
[16:44:07] <twnqx> usb 2.0 has nowhere near enough bandiwdth
[16:44:21] <twnqx> i guess there is a framing protocol
[16:44:24] <langoliers> it is not bandwidth, it is latency
[16:44:26] <twnqx> and inserted timestamps
[16:44:52] <twnqx> doesn't matter if the data is timestamped at the bandwidth isn't saturated
[16:44:59] <langoliers> ;/
[16:45:03] <xorly> yes, USB Oscope needs precise TimeBase inside too, so timestamp won't be problem
[16:45:21] <twnqx> sure, the randomness of usb sucks
[16:45:41] <twnqx> but at least it makes more bandwidth than any other interface easily available
[17:18:51] <langoliers> anybody know a simpler logic for this? or an universal macro?
[17:18:53] <langoliers> PORTD |= ( (si&1) << red_led ) | ( ((si>>1) & 1) << green_led ) | ( ((si>>2)&1) << blue_led ); // turn on leds
[17:18:53] <langoliers> PORTD &= ( (si&1) << red_led ) | ( ((si>>1) & 1) << green_led ) | ( ((si>>2)&1) << blue_led ); // turn off leds
[17:29:22] <twnqx> i would use a temporary variable
[17:29:39] <twnqx> but no, unless you turn that into macros... no.
[17:30:15] <twnqx> but are you sure the logic is correct?
[17:30:30] <langoliers> (it works)
[17:30:35] <twnqx> oh wait, it's not consecutive
[17:30:39] <twnqx> in your program, i mean
[17:30:47] <twnqx> it's like, two separate functions
[17:34:19] <langoliers> i think you shold be able to guess what it does
[17:34:30] <twnqx> yeah
[17:36:33] <twnqx> i might use PORT = ( PORT & ~((1<<red_led)|(1<<green_led)|(1<<red_led)) | ( (si&1) << red_led ) | ( ((si>>1) & 1) << green_led ) | ( ((si>>2)&1) << blue_led )
[17:36:46] <twnqx> PORTD*
[17:36:55] <twnqx> unconsditionally mask out all LEDS, then set them
[17:37:21] <twnqx> the and mask will turn into a constant
[17:37:31] <langoliers> hmm
[17:37:38] <twnqx> and you only need one read and one write to the IO Port
[17:37:58] <twnqx> but that's just efficiency ;)
[17:38:05] <langoliers> sounds fun
[17:39:11] <langoliers> hmm, yeah i had unnecessary read ;/
[17:40:31] <twnqx> consequence of the volatile
[17:40:46] <twnqx> compiler can't assume no change :/
[17:41:17] <twnqx> not sure how good the compiler will optimize the second part
[17:42:01] <twnqx> but i looked at some (x86) results that had similar amounts of shifts, and was positively surprised
[17:45:55] <langoliers> it even eliminates my delay loop :)
[17:46:13] <langoliers> want that variable 0 ? no problem!
[17:46:26] <twnqx> yeah
[17:46:49] <twnqx> i had to do for (i=0...) __asm__ "nop";
[17:47:26] <twnqx> mh or with braces... can never remember
[17:47:30] <twnqx> but you get it
[17:48:42] <langoliers> it needs some volatile switch to leave it alone
[17:49:01] <twnqx> hm
[17:49:19] <langoliers> and static inline to make it more likely to inline
[17:49:34] <langoliers> but only macro is a real inline on gcc
[17:49:37] <twnqx> __attribute__ ((always_inline))
[17:49:39] <twnqx> :>
[17:49:52] <langoliers> macro is fine too ;>
[17:50:06] <twnqx> "do as i say!" works as well
[17:50:15] <twnqx> but yeah, macro is guaranteed
[17:50:17] <langoliers> i don't trust gcc ;/
[17:50:35] <langoliers> they make it uninline inline atributes
[17:50:46] <twnqx> inline is just a hint
[17:50:59] <twnqx> that attribute is the hammer to force it
[17:51:03] <langoliers> i think gcc can decide that without a hint...
[17:51:20] <twnqx> depends on -O setting
[17:51:23] <langoliers> so i'm just writing thing that is ignored
[17:51:29] <twnqx> -Os will almost never inline
[17:51:50] <langoliers> on pc i do -O3, on micro... well space is limit usually
[17:52:43] <langoliers> the extreme ends
[17:54:10] <twnqx> http://gcc.gnu.org/ml/gcc-help/2007-01/msg00049.html
[17:54:12] <twnqx> :)
[17:59:44] <twnqx> if there's one thing i hate about C... it's the lack of dynamic preprocessor macros
[18:00:36] <twnqx> though... maybe the compiler would just eliminate a switch() statement that is fed a constant.. hmm
[18:01:19] <langoliers> gcc evaluates my 3x3 matrix multiplication macros at compile time :)
[18:01:39] <langoliers> it is just, macros are not that smart
[18:03:12] <twnqx> and... slow
[18:03:40] <twnqx> i recently used a lot of macro magic
[18:03:43] <langoliers> on a PC ? no
[18:03:47] <twnqx> recursive macros, etc
[18:03:53] <twnqx> it takes seconds to compile the file
[18:03:58] <langoliers> haha yes.
[18:04:05] <langoliers> i can wait a minute for a compile
[18:04:08] <twnqx> :)
[18:04:41] <langoliers> rather than write 60000 line of asm code
[18:04:51] <twnqx> ;)
[18:05:09] <twnqx> i stopped writing assembler on large scale
[18:05:22] <langoliers> gcc compiles to asm
[18:05:48] <twnqx> yeah, but i still wouldn't write it myseld
[18:05:55] <twnqx> i was tempted some days ago
[18:05:57] <langoliers> 5000 lines of C is about 60000 lines of asm
[18:06:01] <twnqx> then i was told some tricks
[18:06:15] <twnqx> and gcc did what i'd have done in asm....
[18:06:37] <twnqx> my 4k lines of c compile to <20kB
[18:09:36] <OndraSter_> my 2k - 3k lines of asm compile to 3.5kB I think :P
[18:09:40] <OndraSter_> for mega128a!
[18:11:19] <langoliers> do you use asm for fun?
[18:11:28] <langoliers> or is was hardcoded?
[18:16:37] * RikusW coded a jtagice in 3770 lines of asm
[18:17:29] <RikusW> stk500 and bootloader in another 4000 lines
[18:17:37] <twnqx> but... why
[18:17:49] <RikusW> got fed up with gcc
[18:17:54] <RikusW> avr-gcc
[18:17:58] <twnqx> Oo
[18:18:07] <RikusW> and did some stuff not possible with gcc
[18:18:12] <RikusW> like loadable modules
[18:18:22] <RikusW> loading it high in flash
[18:18:42] <RikusW> btw its not that much harder than C
[18:18:57] <RikusW> apart from having to keep track of register usage....
[18:18:59] <twnqx> loadable modules would be possible in C
[18:19:11] <RikusW> with a BIG BIG effort
[18:19:24] <twnqx> nah, function pointers are simple
[18:19:34] <RikusW> it is
[18:19:41] <twnqx> probably would have them all be variadic
[18:19:48] <twnqx> or the prototype at least
[18:20:08] <RikusW> getting gcc to do what I wanted would have taken longer than just writing the asm...
[18:20:14] <megal0maniac> OndraSter_: Get one of these: http://www.ebay.com/itm/330781947974
[18:20:39] <RikusW> and avr-gcc is buggy and don't always do what you want
[18:20:53] <RikusW> twnqx: like putting a full CDC USB stack in only 800 bytes.
[18:21:03] <megal0maniac> My mobo has 3 unused headers (6 ports) so I got one. Glad I did
[18:21:23] <langoliers> RikusW<= there is inline asm too
[18:21:41] * RikusW really dislikes AT&T asm...
[18:21:59] <langoliers> mee too this is why i used --masm=intel switch
[18:21:59] <OndraSter_> I have got few of those megal0maniac
[18:22:08] <megal0maniac> Oh dear
[18:22:12] <twnqx> as long as it's ELF you could write some objects in asm...
[18:22:24] <megal0maniac> Then go pci-e x1 :)
[18:22:35] <OndraSter_> megal0maniac, I do not have them plugged in :P
[18:22:39] <OndraSter_> langoliers, it was beacuse I needed every single CPU cycle
[18:22:50] <OndraSter_> screw gcc, I did not use any memory for variables, just registers
[18:22:56] <OndraSter_> but I ran very intensive stuff on it
[18:23:01] <twnqx> pfff
[18:23:05] <twnqx> i got gcc to do that as well
[18:23:07] <langoliers> i like that.
[18:23:11] <megal0maniac> That's all. Goodnight!
[18:23:14] <langoliers> registers are way faster than memory.
[18:23:14] <OndraSter_> gn
[18:23:17] <OndraSter_> of course
[18:24:30] <langoliers> you don't know gcc's little secrets then?
[18:24:54] <OndraSter_> like..?
[18:25:08] <langoliers> clone the function parameter to make gcc cache it into register
[18:25:12] <OndraSter_> eh
[18:25:18] <OndraSter_> or you know, just use asm :P
[18:25:22] <langoliers> yeah
[18:25:23] <OndraSter_> it was nothing hard, just intensive
[18:25:31] <langoliers> it is just... more time
[18:25:35] <twnqx> just declare the vrs as register :X
[18:25:35] <OndraSter_> afterall, it is always load & process & save result :D
[18:25:44] <langoliers> but gcc can not do atomic stuff
[18:25:50] <OndraSter_> (except here it was load, process and no saving)
[18:26:11] <langoliers> well anyway, if you use -O3
[18:26:19] <langoliers> gcc uses mostly registers
[18:26:19] <OndraSter_> I was driving 3072 LEDs with the atmega
[18:26:23] <OndraSter_> at 16MHz
[18:26:32] <OndraSter_> it made about 35% CPU load
[18:26:51] <OndraSter_> in the end
[18:26:53] <langoliers> 4094 ?
[18:26:56] <OndraSter_> giving me enough space to write simple pong :)
[18:27:02] <OndraSter_> what is 4094?
[18:27:06] <langoliers> CD4094
[18:27:09] <langoliers> shift register
[18:27:11] <OndraSter_> I figured that
[18:27:12] <RikusW> twnqx: I was able to make the application fw in C and interface it to the CDC code in the bootloader btw.
[18:27:19] <twnqx> http://pastebin.com/gMYKi6xb <- 0 bytes ram use :P
[18:27:34] <OndraSter_> I used one 595 + binary decoders to drive row FETs and then constant current LED drivers for the low side
[18:27:40] <OndraSter_> for columns
[18:28:09] <OndraSter_> from... Allegro
[18:28:17] <OndraSter_> I was given them by the teacher...
[18:28:27] <OndraSter_> as he had a big stack of them at home
[18:28:39] <twnqx> i know that problem
[18:28:51] <twnqx> "hey, buying 1000 is not much more expensive than buying 100"
[18:28:57] <langoliers> hehe i never seen thing like this in C before
[18:28:58] <langoliers> DDRB = 0b11110000; /*PB4-7 are LEDs */
[18:29:00] <OndraSter_> no, he got them from a company that was closing
[18:29:07] <langoliers> everybody uses hex
[18:29:12] <twnqx> i don't
[18:29:14] <OndraSter_> I use binary sometimes
[18:29:23] <OndraSter_> it all depends on the context
[18:29:32] <twnqx> hex where it's useful, binary wheni want to see bitmasks
[18:29:37] <twnqx> i'm visual in that
[18:30:10] <langoliers> for da hax0rz a 0x34ff is visual ;>>
[18:31:24] <RikusW> just be carefull some bit positions change between different AVRs
[18:31:33] <langoliers> i saw some 0.8mm pitch resistor arrays ;/
[18:31:44] <twnqx> large!
[18:31:52] <RikusW> I soldered some of those
[18:32:05] <langoliers> but only 4 resistors in one, so you need 2 of this for a 8 bit port
[18:32:06] <RikusW> and found it was almost impossible to get a solder bridge :)
[18:32:14] <RikusW> mine is 8 in one
[18:32:17] <RikusW> 10 pins
[18:32:24] <RikusW> 2 is common
[18:32:34] <RikusW> YC158
[18:32:36] <langoliers> they're cheap
[18:33:02] <langoliers> $1/230 pieces
[18:33:36] <twnqx> ok, that is cheap
[18:35:32] <twnqx> RikusW: i wrote that when i wasn't trusting my chip any more
[18:36:01] <langoliers> pic used to die at random
[18:36:16] <langoliers> pic's die used to die at random :)
[18:39:34] <RikusW> pics used to have dies :-P
[18:40:02] <RikusW> before 230Vac :-D
[19:12:07] <rue_bed>
[19:12:13] <rue_bed> pics suck
[19:12:24] <rue_bed> verry poewr sensitive
[19:13:33] <Xark> That, plus the architecture pretty much sucks too. :)
[19:13:36] <langoliers> rue_bed<= they need 224uA +- 5%? ;)
[19:14:39] <langoliers> wondering how much avalanche energy/current can an atmega take :)
[19:32:10] <RikusW> http://www.youtube.com/watch?v=KH1_Q-BQh1A
[19:32:17] <RikusW> want a pet ? :-D
[19:39:55] <Horologium> sure.
[19:39:58] <Horologium> looks cute and cuddly.