#avr | Logs for 2014-10-01

Back
[01:03:42] <Bright> YES I'M BLINKING AN LED
[01:03:54] <N1njaneer> Woooo!
[01:08:10] <Bright> it only took 29 lines of verilog...
[01:08:49] <Bright> though through writing it i begin to see how verilog can be powerful
[01:11:22] <N1njaneer> Indeed!
[01:11:38] <N1njaneer> Now come here and finish my FPGA code! :D
[01:18:31] <jeremyabel> lol
[02:44:32] <Xark> Bright: Now try it with 59 lines of VHDL. :)
[02:45:12] <Trieste> Bright: what are you learning Verilog from?
[06:08:05] <abcminiuser_> Ahoyhoy
[06:15:20] <Lambda_Aurigae> morning abcminiuser
[06:15:25] <Lambda_Aurigae> and abcminiuser_
[06:16:07] <abcminiuser_> Heh
[06:16:12] <abcminiuser_> I need a translation
[06:16:30] <abcminiuser_> Guy emailed with an AVRDude problem, I told him to upgrade to a version that supports his processor
[06:16:44] <abcminiuser_> "There isn't really a programming interface difference, but the device
[06:16:45] <abcminiuser_> contains a different signature which the programmer will report back to
[06:16:45] <abcminiuser_> AVRDUDE. Based on that log it looks like you are still trying to program
[06:16:45] <abcminiuser_> the ATXMEGA32A4U with the non-USB ATXMEGA32A4 device specified, and
[06:16:45] <abcminiuser_> AVRDUDE is aborting as the signature doesn't match what it expects for
[06:16:45] <abcminiuser_> that part. Try the "-F" parameter which ignores the signature check, or
[06:16:48] <abcminiuser_> (better) update the AVRDUDE configuration file to one that has a part
[06:16:50] <abcminiuser_> definition for the ATXMEGA32A4U specifically.
[06:16:52] <abcminiuser_> "
[06:17:02] <abcminiuser_> Then I got back just "Welcome.
[06:17:03] <abcminiuser_> Please write any signature
[06:17:03] <abcminiuser_> in X32a4U and X128a4U"
[06:17:09] <abcminiuser_> Any idea what the hell that means?
[06:17:34] <Lambda_Aurigae> he wants the signatures for those two chips?
[06:17:53] <abcminiuser_> Oh
[06:18:19] <Lambda_Aurigae> I been on irc a looong time...seen a lot of foreign and native english speakers screw up the language.
[06:18:34] <abcminiuser_> Yeah I'm just bad at discerning their intent
[06:18:55] <Lambda_Aurigae> I've gotten pretty good at it.
[06:19:02] <RikusW> like charging an inductor for 1s to light a led :-P
[06:19:25] <Lambda_Aurigae> RikusW, you,,,could,,,
[06:19:34] <RikusW> zlog
[06:19:43] <Lambda_Aurigae> don't think it will stay on very long though.
[06:19:45] <RikusW> look at yesterday's log...
[06:19:54] <RikusW> someone else wanted it done...
[06:20:21] <RikusW> Lambda_Aurigae: and kill the led with back emf ?
[06:20:34] <Lambda_Aurigae> no..you USE the back emf to light the LED!
[06:20:41] <Lambda_Aurigae> or at least, flash it.
[06:20:48] <RikusW> and maybe kill it
[06:21:17] <Lambda_Aurigae> well,,,that's what happens to flash bulbs isn't it?
[06:21:23] <RikusW> 1s is way too long anyways, 100us is more like it
[06:21:45] <RikusW> its called smps then ;)
[06:22:16] <RikusW> doesn't camera flash bulbs use a cap ?
[06:22:20] <Lambda_Aurigae> simple multiple part shatterer
[06:22:49] <Lambda_Aurigae> depends on the flash bulb...older single use are just magnesium wire in a high oxy environment.
[06:23:05] <Lambda_Aurigae> heat it up just a little with about 3V and it burns fast and bright.
[06:23:46] <Lambda_Aurigae> xenon flash units use a high voltage discharge with cap and inductor.
[06:25:21] <RikusW> hmm, magnesium could be used as an IC self destruct..
[06:25:50] <Lambda_Aurigae> it is efficient as a signal device at least.
[06:26:25] <Lambda_Aurigae> old VW engine blocks were made from magnesium.
[06:27:14] <Lambda_Aurigae> it was possible to get the block burning,,,with the right torch and a little work.
[06:27:33] <Lambda_Aurigae> then the fire department has royal shitfits trying to put it out.
[06:28:15] <RikusW> lol
[06:28:23] <Lambda_Aurigae> https://www.youtube.com/watch?v=nhY0xzKcPoE
[06:28:52] <Lambda_Aurigae> that's not mine...but it looked similar.
[06:35:10] <Lambda_Aurigae> we did it back in highschool before youtube...heck, before we had a video camera even.
[07:16:06] <LeoNerd> Mmm. My 14-pin ZIF sockets have arrived. They look so tiny and cute...
[07:16:25] <Lambda_Aurigae> hehe.
[07:16:34] <Lambda_Aurigae> making chip programmers?
[07:17:05] <LeoNerd> Yeah; 8/14-pin ATtiny HVSP board
[07:17:39] <LeoNerd> My first attempt is that veryveryslow bitbanging from a Bus Pirate. For my next design I'll build a much faster adapter that emulates STK500 in HVSP mode
[07:18:28] <LeoNerd> I'll probably build it up as a two-layer stack with the target board on its own having a 7-pin breakout, to allow me to stack it either onto the BP, or the adapter
[07:18:56] <LeoNerd> Annoyingly I couldn't find 8pin ZIFs so I'll have to use one of the 14s and label it up somehow to say "use only these 8 pins"
[07:20:06] <Lambda_Aurigae> could use a translation matrix and do them both on one socket.
[07:21:02] <LeoNerd> I don't like the sound of that.. The problem is that in Atmel's infinite wisdom, the pinouts of 8 and 14 are -very- different
[07:21:10] <Lambda_Aurigae> yup.
[07:21:15] <LeoNerd> To the point that the VCC line on one is GND on the other. I dislike the sound of multiplexing those
[07:21:40] <Lambda_Aurigae> I did something similar for programming 28 and 40 pin dips some time back...
[07:21:47] <Lambda_Aurigae> wasn't doing HV though.
[07:22:11] <LeoNerd> Oh, yeah.. HV needs you to put +12V on the RESET pin; any other pin would be destroyed by doing that
[07:22:33] <Lambda_Aurigae> just used some 1 of 8 demultiplexer and 8 to 1 multiplexer chips to select where the signals went.
[07:22:36] <LeoNerd> I think I'll just stick to having two physical sockets
[07:23:01] <Lambda_Aurigae> even could move around power.
[07:23:04] <Lambda_Aurigae> and GND
[07:23:10] <LeoNerd> I've not seen any (de)mux chips that can handle +12V. Honestly, I think I'm fine with just two sockets.
[07:23:22] <Lambda_Aurigae> hehe
[07:24:43] <Lambda_Aurigae> just found several mux/demux chips that will handle 12V
[07:25:39] <LeoNerd> I'm not sure it seems worth it for just two kinds, when I can just have two sockets. If it was, say, the ISP protocol and there were many more kinds of chips, I might be tempted to try to mux them onto one socket. But just two kinds, when they're 14pin sockets?
[07:25:46] <Lambda_Aurigae> http://www.onsemi.com/pub_link/Collateral/MC74HC4051A-D.PDF
[07:25:53] <LeoNerd> I suspect any muxing logic would take more board space and be more expensive than just two sockets anyway
[07:25:58] <Lambda_Aurigae> yeah..for your project, simple enough to do it with 2 sockets.
[07:26:18] <Lambda_Aurigae> for a general generic do every chip board, however,,,,
[07:26:33] <LeoNerd> Ohquite. Well, for generic stuff I'd still just do per-target ISP breakouts
[07:27:04] <LeoNerd> https://www.tindie.com/products/bot_thoughts/eezee-attiny244484-breakout/ <== also, I'm loving the idea of these. :) I ordered a full set of them
[07:27:59] <RikusW> LeoNerd: applying 12V via 1k5 resistor seems to work just fine, its certainly safer for the chip if incorrectly connected
[07:29:03] <LeoNerd> Ah, hi RikusW :) Was wondering where you were
[07:29:21] <LeoNerd> Ohyeah.. that'll definitely help. But the VCC/GND mixup would still be annoying
[07:29:56] <Lambda_Aurigae> ok...time to go break some copiers.
[07:29:57] <Lambda_Aurigae> have fun all.
[07:30:25] <RikusW> LeoNerd: So how is the dedicated HVSP programmer coming along ?
[07:30:55] <LeoNerd> Works just fine
[07:31:09] <LeoNerd> Just a little slow.. the BP one. Am pondering the STK500 version. See above ;)
[07:32:12] <RikusW> I used a ST662AB chip to generate 12V
[07:32:34] <RikusW> then 1k5 and a NPN transistor to pull it down to 0V
[07:32:49] <RikusW> also a PNP to control Vcc
[07:33:00] <RikusW> there is a schematic on my U2S site
[07:33:42] <Tom_itx> that's the only 12v chargepump chip i could find
[07:34:01] <RikusW> Tom_itx: recommended it to me :)
[07:34:28] <twnqx> can't you just use an of the lots of step-up regulators?
[07:34:36] <twnqx> any of*
[07:34:37] <Tom_itx> why?
[07:34:43] <LeoNerd> Yeah; I've got a Pololu one on order
[07:34:45] <twnqx> to generate the 12V
[07:34:46] <LeoNerd> I like those
[07:34:50] <Tom_itx> cost more
[07:34:53] <twnqx> ah
[07:34:55] <RikusW> ST662 is just right for programming
[07:35:07] <twnqx> also you probably don't need that much current
[07:35:10] <LeoNerd> -technically- much overkill because that's a full boost reg so can supply up to 0.5A if you need it, whereas this thing only needs µA
[07:35:21] <LeoNerd> But they're cheap and generic and I like them. :)
[07:35:46] <LeoNerd> Also they're standard 0.1" pitch, unlike those crazy SOICs
[07:36:02] <RikusW> soic are _easy_ to solder ;)
[07:36:04] <Tom_itx> who uses thru hole anymore?
[07:36:18] <LeoNerd> I do, because I don't happen to have a PCB fab plant in my garage
[07:36:23] <RikusW> 0.8mm tqfp is a little harder, but not really difficult
[07:36:33] <Tom_itx> you're just not very dedicated now are you?
[07:36:46] <LeoNerd> Though I -am- planning to get myself a CNC mill soon
[07:36:51] <RikusW> LeoNerd: I made my U2S boards with a temp controlled iron, _no_ hot air
[07:37:02] <LeoNerd> RikusW: Yes but you got the PCB from /somewhere/
[07:37:23] <RikusW> just ask in #hackvana, he does it cheaply
[07:37:23] <LeoNerd> Oh huh.. you can get DIP8 662s
[07:37:44] <Tom_itx> i don't think i would though
[07:38:04] <RikusW> LeoNerd: last time I ordered PCBs from him it was like $20 for 10x 5x5cm
[07:38:16] <LeoNerd> Delivery to the UK? ;)
[07:38:44] <LeoNerd> I am planning to do some PCBs sometime, but not for one-shot things. I'd use those when I hit the "I need 5 of these" level
[07:41:35] <LeoNerd> Actually I can't find anyone /actually/ selling DIP8 versions.. only datasheets that claim that theoretically they're available. Ahwell, I could just mount one on a SOIC8 adapter board
[07:43:05] <RikusW> He delivers all over
[07:43:19] <RikusW> LeoNerd: /join #hackvana
[07:43:22] <LeoNerd> WTF? Why are ST662s £5 each at Farnell but £0.60 each at RS??
[07:43:33] <LeoNerd> I suspect atleast one of those is wrong
[07:43:35] <RikusW> ouch
[07:43:40] <RikusW> farnell
[07:43:48] <twnqx> i suppose the first is
[07:44:09] <RikusW> it should be <$1
[07:44:10] <LeoNerd> Oh.. they're £5 each if you buy them individually. Of course if I buy a reel of 100 they're cheaper per unit
[07:44:20] <LeoNerd> I'm really going off Farnell lately
[07:44:24] <RikusW> RS sells in 5x iirc
[07:44:55] <LeoNerd> Yeah, but *shrug* I'm sure I'll end up destroying -one- of them while soldering it up. Nice to have some spares
[07:45:02] <LeoNerd> I've never done a SOIC before
[07:45:06] <hetii> HI :)
[07:45:35] <RikusW> LeoNerd: when using liquid flux its easy to solder them
[07:45:38] <hetii> I play a bit with frequency counter, my current sources are here https://bitbucket.org/hetii/freq/src/e59cc77486ab54964951f7bfd78d8500639ce175/main.c?at=master
[07:45:57] <RikusW> 1.25mm are quite easy
[07:46:16] <RikusW> if you're really worried get some solder braid to clean up bridges
[07:46:20] <hetii> for testing I put 4MHz clock throught 74hct393 divider to my atmega328p
[07:46:27] <hetii> Here is the result http://pastebin.com/5VRi6XZS
[07:46:27] <RikusW> and tweezers..
[07:47:08] * LeoNerd => pause for lunch
[07:48:36] <hetii> Q:1. Why with hihger frequnecy got worst results. 2. I cannot use divider less then 4, oterhwise instead numbers i got some random characters.
[07:49:24] <hetii> Seams like atmega328p have trouble to alocate my two uint32_t variable.
[07:55:41] <AndChat|221969> Re
[07:58:41] <twnqx> flux for soic? that's.... overkill
[08:04:02] <AndChat|221969> Hmm
[08:11:54] <LeoNerd> RikusW: A thought I had over lunch: I'm guessing the rise time on the ST662 isn't fast enough for the paranoia the AVR datasheet has about the rise time on +12V line. So simply controlling it with its own SHDN line isn't good enough
[08:15:23] <LeoNerd> Ah.. 80µs according to the datasheet
[08:29:30] <hetii> Re
[08:31:21] <ecilop> hetii: Hello. Do you modify algoritm?
[08:40:42] <RikusW> LeoNerd: re rise time
[08:40:45] <RikusW> (14:12:54) RikusW: I used a ST662AB chip to generate 12V
[08:40:46] <RikusW> (14:13:16) RikusW: then 1k5 and a NPN transistor to pull it down to 0V
[08:40:46] <RikusW> (
[08:41:57] <LeoNerd> Ahhh
[08:42:46] <LeoNerd> Mmm.. I've never really liked that kind of "negative" switching; effectively shorting out the supply unless you want it on. I'm doing it with a PNP
[08:43:11] <LeoNerd> https://twitter.com/leonerduk/status/517277809929371649 <== coïncidentally enough, I posted it today. see here
[08:43:36] <RikusW> you'll have trouble with PNP, 12V on emmiter requires 12V on base to turn it off...
[08:43:42] <RikusW> or another NPN on the base
[08:43:51] <LeoNerd> Yeah.. which is just what I did. :)
[08:44:57] <LeoNerd> Plus it now means the AUX line gives it active-high control, which I always find nicer.
[08:44:57] <RikusW> if you put in the 1k5 you can use the NPN, since the ST662 is on only for a short time until the NPN is turned off
[08:45:35] <RikusW> disadvantage of my design is low current supply...
[08:45:42] <LeoNerd> Ooh.. hang on - use the same control line on SHDN and the NPN base?
[08:45:47] <RikusW> in PNP + NPN the resistor is optional
[08:45:55] <LeoNerd> YAh
[08:46:04] <RikusW> I used 2 lines, SHDN and NPN
[08:46:07] * LeoNerd rereads your HVSP design
[08:46:27] <LeoNerd> Is the schematic around somewhere? I only see the final board copper
[08:46:35] <RikusW> I have 2 designs on my site, the ST662 one and the one from the original STK500
[08:46:48] <RikusW> Click on the HVPP page
[08:46:52] <RikusW> right at the bottom
[08:47:15] <LeoNerd> https://sites.google.com/site/megau2s/ <== I'm looking here
[08:48:58] <RikusW> look at the HV page
[08:49:02] <RikusW> or maybe stk500
[08:49:29] <LeoNerd> Ahyes
[08:51:08] <LeoNerd> Hm.. yeah, so two separate controls
[08:52:24] <RikusW> I'm not sure how important the Vcc power cycling is.. I put it in anyways
[08:52:48] <LeoNerd> I mean - one for the SHDN and one for the NPN; both ultimately controlling +12V on the RESET pin
[08:53:10] <RikusW> yes
[08:53:35] <RikusW> with a delay between them to allow the ST662 to get to 12V
[08:53:42] <LeoNerd> Yah. I imagined that's why
[09:14:21] <Vutral> hm
[09:14:30] <Vutral> RikusW, well if you latch something
[09:14:31] <Vutral> ^^
[09:14:36] <Vutral> RikusW, but there is brown out
[09:16:42] <Kre10s> hello. I want to do error/z; where error is a int32_t and z is some big number. instead of dividing i am thinking about shifting instead. error>>y; ... Does AVR have a variable shift instruction?
[09:22:30] <LeoNerd> Generally what happens is repeated shift in a loop
[09:23:10] <LeoNerd> var >> y will generally be converted into a form looking a bit like out = var; tmp = y; while(y--) out >>= 1;
[09:23:21] <LeoNerd> which then trivially compiles down to the actual AVR instructions
[09:46:07] <RikusW> Kre10s: only single bit shifting
[09:46:16] <RikusW> and swap 4 bits
[09:47:34] <RikusW> and of course 8 bit shifting...
[09:47:44] <RikusW> just move the bytes one up
[09:48:15] <RikusW> so at most you'll have to do 4 bit shifts
[09:48:29] <RikusW> 4 x 1 bit
[09:57:21] <twnqx> which will still be lots faster than division.
[10:34:33] <LeoNerd> So.. I'm currently reading up on all sorts of cute and curious ways to do decimal conversion, divide by 10, etc... and I suddenly notice that gcc-avr doesn't use them
[10:34:55] <LeoNerd> If I write a /= 10; it fills in a call to a generic divmod algorithm, rather than a much more efficient hardcoded-to-10 version
[11:23:41] <Casper> man capacitive touch sensors can be... touchy to design
[11:24:02] <vsync> man are you like the ghost man
[11:26:29] <[F_F]> AVR = asm + Cancer
[11:40:16] <Casper> from atmel appnote: if a led is within 4mm away and switched on/off, then it will cause a capacitance change on the sensor
[11:40:38] <Casper> so you need to bypass the led with a 1nf capacitor
[13:08:26] <Tom_L> http://www.electronicproducts.com/Software/System/New_Shellshock_virus_considered_1_000_times_worse_than_Heartbleed_bug_could_affect_at_least_500M_computers.aspx
[13:28:24] <spybert> The patch is already out, though
[13:30:03] <LeoNerd> Hah!... "the patch"
[13:30:19] <LeoNerd> The underlying problem was a very flawed design of a little-used little-understood feature hardly anyone ever wanted
[13:30:38] <spybert> not an unusual source of problems
[13:50:53] <Casper> and if that shellshock thing work.... it's because the network wasn't secure anywau
[13:59:13] <Tefad> i like how bugs like these happen quite frequently but only recently have they been making headlines
[14:05:03] <Kre10s> The media has decided it needs to get on the geek bandwagon... just think about all the new tv shows, and how many of them now have 'hacker' lead figures.
[14:17:12] <darsie> hi
[15:23:18] <Casper> let's say I want to aproximatelly average 10000 ADC sample.... is there a way to do it without having to store 10k samples?
[15:24:23] <N1njaneer> Yes, just add them together into a long, then divide by 10,000
[15:24:32] <Casper> like is using a big int, dividing the content by the sample count, substracting the result, adding the new value, dividing to get the average? sound like a waste and imprecise...
[15:24:50] <N1njaneer> Or more ideally take 16,384 samples, then just right-shift the result so you don't have to take the devide hit
[15:25:14] <Casper> yeah was thinking about tat actually
[15:25:14] <N1njaneer> +divide
[15:25:24] <N1njaneer> Unless you need a rolling average, all you need is the sum
[15:25:46] <N1njaneer> If you need a rolling average, you need to use a circular buffer for the table
[15:27:39] <Casper> I'm thinking to make some touch sensor, but I read about many issues, including drift over time
[15:27:55] <Casper> it use afunny way to do it
[15:29:19] <Casper> connect the pad to the adc pin via an optional resistor. Set output to high, set to input, sample immediatelly.
[15:29:49] <Casper> the pad act like a tiny capacitor, so get charged to VCC
[15:30:09] <Casper> then you sample, the internal sample and hold capacitor has been discharged...
[15:30:24] <Casper> the sample and hold then get in parallel with the sensor
[15:30:35] <Casper> 2 caps... charged at 0 and 5V
[15:30:45] <Casper> they tend to equalise the charge
[15:30:51] <N1njaneer> Why not just use QTouch directly in the AVRs? It handles all that stuff for you.
[15:30:54] <Casper> the sensor act as a variable capacitance
[15:31:11] <Casper> so equalise differently
[15:31:20] <Casper> well, I'm debating abot it
[15:31:41] <Casper> closed source, but the documentation is fricking long...
[15:32:00] <N1njaneer> Work though it once, then you're an experty.
[15:32:02] <N1njaneer> -y
[15:33:13] <Casper> yeah if the lib work on the avr I have
[15:33:33] <Casper> bbs
[18:21:27] <LeoNerd> http://pastie.org/9611486 <== gcc disappoints me sometimes. Manually unrolling that loop saves me ~40 bytes of flash
[18:23:52] <Casper> not the same code at all, so it's normal
[18:28:05] <LeoNerd> How does it differ..?
[18:28:35] <LeoNerd> And unrelatedly: how come I can reflash my tiny84 at Vcc=+5V but not +3.3V?
[18:28:54] <Lambda_Aurigae> how fast are you trying to program it?
[18:29:02] <Lambda_Aurigae> and/or how fast is it running?
[18:29:23] <Lambda_Aurigae> many chips will run good at a specific frequency and voltage but drop the voltage and things stop working at that frequency.
[18:30:15] <LeoNerd> Ah. hrm. default fuses and programmer settings.. one mome
[18:30:22] <Lambda_Aurigae> the attiny84, for instance, will run 0-20MHz at 4.5V to 5.5V...but under 4.5V it maxes at 10MHz.
[18:30:33] <LeoNerd> Oh. internal 8MHz osc
[18:31:10] <Lambda_Aurigae> so should be ok.
[18:31:44] <Lambda_Aurigae> voltage level issue with your programmer then?
[18:32:15] <Casper> LeoNerd: the result is the same, however the compiler have no way to know that you are only doing a 3 loop
[18:32:26] <LeoNerd> Casper: hrmmmm
[18:37:31] <LeoNerd> Woo. I have interrupts. Well, a timer interrupt
[18:37:40] <LeoNerd> Good enough for LED pulse-stretching anyway
[18:51:13] <Lambda_Aurigae> http://xkcd.com/323/
[21:51:37] <N1njaneer> Wibble wibble wibble, to break the deafening silence.
[22:02:41] <N1njaneer> So quiet.
[22:02:43] <N1njaneer> TOO quiet.
[22:02:48] <N1njaneer> People are up to no good.
[22:03:31] <Tom_itx> oh shut up!
[22:03:35] <Tom_itx> :D
[22:03:45] <N1njaneer> Mmm?
[22:03:49] <Tom_itx> been moving to a different hdd
[22:04:10] <Tom_itx> and work
[22:04:48] <Tom_itx> this channel seems to go in waves
[22:47:05] <Casper> N1njaneer: have you used the qtouch lib?
[22:49:21] <N1njaneer> I have not personally, no.
[22:49:43] <N1njaneer> I prefer tactile buttons :)
[22:51:49] <Casper> ok, the documentation is really bad imo... all I found up to now focus on their windows only tool to generate the lib...