#avr | Logs for 2016-01-11

Back
[00:01:00] <MarkX> i'm trying to use timer4 on my atmega32u4 to output 2 separate PWM signals on 2 pins (OC4B and OC4D)
[00:01:36] <MarkX> http://pastebin.com/zHUJ7eGq this is the code for the set up of the timer, am i doing it right?
[00:02:16] <MarkX> i'm setting the compare registers as well >> OCR4B = 255;
[00:02:16] <MarkX> OCR4D = 127;
[00:03:27] <MarkX> am i missing something because i'm not seeing OC4B doing anything
[00:11:48] <phinxy> What are icons with only 0 and 1 called?
[00:44:34] <MarkX> anyone?
[01:15:13] <Haohmaru> i got a 10ms timer interrupt, and i want to increment a uint8_t which i'll then use in the main thread to process some stuff, and decrement it.. is it enough to declare it volatile, or should i disable interrupts?
[01:17:14] <Haohmaru> the point is.. i don't care about tiny jitter, but i don't want to miss a whole 10ms tick
[01:17:54] <Casper> 8 bits shall be fine
[01:18:08] <Casper> as long as no overflow happend...
[01:18:32] <Haohmaru> thus if my main thread is too busy doing something else - my counter may grow big.. 6 perhaps, but as soon as the main thread finishes - it will process 6 times and "catch up"
[01:18:54] <Casper> with 16 bits you need to be carefull, as your main could read the first 8 bit, the interrupt fire up, update the 16 bits, and your main read the new second 8 bits...
[01:19:13] <Haohmaru> ehm, i increment it like if (counter < 255) { ++counter; }
[01:19:38] <Haohmaru> nah, 8bit is enough
[01:19:58] <Haohmaru> do i do something special in the main thread when reading and decrementing the counter?
[01:20:24] <Haohmaru> or just plain while (counter) { --counter; do_the_stuff(); }
[01:22:40] <Casper> there is nothing special with 8 bits
[01:22:47] <Haohmaru> kewl
[01:23:00] <Haohmaru> so just volatile then
[02:58:06] <Haohmaru> how do i read a byte from the user signature memory?
[03:21:15] <Xark> "user signature memory" what exactly do you mean?
[03:21:55] <Haohmaru> exactly what you quoted
[03:22:06] <Haohmaru> maybe i should mention that it's xmega ;P~
[03:23:18] <Xark> Ahh, yes. :)
[03:23:28] * Xark has not used USM
[03:27:03] <Haohmaru> nor have i, but it looks like teh perfect place for a custom serial number
[03:27:40] <Haohmaru> avrdude can write it with -U usersig:w:...
[04:52:51] <lorenzo> http://pastebin.com/B8vhYSty
[04:53:15] <lorenzo> hm, any ideas why I can't seem to get such a basic thing to work? :(
[05:10:23] <rue_bed> well
[05:10:31] <rue_bed> you want to to trap into a loop when its done
[05:10:50] <rue_bed> F_CPU should prolly be defined first, if its ever used
[05:11:31] <rue_bed> and wtf are you trying to write?
[05:11:47] <rue_bed> lorenzo,
[05:11:51] <lorenzo> I've also tried plain '4'
[05:12:19] <rue_bed> end: rjmp end
[05:12:45] <rue_bed> I'm pretty sure the org should not be 0x0
[05:13:13] <rue_bed> there is an interrupt table, and the boot vector is relocatable by the fuses
[05:13:56] <rue_bed> .cseg ;CODE segment
[05:13:56] <rue_bed> .org 0x0000
[05:13:56] <rue_bed> rjmp init ; RESET
[05:13:56] <rue_bed> reti ; EXT_INT0
[05:13:56] <rue_bed> reti ; PCINT0 (pin change)
[05:13:56] <rue_bed> reti ; TIM0_OVF
[05:13:58] <rue_bed> reti ; EE_RDY
[05:14:00] <rue_bed> reti ; ANA_COMP
[05:14:02] <rue_bed> reti ; TIM0_COMPA
[05:14:04] <rue_bed> reti ; TIM0_COMPB
[05:14:08] <rue_bed> reti ; WATCHDOG
[05:14:10] <rue_bed> reti ; ADC
[05:15:55] <rue_bed> and ldi should be ldi R16, $FF
[05:16:02] <rue_bed> what are you using to assemble this?
[05:16:08] <lorenzo> rue_bed: avr-gcc
[05:16:22] <rue_bed> do you know what the c is for in gcc?
[05:16:38] <rue_bed> the first one?
[05:16:42] <lorenzo> rue_bed: I'm passing it as .S file
[05:16:47] <rue_bed> or the second one?
[05:17:49] <rue_bed> do you know about avr-as
[05:19:37] <Haohmaru> the two Cs in gcc are only there fo' da rhyme
[05:19:44] <rue_bed> wait, why does your paste say z80 assembler...
[05:20:03] * rue_bed hits Haohmaru with a frozen fish
[05:20:06] <lorenzo> rue_bed: I've typed in "ASM"
[05:20:07] <rue_bed> no
[05:20:11] <Haohmaru> cuz there's probably no "AVR ASM" in pastebin to select it
[05:20:20] <lorenzo> rue_bed: okay, I'm trying with avr-as and tn85def.inc
[05:21:32] <rue_bed> apparently back in my day I was using gavrasm
[05:21:42] <rue_bed> so I might not be of much syntax help
[05:22:25] <Haohmaru> aren't you in bed?
[05:22:32] <rue_bed> yes
[05:22:38] <rue_bed> bedtime is 9:45
[05:22:41] <rue_bed> pm
[05:22:50] <rue_bed> its currently 2:59am
[05:23:04] <rue_bed> I'm not gonna be a happy camper in the morning
[05:23:47] <rue_bed> I'm just pumped cuase my 250Khz smps is finally showing like its gonna work
[05:24:19] <lorenzo> wooo, works :-)
[05:24:28] <lorenzo> thanks!
[05:24:30] <rue_bed> ok,
[05:24:38] <rue_bed> make that a lesson for you
[05:24:57] <rue_bed> dont use a C COMPILER to ASSEMBLE ASSEMBLER
[05:25:01] <Haohmaru> and i'm getting "main.cpp|136|error: impossible constraint in 'asm'"
[05:25:12] <lorenzo> sure. for some reason every tutorial I was following just included avr/io.h, then wrote some assembly and used avr-gcc
[05:25:15] <Haohmaru> impossiburu!
[05:25:21] <rue_bed> ugh
[05:58:50] <Jartza> allo
[05:59:22] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxcTdBT0tkTXdPUk0/view
[05:59:29] <Jartza> someone asked the schematic of my attiny5 vga
[05:59:41] <Jartza> resistor values are missing as I haven't really measured them yet
[05:59:57] <Jartza> also the diode doesn't have any type. currently I'm using green led ;)
[06:01:31] <Jartza> also, I suggest avra for everybody who wants assembler for avr :)
[06:15:52] <Haohmaru> while i switched to c++
[06:16:35] <Haohmaru> take that, pic
[06:17:07] <Lambda_Aurigae> why would C++ be a kick at PIC?
[06:17:16] <Haohmaru> cuz sdcc
[06:17:28] <Lambda_Aurigae> I still don't get it.
[06:17:31] <Haohmaru> yes, i know
[06:17:43] <Lambda_Aurigae> I don't see where C++ is any better than C for microcontrollers.
[06:18:19] <Haohmaru> it's nicer to write stuff like LED1.toggle();
[06:18:35] <LeoNerd> Yes that little dot makes it soooo much nicer than toggle_led(1);
[06:18:49] <Lambda_Aurigae> can do similar in C with a struct.
[06:19:28] <Haohmaru> member functions ftw
[06:20:13] <Lambda_Aurigae> yes, C++ can isolate functions and variables so they can't be accessed outside of a class...
[06:20:22] <Haohmaru> yup
[06:20:31] <Lambda_Aurigae> big whoop.
[06:20:36] <Haohmaru> and constructors
[06:22:04] <Haohmaru> i guess it won't be too exciting on atmega, but it kinda works nicely on xmega
[06:22:46] <Haohmaru> given that certain modules are already defined as structs.. like USART_t, SPI_t, etc..
[06:23:01] <LeoNerd> I can isolate functions so they can't be accessed from outside the .c file they're in. It's called 'static'
[06:23:44] <Lambda_Aurigae> static vs extern for the win.
[06:24:07] <Haohmaru> then you have to modify that .c file if you need different number of instances of something per project, don't you?
[06:25:24] <Haohmaru> while i put together some classes which wrap around an USART_t pointer and give it a FIFO and read() write() methods, which can then be instantiated any number of times
[06:26:08] <Lambda_Aurigae> I can do the same and call read() and write() functions any number of times through the program.
[06:26:13] <Lambda_Aurigae> no difference other than syntax really.
[06:26:18] <Haohmaru> yes
[06:26:58] <Haohmaru> you can do the same on ASM or even with notepad.exe and save-as-hex
[06:27:43] <Lambda_Aurigae> so, other than personal preference, C vs C++ on a microcontroller is all personal preference.
[06:28:02] <Haohmaru> well, actually, i also like scoped stuff
[06:28:03] <Lambda_Aurigae> err....I'm channeling the department of redundancy department this morning.
[06:28:14] <Lambda_Aurigae> it happens when I wake up at 2am
[06:28:34] <Haohmaru> a dummy class which does cli() in its constructor and sei() in its destructor
[06:28:41] <Haohmaru> for teh lolz
[06:29:17] <Jartza> I write both C and C++ for embedded... and the more I write C++ the more I learn to hate it ;)
[06:29:43] <Jartza> but hey, I'm just a simple guy who likes simple things, like assembly
[06:29:53] <Lambda_Aurigae> and xc compilers can do C++ if you pay for it.
[06:29:57] <Haohmaru> that explains it ;P~
[06:29:58] <Lambda_Aurigae> for pic.
[06:30:10] <Haohmaru> i know.. if i pay for it
[06:30:16] <Haohmaru> absolutely nevah!
[06:31:11] <Lambda_Aurigae> or hack it.
[06:31:16] <Lambda_Aurigae> xc32++ is free.
[06:31:20] <Lambda_Aurigae> but, it's just gcc.
[06:32:30] <Haohmaru> ain't that for pic32?
[06:33:25] <Lambda_Aurigae> yup.
[06:33:54] <Haohmaru> i use eight bit chipz
[06:34:13] <Lambda_Aurigae> mips processor...so they just modded gcc and put in a custom libc for it.
[06:34:14] <Haohmaru> i can't count to thirty two yet
[06:34:40] <Lambda_Aurigae> just to 16?
[06:34:49] <Lambda_Aurigae> isn't xmega 16bit?
[06:34:54] <Haohmaru> no, eight
[06:34:58] <Haohmaru> xmega is 8bit
[06:35:05] <Haohmaru> but very sugary
[06:35:15] <Haohmaru> and juicy
[06:35:28] <Lambda_Aurigae> I thought it was 16bit...oh well.
[06:36:09] <Haohmaru> xmega is much x, very mega
[06:36:13] <Lambda_Aurigae> avr is nice but lacking in some ways...it's still my favorite microcontroller overall though.
[06:37:54] <Lambda_Aurigae> but I've grown fond of pic32 chips.
[06:38:01] <Lambda_Aurigae> specially the pic32mx270f256b
[07:43:41] <LeoNerd> Hrmm.... RTC chips. DS1307 seems popular, as does PCF8563.
[07:43:59] <LeoNerd> I appreciate I'm likely asking a question similar to vim/emacs or AVR/PIC, but... Does anyone have any preferences?
[07:44:24] <LeoNerd> They're both 8pin SOIC-available chips running on 32kHz watch crystals and talk I²C, but they do appear to have differences
[07:45:17] <LeoNerd> The DS chip has only one "output" pin that you can use for either squarewave or alarm interrupt, but does have a separate Vbatt pin.
[07:45:44] <LeoNerd> The PCF lacks a dedicated battery input (but you can mux main supply and battery with a couple of diodes), but in its place has separate "clock pulse output" vs "interrupt" pins
[07:46:36] <LeoNerd> Also the PCF has a little timer unit almost like an AVR timer, with a prescaler available at 4096, 64, 1Hz or 1/60th Hz frequency, and an arbitrary 8bit counter
[07:51:03] <orzel> hello. I have quite a technical question and i can't find any useful information with google about it: what are the consequences of doing a switch{case:...} over a 16 bit value ? Is that really bad ? Or will only kinda be slow ?
[07:52:28] <LeoNerd> What do you mean "consequences" ?
[07:52:37] <LeoNerd> If that's the correct way to write the code, then write it that way
[07:59:01] <tkoskine> orzel: Check the generated assembly code (avr-gcc -save-temps). Also, try to do some of your own benchmarks (8-bit val vs 16-bit val looping 1000000 times).
[08:05:05] <twnqx> LeoNerd: there is not one correct way
[08:05:33] <twnqx> you can always manually introduce jumptables for the same purpose (though i doubt full 16 bit value range on avr is doable :P)
[08:57:53] * LeoNerd mumblemutter
[08:58:07] <LeoNerd> PCF2123 has "SPI" interface. It has a CE pin. That is active high.
[08:58:09] <LeoNerd> Active. High.
[08:58:10] <LeoNerd> "SPI"
[08:58:34] <LeoNerd> What the hell is wrong with some people??!!
[09:07:08] <Haohmaru> why?
[09:07:15] <Haohmaru> CE == chip enable?
[09:08:23] <LeoNerd> Prettymuch universally on SPI interfaces, people use active-low
[09:10:16] <Flutterbat> LeoNerd: thats why its called SPI compatible :p
[09:13:42] <LeoNerd> Sounds to me like the marketing getout clause of "strawberry-flavoured" ... i.e. doesn't actually have any strawberry in it
[09:34:34] <Haohmaru> this is SPI-flavoured
[09:35:09] <LeoNerd> So it seems
[09:44:27] <Haohmaru> can anyone help me with this asm mess i've made? http://pastebin.com/s3yTEzxE
[09:45:02] <LeoNerd> I'd prefer it on some other site than pastebin.com, but just this once I'll take a look
[09:45:11] <LeoNerd> prefer pastie.org or ... to be honest anyone else
[09:48:11] <Haohmaru> this is from a .S file, and i'm trying to put it into a C function with inline asm.. that's not doable if you have no idea of asm ;P~
[09:48:53] <LeoNerd> This is C code, not "from a .S file"
[09:49:24] <Haohmaru> the asm code is from a .S file, and i tried to make it inline asm
[09:49:47] <Haohmaru> by looking at actual inline asm syntax..
[09:50:16] <LeoNerd> Right... so what's the question?
[09:50:53] <Haohmaru> it's broken on many levels, i can't seem to make it work, it doesn't even compile
[09:51:34] <Haohmaru> it should take the nvm_cmd and address from the arguments, and put the result in the local "res" variable
[09:51:58] <LeoNerd> Well, for a start you're inventing register names inside the thing
[09:52:05] <LeoNerd> and then you're not making use of all four values passed in
[09:52:53] <Haohmaru> yeah, that's just.. i tried 50 things and none worked, that's the last state i left it at
[09:53:29] <LeoNerd> You might want to start by reading about the asm-in-C syntax then
[09:53:31] <Haohmaru> i mostly get this error: impossible constraint in 'asm'
[09:53:33] <LeoNerd> is this avr-gcc + avr-libc?
[09:54:04] <Haohmaru> i did look at that, but that assumes i have an idea about ASM to begin with ;]
[09:54:20] <Haohmaru> yes, it's avrgcc
[09:54:39] <Haohmaru> uhm
[09:55:25] <LeoNerd> http://www.nongnu.org/avr-libc/user-manual/inline_asm.html
[09:55:41] <Haohmaru> i need to read from the user signature memory, which as far as i understand must be read via this NVM controller, and the only example there is is using this .S file
[09:56:04] <Haohmaru> and i think i read that it won't exactly work if it's written normally in C
[09:56:31] <Haohmaru> otherwise i think it's doing something like:
[09:57:51] <Haohmaru> NVM.ADDR0 = lowbyte; NVM.ADDR1 = highbyte; NVM.CMD = nvm_cmd; res = NVM.DATA0;
[09:59:04] <Haohmaru> hm
[09:59:15] <Haohmaru> %0 would be the "res" part?
[09:59:26] <LeoNerd> Again, read the inline asm page above
[09:59:28] <LeoNerd> That will help
[09:59:33] <Haohmaru> i did
[09:59:40] <LeoNerd> I can't answer your question any better than reading the page myself and then parroting to you what I just read
[09:59:44] <Haohmaru> which doesn't mean i understood anything ;]
[09:59:46] <LeoNerd> So you can do it more efficiently by reading yourself
[10:00:46] <LeoNerd> In the code section, operands are referenced by a percent sign followed by a single digit. %0 refers to the first %1 to the second operand and so forth. From the above example:
[10:10:04] <Haohmaru> i'm still not going anywhere
[10:10:56] <LeoNerd> The main string of assembly code is a template
[10:11:14] <LeoNerd> %0, %1, %2, ... are placeholders, that are replaced by actual register names
[10:11:32] <Haohmaru> i'll try writing it in C the way i suspect it should be, and test if it works.. which will be hard to tell ;P~
[10:13:48] <Haohmaru> as far as i understand, the eeprom_read_byte() functions are very related, and they work almost the same way (if not more complicated) but i don't find their source code
[10:13:59] <Haohmaru> they are only declared in the avr headers
[10:14:32] <Haohmaru> otherwise i'd look how the ASM looks for them, because i'm almost sure they'd be written with inline asm
[10:30:17] <Haohmaru> well, the generated ASM from the C i wrote looks 6 times longer and.. different ;P~
[10:30:46] <LeoNerd> Shock as assembly code generated from C found to be longer than hand-written code
[10:30:47] <LeoNerd> News at 11
[10:32:30] <Haohmaru> but i don't see this "LPM" instruction at all in it
[10:32:37] <Haohmaru> which smells slighly wrong
[10:32:39] <Haohmaru> ;]
[10:33:10] <Haohmaru> because afaik, it is this instruction which actually reads from the flash, isn't it?
[10:33:23] <Haohmaru> all i see is LDD, LD, etc..
[10:33:41] <Haohmaru> and LDI
[10:34:21] <LeoNerd> I have no idea what problem you're trying to solve, so I'm not sure I can help
[10:36:54] <Haohmaru> "impossible asm" ;]
[10:37:21] <Haohmaru> wasn't there such a movie with tom cruise
[12:13:45] <phinxy> spent all my money of electronic components and soldering accessories. 8 days until payday. i guess 10 eggs and 3 bacons will suffice
[13:06:46] <MarkX> i'm trying to use timer4 on my atmega32u4 to output 2 separate PWM signals on 2 pins (OC4B and OC4D)
[13:06:46] <MarkX> http://pastebin.com/zHUJ7eGq this is the code for the set up of the timer, am i doing it right?
[13:06:46] <MarkX> i'm setting the compare registers as well >> OCR4B = 255;
[13:06:46] <MarkX> OCR4D = 127;
[13:06:56] <MarkX> am i missing something because i'm not seeing OC4B doing anything
[13:25:56] <phinxy> im also struggling with timers at the moment
[13:26:38] <phinxy> i have a 16-bit timer in CTC mode. i want it to trigger at specific count. the register to set that count is just 8-bits tough
[13:30:37] <MarkX> phinxy: what chip?
[13:30:43] <phinxy> 1284p
[13:31:02] <MarkX> and which timer?
[13:31:21] <phinxy> im using timer2 TCCR2A and TCCR2B is the registers
[13:33:41] <MarkX> timer2 is 8 bit
[13:33:44] <phinxy> timer counter 3 have a OCR registers with H and L bits
[13:33:53] <phinxy> right its timer 0 or 3 thats 16 bit
[13:34:17] <MarkX> so you're using timer 3?
[13:34:24] <phinxy> i guess i have to pick one
[13:34:35] <MarkX> yes because timer 2 is 8 bit according to the datasheet
[13:35:04] <MarkX> so you won't have a compare register of 16 bits
[13:35:22] <MarkX> also timer1/3 are also 16 bit
[13:35:25] <phinxy> yeah i want it all hardware
[13:35:34] <MarkX> not timer0
[13:35:39] <phinxy> oh.
[13:35:55] <MarkX> timer0 is 8 bit as well
[13:35:59] <MarkX> http://www.atmel.com/images/doc8059.pdf
[13:36:04] <MarkX> look at the datasheet
[13:36:18] <MarkX> just ctrl+f "Timer/CounterN"
[13:36:25] <MarkX> where N is your timer number
[13:36:40] <MarkX> or look at the index on page 372
[13:36:50] <MarkX> it will list the pages for the timers and tell you what size they are
[13:37:06] <LeoNerd> I've often thought of writign up a quick summary page on AVR Timers
[13:37:12] <MarkX> 0/2 are 8-bit, 1/3 are 16 bit
[13:37:23] <MarkX> LeoNerd: there is actually a really good one written by abcminiuser
[13:37:34] <MarkX> (who is an awesome person that i will praise all the time hahahaha)
[13:37:46] <LeoNerd> Big list of every AVR chip (or at least, those I use) and a quick summary of each timer, whether it's 8 or 16 bit, what version (so as to support PWM accurate, or CTC to matchA), how many match outputs, if it does async, ...
[13:37:48] <LeoNerd> OHyes?
[13:37:57] <MarkX> ah no
[13:38:00] <MarkX> not to that extent
[13:38:09] <MarkX> his is a tutorial for getting started with timers on AVR
[13:38:18] <MarkX> he also wrote some for interrupts and PWM iirc
[13:38:33] <LeoNerd> Ahright. yeah I just want a summary to remind me
[13:39:02] <MarkX> is there some logic behind it? like on each chip, every odd timer is 16-bit?
[13:39:11] <MarkX> i haven't worked with other chips so i don't know
[13:40:10] <LeoNerd> No, there doesn't seem to be a pattern
[13:40:20] <LeoNerd> timer0 is often 8bit, but that's about as far as it goes
[13:40:49] <LeoNerd> tiny85: timer1 is 8 bit PLL-capable; tiny84: timer1 is 16bit. mega328: timer1 and timer2 are 16bit, timer2 can do async,...
[13:40:49] <MarkX> ah i see
[13:40:59] <MarkX> heh
[13:41:00] <LeoNerd> 32U4 has timer0, 1, 3 no 2
[13:41:03] <MarkX> so all over the place
[13:41:11] <LeoNerd> Another tiny has timer0 async-capable
[13:41:11] <MarkX> and timer 4 as well
[13:41:11] <MarkX> :P
[13:41:16] <LeoNerd> Ithink they just roll a dice
[13:41:20] <LeoNerd> (they == Atmel)
[13:41:30] <MarkX> timer4 is what is screwing me over right now, no idea what i'm doing wrong
[13:54:47] <phinxy> hmm. how can one fully executed while loop be exactly 1 cpu tick? isnt each assembly instruction a couple ticks each?
[13:56:06] <phinxy> nevermind i get it now
[14:07:32] <phinxy> my RTC clock is working !
[14:07:45] <LeoNerd> \o/
[14:07:50] * LeoNerd 'll be playing with one of those soon
[15:07:18] <phinxy> one of these functions: itoa(), strcat() needs the output string to be +1 bytes than the actual string length?
[15:07:35] <phinxy> aha.. maybe it adds a null or whatever its called?
[15:33:16] <Lambda_Aurigae> phinxy, yes, they add \0 to the end of the string...called a null terminated string.
[15:33:21] <phinxy> i found a typo in the 1284p documentation
[15:33:40] <Lambda_Aurigae> it is how C knows where to terminate a string inside an allocated string buffer.
[15:33:58] <Lambda_Aurigae> have you checked the eratta to see if that typo is listed?
[15:34:05] <phinxy> unless TIMSK3 interrupt mask registers should affect timer/counter1
[15:34:18] <phinxy> no idea what that is, ill look it up
[15:34:42] <Lambda_Aurigae> it's the documents put out to fix errors in the original documents.
[15:37:10] <phinxy> the 1284p doesnt have one it looks like
[15:37:19] <Lambda_Aurigae> then report it to atmel.
[15:52:05] <lald> Isn't the eratta just at the end of the datasheet?
[15:53:39] <Lambda_Aurigae> sometimes there are extra docs with eratta in them.
[15:53:53] <Lambda_Aurigae> but, yeah, datasheets have them at the end also.
[15:54:01] <lald> Hmm, interesting.
[15:59:50] <julius> hi
[16:00:17] <julius> ive got a atmega32L, but this fuse calculator: http://www.engbedded.com/fusecalc does not list L, is it that important for fuses?
[16:08:03] <LeoNerd> What's the datasheet say?
[16:08:17] <LeoNerd> Often they do a "conversion" document too; e.g. comparing mega32 to mega32L
[16:09:30] <julius> ah, its low voltage
[16:09:37] <julius> and low frequency
[16:10:45] <julius> crap, that thing does 8mhz max
[16:11:41] <Lambda_Aurigae> yup.
[16:12:10] <Lambda_Aurigae> fuses should be pretty much the same I would think...
[16:12:21] <Lambda_Aurigae> signature will be different though.
[16:16:04] <julius> well, i ordered yesterday a arduino uno and a 328 as a single chip....im gonna wait
[16:18:21] <julius> while using a ws2812 light strip i observed that it took about(time measured by my eyes) 0.5s when i set all leds to one color for the last one to go on. i used the light_ws2812 library
[16:18:45] <julius> 60 leds / 1m strip. isnt that a bit slow?
[16:19:42] <Lambda_Aurigae> depends on how it communicates and how fast.
[16:20:39] <LeoNerd> that sounds waaaaay too slow
[16:20:54] <LeoNerd> it should be hundreds of times faster
[16:22:23] <Lambda_Aurigae> 1.25us per bit, 24 bits per pixel, 60 pixels.
[16:22:50] <Lambda_Aurigae> 1800us
[16:23:18] <Lambda_Aurigae> .0018 seconds.
[16:23:51] <julius> i used c, but in my simple examples i only used a for loop, and called the ws2812 write method from the library for each led
[16:23:52] <LeoNerd> Yah.. I have a 90led strip and I can easily get 100 updates/sec off that
[16:23:59] <LeoNerd> Oh... yeah don't do that
[16:24:04] <LeoNerd> write the whole chain in one go
[16:24:10] <julius> ah
[16:24:15] <LeoNerd> you can't address individual LEDs as such
[16:24:25] <julius> yes, i read about that
[16:24:26] <LeoNerd> You write all the values at once, and it works its way along the chain
[16:24:35] <Lambda_Aurigae> it's a chain...to write one LED you have to send data out to all of them.
[16:24:59] <julius> jesus, i must look really dumb in your eyes now
[16:25:25] <Lambda_Aurigae> naaa...just look like an ardweeny to me.
[16:25:55] <LeoNerd> Easy enough mistake ;) I've made all kinds of silly upsets like that with the nRF radios
[16:34:10] <phinxy> how quick is the brown out detection? is there time to store a couple integers to eeprom if i unplug battery?
[16:34:46] <phinxy> Maybe a supercap in series with the power supply could help keep the micro alive for a while
[16:34:54] <LeoNerd> parallel surely
[16:35:25] <phinxy> would it charge in paralell?
[16:35:51] <LeoNerd> anyway, doesn't need to be a /super/ cap... If you make sure to isolate any heavy loads from it, something like a 100µF would still power it long enough to burn an EEPROM cell
[16:36:44] <julius> great, now the cable for din broke.....and no soldering station in sight
[16:37:22] <phinxy> crimp it!
[16:37:33] <julius> all my stuff is at home
[16:37:47] <julius> and mcgyver is not answering his phone
[16:40:14] <julius> im gonna "solder" it on with coolmorph tomorrow ;)
[16:52:45] <Lambda_Aurigae> you don't carry a butane soldering iron with you?
[16:52:55] <Lambda_Aurigae> kids these days,,,sheesh.
[16:53:13] <julius> ive got COOLmorph, it got the word cool in it
[16:54:35] <julius> polymorph that looks like hot glue at 42°C, when it cools down it gets hard
[16:55:40] <julius> anyway, what do you guys spend on a soldering station that can do smd/normal dip?
[16:55:58] <Lambda_Aurigae> 50 to 100 dollars.
[16:56:02] <Lambda_Aurigae> depends on the smd.
[16:56:07] <Lambda_Aurigae> sometimes much more.
[16:56:18] <Lambda_Aurigae> my soldering irons generally don't cost more than that though.
[16:56:49] <Lambda_Aurigae> with a 25 dollar cheapy and a flat tip I can do tqfp64 if I'm careful.
[16:56:55] <julius> seen some smd soldering videos online, the guy barely touches the chip/board and the solder runs immediately
[16:56:57] <Lambda_Aurigae> I prefer not to.
[16:56:58] <Lambda_Aurigae> but,,,
[16:57:14] <Lambda_Aurigae> 40 watt iron will do that.
[16:57:30] <julius> with my 60w analog elsa station, it takes some time...at least while i was testing on old mainboards/controllers
[16:57:35] <Lambda_Aurigae> my little 14 dollar butane iron will do it too.
[16:57:59] <Lambda_Aurigae> quality of the tip makes a difference.
[16:58:13] <Lambda_Aurigae> how well the tip is tinned makes a difference as well.
[16:58:16] <julius> tested a new original else one, still no luck
[16:58:30] <julius> elsa
[16:58:53] <Lambda_Aurigae> my main one is a 35 watt weller
[16:59:15] <Lambda_Aurigae> I love my travel iron though..heats up fast and works well and no power needed.
[16:59:26] <julius> ah, with batteries
[16:59:30] <Lambda_Aurigae> nope
[16:59:32] <Lambda_Aurigae> butane
[16:59:48] <julius> yeah they work well too
[17:00:00] <julius> i "torched" a old mainboard for the parallel port connector
[17:00:12] <Lambda_Aurigae> I have a cheap radio shack battery soldering iron thingie....it works, mostly..
[17:00:18] <Lambda_Aurigae> but you gotta be careful with it.
[17:00:28] <julius> mostly?
[17:00:28] <Lambda_Aurigae> it heats the solder by running a high current low voltage across it.
[17:00:37] <julius> ah
[17:00:44] <Lambda_Aurigae> you can damage components by touching things wrong.
[17:01:11] <Lambda_Aurigae> butane iron is much nicer.
[17:01:38] <Lambda_Aurigae> and it has a flame attachment so I can do low temp brazing or even solder copper pipe with it.
[17:01:55] <julius> my cheap one does not really have a fine control for the flame. so i wouldnt really want to use it on something i want to work
[17:02:11] <Lambda_Aurigae> I have a soldering tip.
[17:02:21] <Lambda_Aurigae> no flame touches the product.
[17:02:30] <Lambda_Aurigae> the flame is contained inside a heating element behind the tip.
[17:02:33] <julius> that could help
[17:03:14] <Lambda_Aurigae> http://www.all-spec.com/products/7971.html?gclid=CIr6tMLposoCFQ6OaQodTQEJrA
[17:03:18] <Lambda_Aurigae> basically what I have.
[17:06:42] <julius> looks nice
[17:07:14] <Lambda_Aurigae> got mine for 14 dollars when the local radio shack was having its going out of business sale.
[17:15:27] <Lambda_Aurigae> I have used the flame mode to solder copper wire to the metal frame of a copier twice now.
[17:15:55] <Lambda_Aurigae> scratch the hell out of an area, then apply some flux and solder with heat then lay wire kinda flattened and spread a little.
[17:16:25] <Lambda_Aurigae> was easier than drilling a new hole for a grounding wire.
[17:16:42] <Lambda_Aurigae> after screw got stripped or broken off in existing hole.
[17:27:25] <LeoNerd> Dear $random-vendor-on-amazon: A 1N4004 is not a "low-leakage" diode
[17:27:29] <LeoNerd> 30µA is not low
[17:36:50] <julius> if they sell on amazon, thats all you need to know ;)
[17:37:24] <Lambda_Aurigae> it's amazon...it's gotta be correct...don't question your drone delivering overlords!
[17:37:55] <LeoNerd> Aha. Found a BAS116. 3pA
[17:37:58] <LeoNerd> That's more what I'm thinking :)
[17:38:07] <LeoNerd> That's ten-miiiiiiiiiiiillion times better
[17:38:11] <LeoNerd> </DrEvil>
[18:24:22] <goonball> atmega328p, can't figure out why my timer ISR doesn't fire. I've got TIMSK1=0x01 and I sei(). I can look at TCNT1L and it seems to be incrementing. I've got ISR(TIMER1_OVF_vect) filled out. not sure what I'm doing wrong.
[18:25:24] <theBear> you haven't got a timer mode set that stopping it overflowing or soft-overflowing it early or something ?
[18:25:33] <theBear> you got interrupts enabled ?
[18:25:40] <theBear> oh sei
[18:26:00] <theBear> i'm outta practice btw, but i was good maybe 5 or 10 years back, i promise :)
[18:29:19] <goonball> TCCR1A= 0x40 OCR1A=7999 TCCR1B=0x09 TIMSK1 = 0x01 and I do sei()
[18:38:55] <goonball> I'm wondering if the interrupt vector table might still be pointing at the bootloader's table.
[18:43:01] <goonball> hrm, MCUCR reads 0x00
[18:48:10] <goonball> SREG reads 0x82
[18:50:42] <goonball> aha! I think I want the compare match flag, not the overflow flag
[19:05:42] <theBear> you do ?
[19:05:52] <theBear> and if so why isn't it overflowing ?
[19:06:09] <theBear> i spose you want a fixed timing, not a direct division of the clock freq anyway
[19:06:15] <theBear> very good
[19:07:56] <phinxy> im trying to get a simple button to function. it have functioned before in the same circuit. it simply connects to ground from the PD7.
[19:08:04] <phinxy> i set DDRD to 0
[19:08:09] <phinxy> then PORTD to 1
[19:08:14] <phinxy> anything else i need to do?
[19:12:12] <phinxy> http://pastebin.com/C5Y44tDF
[19:13:23] <phinxy> okay its my bitwise thats broken
[19:32:27] <phinxy> nope its not my fault. im not allowed to set multiple bits at the same time in the PORD register
[19:53:50] <theBear> why in the hell not ?
[19:54:18] <theBear> it's a byte wide register, pretty sure it's literally impossible NOT to set the whole 8 bits at once
[20:05:05] <Casper> theBear: what about sbi/cbi? :D
[20:06:03] <phinxy> theBear when i set bit 7 its fine and my button works. when i set any other bit in the register the button stops working
[20:12:43] <theBear> phinxy, how you setting a single bit ?
[20:45:05] <phinxy> theBear the problem was the internal pull-up resistors was not enough. the full PIND would oscillate between 0 and 1 if any pin was grounded
[20:45:58] <phinxy> i just added a 1K3 pull up to each button switch and it works
[20:53:59] <theBear> that's umm, not cos the resistors ain't strong enough, iit's cos "grounded" apparently wasn't remotely close to grounded
[20:54:33] <theBear> perhaps cos you using a shitty breadboard or long wires or got a , that really makes very little sense, if anything 1k pullups should have the opposite effect
[22:36:14] <phinxy> theBear im giving up PORTB it seems broken. PORTA is working flawless
[22:36:30] <phinxy> maybe ive done something with the portB in past that fried it
[22:36:46] <phinxy> nothing connected to it and cant get a simple button to work
[22:37:01] <phinxy> not using any timers that live there either
[22:37:24] <phinxy> unless the timer interferes somehow
[22:37:37] <phinxy> there are timer pin outputs in PORTB..
[22:38:18] <phinxy> im gonna try this on my other atmega128 later
[22:41:59] <Casper> phinxy: portb... is that the one with jtag?
[22:42:22] <phinxy> nope.
[22:42:27] <phinxy> just special features
[22:42:42] <theBear> timers are timers, there only 2 or 3 or whatever in a given chip, tho as far as pins "attached" to them in various ways that should all be configgable via various registers... if a given pin has at least one of its functions marked a portX.y it should definately be capable of doing that when told to do so
[22:42:46] <phinxy> wait
[22:42:48] <phinxy> sorry
[22:42:50] <theBear> what chip you using now ?
[22:42:51] <phinxy> its my PORD thats broken
[22:43:11] <phinxy> 1284p
[22:43:35] <theBear> hmm... i never had one that new and fancy so no special comments to say
[22:44:26] <phinxy> it runs at 16mhz baby
[22:44:54] <theBear> pretty sure early in the datasheet there's a big function-per-pin table with verbose kinda descriptions and alternate functions and equivalent schematics etc which should tell yer pretty quick
[22:45:39] <theBear> pfft, i had 16mhz avrs, i had 'em a decade ago, but not with usb, or more than maybe 2 and a bit ports exposed or >1 hw uarts, letalone usarts :)
[22:46:06] <theBear> wtf ! gone sunny rainy sunny already and it's only lunchtime
[22:46:27] <theBear> middle of summer here and i can't workout if i should put the washing on ffs
[22:46:37] * apo_ wants summer :(