#avr | Logs for 2017-01-12

Back
[00:45:35] <hypermagic> Hi
[00:46:04] <hypermagic> #define magic static inline
[00:46:14] <hypermagic> magic void ...
[01:15:50] <rue_house> bah, the max548 isn't i2c
[02:20:54] <rue_house> that said, it looks easier
[02:21:25] <rue_house> it does mean a whole nother dev cycle tho
[02:40:17] <rue_house> its too bad I cant access the carry flag from C
[02:42:41] <hypermagic> what do you need that for ?
[02:43:26] <rue_house> real analog output
[02:43:42] <rue_house> oh, serial data
[02:43:50] <rue_house> I just want it
[02:43:55] <hypermagic> rc lowpass wont do ?
[02:44:01] <rue_house> no it wont
[02:44:14] <rue_house> not today
[02:44:55] <hypermagic> and what problem you can't solve without carry flag?
[02:46:02] <rue_house> oh I can, but it'd be nice to do it with the carry
[02:46:15] <rue_house> I suppose I could just write the fn in asm
[02:46:16] <hypermagic> i don't think so ;/
[02:46:26] <rue_house> CSlow();
[02:46:26] <rue_house> for( m = 0x80; m != 0; m >>= 1) {
[02:46:26] <rue_house> if ((m & d) != 0) {
[02:46:26] <rue_house> push1();
[02:46:26] <rue_house> } else {
[02:46:27] <rue_house> push0();
[02:46:29] <rue_house> }
[02:46:31] <rue_house> }
[02:46:33] <rue_house> CShigh();
[02:47:10] <hypermagic> hm btw i never used push pop in c on avr yet
[02:47:24] <rue_house> its not a real push
[02:47:30] <rue_house> #define push1() PORTB = b011; PORTB = b010
[02:47:31] <rue_house> #define push0() PORTB = b001; PORTB = b000
[02:48:33] <hypermagic> oh i see but you are missing the delay
[02:48:47] <rue_house> no I'm not :)
[02:49:08] <hypermagic> gotto gofast?
[02:49:09] <rue_house> its just blindingly fast
[02:49:15] <hypermagic> haha
[02:49:27] <rue_house> it does work
[02:49:33] <hypermagic> kk
[02:49:46] <hypermagic> btw did you ever use hc595?
[02:49:50] <rue_house> yup
[02:50:15] <hypermagic> i was surprised to see how fast it did step in those bits perfectly
[02:50:28] <rue_house> yep
[02:50:31] <Emil> rue_house: what's the point of that functiopn
[02:50:54] <Emil> To send out a byte?
[02:51:12] <rue_house> yup, to a max548
[02:51:14] <hypermagic> rue_house, btw i wired it as i did my programming cable, udma133 mode
[02:51:42] <rue_house> ?
[02:51:45] <hypermagic> every second wire on the flatcable is gnd
[02:51:59] <rue_house> ah
[02:52:39] <hypermagic> capacitive crosstalk fucks signal integrity otherwise
[02:52:43] <rue_house> you know, I'v never pulled apart one of those 80 conductor cable connectors
[02:53:53] <hypermagic> it is common knowledge, 40 pin ide cable was shit because capacitive crosstalk, it was about 5MB/s when it lost it
[02:55:20] <hypermagic> rue_house, i have a spacewire project
[02:55:48] <hypermagic> rue_house, what is your opinion about spacewire?
[02:55:49] <rue_house> ?
[02:56:15] <rue_house> hmm the code compiled, that suspicious
[02:57:34] <Emil> rue_house: do you want maximum speed of transmission?
[02:57:43] <rue_house> I hate flying blind, I really wanted to do this project differently
[02:57:57] <rue_house> sure, you have an optimizaion?
[02:58:28] <rue_house> I could unroll it I suppose
[03:01:26] <rue_house> well, no jumper wries, I'll have to test the code tommorow
[03:01:52] <rue_house> if I have a working DAC, I can work on some code to read the 24lc512
[03:02:26] <rue_house> and, in a few weeks I should have the sound player I been trying to get myself to finish for 3 years
[03:09:28] <Emil> https://emil.fi/jako/bbspi.c
[03:09:59] <Emil> Might need to add a nop to make it even, though
[03:10:55] <Emil> That assumes that we have the whole register, though
[03:12:22] <hypermagic> rue_house, for( m = 0x80; m != 0; m >>= 1) { t=((m & d)<<1)|1; PORTB = t; t ^= 1; PORTB = t; } added delay :)
[03:39:35] <hypermagic> sry
[03:42:42] <hypermagic> rue_house, here is your carry: for( m = 0x80; m != 0; m >>= 1) { t=(((m & d) != 0 )<<1)|1; PORTB = t; t ^= 1; PORTB = t; } added delay :)
[03:49:20] <Emil> hypermagic: there is no reason to use conditionals
[03:59:17] <hypermagic> Emil, there is always a reason ;>
[04:01:15] <Emil> hypermagic: not in this case
[04:01:43] <Emil> Using conditionals is probably detrimental to the performance
[04:02:16] <Emil> They always include a comparison and then either conditional or unconditional jump
[04:02:31] <Emil> The problem is deterministic
[04:04:57] <hypermagic> in asm the zero flag is implied after and possibly so it has no penalty using it.
[04:06:44] <hypermagic> and no my code does not include a jump ;)
[04:07:46] <hypermagic> in case you want to know it is called functional polymorphism
[04:17:31] <Emil> hypermagic: ldi and cmp shift or out xor out shift branch equal
[04:17:42] <Emil> That's the naive translation of your code
[04:18:59] <Emil> hmm, does that even include the required asm after cmp
[04:19:34] <hypermagic> Emil, m = 0x80;
[04:19:34] <hypermagic> #define repit8x() t=(((m & d) != 0 )<<1)|1; PORTB = t; t ^= 1; PORTB = t; m >>= 1;
[04:19:34] <hypermagic> repit8x();repit8x();repit8x();repit8x();repit8x();repit8x();repit8x();repit8x();
[04:19:57] <Emil> Might need to insert branch equal there, too
[04:19:59] <hypermagic> no jumps
[04:20:15] <Emil> hypermagic: so? That's different code
[04:20:21] <Emil> and still includes cmp
[04:20:47] <Emil> But I'm not sure if it needs branch equal to handle that != or if one can get it somehow else
[04:21:22] <hypermagic> they used to leave it out in C...
[04:21:42] <hypermagic> but that does not change the logic
[04:21:55] <hypermagic> (hopefully)
[04:22:07] <Emil> hypermagic: my point is that your code unnecessary adds compare
[04:26:26] <hypermagic> Emil, read this http://www.atmel.com/images/Atmel-0856-AVR-Instruction-Set-Manual.pdf then start over again
[04:26:45] <Emil> hypermagic: how about you read it
[04:27:15] <hypermagic> Emil, assuming i didn't. ;/
[04:27:29] <Emil> hypermagic: you are assuming I didn't
[04:27:40] <hypermagic> yes
[04:29:41] <Emil> hypermagic: same way
[04:33:01] <hypermagic> If you did then you did not pay attention to details.
[04:35:25] <Emil> hypermagic: how about you get off your hight horse and translate your code into assembly
[04:36:30] <hypermagic> i was being respectful, you are on high horse ;>
[04:37:09] <Emil> hypermagic: and out shift sbi is pretty much as low as you can get
[04:37:21] <hypermagic> it is also a good thing to let others think by theirselves
[04:37:50] <Emil> and cmp shift or out pin is what your generates to IF we assume the simple t^=1; port=t optimisation to pin
[04:38:02] <Emil> hypermagic: so yeah, get of your high horse
[04:38:34] <Emil> and out shift sbi is also even
[04:39:07] <hypermagic> i don't write much asm because gcc does a good job at it usually
[04:39:20] <Emil> hypermagic: oh there we go
[04:39:26] <hypermagic> but i do used to check the output asm gcc makes for me
[04:43:12] <hypermagic> good thing in a C code that i can copypasta it into my x86, avr, arm code and it will work
[04:43:35] <hypermagic> i also like macros
[04:44:18] <Emil> hypermagic: are you still not getting it?
[04:45:12] <Emil> PORT=d&1; d>>=1; PORT|=2;
[04:46:23] <hypermagic> if your device doesn't have a pntoggle function builtin like xmegas then modding a port wil first translate to a port read then a port write
[04:46:45] <hypermagic> port toggle
[04:47:30] <Emil> hypermagic: mate, how about you read the instruction set
[04:47:59] <Emil> And what registers are available in what avrs
[04:48:25] <Emil> Also your comment is not even relevant here
[04:48:32] <hypermagic> I don't use all.
[04:48:33] <Emil> My code does not toggle
[04:59:20] <hypermagic> Emil, when did you start programming? Do you do it much?
[04:59:51] <Emil> Yes I do it much
[05:00:15] <Emil> And that question comes from nowhere
[05:03:26] <hypermagic> How many years? ;>
[05:03:54] <Emil> hypermagic: more than you
[05:04:02] <Emil> See how stupid that question was?
[05:04:17] <hypermagic> 19?
[05:05:10] <hypermagic> yeah deefinitely
[05:07:00] <hypermagic> ok, invalid argument
[05:08:24] <shangul> hi.stk 200/300 programmer needs external power supply?if yes what voltage, etc?
[05:09:11] <shangul> or the power comes from parallel port?
[05:10:36] <hypermagic> hi, parallel port does not supply much current, you should give it 5V from usb for example
[05:12:00] <hypermagic> or the isolated supply on your working board will do if it is enough for programing
[05:12:37] <shangul> hmm, it was my idea, using usb port, i don't have an external power supply at all, so i want to use usb for circuits too
[05:13:30] <shangul> i mean the power of the board comes from usb
[05:14:15] <shangul> isn't this dangrous or something?
[05:15:07] <shangul> idk if i connect vcc and gnd of usb together what will happen
[05:15:30] <shangul> so?
[05:17:30] <hypermagic> shangul, usb is only 5v and usually limited to 150-500mA so it can not simply cause fire or electric shock even if you lick it
[05:18:52] <shangul> i thought it can give 1a, can i damage my motherboard in this way?
[05:19:02] <Emil> hypermagic: spec says 100mA initial, 500mA after negotiation, most just limit it straight away to 500mA
[05:19:08] <Emil> shangul: chargers are different
[05:19:17] <hypermagic> ofc it may shock you a bit if your pc is plugged into an ungrounded socket and you are earthed and you lick it
[05:20:04] <hypermagic> Emil, oh yea if the thing obeys the standard it might not let more than that out unless asked
[05:20:54] <Emil> Yeah, but most just give 500mA straight without any problems
[05:20:56] <Emil> which is nice
[05:20:59] <shangul> it doesn't matter if i get shocked but nothing should happen to my computer!
[05:21:46] <hypermagic> Well the standard defines short-circouit protection if i remember right
[05:22:57] <hypermagic> old ps/2 keyboards however used to be directly wired to 5V on motherboard and they did let out the magic smoke at short-circuit
[05:25:27] <hypermagic> shangul, interesting fact that parallel port can usually give out >0.5mA / high pin at 5V so in some cases it might be enough
[05:26:43] <shangul> i don't think that 0.5ma is enough, which cases?
[05:26:51] <hypermagic> but for example serial mouse gets its power from the serial port too, 5-25mA
[05:27:45] <hypermagic> well if somebody would turn on all unused pins and parallel them :)
[05:28:15] <shangul> what?
[05:28:30] <shangul> it's not standard
[05:29:43] <hypermagic> http://www.epanorama.net/circuits/rspower.html
[05:29:45] <hypermagic> :)
[05:29:55] <hypermagic> all serial mouses work like that
[05:30:18] <Emil> hypermagic: it's abit more
[05:30:27] <Emil> 2.5 to 10mA
[05:30:31] <shangul> ok 5ma of com1 + 5ma of com2 + .5ma of lpt1 = 10.5ma
[05:30:39] <hypermagic> also check this out shangul https://www.avrprogrammers.com/programmers/all-serial-port
[05:31:04] <shangul> i think i already saw that
[05:31:29] <hypermagic> "Typical PC serial port mouse takes 10 mA total current and operates at voltage range of 6-15V"
[05:31:45] <shangul> a stk200/300is cheaper and faster to make
[05:32:42] <hypermagic> http://www.dl1dow.de/artikel/arduino_bootloader/index_en.htm
[05:33:17] <hypermagic> i have one of the simple dapa and i made a dapa with a tristate buffer and switchable 5V :)
[05:34:40] <hypermagic> i could wire all unused pins parallel as power but i added o molex connector instead and i switch the 5V with a mosfet with 150mA current limit
[05:35:16] <hypermagic> it seemed more appropriate
[05:36:00] <hypermagic> i could also add an usb connector and pleg in one as power
[05:36:36] <hypermagic> good thing all laptops have usb too
[05:42:28] <shangul> so i know what to do, a simple stk200 programmer with an ic buffer which its power comes from usb port, all right?
[05:43:34] <shangul> seems right
[05:44:55] <hypermagic> sounds cool
[05:45:08] <hypermagic> no power supply required
[05:46:36] <hypermagic> did you download avrdude already ?
[05:48:02] <shangul> no but i want to
[05:48:30] <shangul> it sounds feature rich
[05:48:33] <hypermagic> http://www.nongnu.org/avrdude/
[05:48:41] <hypermagic> you on linux?
[05:49:05] <shangul> i already saw that, someone from here told me about it
[05:49:24] <shangul> yes on gnu/linux
[05:49:46] <hypermagic> k, fetch it and ready to burn
[05:50:16] <hypermagic> assuming you already have avr-gcc and/or asm?
[05:50:24] <shangul> but what assembler and c compiler i should use?avr-gcc and avr-as?
[05:50:36] <hypermagic> yes
[05:50:46] <hypermagic> and avr-libc
[05:51:10] <shangul> i have but i don't know how to use, avr-as gave me a.out
[05:51:28] <hypermagic> i have comyiled all of this from source yesterday for example
[05:51:41] <shangul> avr-libc is required for asm or just c?
[05:52:03] <hypermagic> you install avr-libc after you install avr-gcc
[05:52:28] <shangul> ok i'll do
[05:52:33] <hypermagic> avr-libc is written for avr
[05:53:13] <hypermagic> shangul, http://www.nongnu.org/avr-libc/user-manual/install_tools.html
[05:53:53] <hypermagic> you can install a simulator and debugger if you like to play with it learning
[05:54:11] <shangul> simulavr
[05:54:31] <shangul> ?
[05:54:34] <hypermagic> y
[05:57:14] <Lambda_Aurigae> avr-libc is required for C...it is the C libraries after all.
[05:57:50] <hypermagic> btw i installed avr-libc 2.0.0 and gcc 4.7.4
[05:57:58] <shangul> hi lamba
[05:58:17] <hypermagic> hi Lambda_Aurigae whatsup?
[05:59:09] <hypermagic> shangul, and now i upgraded from avrdude 6.0.1 to 6.3
[06:00:22] <shangul> with as how to assemble for avr?
[06:00:35] <hypermagic> and binutils 2.26.1 seems ok
[06:01:20] <Lambda_Aurigae> I am, I think.
[06:01:28] <Lambda_Aurigae> shangul, what AVR are you working with?
[06:02:07] <hypermagic> Lambda_Aurigae, btw avr-libc has some issues, it has aliased float as double ;/ i am replacing all double text to float now
[06:02:21] <Lambda_Aurigae> for most modern linux distros you can just use your package manager to install avr-libc, avr-gcc, avr-lib, and avr-binutils...some of those might be reversed, like gcc-avr and binutils-avr
[06:02:39] <shangul> atmega8
[06:02:40] <shangul> i ran "avr-as -mmcu=atmega8 led0.asm" and it gave me an a.out
[06:03:11] <Lambda_Aurigae> not so much an issue as the way it's done to limit the amount of code...so it doesn't have to have code for dealing with two different size floating point variables.
[06:03:16] <Lambda_Aurigae> shangul, that's what it is supposed to do.
[06:03:42] <shangul> Lamba, yes you are right but compiling from source is available on all unix likes
[06:04:07] <hypermagic> shangul, i like the atmega168p series too that is somewhat similar but newer
[06:04:45] <Lambda_Aurigae> I like the atmega1284p myself but I'm strange.
[06:04:56] <Lambda_Aurigae> for most assembly work I would use avra instead of avr-as
[06:04:57] <hypermagic> ;>
[06:05:15] <Lambda_Aurigae> avr-as is very powerful but is really meant for assembling code output from gcc-avr
[06:05:58] <Lambda_Aurigae> http://www.avr-asm-tutorial.net/avr_en/
[06:06:05] <Lambda_Aurigae> best tutorial I ever found on avr assembly.
[06:06:17] <shangul> i should use a.out to program my atmega8?
[06:07:03] <hypermagic> Lambda_Aurigae, i think my next step would be an lqfp100 100MHz arm :)
[06:07:19] <Lambda_Aurigae> shangul, it has to be converted to a .hex file.
[06:08:59] <Lambda_Aurigae> http://nerdathome.blogspot.com/2008/04/avr-as-usage-tutorial.html
[06:09:08] <hypermagic> Lambda_Aurigae, you wouldn't like an LPC1763FBD100 ?
[06:09:26] <Lambda_Aurigae> but you have to link it first.
[06:10:27] <Lambda_Aurigae> hypermagic, other than the speed, my pic32mx270f256b is just as good.
[06:10:46] <Lambda_Aurigae> and I don't need another programmer tool and toolchain.
[06:11:27] <Lambda_Aurigae> if I get to the point where I need more power than that I just go for a rPI or similar unit that is running in the GHz rage.
[06:12:45] <hypermagic> it is an ARM Cortex-M3 in lqfp fackage
[06:13:12] <hypermagic> rpi is larger and expensive
[06:13:20] <Gottaname> hey guys, attiny13 or attiny85
[06:13:24] <Lambda_Aurigae> shangul, avr-as just assembles your code. You will probably need to link with avr-ld. Then you will need to convert it to an ihex format with avr-objcopy
[06:13:26] <hypermagic> hi 85
[06:13:40] <Lambda_Aurigae> hypermagic, so? what do I need an arm m3 for?
[06:13:47] <Lambda_Aurigae> Gottaname, depends on what you are doing.
[06:13:47] <shangul> thanks lamba
[06:14:06] <Gottaname> Lambda_Aurigae, a relay switch reading in an R/C PWM signal
[06:14:22] <Lambda_Aurigae> shangul, unless you are doing things that require some real tight timing, you should probably go with C rather than assembly, unless you are comfortable with assembly anyhow.
[06:15:27] <hypermagic> Lambda_Aurigae, i was thinking about as upgrade to your 1284 avr :) i don't know what you use it for
[06:15:33] <Lambda_Aurigae> Gottaname, then either will work..tiny13 is a bit cheaper.
[06:15:49] <Lambda_Aurigae> hypermagic, that's what the pic32mx270f256b is.
[06:16:03] <Lambda_Aurigae> twice the flash, 4 times the flash, 4 times the speed.
[06:16:17] <hypermagic> yeah i checked it
[06:16:27] <Lambda_Aurigae> I have some stm32 arm chips but they are not particularly impressing me.
[06:17:12] <Lambda_Aurigae> my next step, if I go anywhere with it, will be a bigger pic32.
[06:17:15] <hypermagic> first i thought of atmel arms but there are things i don't like it them so i settle for nxp
[06:17:23] <shangul> lamba, i know, assembly is hard and slow(to code in), i will go on c when i got tired and angry or like that
[06:17:34] <Lambda_Aurigae> assembly is fun!
[06:17:35] <Lambda_Aurigae> I love it.
[06:17:43] <Lambda_Aurigae> but, C is easier by far.
[06:17:54] <Lambda_Aurigae> I taught myself assembly on the 6502 when I was 14.
[06:17:55] <hypermagic> assembly is slow to write
[06:18:18] <Lambda_Aurigae> 35ish years ago.
[06:18:42] <hypermagic> i heard about that too
[06:18:56] <Lambda_Aurigae> have since taught myself assembly for x86, pic, asm, 8051/2, 68000
[06:19:13] <shangul> when i was 14 i did not know assembly :( except a little 8086
[06:19:18] <Lambda_Aurigae> heard about? 6502 was one of the most used processors in the world for a while.
[06:19:42] <shangul> i heard about 8051
[06:20:10] <Lambda_Aurigae> my progression was BASIC, 6502 assembly, PASCAL, FORTRAN, C, 68000 assembly, x86 assembly, then all the rest.
[06:20:17] <Lambda_Aurigae> I love the 8052 series...
[06:20:38] <Lambda_Aurigae> the ability to map external ram/rom/flash to either program or data space rocks.
[06:20:41] <Gottaname> Lambda_Aurigae, which is more common though?
[06:20:42] <shangul> you knew these when you were 14?
[06:21:36] <Lambda_Aurigae> started with BASIC at 10...6502 on vic-20 and apple-2 when I was 14...pascal at 16, fortran at 18, C at 20ish.
[06:21:40] <hypermagic> wrote a knight rider running light in asm on the atmel 89c2051 16 years ago ;>
[06:22:17] <hypermagic> it was trendy at that time
[06:22:19] <Lambda_Aurigae> I only touched pic and avr about 17 years ago.
[06:22:45] <Lambda_Aurigae> 8051/2 about,,,,10 years ago.
[06:23:18] <shangul> just cool, and sad that i did not have these when i was 14
[06:23:26] <hypermagic> interesting thing was that the asm of the 89c2051 didn't differ much from the x86 asm
[06:23:34] <hypermagic> it was familiar
[06:23:43] <Lambda_Aurigae> hypermagic, yes, they are similar.
[06:23:43] <hypermagic> hi abcminiuser
[06:24:01] <Lambda_Aurigae> I found avr assembly to be similar to 6502.
[06:24:02] <Lambda_Aurigae> heya abcminiuser
[06:24:08] <Lambda_Aurigae> we were using your name in vain the other day!
[06:24:36] <hypermagic> Lambda_Aurigae, cisc vs risc right? ;>
[06:25:02] <Lambda_Aurigae> Gottaname, hmmmm...neither is really common....I like the 85 because it has more ram and flash.
[06:25:12] <shangul> someone said risc asm is easier
[06:25:14] <Lambda_Aurigae> hypermagic, these days those definitions are meaningless.
[06:25:32] <Lambda_Aurigae> risc just means fewer instructions that can run faster.
[06:25:52] <Gottaname> Lambda_Aurigae, I mean help for either, tutorials, thereabouts
[06:25:57] <Lambda_Aurigae> cisc has more complex instructions that don't run as fast but can do more with each instruction.
[06:25:58] <Gottaname> more people working on them
[06:26:00] <hypermagic> and branching differences
[06:26:05] <Lambda_Aurigae> Gottaname, they are about the same really.
[06:26:14] <shangul> Lamba, no if you are working with tiny12!
[06:26:25] <Lambda_Aurigae> I don't work with tiny12
[06:26:32] <Lambda_Aurigae> Jartza might.
[06:26:41] <Lambda_Aurigae> he likes them teeny tiny things.
[06:27:13] <shangul> i meant those definitions
[06:27:14] <hypermagic> Gottaname, http://www.atmel.com/devices/attiny85.aspx?tab=parameters this has adc, eeprom, ... more flash
[06:27:42] <hypermagic> it might be worth it for that extra cost
[06:28:27] <Lambda_Aurigae> hypermagic, again, depends on what it's used for. for learning, yeah. for a specific purpose design, use the chip that meets minimum requirements unless you are looking for future expansion capability.
[06:29:18] <Gottaname> Lambda_Aurigae, I'll start with the attiny13
[06:29:22] <Gottaname> once I've fried enough of them
[06:29:23] <Gottaname> :P
[06:29:29] <Gottaname> then I'll try the attiny85
[06:29:30] <hypermagic> yea i usually expand the features
[06:29:31] <Gottaname> thanks
[06:29:43] <Lambda_Aurigae> I've only ever physically damaged 1 AVR in the years I've been working with them.
[06:30:01] <Lambda_Aurigae> screwed up fuses on several but was always able to fix them with an external clock source.
[06:30:33] <Lambda_Aurigae> pic chips are much more sensitive to overvoltage or improperly connected power lines.
[06:30:39] <_ami_> if carabia were here, he would have said to Gottaname: throw your tinys into dustbin :P
[06:30:49] <hypermagic> Lambda_Aurigae, what i really missed from the 89c2051 is the ISP, and interrupts
[06:31:00] <Gottaname> _ami_, nah I need something less than a arduino
[06:31:04] <Gottaname> has to be small
[06:31:06] <Lambda_Aurigae> ISP? you mean the built in bootloader?
[06:31:27] <Lambda_Aurigae> Gottaname, you can get an arm in an 8pin chip these days...but that's major overkill for what you are doing in my opinion.
[06:31:44] <hypermagic> no i mean the serial programming :) the 2051 was only high voltage programmable and it is pretty fucked up
[06:32:05] <Lambda_Aurigae> hypermagic, and, avr has much nicer interrupt system than 8051/2051
[06:32:18] <Lambda_Aurigae> serial programming being the built in serial bootloader.
[06:32:21] <hypermagic> yes i see that
[06:33:32] <hypermagic> Gottaname, just get an atmega168p instead of an arduweenie
[06:34:59] <Lambda_Aurigae> hypermagic, atmega328p...same chip with more flash and ram.
[06:35:24] <hypermagic> yea get that if you want 32k flash
[06:35:57] <shangul> atmega8 has optional boot code section, what can i do with that
[06:36:15] <hypermagic> i just happened to find the best deal for 168pas
[06:37:40] <shangul> hypermagic, you were right, mega8 uses just 3.6ma in active state
[06:38:15] <shangul> well atmega8l
[06:38:16] <Lambda_Aurigae> shangul, you can put a bootloader on it.
[06:38:19] <hypermagic> shangul, p,a,pa versions even less :)
[06:38:40] <Lambda_Aurigae> the bootloader can be used to upload programs to the chip via usart or i2c or spi or whatever...usually usart though.
[06:38:56] <hypermagic> ofc depends on what else needs power and what is the operating speed
[06:39:07] <Lambda_Aurigae> shangul, that chip is older stock too...not made anymore...
[06:39:51] <shangul> which?atmega8l?
[06:40:00] <hypermagic> y
[06:40:04] <hypermagic> very old
[06:40:27] <hypermagic> i have one too, i shousd make something out of it
[06:40:39] <Lambda_Aurigae> atmega88 replaced the atmega8
[06:40:39] <shangul> the same about atmega16l, 32l, etc?
[06:40:45] <Lambda_Aurigae> yup
[06:40:53] <Lambda_Aurigae> replaced with atmega168, atmega328
[06:41:01] <shangul> atmega88?
[06:41:10] <Lambda_Aurigae> atmega88 is the replacement for the atmega8
[06:41:14] <Lambda_Aurigae> has some new features
[06:41:25] <Lambda_Aurigae> most notably, interrupt capability on every i/o pin...
[06:41:25] <shangul> what?afaik atmega8 is available yet
[06:41:32] <Lambda_Aurigae> old stock.
[06:41:45] <Lambda_Aurigae> only available until they are sold out.
[06:41:52] <Lambda_Aurigae> they made a shit tonne of the things.
[06:42:26] <shangul> whats atmega169?
[06:43:29] <shangul> 163, 162, 161
[06:43:31] <Lambda_Aurigae> different chip entirely...still avr but different "series"
[06:43:39] <Lambda_Aurigae> those are older as I recall.
[06:43:48] <shangul> ok
[06:44:03] <Lambda_Aurigae> atmega169 was used on the avr-butterfly I think.
[06:44:22] <Lambda_Aurigae> an old dev board that was used as namebadges for several years.
[06:44:31] <hypermagic> shangul, http://www.atmel.com/devices/ATMEGA169P.aspx?tab=parameters this
[06:44:51] <hypermagic> it has 64 pins
[06:45:07] <shangul> i see
[06:46:35] <shangul> i have these chips: atmega8a, ht27c020,sa556, ne555
[06:47:14] <shangul> and i don't know how to work with them, but i can make circuits with them
[06:47:36] <shangul> also um66 :)
[06:48:22] <hypermagic> Lambda_Aurigae, why is this cool? http://www.atmel.com/devices/ATMEGA32HVB.aspx?tab=overview
[06:48:50] <Lambda_Aurigae> ummm..dunno.
[06:48:54] <hypermagic> shangul, you probably should get more types ;>
[06:49:45] <hypermagic> 18-bit coulomb counter current A/D converter hmm ;/
[06:50:24] <Lambda_Aurigae> hypermagic, looks like a battery management processor to me.
[06:50:30] <hypermagic> it says so
[06:51:35] <Lambda_Aurigae> I don't do battery management myself so really no need for such.
[06:55:14] <hypermagic> well a 18 bit adc might be useful for things
[06:55:15] <Lambda_Aurigae> I've seen too many home grown battery management solutions go bad and burn buildings to the ground.
[06:55:32] <Lambda_Aurigae> again, nothing I need.
[06:55:39] <Lambda_Aurigae> at least, so far.
[06:56:16] <hypermagic> it is about -20°C outside ;/
[06:56:17] <Lambda_Aurigae> I usually shift my 12bit ADC to 8 bits anyhow.
[06:56:41] <Lambda_Aurigae> -11C with half an inch of snow on the ground.
[06:56:41] <shangul> thanks and bye for now
[06:57:16] <hypermagic> yea and snow
[06:57:54] <hypermagic> tempted to go and roll a few snowmans ?
[07:29:28] <Tigzee> Lambda_Aurigae, what about hte atmega128? I just bought a few of those...are they still being produced?
[07:39:31] <Lambda_Aurigae> not sure on the atmega128
[07:39:37] <Lambda_Aurigae> older core though.
[07:40:10] <Lambda_Aurigae> lots of i/o...ability to map external ram/rom/peripherals to data memory space.
[07:41:06] <sabor> isn't the 1280 a replacement for atmega128?
[07:41:19] <Lambda_Aurigae> dunno....does it have pin change interrupts?
[07:41:35] <Lambda_Aurigae> I don't work with many of the larger ones as they are all smt and I'm a lazy bastard.
[07:42:04] <Lambda_Aurigae> I have a 128 on a square board which is a pain too.
[07:42:17] <Lambda_Aurigae> need more smt to dip adapters for those chips dangit!
[07:42:44] <sabor> i have a 2560 on a square board, double row pin headers on all sides, not really breadboard friendly ;)
[07:44:22] <sabor> it's meant to be used with a funny development PCB, but I just thought it's a cool chip and already on a breakout board :)
[07:45:37] <Tachaway`> the 1284P is a nice chip
[07:45:49] <Tachaway`> it comes in a DIP40 and has 16K rather than 8K of RAM
[07:46:16] <Tachaway`> only 128K rather than 256K of flash but how much do you need really?
[07:46:47] <sabor> yes, i wanted to use it for a project too, too bad the project died :(
[07:47:58] <sabor> ha! if you have too much flash in your uP you can still use it to backup some mp3's or similar ;)
[07:47:59] <Lambda_Aurigae> I have a stack of 1284p chips here.
[07:48:23] <Lambda_Aurigae> and pic32mx270f256b chips as well....those are my favorite at the moment.
[07:48:40] <Lambda_Aurigae> dip 28 package with 256K flash, 64K sram, and hardware USB
[07:48:51] <Lambda_Aurigae> runs at 50MHz/83mips
[07:49:02] <Lambda_Aurigae> and can run code from flash or ram.
[07:50:42] <sabor> and what about the price compared to an avr?
[07:51:38] <Lambda_Aurigae> 4.45 for the pic32 vs 5.52 for the atmega1284p
[07:51:41] <Lambda_Aurigae> at digikey
[07:51:55] <Lambda_Aurigae> but the atmega1284p is an expensive chip.
[07:51:59] <Lambda_Aurigae> due to all the ram I suppose.
[07:52:40] <sabor> but the pic still has more of everything for less money...
[07:52:47] <Lambda_Aurigae> except for i/o pins
[07:52:47] <toddpratt> I think I looked at some PIC code once and it seemed a lot different from AVR code. I'm a n00b though.
[07:52:59] <Lambda_Aurigae> the pic32mx270f256b is 28 pin...the atmega1284p is 40pin
[07:53:16] <Lambda_Aurigae> toddpratt, C is C...just different register type stuff....
[07:53:27] <Lambda_Aurigae> however, the pic32 is a MIPS core, not a pic core.
[07:53:53] <Lambda_Aurigae> does require a bit more of a programmer than is necessary for most AVR chips too.
[07:54:01] <Lambda_Aurigae> but I have a pickit3 that works just fine.
[07:54:19] <Lambda_Aurigae> anyhoo..time for to go to w*rk
[10:19:34] <Jartza> Lambda_Aurigae: what I might? :o
[10:22:01] <Lambda_Aurigae> Jartza, worked with tiny5 or tiny12
[10:53:28] <_ami_> Eclipse sucks! overall.
[10:53:30] <_ami_> argg..
[10:56:52] <Jartza> Lambda_Aurigae: tiny5 yes, tiny12 nope
[10:57:04] <Jartza> except I've used tiny13, which is successor of tiny12
[11:02:16] <_ami_> Jartza: the tinys lover! :)
[11:05:53] <cehteh> someday atmel will invent a 3 pin mpu for Jartza .. VCC GND and one digital pin :)
[11:06:52] <cehteh> (arent there some programmable 1wire things? 2 pins only)
[11:10:59] <Jartza> cehteh: sounds good!
[11:11:10] <Jartza> hmm
[11:11:25] <Jartza> I could probably drive mono VGA out from single pin ;)
[11:11:28] <Jartza> yes. I could.
[11:11:38] <cehteh> na, HDMI is the goal
[11:11:43] <Jartza> shit. now I have to do that.
[11:11:52] <Jartza> VGA. from. single. pin
[11:12:00] <Jartza> why did I say that?
[11:12:04] <cehteh> lol
[11:12:23] <cehteh> when you do that, then 3 colors from 3 pins are within reach
[11:12:59] <Jartza> cehteh: I already push 8-color vga out from 3 pins
[11:13:07] <Jartza> hsync, vsync, red, green and blue
[11:13:12] <Jartza> https://hackaday.io/project/19248-394-byte-8-color-vga-demo-with-attiny5
[11:13:13] <cehteh> ah ok
[11:13:18] <Jartza> if you didn't check that :)
[11:13:25] <Jartza> there's schematic too
[11:13:33] <cehteh> mariginally
[11:13:47] <cehteh> its your fun, not very useable to me
[11:14:10] <Jartza> it's not useable for anything
[11:14:13] <Jartza> it's just for fun
[11:14:24] <cehteh> but i am thinking about doing something real like octapentaveega from a single tiny85 with color
[11:14:42] <cehteh> if only some data display on serial
[11:15:14] <cehteh> you could sample the internal temperature sensor and make a weather station for example
[11:15:40] <cehteh> maybe time too, and i bet you have some spare pins for other sensors
[11:16:07] <Jartza> ?
[11:16:16] <Jartza> octapentaveega does sample serial
[11:16:21] <cehteh> i know
[11:16:21] <Jartza> that's where the input comes from
[11:16:30] <Jartza> and yes, multiple colors is possible
[11:16:45] <Jartza> but with less characters on screen
[11:16:51] <cehteh> but having a single tiny85 with an old vga monitor as standalone clock and weather station would be fun
[11:17:42] <cehteh> or some other sensor, like display the state of the coffee machine or whatever
[11:17:43] <Jartza> source if public, just hack it ;)
[11:17:53] <cehteh> eek :D
[11:18:10] <cehteh> i try to avoid assembly
[11:18:30] <Jartza> nah
[11:18:33] <Jartza> avr assembly is very easy
[11:19:05] <cehteh> yes it is
[11:19:11] <cehteh> but still
[11:20:33] <Jartza> asm is fun
[11:24:08] <carabia> http://ideone.com/qcaQSx ada is superior to everything, and then some
[11:25:20] <carabia> it only took me 15 minutes to figure out how the fuck to do a left shift and even then i can't get it to work using variables, when the compiler proceeds to throw a hissy fit with all kinds of fucking errors none of which seem relevant. Wowzers.
[11:29:44] <cehteh> what asm does that produce?
[11:31:35] <Jartza> why use ada?
[11:31:48] <cehteh> bondage
[11:46:48] <carabia> specing: ^
[13:17:12] <specing> Because Ada is the most awesome language ever
[13:18:05] <specing> carabia: GNAT has a personal vendetta against you
[13:18:07] <specing> its a fact in the Ada world
[13:37:40] <Jartza> the most awesome language is the one you can actually use
[13:40:52] <cehteh> german? :D
[16:07:49] <Jartza> cehteh: I can't use german, so it's not awesome :)
[16:07:55] <Jartza> I can use finnish, swedish or english, htough
[17:53:53] <LeoNerd> Anyone know any way to get an Atmel MCU to use two separate pins for I²C SDA in vs. out? That would make an isolator much simpler to design
[17:54:11] <LeoNerd> I know I could bitbang it manually but I wonder if the hardware can do it on any of them
[17:54:42] <Jartza> umm
[17:54:53] <Jartza> how do you separate them on slaves?
[17:54:58] <LeoNerd> You don't need to
[17:55:01] <LeoNerd> On the slaves it's fine
[17:55:23] <Jartza> I meant electrically
[17:55:31] <Jartza> how do you separate the signal to two pins
[17:55:37] <LeoNerd> MCU has separate in and out pins, you put them separately through isolator channels, and then join them with a diode on the bus/slave side
[17:55:44] <LeoNerd> So the MCU itself is isolated from the bus
[17:56:07] <LeoNerd> Bus SDA -> isolator+pullup resistor -> MCU SDA in
[17:56:18] <Vikinger> im guessing one needs to type cli() once it has entered the interrupt routine
[17:56:18] <LeoNerd> Bus SDA <- diode <- isolator <- MCU SDA out
[17:56:23] <Jartza> well. how i2c is implemented, it's not really something i2c periferias are designed to
[17:56:37] <Jartza> so I don't really know why they even would allow separate pins for in&out :)
[17:57:50] <Vikinger> isn't the compiler supose to do that ?
[17:58:46] <Lambda_Aurigae> i2c isn't designed for 2 pins for in and out....there is bidirectional signalling on that line.
[17:58:48] <LeoNerd> Vikinger: ISRs start with interrupts disabled
[17:58:55] <LeoNerd> Lambda_Aurigae: please read what I actually wrote
[17:59:04] <LeoNerd> It's a standard technique that lots of chips do
[17:59:08] <LeoNerd> I just don't know Atmels specifically
[17:59:22] <Lambda_Aurigae> lots...hmm...never run into it myself.
[17:59:30] <LeoNerd> The FT232H in MPSSE, for example, only *ever* does it that way
[17:59:40] <LeoNerd> You have to link the D1+D2 pins together to form the SDA line
[17:59:49] <LeoNerd> If you don't do that, then D1 is just an output, and D2 is just an input
[17:59:58] <LeoNerd> Which *already* gives you exactly what you need to put an isolator in front of it
[18:00:07] <Vikinger> LeoNerd: but do you have to disable them on code or is that done automatically once you enter the ISR ?
[18:00:10] <Lambda_Aurigae> fun fun...no, I've never seen that an avr can do that.
[18:00:18] <LeoNerd> Vikinger: The *hardware* of the CPU does it, internally, atomically
[18:00:23] <LeoNerd> You don't have to worry at all
[18:02:02] <Vikinger> ok
[18:05:34] <Jartza> only if you want to do *nested* ISR, then you may want to call "sei" inside ISR
[18:05:42] <Jartza> but yeah, no need to disable ISR inside ISR
[18:10:04] <Vikinger> ic
[23:54:27] <Flipp_> in util/delay_basic.h, the _delay_loop_2 function has "brne 1b" : "=w" (__count): "0" (__count)
[23:54:49] <Flipp_> what does the =w mean?
[23:57:34] <Flipp_> =r is a register constraignt, but I don't see reference to 'w' anywhere in the docs
[23:58:49] <chisight> LeoNerd: http://m.eet.com/media/1075578/0411feat2fig1.gif
[23:58:49] <Flipp_> ah, nevermind. w = registers from r24 to r31 on avr