#avr | Logs for 2012-07-31

Back
[00:08:10] <SuperMiguel> how can i find out the maximum amount of times i can get data from a sensor per second?
[00:09:28] <CapnKernel> Depends on how it's interfaced, and what kind of sensor it is.
[00:27:07] <SuperMiguel> this guys: http://www.crustcrawler.com/motors/RX28/index.php?prod=66
[00:29:32] <SuperMiguel> RX-28 does the Asynchronous Serial Communication with 8 bit, 1 Stop bit, and None Parity.
[00:34:27] <SuperMiguel> im guessing the best way it will be to assign an interrupt to get that data
[00:34:37] <SuperMiguel> just now sure how fast it would update
[04:12:11] <zump> Im trying to layout a board with an atmega32u4, i would program it using AVRISP but would eventually like to program through USB. What do i need to do with the HWB pin?
[04:17:57] <Tom_itx> i put a 10k resistor to gnd on mine
[04:18:14] <Tom_itx> why do you need isp?
[04:18:28] <Tom_itx> it has a bootloader for usb by default
[04:18:57] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/boards/atmega32u4/atmega32u4_1.jpg
[04:19:00] <Tom_itx> there's one i did
[04:20:19] <Tom_itx> if you don't like the resistor idea, you can hold hwb to GND then while holding, press reset to enter program mode
[04:21:04] <Tom_itx> or i should say while holding hwb to gnd take reset to gnd then release both
[04:21:53] <Tom_itx> ISP is ok but you don't really need it unless you plan to replace the bootloader
[04:24:28] <OndraSter> Tom_itx, do these atmega32u* come preprogrammed with USB bootloader? I thought not but somebody mentioned they do
[04:24:37] <Tom_itx> yes
[04:24:50] <OndraSter> oh
[04:24:51] <OndraSter> cool
[04:24:59] <OndraSter> now you need to inject your own bootloader thoguh :)
[04:25:15] <Tom_itx> then you need jtag or isp
[04:25:20] <OndraSter> yep
[04:26:07] <specing> 18.432 crystal stopped oscillating :(
[04:26:19] <OndraSter> YOU BROKE IT!
[04:26:48] <Tom_itx> specing since you pulled it from a parport card did you use the same size caps?
[04:27:00] <specing> it worked yesterday
[04:27:11] <specing> oh look, it seems the 20Mhz doesent work either
[04:27:11] <Tom_itx> it finally realized what you did to it
[04:27:19] <specing> Avr is broke ;(
[04:27:24] <OndraSter> heh
[04:27:41] <OndraSter> you broke the poor POOR POOR AVR!
[04:28:07] <Tom_itx> they're tough lil sob's, i bet you just borked the fuses or something
[04:28:37] <specing> scope is showing a straight line at 1 V on the osc pins :(
[04:29:33] <Tom_itx> how much impedance are you putting on them with the scope probe
[04:29:50] <specing> Well avrdude -t works
[04:30:06] <specing> Tom_itx: Sorry, I have nfi :)
[04:30:29] <OndraSter> nfi?
[04:30:34] <Tom_itx> stop abusing them, they will get you in your sleep
[04:30:39] <Tom_itx> (no farking idea)
[04:31:01] <specing> OndraSter: "no fucking idea" :P
[04:31:04] <OndraSter> oh
[04:31:50] <OndraSter> LOOK! Ondra has dice with 12 points!
[04:31:51] <OndraSter> :P
[04:32:00] <OndraSter> http://clip2net.com/s/2afIK
[04:33:15] <Tom_itx> use a mini reset button
[04:33:21] <OndraSter> this is mini button
[04:33:28] <Tom_itx> oh
[04:33:36] <OndraSter> the whole board is 23x34mm
[04:33:42] <OndraSter> the LEDs are 1206
[04:33:48] <Tom_itx> that's HUGE!
[04:33:50] <Tom_itx> :)
[04:33:57] <OndraSter> well the battery holder sets the board size
[04:34:04] <Tom_itx> why you using 1206 leds?
[04:34:10] <specing> lfuse is 0xff
[04:34:13] <OndraSter> because I have the space for them
[04:34:16] <specing> :S
[04:34:17] <OndraSter> and the bigger = the better
[04:34:35] <Tom_itx> 0402 are pretty bright
[04:34:44] <Tom_itx> i use those on my programmer
[04:34:51] <OndraSter> 0402 is nearly a dust
[04:34:51] <Tom_itx> with big resistors
[04:34:53] <OndraSter> heh
[04:34:56] <Tom_itx> naw
[04:36:16] <Tom_itx> do you have the leds yet?
[04:36:19] <OndraSter> no
[04:36:37] <Tom_itx> check the pads on the bottom, sometimes you don't get much 'trace' space under them
[04:36:49] <OndraSter> pads on the bottom?
[04:36:54] <Tom_itx> of the leds
[04:36:57] <OndraSter> huh?
[04:37:03] <Tom_itx> the solder pads
[04:37:11] <Tom_itx> make sure you have room for the trace
[04:37:25] <Tom_itx> it will have a mask on it anyway
[04:37:37] <OndraSter> I am not sure I understand you..?
[04:37:44] <OndraSter> the solder pads are for 1206 LEDs
[04:37:50] <Tom_itx> it should be fine
[04:38:04] <OndraSter> I will go for these probably
[04:38:05] <OndraSter> http://cz.mouser.com/ProductDetail/OSRAM-Opto-Semiconductors/LG-N971-KN-1/?qs=LsPilcdHE7HjjBJQtQjWPgD2WI1kwc07fF5VQLGkImc%3d
[04:38:16] <OndraSter> (or probably more different colors if somebody asks)
[04:39:01] <OndraSter> btw, with charlieplexing the board layout is really simple (at least for 12 LEDs aka 4 IO pins)
[04:39:21] <Tom_itx> http://cz.mouser.com/ProductDetail/Lite-On/LTST-C190CKT/?qs=S9W2%252blcD1Ryxrr9VBQ7JozTirw0FIEuRsLLokfXGR71c3AszvApTsw%3d%3d
[04:39:38] <OndraSter> the price dude!
[04:39:46] <OndraSter> for 1 - 100
[04:40:17] <OndraSter> also I like 1206 - they will stand out on the black soldermask
[04:40:24] <OndraSter> green/red/.. whatever
[04:40:24] <specing> Ah, it is oscillating
[04:40:31] <specing> My scope is too slow to see it
[04:40:33] <OndraSter> (green/red/.. LEDs)
[04:40:35] <OndraSter> heh specing
[04:40:42] <Tom_itx> why black?
[04:40:44] <OndraSter> I have got Kikusui 2x 40MHz
[04:40:52] <OndraSter> Tom_itx, contrast
[04:40:56] <OndraSter> I like black boards
[04:40:59] <Tom_itx> mkay
[04:41:08] <OndraSter> green is boring and pukey
[04:41:16] <OndraSter> white is the other option
[04:41:23] <OndraSter> but that sucks :)
[04:41:25] <OndraSter> too light
[04:42:12] <specing> It is my code that is not working
[04:42:29] * Tom_itx slaps specing for blaming the avr
[04:42:35] <OndraSter> lol
[04:45:36] <specing> Yeah, fucking timer1
[04:45:52] <specing> Oh shi... that is blaming the avr again
[04:46:22] <specing> I have the TIMSK interrupt set, sei() and no interrupt is happening :(
[04:46:31] <specing> interrupt enable*
[04:52:21] <zump> Tom_itx, whats the dimensions of that board
[04:54:49] <specing> Anyone spots anything wrong with this? (I have a led toggler in the TIMER1_OVF_vect handler)
[04:54:51] <specing> TCCR1B = /*(1 << WGM13) |*/ (1 << WGM12) | (1 << CS12) | (1 << CS10); // /1024, ctc on OCR1A
[04:54:54] <specing> // 18432000 / 1024 = 18000.0
[04:54:57] <specing> OCR1A = 18000;
[04:54:59] <specing> TIMSK = (1 << TOIE1);
[05:01:49] <specing> Do I have to somehow enable to shared prescaler? It says nothing about that
[05:16:59] <zump> can any pin on an avr be used as gpio in addition to their peripheral functions? (besides vcc/gnd/reset)?
[05:17:53] <OndraSter> specing, what hcip?
[05:18:04] <OndraSter> zump, either GPIO or the peripheral
[05:18:10] <OndraSter> you can turn on/off the peripheral as you need
[05:21:22] <specing> OndraSter: tiny2313
[05:22:00] <specing> I found dean's timer tutorial and Im comparing my code to his
[05:22:29] <specing> Hmm he sets TCCR1B in two steps
[05:22:42] <specing> first he sets the mode and then he enables it
[05:22:52] <OndraSter> do you have I flag?
[05:23:22] <OndraSter> also does overflow happen in CTC mode?
[05:23:44] <OndraSter> because you do compare match and clear
[05:23:53] <specing> sei() is on, yes
[05:24:09] <specing> Oh :P nice catch
[05:24:36] <specing> well but overflow is when the counter reaches TOP, right?
[05:24:46] <OndraSter> well when it overflows
[05:24:48] <specing> So if top is actually OCR1A...
[05:25:00] <OndraSter> check GIFR
[05:25:03] <specing> I should be getting the int
[05:25:08] <OndraSter> TIFR*
[05:25:21] <OndraSter> also check TCNT if the value is updating
[05:27:15] <specing> Yeah it works now
[05:27:21] <specing> COMPA was firing
[05:27:38] <specing> ...
[05:27:45] <OndraSter> heh
[05:28:49] <specing> Now the serial ringbuffer stopped working -.-
[05:29:03] <OndraSter> hmm if you have got 1 pole tactile button, are the left and right side internally connected?
[05:30:31] <specing> Ugh tac buttons
[05:30:40] <specing> I never got them right...
[05:42:54] <OndraSter> I do wonder, how will Dragon like programming board that has got hanging charlieplexed LEDs on the programming pins? :P
[05:43:18] <OndraSter> the "only" way how to not make them lit up is to use 1.8V power supply instead the 3V battery
[05:43:40] <OndraSter> they WON'T lit up at 1.8V (or at least will not flow with high current)
[06:15:41] <CapnKernel> OndraSter: The 4-pin SPST momentary tactile ones? Yes, two internal connections.
[06:15:53] <CapnKernel> Which can be useful for routing :-)
[06:15:54] <OndraSter> okay
[06:15:55] <OndraSter> thanks
[06:15:57] <OndraSter> yeah
[06:41:27] <specing> Meh how can a simple event loop not work?
[06:42:07] <specing> everything looks correct in the dissassembly...
[07:13:23] <specing> grrr
[07:22:01] <specing> I have nfi why this doesen't work...
[07:23:38] <specing> THe interrupt fires (I have a led toggler there) and sets a flag. Main loop has an if on that flag... yet the toggler inside doesen't output anything
[07:25:16] <specing> WTF gcc just generated the ugliest code in existance
[07:25:39] <damjan> specing: did you set the variable as volatile?
[07:25:59] <OndraSter> specing, gcc generates always the ugliest code in existence
[07:26:07] <OndraSter> even 4 year old could do better asm code
[07:26:17] <OndraSter> EVEN BRAINDEAD ZOMBIE COULD
[07:26:32] <specing> damjan: that variable is actually a register
[07:26:46] <specing> register u8 flags asm ("r16");
[07:26:47] <specing> #define EV_CLK 0
[07:30:05] <specing> grep r16 firmware.s
[07:30:08] <specing> 146:00 ff sbrsr16, 0
[07:30:15] <specing> 150:0e 7f andir16, 0xFE; 254
[07:30:18] <specing> 174:01 60 orir16, 0x01; 1
[07:30:51] <specing> ...
[07:34:13] <specing> I have no idea why it would work... it should work!
[07:34:19] <specing> *wouldn't
[07:35:57] <specing> Wtf I added a simple PORTD ^= (1 << PIN6);
[07:35:59] <jacekowski> orir16?
[07:36:05] <jacekowski> that's not avr asm
[07:36:08] <OndraSter> ORI R16
[07:36:08] <specing> before the if and now it all works
[07:36:30] <jacekowski> ahm
[07:36:52] <specing> this is weird
[07:37:16] <OndraSter> specing, avr gcc is sometimes randomly stops working :)
[07:37:33] <OndraSter> somebody here few days ago had issues that when he changed optimalizations to -Os the interrupt wouldn't work in LUFA
[07:37:56] <jacekowski> that's by design
[07:38:06] <jacekowski> avrgcc optimisations are designed to break stuff
[07:38:07] <OndraSter> to stop randomly working, jacekowski ?
[07:38:10] <jacekowski> everybody knows that
[07:38:11] <OndraSter> ah
[07:38:59] <jacekowski> they've improved slightly over last few years
[07:39:05] <specing> -fno-buggy-optimisations
[07:39:07] <jacekowski> but it's still pretty bad when it comes to that
[07:39:09] <OndraSter> even less code works?
[07:39:30] <jacekowski> things like inline functions
[07:39:32] <specing> Im running 4.5.3
[07:39:37] <jacekowski> that will take up all your stack space
[07:39:44] <OndraSter> heh
[07:40:09] <OndraSter> you know what is interesting? That when I started writing firmware for my LED matrix I originally wrote it partially in C
[07:40:13] <OndraSter> it was using quite heavily RAM
[07:40:24] <OndraSter> when I rewrote it in ASM I used only two bytes of memory
[07:40:41] <jacekowski> that's bad code
[07:40:50] <OndraSter> in C?
[07:41:06] <OndraSter> it puts stuff onto stack and into memory too much, I could get away with those 31 registers
[07:41:08] <OndraSter> 32*
[07:41:18] <specing> yeah
[07:41:28] <specing> Why cant it jsut work (tm)...
[07:41:38] <OndraSter> because it is not iPhone or Windows Phone :D
[07:41:44] <OndraSter> if the USB was a bit easier I'd make whole USB stack in assembly :D
[07:41:57] <OndraSter> code size -> from 8kB to 4kB
[07:42:05] <OndraSter> (randomly picked numbers)
[07:43:30] <specing> and memory size from 1k to 800b
[07:44:06] <OndraSter> well, if you went for really good optimalizations you'd need just for the incoming/outcoming buffers + few bytes for data that won't fit into 32B of registers :P
[08:04:46] <specing> 146: 80 2f mov r24, r16
[08:04:46] <specing> 148: 90 e0 ldi r25, 0x00 ; 0
[08:04:46] <specing> 14a: 81 70 andi r24, 0x01 ; 1
[08:04:46] <specing> 14c: 90 70 andi r25, 0x00 ; 0
[08:04:55] <specing> if (bit_is_set(flags, EV_CLK)) {
[08:04:55] <specing> 150: 00 97 sbiw r24, 0x00 ; 0
[08:04:56] <specing> 152: e9 f3 breq .-6 ; 0x14e <main+0x2e>
[08:05:04] <specing> W.T.F. is this SHIT?!?!
[08:07:56] <specing> no wonder it does not work
[08:11:08] <OndraSter> lol specing
[08:11:12] <OndraSter> ldi r25 andi r25
[08:11:13] <OndraSter> lmao
[08:11:15] <OndraSter> LMAO
[08:12:26] * specing picks up a large axe
[08:12:37] * specing goes looking for a gcc dev
[08:12:42] <karlp> what C code was that?
[08:13:07] <specing> sei();
[08:13:07] <specing> while(1) {
[08:13:08] <specing> asm volatile ("nop");
[08:13:08] <specing> if (bit_is_set(flags, EV_CLK)) {
[08:13:46] <specing> OndraSter: Are you using gas directly for assembly?
[08:13:52] <OndraSter> I am using atmel studio
[08:13:57] <specing> ah :(
[08:16:04] <OndraSter> I wish there was some way to "pack" the pieces of code
[08:16:11] <OndraSter> like in C# in Visual Studio
[08:16:24] <specing> pack?
[08:16:39] <OndraSter> pack 10/whatever lines into one
[08:16:44] <OndraSter> as in hide them
[08:17:25] <specing> vim can do that ;P
[08:17:44] <damjan> fold
[08:28:02] <OndraSter> bloody hell, LDI is the same length as CLR/SER instructions :(
[08:32:46] <OndraSter> hmm can one do something like
[08:32:49] <OndraSter> RJMP .+2
[08:32:56] <OndraSter> instead creating name for another location
[08:33:29] <OndraSter> nope
[08:50:34] <specing> This folding thing is really neat btw.
[08:52:32] <karlp> OndraSter: so, they used visual studio as a base, but they didn't get code folding for free?
[08:52:40] <OndraSter> no
[08:52:48] <OndraSter> they didn't get a lot of things :/
[08:53:17] <specing> use vim :P
[08:54:00] <OndraSter> no
[08:54:04] <OndraSter> Vim is good for one thing
[08:54:06] <OndraSter> creating passwords :D
[08:54:18] <specing> ?
[08:55:00] <OndraSter> when you are trying to remember HOW THE HELL DO I CLOSE IT
[08:55:01] <OndraSter> :P
[08:55:50] <specing> OndraSter: :q fool
[08:56:07] <specing> seriously, vim is the best :D
[08:56:25] <OndraSter> fool
[08:58:00] <OndraSter> who has invented word "nibble"?
[08:58:04] <OndraSter> it sounds too much like nipple
[08:58:05] <OndraSter> lol
[08:58:10] <OndraSter> inverted nipple!
[08:58:51] <specing> :O
[09:02:20] <karlp> sounds liek visual studio is a pretty crap base for other people to use then OndraSter ;)
[09:02:31] <OndraSter> I have got no idea what they can or can not use
[09:02:35] <OndraSter> but still it is much better than VIM
[09:02:36] <OndraSter> or Eclipse
[09:02:38] <OndraSter> or anything else
[09:03:30] <specing> Vim has a VISUAL mode too!
[09:03:47] <specing> I dont think it is related though...
[09:08:45] <amee2k> anyone here tried soldering a nut and bolt together before as a way to prevent them from coming lose?
[09:13:01] <tomatto> hi
[09:13:02] <tobbor> hi tomatto.
[09:14:19] <tomatto> how can i enable OCR2 pwm output in atmega8? when i do DDRB=(1<<DDB3) i still get 0 on pin
[09:17:18] <amee2k> tomatto: for PWM to work you have to set the adequate bits in the timer control register as well
[09:18:45] <amee2k> to enable the OC2 function on that pin (not OCR2 ;), you have to set the COM2x bits in the TCCR2 register to some value other than 0
[09:19:23] <tomatto> amee2k: like this? http://pastebin.com/m1yMVD4C
[09:20:26] <amee2k> yeah, that should do it
[09:21:27] <amee2k> you should also initialize the OCR2 register when setting up the timer for PWM like that
[09:22:44] <tomatto> like what? OCR2=0;?
[09:30:25] <amee2k> tomatto: yeah, like that. setting it to 0 or 255 probably isn't so cool unless you set it to something else later
[09:30:48] <amee2k> you'd just get a flatline with possibly a tiny spike when the timer wraps around
[09:33:45] <tomatto> it works :)
[09:34:49] <amee2k> \o/
[10:00:34] <OndraSter> tomatto, still haven't solved it?
[10:00:39] <OndraSter> did you set OC pin?
[10:00:55] <OndraSter> if you check datasheet there are "operation of OC pins" bits
[10:01:12] <OndraSter> like "OC output", "OC inverted output", "disconnnected" and one more
[10:01:17] <OndraSter> default is disconnected obviously
[10:19:42] <tomatto> OndraSter: i wrote at 16:22 it works, so i solved this OC2/OCR2 issue. but thanks ;)
[10:20:04] <OndraSter> I wasn't here at 1622
[10:20:11] <OndraSter> my internet crpped out
[10:20:12] <OndraSter> crapped*
[10:20:38] <tomatto> i have made pwm DAC with atmega8 :)
[10:20:47] <OndraSter> :)
[10:20:51] <tomatto> OndraSter: sorry, i didn't now that
[10:22:54] <tomatto> recipe: 1x atmega8, 2x 10k resistor and 2x 100nF ceramic capacitor. wonderful! :o)
[10:23:37] <OndraSter> recipe for real DAC: 1x atxmega a* or c* series :)
[10:24:39] <tomatto> it will cost much more money :D
[10:24:48] <OndraSter> surely
[10:24:53] <OndraSter> how much was your mega8?
[10:25:18] <tomatto> OndraSter: i don't hear about this series and not much about atxmega
[10:25:32] <tomatto> OndraSter: about 2$
[10:25:38] <OndraSter> xmega is the new best thing since sliced bread
[10:25:46] <OndraSter> hmm let me see what is the cheapest xmega with real hardware DAC :)
[10:25:56] <tomatto> ok
[10:28:07] <OndraSter> hmm atxmega32a4u... 32kB flash, 4kB RAM, five timers, USB, 1x8channel 12bit 2MSPS ADC, 1x2channel 12bit 1MSPS DAC
[10:28:11] <OndraSter> and bazilion more stuff :D
[10:28:18] <OndraSter> 2.92€
[10:28:21] <OndraSter> BU!
[10:28:22] <OndraSter> BUT!
[10:28:31] <Kevin`> wait, there's more!
[10:28:45] <tomatto> OndraSter: BUT! ?
[10:28:48] <OndraSter> atxmega256a3u (my favourite now :D)... 256 + 8kB flash, 16kB RAM, seven timers, USB, 2x8channel 12bit 2MSPS ADC each (!!), 1x2channel 12bit 1MSPS DAC
[10:28:51] <OndraSter> 4€
[10:29:06] <tomatto> EUR is more than USD
[10:29:10] <OndraSter> yes
[10:29:13] <Kevin`> I have a few of those usb xmegas here for a project i'm procrastinating on, they are nice
[10:29:20] <OndraSter> but for 4 EUR you get much, much more bang for a buck
[10:29:32] <OndraSter> I have ordered few 256a3u and I am waiting for them + boards to arrive
[10:29:36] <Kevin`> tomatto: look up priced from a US distributor, it probably won't be that expensive
[10:29:57] <OndraSter> but $2 for mega8 is just stealing :)
[10:30:25] <tomatto> OndraSter: ?
[10:30:31] <OndraSter> it is too much :)
[10:30:34] <OndraSter> compared to some xmegas
[10:30:46] <Kevin`> tomatto: http://www.mouser.com/ProductDetail/Atmel/ATXMEGA32A4U-AU/?qs=HbI%2fMOA3e15cJNiXny0NsrxmAlxA1Fib16vg62fSimU%3d - example
[10:30:52] <tomatto> i think maybe they cost 1.5
[10:31:53] <tomatto> OndraSter: what price did you have atmega8 ?
[10:32:05] <OndraSter> I bought one locally and it is overpriced locally :D
[10:32:18] <OndraSter> but I suppose that below $2 it is really hard to make the chip
[10:32:22] <OndraSter> the substrate itself costs a lot
[10:32:33] <OndraSter> and the ceramic package
[10:33:36] <tomatto> OndraSter: so what do you suggest from xmega line?
[10:33:44] <OndraSter> that 256a3u :)
[10:33:57] <OndraSter> because:
[10:34:03] <OndraSter> a) it costs less than 16a4 (!!)
[10:34:22] <OndraSter> b) has all features except external memory interface which is only on A1 series (which is hard to find with USB though)
[10:34:30] <tomatto> and where did you get boards to it?
[10:34:32] <OndraSter> c) all USB parts are overclockable beyond 48 or even 64MHz often :)
[10:34:38] <OndraSter> DIY
[10:34:42] <OndraSter> ordered from iTeadStudio
[10:34:47] <OndraSter> I will be selling them
[10:35:18] <tomatto> OndraSter: can you show me it?
[10:35:25] <OndraSter> only "issue" with xmega = you have to either have on them USB bootloader or get some more expensive ($20 - $30) programmer. The classic stuffs for Atmega don't work anymore
[10:35:35] <OndraSter> tomatto, breakout board with xmega in the middle of it
[10:35:42] <OndraSter> and 3v3 LDO and few bits'n pieces
[10:36:09] <kobsu> abcminiuser: congrats for the new LUFA release:)
[10:36:09] <OndraSter> not the version I sent to fab house, but almost the latest one:
[10:36:10] <OndraSter> http://clip2net.com/page/m12051/31780892
[10:36:17] <OndraSter> http://clip2net.com/page/m12051/31774606
[10:36:52] <Kevin`> is that for the qfn chips?
[10:36:55] <OndraSter> ye
[10:37:38] <tomatto> tqfp i think, isn't it?
[10:37:41] <OndraSter> QFN
[10:37:46] <OndraSter> TQFP is almost twice as big :o
[10:37:50] <OndraSter> QFN = 9x9mm
[10:37:53] <OndraSter> TQFP = 14x14
[10:38:05] <OndraSter> actually it is twice as big
[10:38:06] <tomatto> oh, i see
[10:38:06] <Kevin`> tomatto: both are available. if you are hand soldering, qfp is pretty easy
[10:38:08] <OndraSter> and a bit more
[10:38:18] <OndraSter> but TQFP costs almost twice as much on mouser :P
[10:38:32] <Kevin`> it's all that tin
[10:38:33] <Kevin`> ;p
[10:38:39] <OndraSter> (on digikey they are both at $6 or so per piece, down to $3.2 for 100pcs)
[10:39:02] <tomatto> OndraSter: so this your board is something like reduction to classic DIP package?
[10:39:03] <OndraSter> $3.9 per 100pcs @ digikey*
[10:39:06] <OndraSter> tomatto, yes
[10:39:18] <OndraSter> it has two onboard LEDs for your use even
[10:39:49] <OndraSter> you can actually replace it with SMD crystal, make solder bridges and add capacitors even I have just realized!
[10:39:52] <OndraSter> :P
[10:39:56] <OndraSter> but the internal clocks are enough really
[10:40:41] <Kevin`> i'm kinda suprised the internal clock works well for usb
[10:40:52] <OndraSter> the xmega can actually sync from USB :)
[10:40:59] <OndraSter> from that preamble or w/e is it called
[10:41:05] <abcminiuser> kobsu, cheers :)
[10:41:16] <OndraSter> before each transfer there is few clock changes to synchronize host and client
[10:41:31] <OndraSter> few = 11 I think?
[10:41:33] <Kevin`> oh, neat
[10:41:35] <tomatto> OndraSter: my friend telling me, that 32bit arm chips are better, but i don't sure
[10:41:40] <OndraSter> sure they are
[10:41:43] <OndraSter> but they cost more with such peripherals
[10:41:56] <abcminiuser> OndraSter, I can't condone overclocking XMEGAs, tut tut
[10:42:16] <OndraSter> why?
[10:42:17] <abcminiuser> However, I got one running at 70MHz for some basic tasks
[10:42:20] <OndraSter> the peripherals have their own clocks
[10:42:22] <OndraSter> heh
[10:42:26] <OndraSter> basic tasks @ 70MHz
[10:42:43] <abcminiuser> Running a display and UI code
[10:42:50] <OndraSter> do you remember that guy that wrote ARM emu for AVR?
[10:42:51] <tomatto> OndraSter: $3 with usb, adc, lot of timers with PWM channels and 72MHz clock
[10:42:55] <OndraSter> and was running it on 16MHz atmega?
[10:43:04] <OndraSter> tomatto, DAC, DMA,...
[10:43:11] <OndraSter> I presume it is some stm32?
[10:43:39] <tomatto> OndraSter: yes it is
[10:43:45] <OndraSter> link?
[10:44:27] <tomatto> OndraSter: i have no, but it is cortex-m3 core
[10:44:37] <OndraSter> well you had to get the price somewhere :)
[10:44:38] <tomatto> i haven't know
[10:44:44] <OndraSter> ah
[10:44:56] <tomatto> OndraSter: he told me few months ago
[10:45:44] <OndraSter> cheapest stm32 with 72MHz is on mouser for 3.8€
[10:45:51] <OndraSter> 16kB flash/6kB RAM
[10:46:00] <OndraSter> and only 48 pin device
[10:46:32] <tomatto> i think he has 64KB flash. but i am not sure
[10:46:36] <OndraSter> stm32 with 256kB flash, 36MHz goes for 5.6€
[10:46:46] <OndraSter> well mine xmega has 256kB
[10:47:05] <tomatto> OndraSter: still 8bit core right?
[10:47:09] <OndraSter> yes
[10:47:13] <OndraSter> with some 16bit stuff on top of it
[10:48:23] <tomatto> what stuff do you mean?
[10:48:29] <OndraSter> instructions
[10:49:07] <OndraSter> also ARMs have got one major issue - their driving strength
[10:49:13] <OndraSter> we are talking usually 4 - 8mA
[10:49:23] <damjan> what's easier to solder at home? the QFN or TQFP. And how do you make the board for that?
[10:49:25] <OndraSter> while (x)mega has 20mA per pin
[10:49:34] <OndraSter> damjan, TQFP is easier to solder
[10:49:44] <OndraSter> board => either at home or order it from fab house (home design)
[11:09:30] <karlp> 5mA is enough for a modern led anyway OndraSter, what else do you want to drive?
[11:09:40] <OndraSter> TWO LEDS!
[11:09:52] <OndraSter> switching MOSFET...
[11:10:05] <OndraSter> at high frequencies
[11:10:30] <OndraSter> you want FAST charge and FAST discharge
[11:10:32] <OndraSter> of the gate
[11:11:39] <tomatto> OndraSter: you can't connect gate of power MOSFET directly to uP pin
[11:11:47] <Kevin`> sure you can
[11:11:48] <OndraSter> I can
[11:11:49] <OndraSter> I did
[11:11:50] <OndraSter> many times
[11:11:51] <tomatto> you need driver for it
[11:11:54] <OndraSter> no you don't
[11:12:20] <OndraSter> I was driving 2x16 MOSFETs via 2x 74hc138 (or whatever number it is) 4to8 decoders
[11:12:21] <tomatto> you can blow up uP
[11:12:27] <OndraSter> how come
[11:12:29] <OndraSter> ?
[11:13:16] <tomatto> when blow up mosfet or just current via pin will be to high
[11:13:24] <OndraSter> why should the MOSFET blow up?
[11:13:35] <tomatto> zkrat
[11:13:42] <tomatto> short
[11:13:45] <OndraSter> why should you short circuit it?
[11:13:57] <OndraSter> tomatto, pockej, jeste rekni ze jsi z Prahy :D
[11:14:05] <tomatto> OndraSter: accident?
[11:14:10] <OndraSter> well then
[11:14:14] <Kevin`> tomatto: that's an extra chip just to handle rare failure conditions, not all designs need that
[11:14:17] <OndraSter> you have a bad luck
[11:14:41] <tomatto> i am only careful
[11:15:15] <tomatto> when you run it on high frequency, you need more than 20mA to drive it
[11:15:21] <OndraSter> depends on the MOSFET
[11:15:28] <tomatto> OndraSter: ne z Nachoda :o)
[11:15:30] <OndraSter> ah
[11:15:32] <OndraSter> almost :D
[11:16:02] <tomatto> high current mosfets
[11:16:13] <OndraSter> depends on the gate charge
[11:16:19] <tomatto> yeah
[11:17:08] <tomatto> high current mosfets have about 3nF, it is a lot for >KHz frequencies
[11:17:11] <tomatto> i think
[11:18:01] <tomatto> OndraSter: or not?
[11:18:07] <OndraSter> no idea from top of my head
[11:18:15] <OndraSter> I am dealing with another things atm :)
[11:18:22] <tomatto> atm?
[11:18:26] <OndraSter> at the moment
[11:18:38] <tomatto> ok, what about?
[11:19:04] <OndraSter> I am writing firmware for small gadget that has charlieplexed LEDs
[11:19:11] <OndraSter> purely in asm
[11:19:14] <OndraSter> to fit in attiny13's flash
[11:19:16] <OndraSter> and RAM
[11:20:03] <tomatto> what do you do that? i think that it is kind of suicide
[11:20:17] <OndraSter> because gcc produces some evil stuff
[11:20:20] <OndraSter> and I have 1kB flash
[11:20:27] <OndraSter> and 64B RAM
[11:20:40] <tomatto> i think why attiny13?
[11:20:44] <OndraSter> oh
[11:20:44] <OndraSter> size
[11:20:46] <OndraSter> and price :)
[11:20:59] <tomatto> what is charlieplexing?
[11:21:12] <OndraSter> with 4 pins you drive 12 LEDs
[11:21:17] <OndraSter> with 5 pins you drive 20 LEDs
[11:21:19] <tomatto> OndraSter: for what or who?
[11:21:21] <OndraSter> with 6 pins you drive 30 LEDs
[11:21:23] <OndraSter> for me
[11:21:25] <OndraSter> small gadget
[11:21:39] <OndraSter> http://clip2net.com/s/2akDL
[11:21:42] <tomatto> what it exactly is?
[11:21:48] <OndraSter> ^
[11:22:07] <OndraSter> I have got hyperdice even
[11:22:13] <OndraSter> goes beyond regular 1 - 6
[11:22:14] <OndraSter> :P
[11:23:13] <tomatto> what for exactly is this gadget?
[11:23:21] <OndraSter> public :o
[11:23:58] <tomatto> can you be more specific?
[11:24:06] <OndraSter> I shall be selling them
[11:24:22] <tomatto> OndraSter: what price? :)
[11:24:38] <OndraSter> about 5 EUR assembled, 4 EUR as a kit probably, no idea yet
[11:24:53] <OndraSter> parts are about 3.3€ for single board (incl. board)
[11:25:17] <OndraSter> 2.8€/board for 25 pieces, 2.2€ for 100 pcs
[11:25:26] <tomatto> you should use attiny25/45/85 there is enough flash
[11:25:35] <OndraSter> tiny13a has less power consumption
[11:25:39] <OndraSter> in sleep
[11:25:41] <OndraSter> supposedly
[11:25:44] <OndraSter> it is marked as picopower
[11:26:22] <tomatto> you ordered 100pcs of pcb?
[11:26:28] <OndraSter> no
[11:26:59] <tomatto> it is price of tiny's?
[11:27:01] <OndraSter> I haven't got any PCBs yet, I need to find somebody who can make them cheaply - iTead has got the smallest orderable 50x50mm, these are 23x34 and would fit two on the board - but it is hard to separate them cleanly
[11:27:05] <OndraSter> 0.7€/1pcs
[11:27:30] <OndraSter> $15 for colour 50x50mm PCBs, 10 of them. If I could fit there two, I would be on $0.75/board
[11:27:37] <OndraSter> + the parts for it
[11:28:17] <tomatto> iron shears :D
[11:29:03] <tomatto> or something like that
[11:29:19] <OndraSter> I sent them email asking if they could make like 20 boards 25x50 for $17
[11:29:20] <OndraSter> colour
[11:29:25] <OndraSter> would be awesome
[11:29:31] <OndraSter> I'd much prefer having them routed out
[11:29:36] <OndraSter> than just home snapped
[11:29:39] <OndraSter> or home cut
[11:30:05] <tomatto> why do you want coloured?
[11:30:11] <OndraSter> because green is:
[11:30:12] <OndraSter> a) boring
[11:30:25] <OndraSter> b) doesn't hide enough the traces and vias etc :)
[11:30:32] <OndraSter> I want it to be as neat as possible
[11:30:33] <OndraSter> plus
[11:30:36] <OndraSter> c) colour is cool
[11:30:41] <OndraSter> green is meh
[11:31:15] <tomatto> i know, but for $5 :D
[11:31:32] <OndraSter> yeah well
[11:31:37] <OndraSter> but it is neater :P
[11:31:54] <OndraSter> sure I could sell green ones a bit cheaper
[11:32:44] <tomatto> ok, i am silent now :D
[11:32:49] <OndraSter> ;)
[11:33:04] <tomatto> OndraSter: where do you learn about charlieplexing?
[11:33:10] <OndraSter> internet
[11:33:17] <tomatto> very specific :D
[11:33:25] <OndraSter> wikipedia has got fairly long article about it
[11:33:30] <OndraSter> amongst other websites
[11:34:00] <tomatto> unexpected, yeah
[11:34:27] <tomatto> OndraSter: can i drive 7 segment leds with it clearly?
[11:34:40] <OndraSter> sure
[11:34:46] <OndraSter> you need to up the current though
[11:34:55] <OndraSter> each segment will be driven only 1/7th of a second
[11:34:57] <OndraSter> (in theory)
[11:36:43] <tomatto> in case of more than one of 7segment leds time per second will be lower so current must be higher. i assume
[11:36:53] <OndraSter> yes
[11:37:19] <OndraSter> I was driving rather large LED matrix (not charlieplexing method though) and I was pumping more than 70mA per diode :)
[11:37:36] <OndraSter> well, in the end I lowered the duty cycle by far and I am down to 5 or 4mA when I don't need it bright
[11:37:55] <OndraSter> I lied, less than 4mA actually*
[11:37:57] <Hfuy> Hello.
[11:38:43] <Hfuy> I'm trying to install AVR Studio 4.19 on this laptop (a dual core Atom with Windows 7). I get as far as starting the installation after the installshield wizard has run, and I get a taskbar icon but no window and no disk activity. Has anyone seen this before?
[11:39:01] <OndraSter> why 4.19?
[11:39:19] <Hfuy> I was advised to go for 4. People said it was easier on beginners.
[11:39:48] <Hfuy> I could try something else.
[11:39:48] <OndraSter> nah not really
[11:39:52] <OndraSter> as6 :)
[11:39:54] <OndraSter> atmel studio 6
[11:40:08] <Hfuy> Okay.
[11:40:16] <Hfuy> Bah, irritating email roundy-roundy.
[11:42:43] <Hfuy> This is only a basic laptop, though. Dual core Atom CPU.
[11:45:23] <Hfuy> Five hundred and twenty-eight megabytes?!
[11:45:27] * Hfuy gesticulates wildly
[11:48:19] <OndraSter> + visual studio shell :P
[11:48:22] <OndraSter> or is that including it?
[11:48:36] <Hfuy> I think I went for the simpler one.
[11:48:38] <Hfuy> We'll find out.
[11:48:48] <tomatto> OndraSter: xmega can't be programmed via spi?
[11:48:58] <OndraSter> no
[11:49:38] <Hfuy> Tom_itx's programmers have a green and a red LED. Both mine are on. What does that mean?
[11:50:13] <Hfuy> Hm. One of them means USB power is selected.
[11:50:40] <tomatto> OndraSter: what programmer do you or will you use?
[11:51:26] <tomatto> avrdude can't program eeproms?
[11:56:19] <Hfuy> Why is this thing trying to download .net 4
[11:56:26] <Hfuy> from a URL that apparently no longer exists?
[12:10:13] <Hfuy> Hm. Really can't get AVR Studio to install.
[12:10:16] <Hfuy> This screws me rather.,
[12:11:11] <Hfuy> I just have an idle task called "AvrStudio4Setup.exe" and a taskbar icon that doesn't open any windows.
[12:17:03] <OndraSter> tomatto, Dragon for developing, but for people I will be sending it with USB bootloader
[12:21:54] <tomatto> OndraSter: when i haven't Dragon, what can i use for programming?
[12:22:05] <OndraSter> I will be shipping them with USB bootloader
[12:22:08] <OndraSter> but it will take some time
[12:22:14] <OndraSter> the ones without BL will be available "soon"
[12:23:23] <tomatto> i have atmega and attiny programmer/uploader but not for eeproms like 93c46 and atxmega
[12:30:25] <tomatto> i am here again :)
[12:35:48] <tomatto> OndraSter: told you something about programming xmega or 93c46 eeproms?
[12:36:01] <karlp> OndraSter: usb xmegas don't come with a factory usb bootloader?
[12:36:01] <OndraSter> huh?
[12:36:09] <OndraSter> karlp, no idea
[12:36:15] <OndraSter> I thought not
[12:36:21] <karlp> surely you checked that before you started writing your own?
[12:36:32] <karlp> I haven't looked either, but all the stm32's with usb have a usb bootloader
[12:36:33] <OndraSter> I haven't started yet :)
[12:36:44] <karlp> I would have thought it would be pretty standard
[12:36:56] <OndraSter> well mega*u* does come
[12:37:00] <OndraSter> with preflashed BL
[12:37:25] <karlp> but is that rom or just the beginning of flash?
[12:37:39] <OndraSter> it is bootloader
[12:37:41] <OndraSter> that can flash
[12:37:48] <OndraSter> in the flash
[12:37:49] <tomatto> karlp: stm32 friend's demoboard come with serial bootloader
[12:37:51] <OndraSter> in the end of the flash
[12:38:00] <karlp> tomatto: they all have at least serial
[12:38:08] <karlp> the usb ones have serial + usb bootloaders
[12:38:13] <Hfuy> What sort of "debug platform" should I select for one of Tom_itx's programmers?
[12:38:32] <karlp> you can even bootload them via can/i2c on some of the models
[12:39:02] <Hfuy> Does "debug platform" even matter that much? I don't recall doing any debugging last time.
[12:39:42] <OndraSter> you cna't debug with Tom's programmer
[12:39:46] <OndraSter> can't*
[12:40:04] <OndraSter> huzzah, attiny13a
[12:40:04] <OndraSter> 1: 0,714 €
[12:40:04] <OndraSter> 10: 0,595 €
[12:40:05] <OndraSter> 25: 0,447 €
[12:40:05] <OndraSter> 100: 0,412 €
[12:40:09] <OndraSter> attiny25
[12:40:09] <OndraSter> 1: 0,808 €
[12:40:10] <OndraSter> 10: 0,672 €
[12:40:10] <OndraSter> 25: 0,505 €
[12:40:13] <OndraSter> 100: 0,465 €
[12:40:15] <OndraSter> that is 0.9€
[12:40:18] <OndraSter> 0.09€
[12:40:30] <OndraSter> I think I will use that one
[12:40:35] <OndraSter> it has actually two timers
[12:40:35] <Upu> Afternoon, hi OndraSter just thought I'd let you know I put a 8Mhz crystal on that board and it worked fine, was a brand new ATMega328 so not sure why I couldn't use the internal oscillator but hey ho
[12:40:44] <OndraSter> Upu, congrats
[12:40:46] <OndraSter> check fuses
[12:40:52] <Hfuy> So what, just select anything to make the dialog go away?
[12:40:59] <Upu> well thats the issue I couldn't check the fuses or set them
[12:41:06] <OndraSter> Hfuy, which dialog?
[12:41:10] <OndraSter> Upu, check them now
[12:41:15] <Upu> programmer wouldn't talk to it anyway working now
[12:41:31] <Hfuy> The "new project" wizar dthing
[12:41:36] <Hfuy> "Select debug platform and device"
[12:42:01] <tomatto> karlp: where can i find Tom's programmer? can it program spi eeproms?
[12:42:08] <OndraSter> well you select the device don't you?
[12:42:11] <karlp> tomatto: why are you asking me that?
[12:42:23] <Hfuy> OndraSter: are you talking to me
[12:42:31] <OndraSter> Hfuy, yes
[12:42:43] <Hfuy> Right, well, that's what I'm asking. Do I select the device? Which device?
[12:43:09] <OndraSter> give me screenshot
[12:43:16] <OndraSter> you usually select the target device
[12:43:18] <OndraSter> the target meg
[12:43:19] <OndraSter> a
[12:43:29] <Hfuy> Yes, but you've told me I can't debug with this programmer.
[12:43:36] <Hfuy> It still needs an answer to the "debug platform" question.
[12:43:48] <Hfuy> "none" is not an option that exists.
[12:44:08] <OndraSter> screenshot?
[12:44:58] <Hfuy> Wait one.
[12:45:19] <tomatto> karlp: sorry, i think you speaking of it
[12:45:38] <Hfuy> http://imagebin.org/222770
[12:45:39] <tomatto> where can i find Tom's programmer sources? can it program spi eeproms?
[12:45:47] <OndraSter> tomatto, check topic
[12:45:53] <OndraSter> spi eeproms -> no (as far as I know)
[12:46:02] <OndraSter> you can build SPI EEPROM programmer using some tiny atmega
[12:47:03] <OndraSter> heya abc
[12:47:13] <Steffanx> def
[12:47:23] <OndraSter> qwe
[12:47:51] <Hfuy> Do I absolutely have to have a debugger of some kind to use this software?
[12:48:03] <OndraSter> no
[12:48:09] <Hfuy> Then what do I tell it?
[12:48:23] <OndraSter> AVR Simulator
[12:48:23] <OndraSter> 2
[12:48:51] <Hfuy> Okay.
[12:49:16] <Hfuy> it's decided to spend a lot of time doing something
[12:50:06] <OndraSter> aha! attiny25V costs over 1.6€
[12:50:18] <OndraSter> attiny25, the one without low power option, costs half of that
[12:50:45] <Hfuy> My AVR is an ATMEGA168-20PU. PU doesn't seem to be an option in the "device" list. I have A, P and PA.
[12:51:03] <OndraSter> ignore the PU
[12:51:06] <OndraSter> the PU is just packaging option
[12:51:14] <Hfuy> Fu
[12:51:17] <Hfuy> er
[12:51:17] <Hfuy> Fine
[12:51:21] <OndraSter> LOL
[12:51:49] <Hfuy> It's complaining about not having found an "avr toolchain".
[12:51:58] <OndraSter> obviousl
[12:51:58] <OndraSter> y
[12:52:01] <OndraSter> avrgcc is separate
[12:52:18] <OndraSter> see - if you used as6.. :)
[12:52:38] <tomatto> OndraSter: on website from topic i can't find any schematics or source codes
[12:52:47] <OndraSter> why do you need that?
[12:53:00] <OndraSter> it is order & pay & receive & use
[12:53:13] <Hfuy> I tried to get 6. It wouldn't install.
[12:53:18] <OndraSter> you'd need to make your own PCB and order parts etc
[12:53:21] <Hfuy> Failed at the point of downloading .net 4.
[12:53:24] <OndraSter> you'd spend more on it than buying it already finisehd
[12:53:33] <OndraSter> Hfuy, download .net4 separate and install it manually then
[12:53:49] <tomatto> OndraSter: so his software isn't available too?
[12:53:58] <OndraSter> it uses atmel studio 6 as the software
[12:54:50] <tomatto> OndraSter: ok, i mean firmware to programmer
[12:55:08] <OndraSter> ask Tom_itx :)
[12:58:30] <tomatto> Tom_itx: hi, please can i download firmware of your programmers?
[12:58:57] <Steffanx> You can tomatto
[12:59:11] <Steffanx> You can find it on his website'
[12:59:18] <Steffanx> and you can find the code in lufa
[13:13:13] <Hfuy> Tom's USB programmer is effectively an "AVRISP mkII" isn't it?
[13:13:24] <Tom_itx> Hfuy which programmer do you have?
[13:13:36] <Hfuy> "USBTiny MkII LUFA Powered"
[13:13:57] <Hfuy> Rev 1.1b
[13:13:57] <Tom_itx> yes you select avrispmkii in studio
[13:14:07] <Hfuy> Should it react when I hit "conect"
[13:14:24] <Tom_itx> like jump off the table?
[13:14:25] <Tom_itx> no
[13:14:48] <Hfuy> I have both red and green lights.
[13:14:56] <Tom_itx> it should connect unless your jungo driver isn't installed right
[13:15:08] <Tom_itx> red is usb power green is 'usb good'
[13:15:10] <Hfuy> It did install that.
[13:15:29] <Tom_itx> orange isn't so good
[13:15:50] <Tom_itx> the red one switches with the switch
[13:15:59] <Hfuy> It does, yes.
[13:16:10] <Hfuy> Ah, THAT red one.
[13:16:15] <Tom_itx> green means it's ready and waiting for you
[13:16:31] <Hfuy> I have two up the top, next to the switch, both illuminated.
[13:16:56] <Tom_itx> 'orange' ?
[13:17:02] <Hfuy> If I squint.
[13:17:11] <Hfuy> It doesn't seem to have found the drivers. Would that explain it?
[13:17:25] * Hfuy pokes the "search automatically" button
[13:17:27] <Tom_itx> try replugging it or check to see if it's in your hardware devices in windows
[13:17:51] <Hfuy> Bear with me. This is a dual core Atom laptop, it isn't going for podium position at the Olympics.
[13:18:04] <Hfuy> I suspect all but the most trivial stuff will be painful to compile.
[13:18:10] <Hfuy> Aha! Driver installed, light reverts to green.
[13:18:56] <Tom_itx> how about that
[13:19:07] <Hfuy> It claims the connected device is an ATMEGA168, signature 0x1E 0x94 0x06.
[13:19:13] <Hfuy> This corresponds with reality.
[13:19:59] <Hfuy> Now I need to solve this "toolchain" issue.
[13:27:03] <Hfuy> Why does AVR Studio only have entries for ports B, C and D?
[13:27:06] <Hfuy> What happened to A?
[13:27:21] <Tom_itx> not all chips have A
[13:27:58] <specing> I wonder how vim's folding works with assembly :P
[13:28:01] <Hfuy> Ah.
[13:28:13] <Hfuy> I was rather counting on four ports being available for current-handling reasons.
[13:38:59] <OndraSter> Hfuy, what chip?
[13:39:06] <Hfuy> mega168
[13:40:45] <Hfuy> Why would it say "../test.c:10: error: 'TIMSK' undeclared (first use in this function)"
[13:41:07] <OndraSter> TIMSK0?
[13:41:54] <Hfuy> Now it says ../test.c:16: error: expected expression before '}' token, but I don't see the syntax error
[13:42:18] <OndraSter> show us the line
[13:42:22] <Hfuy> Ah, no, my bad.
[13:42:24] <OndraSter> ..
[13:42:43] <Hfuy> It's basically Tom_itx's "interrupt driven LED flasher"
[13:42:56] <Hfuy> It wanted TIMSK1, which was a line I had to uncomment
[13:44:03] <Hfuy> Huh. There's a bug in the example code.
[13:44:08] <Hfuy> while(1) should read while(1);
[13:44:21] <Tom_itx> did you dl the file?
[13:44:29] <Hfuy> No, I copied it out of the web page.
[13:45:38] * Tom_itx gives Hfuy some more html to compile
[13:46:01] <Hfuy> If it was me I'd want to fix it.
[13:46:07] <Hfuy> But as you will.
[13:46:23] <Tom_itx> it's a suttle tracking mechanism :)
[13:48:22] <Hfuy> Well, it builds, and it can talk to the programmer.
[13:48:34] <Hfuy> Getting it to actually send the compiled binary to the AVR is a bit of a game.
[13:49:56] <Tom_itx> better?
[13:51:19] <Hfuy> How do I determine how fast it's supposed to flash
[13:51:26] <tomatto> LUFA works only with avrs with hardware usb?
[13:51:48] <Tom_itx> dean's working on other platforms
[13:55:23] <Hfuy> I can't see where in this code it actually sets the time parameter.
[13:56:38] <Tom_itx> maybe it runs the full overflow count
[13:56:46] <Hfuy> Is that the default behaviour?
[13:56:53] <Hfuy> How long would that be at 1MHz?
[13:56:53] <Tom_itx> it must be, it works
[13:57:04] <Tom_itx> i dunno what the mask is off hand
[13:57:07] <Tom_itx> prescalar
[13:57:19] <Hfuy> I'm not sure, but I've been sitting here ten minutes and the light hasn't come on yet.
[13:57:54] <Hfuy> The pin by default would be set to source current, right?
[13:57:57] <Tom_itx> each of those have been tested
[13:58:00] <Tom_itx> check your connections
[13:58:24] <Hfuy> The connections are very definitely fine as it previously had a slightly different LED flasher on it, til I erased the thing.
[13:58:58] <Tom_itx> you can't expect me to remember something i wrote 4 yrs ago can you?
[13:59:11] <Hfuy> I don't recall addressing you in particular.
[14:00:14] <Tom_itx> i assumed you were since you replied to my question
[14:00:44] <Hfuy> I'm not sure which binary it's using, though.
[14:01:13] <Tom_itx> studio?
[14:01:23] <Tom_itx> what's the download file path point to?
[14:01:41] <Hfuy> Ah. Wrong binary.
[14:01:45] <Tom_itx> should be some .hex file
[14:01:56] <Hfuy> The hex files are, for some reason, in c:\users\hfuy\documents\default
[14:02:06] <Hfuy> Blinkenlights be mine.
[14:03:05] <Tom_itx> preload the timer value and see if it changes
[14:03:12] <Tom_itx> i used the default full count
[14:03:27] <Hfuy> Do these things mind sourcing or sinking
[14:03:32] <Hfuy> I need it to sink, really.
[14:03:37] <Tom_itx> doesn't matter
[14:03:47] <Tom_itx> current may vary
[14:04:17] <Hfuy> Current really is the problem.
[14:04:21] <Hfuy> I need it to run 17 LEDs.
[14:04:29] <Hfuy> They're all resistored-up to pull 18-20mA each.
[14:04:30] <Tom_itx> you need a driver then
[14:04:37] <Tom_itx> OndraSter what did you use on your led matrix?
[14:04:46] <Hfuy> Buggeration.#
[14:04:49] <OndraSter> Allegro A6275
[14:04:53] <OndraSter> not available anymore
[14:05:07] <Hfuy> I guess I could strobe them but they'd appear dim.
[14:05:15] <Hfuy> And not camera-safe.
[14:06:02] <Hfuy> I think I may have a single DIL16 somewhere with seven darlington driver pairs in it, but it's ancient - I'm not sure what the levels it requires are.
[15:01:14] <R0b0t1> k-man: Sparkfun is really overpriced.
[15:01:17] <R0b0t1> Like really.
[15:01:21] <R0b0t1> Really really really.
[15:01:37] <Hfuy> Futurlec seems more reasonable.
[15:01:40] <Hfuy> I covet many of their things.
[15:03:35] <R0b0t1> http://www.atmel.com/devices/ATtiny1634.aspx
[15:03:36] <R0b0t1> looks kinda cool
[15:10:42] <OndraSter> ay, not bad, R0b0t1
[15:10:45] <OndraSter> 12 ADCs
[15:10:57] <OndraSter> 1K SRAM + 16K flash
[15:12:10] <OndraSter> and it is 1.46€ @ 1pcs on mouser
[15:13:26] <R0b0t1> I'll try comparing it to some atmegas then.
[15:19:03] <Hfuy> If I set PORTB to 1, will PB0 or PB7 be high?
[15:19:11] <Hfuy> I suppose that's a very inarticulate way of asking about endianness.
[15:19:20] <OndraSter> PORTB to 1?
[15:19:26] <OndraSter> that will enable pullup to PB0
[15:19:39] <OndraSter> there is no endianness when talking bits
[15:19:42] <Hfuy> Really?
[15:19:44] <OndraSter> LSb is LSb, MSb is MSb
[15:19:46] <Hfuy> I'm confused, then.
[15:19:46] <OndraSter> yes
[15:20:02] <OndraSter> try watching online porn first, before you try it!
[15:20:13] <Hfuy> This test code setts DDRB to 0xFF then flashes the light on and off with "PORTB ^= 0xFF"
[15:20:23] <specing> false.
[15:20:35] <Hfuy> I assumed if I set PORTB = 1 I would set the literal binary value of 1 on the PORTB pins.
[15:20:39] <specing> it toggles the whole port
[15:20:47] <OndraSter> and DDRB, Hfuy ?
[15:21:13] <Hfuy> Then I've misunderstood what's going on.
[15:21:36] <Hfuy> I assumed he was setting (or rather not-in, but you see what I mean) the value 255, which would set all the pins on the port.
[15:21:49] <Hfuy> And they certainly are all going up and down.
[15:36:05] <OndraSter> hmm
[15:36:12] <OndraSter> assembly is the only language in which I make comments!
[15:36:53] <tlvb> no descriptive variable names
[15:37:02] <OndraSter> not because of that
[15:37:38] <tlvb> habit then?
[15:37:59] <OndraSter> if you are writing something to TCCR0B register or PRR register
[15:38:01] <OndraSter> you want to know what :P
[15:38:04] <OndraSter> in case you want to modify it
[15:38:43] <R0b0t1> My code is write only.
[15:38:48] <OndraSter> hehe
[15:38:50] <OndraSter> mine often as well
[15:38:56] <OndraSter> doing huge changes = delete and start over again
[15:39:01] <OndraSter> but for bug fixing the comments are handy
[15:39:07] <tlvb> my code is compile only, I have no idea what I'm doing, but it works
[15:39:11] <tlvb> :p
[15:39:20] <specing> Wish that was the case for me too
[15:39:28] <specing> gcc generate garbage
[15:39:33] <tlvb> often it is the other way around
[15:39:56] <tlvb> I know exactly how it works, but it doesn't
[15:40:17] <R0b0t1> Most times when I fix a bug
[15:40:22] <R0b0t1> I change random parts of the code until it works
[15:40:44] <tlvb> evolution at work
[15:40:49] <tlvb> compiling of the fittest
[15:45:31] <OndraSter> abc
[15:45:35] <OndraSter> oh god he is off again
[15:45:53] <OndraSter> do you guys remember me reporting issue with AVR gcc that when you step on SEI that the flag doesn't get set in simulator?
[15:45:54] <OndraSter> well
[15:45:58] <OndraSter> the same thing happens in asm
[15:46:03] <OndraSter> and the BLOODY SAME THING HAPPENS FOR RETI
[15:46:06] <OndraSter> it doesn't restore I flag
[15:46:07] <OndraSter> BLOODY THING
[15:46:32] <OndraSter> when you let it run beyond the RETI it sets the I flag back on
[15:46:41] <OndraSter> if you manually step via F11 on RETI instruction it doesn't set the I flag
[15:46:56] <OndraSter> I knew I should've tested it properly :(
[15:47:02] <OndraSter> and report it
[15:47:09] <OndraSter> now I will have to wait for them before they notice it :(
[15:47:27] <tlvb> Is it a gcc bug then? not a simulator bug?
[15:47:33] <OndraSter> it is simulator bug
[15:47:36] <tlvb> ah
[15:47:46] <OndraSter> since on device it works fine
[15:50:59] <Hfuy> I assume 2 >> 1 == 4
[15:51:14] <Hfuy> Or is this daft backwards binary, where 2 << 1 == 4
[15:51:23] <_abc_> Hfuy: you are everywhere :)
[15:51:29] <Hfuy> So are you.
[15:51:39] <_abc_> Hfuy: a << b shifts a left b times
[15:51:58] <_abc_> 2 >> 1 is 1
[15:51:58] <Hfuy> Yes, but is left more significant or less?
[15:52:06] <_abc_> left is more significant
[15:52:17] <OndraSter> 2 << 1 = 4
[15:52:31] <_abc_> but 1 << 2 also 4
[15:52:33] <OndraSter> MSb --- --- --- --- --- --- LSb
[15:52:33] <_abc_> bad example
[15:52:34] <_abc_> ...
[15:52:38] <OndraSter> 7 6 5 4 3 2 1 0
[15:52:39] <OndraSter> bits
[15:52:52] <Hfuy> Backwards binary, as I believe we're required to say on the internet, FTL.
[15:53:07] <_abc_> who what where?
[15:53:30] <Hfuy> I have achieved a three-step light sequencer, anyway.
[15:53:32] <_abc_> Hfuy: did you get the line I posted in #electronics?
[15:53:42] <_abc_> concerning serial out?
[15:53:53] <Hfuy> On the basis that three steps is all I have the GPIO to drive, since PC4 is part of the ISP pin collection.
[15:54:03] <_abc_> OndraSter: what is that about simulator? Which one?
[15:54:10] <OndraSter> the one in AS6
[15:54:16] <_abc_> Hfuy: did you get the line I posted in #electronics?
[15:54:21] <_abc_> OndraSter: as6?
[15:54:26] <OndraSter> atmel studio 6
[15:54:26] <_abc_> studio 6?
[15:54:31] <Hfuy> Inasmuch as I received it, I got it, but I did not to any useful extent "get" it.
[15:54:33] <_abc_> ah i am still at 4 or 5
[15:54:42] <OndraSter> I am not sure if olders had the same bug
[15:54:50] <_abc_> Hfuy: heh write it out nicely one command per line and try to understand it
[15:54:55] <OndraSter> but Atmel knows about the issue with (not) setting I flag on SEI
[15:54:57] <OndraSter> not sure how about RETI
[15:55:02] <_abc_> Hfuy: that is ALL you need to drive any shift register or SPI ic
[15:55:03] <OndraSter> if they found that out as well
[15:55:13] <_abc_> Hfuy: and SPI is just another kind of shift register, really
[15:55:30] <Hfuy> Look, I'm still struggling gamely with "proxy = proxy << 1; PORTB = 0xFF ^ proxy; if(proxy == 128) proxy = 1;"
[15:55:39] <Hfuy> ...to create an 8-step light sequencer.
[15:55:52] <_abc_> Hfuy: okay
[15:55:54] <Hfuy> It appears to work.
[15:56:06] <_abc_> Hfuy: you can write if(proxy & 0x80) proxy = 1;
[15:56:18] <Hfuy> How would that help?
[15:56:25] <_abc_> it makes it more obvious where that 1 is
[15:56:35] <_abc_> or also b'10000000'
[15:56:37] <Hfuy> It does?!
[15:56:43] <_abc_> it does to me
[15:56:52] <OndraSter> http://youtu.be/tvvMRXeKpCc
[15:56:53] <OndraSter> here
[15:56:58] <OndraSter> (will be in 1080p in a second)
[15:56:58] <Hfuy> I assume "int" is 8-bit on these things.
[15:57:03] <_abc_> err no tubes for me today
[15:57:17] <_abc_> Hfuy: you can be sure by writing int8_t
[15:57:21] <OndraSter> Hfuy, not nescessarily, int might be 32bit!
[15:57:27] <OndraSter> depends whether it is using default arch int
[15:57:27] <_abc_> Hfuy: but usually int is 16 bits
[15:57:28] <tlvb> Hfuy: #include <inttypes.h> uint8_t, int8_t
[15:57:31] <OndraSter> OR common sense arch
[15:57:32] <Hfuy> Oh, well. It still seems to work.
[15:57:34] <OndraSter> err, common sense int
[15:57:43] <_abc_> Hfuy: so be explicit: int8_t a, uint8_t
[15:57:58] <_abc_> Hfuy: there's also int16_t uint16_t and int32_t and uint32_t
[15:58:13] <_abc_> Hfuy: it will always work *somehow*
[15:58:15] <Hfuy> That include doesn't appear to exist.
[15:58:22] <_abc_> what include?
[15:58:25] <_abc_> ah
[15:58:34] <_abc_> tlvb: it's all in avr.h I think
[15:58:36] <Hfuy> I suspect right now I'm using considerably more cycles to bitshift a larger-than-8-bit type. However, I care not.
[15:58:44] <tlvb> I think that there is some specification that int should be the system "width" (correct term escapes me) BUT at least iirc 16 bit
[15:58:44] <_abc_> Hfuy: you do #include <avr.h>, right?
[15:58:50] <Hfuy> No.
[15:58:55] <_abc_> do that plase
[15:58:55] <tlvb> _abc_: ah, I don't use avr.h /linux_guy
[15:58:58] <Hfuy> io.h and interrupt.h
[15:59:11] <RikusW> <avr/io.h>
[15:59:12] <_abc_> you are using gcc?
[15:59:15] <_abc_> yes
[15:59:28] <Hfuy> No avr.h either.
[15:59:38] <_abc_> Hfuy: RikusW got the right one
[15:59:43] <_abc_> <avr/io.h>
[15:59:49] <Hfuy> I've already got that.
[15:59:53] <_abc_> okay
[16:00:00] <_abc_> then you should already have all the int8_t etc
[16:00:37] <Hfuy> I do, apparently, since it compiles and runs.
[16:01:29] <Hfuy> I need to be a little cautious as if I set that limit to 128, it will end up firing volts back up the programmer.
[16:01:35] * Hfuy sets it to 8
[16:02:08] <Hfuy> I suppose that once I'm happy with my code, I don't need to use the ISP pins for ISP.
[16:15:11] <Hfuy> Are registers (such as TCCR1B) zeroed at power-on?
[16:15:16] <Hfuy> Or should I not assume that?
[16:16:20] <R0b0t1> You guys think a tiny13 would be able to read from I2C accel and then store to I2C eeprom?
[16:18:34] <R0b0t1> This is mainly a question of code size, I guess
[16:20:01] <specing> you can fit the whole earth into 1k
[16:20:55] <RikusW> Hfuy: read the datasheet, it provides default values
[16:21:02] <RikusW> just to be sure you can zero it
[16:21:39] <RikusW> R0b0t1: if coding in asm it should be easy enough
[16:22:03] <RikusW> Hfuy: you can always use a bootloader instead of ISP
[16:26:40] * R0b0t1 needs to find an easy way to breakout 28lga
[16:26:57] <R0b0t1> 14*
[16:28:40] <R0b0t1> wait, does the tiny13 have a USI?
[16:29:35] <RikusW> http://cm.bell-labs.com/who/ken/trust.html
[16:31:27] <Steffanx> Welcome back in 1990 RikusW ?
[16:31:32] <OndraSter> R0b0t1, check how much does i2c software take
[16:31:37] <OndraSter> there is no USI on tiny13 :)
[16:31:43] <Steffanx> *84
[16:31:43] <OndraSter> you will have to grab tiny25
[16:31:44] <RikusW> R0b0t1: seems its don't
[16:32:03] <R0b0t1> ffff
[16:32:04] <R0b0t1> okay
[16:32:06] <OndraSter> almost the same price, but doesn't run below 2.7V (or at least by datasheet), 25V does but costs twice as much as tiny13a
[16:32:13] <R0b0t1> well, people seem to have i2c implementations floating around
[16:32:42] <RikusW> Steffanx: things were simpler then :-P
[16:39:49] <OndraSter> hmm that reminds me
[16:39:52] <OndraSter> I had this crazy idea
[16:40:00] <OndraSter> DS18B20 + NRF24L01
[16:40:02] <OndraSter> on attiny13
[16:40:05] <OndraSter> I am pretty sure it wouldn't fit
[16:40:11] <OndraSter> (let alone the fact that there was not enough IOs :(
[16:53:54] <Waldi_> hey guys, i try to program my atmega32a with: http://www.abload.de/img/captureouafy.jpg , but the pins are not working properly, at porta only pin 0 and 4 is working as HIGH Output for example, on C 3 and 7, on d also 3 and 7.. any ideas why ? :/
[16:55:27] <OndraSter> JTAG?
[16:55:31] <OndraSter> JTAGEN fuse
[16:55:41] <OndraSter> oh
[16:55:42] <OndraSter> nvm
[16:55:52] <OndraSter> isn't the mega burned? :P
[16:56:00] <Waldi_> uhm, what? :D
[16:56:08] <OndraSter> wait
[16:56:09] <Waldi_> sry i'm a beginner xD
[16:56:10] <OndraSter> 0x1111111?
[16:56:14] <OndraSter> do you know what are you writing? :)
[16:56:23] <OndraSter> didn't you mean 0b1111111?
[16:56:27] <OndraSter> 0x is hex
[16:56:29] <OndraSter> 0b is bin
[16:56:31] <OndraSter> ;)
[16:56:33] <Waldi_> *facepalm*
[16:56:38] <Waldi_> *head vs table*
[16:56:38] <Waldi_> xD
[16:57:06] <Hfuy> is the 0b0101010 sort of syntax valid here
[16:57:21] <Waldi_> thanks a lot xd
[16:57:24] <Waldi_> xD
[16:59:12] <Hfuy> On a mega168, PC7 is also !RESET.
[16:59:29] <Hfuy> But PC7 is the last bit of PC.
[16:59:40] <Hfuy> So is the value of PC1 0x01 or 0x64
[16:59:47] <Hfuy> er no
[16:59:51] <Hfuy> 64 decimal, rather
[17:01:03] <OndraSter> value of PC1?
[17:01:24] <OndraSter> there is no such register
[17:01:42] <Hfuy> Sorry, I'm being unclear
[17:01:46] <Hfuy> port C is only 7 bits wids
[17:01:48] <Hfuy> wide
[17:02:04] <Hfuy> the least significant bit of Port C is PC7.
[17:02:13] <Hfuy> But the register still appears to be 8 bits wide.
[17:02:31] <Hfuy> Therefore, if I wish to set pin PC7 high, what value do I write to PORTC?
[17:02:33] <OndraSter> no, the LSb is PC0
[17:02:41] <Hfuy> Auch.
[17:02:47] <OndraSter> MSb is still PC8, only it is overriden by the RESET
[17:03:00] <OndraSter> to set PC7 high you write 0x40 to PORTC reg
[17:03:04] <OndraSter> (and DDRC)
[17:03:16] <Hfuy> Actually it's PC6, I was thinking "the seventh pin."
[17:03:30] <Hfuy> There is no PC7 on the mega168. It's only 7 bits wide.
[17:03:36] <Hfuy> Hence my confusion.
[17:04:10] <Hfuy> What I'd like to do is mask the reset bit out of writes to PORTC, which needs to be foo = foo & ~0x??
[17:04:14] <Hfuy> I'm just not sure what ?? should be
[17:04:48] <Hfuy> I'd write it as binary but I'm not sure what the binary literal should be.
[17:05:13] <OndraSter> yes, for PC6 you use 0x40
[17:05:18] <OndraSter> 0b01000000
[17:07:37] <Hfuy> Can I write it as 0b01000000
[17:07:49] <OndraSter> yes
[17:08:08] <Hfuy> I'll do that. Easier to read.
[17:08:33] <OndraSter> btw, my Dice application, supports only classic "1 - 6" mode:
[17:08:34] <OndraSter> [.cseg] 0x000000 0x0001a6 328 94 422 1024 41.2%
[17:08:34] <OndraSter> [.dseg] 0x000060 0x000060 0 0 0 64 0.0%
[17:08:34] <OndraSter> [.eseg] 0x000000 0x000000 0 0 0 64 0.0%
[17:08:43] <Hfuy> What's the type of PORTx
[17:08:45] <OndraSter> the data in the .cseg are actually ASCII characters for future even
[17:08:52] <OndraSter> register8_t
[17:08:53] <OndraSter> :P
[17:08:57] <Hfuy> Ah.
[17:09:08] <Hfuy> Is there an intrinsic converstion to uint8_t?
[17:09:13] <OndraSter> yes
[17:09:17] <OndraSter> you can pass on it pretty much anything
[17:09:25] <Hfuy> That'd be why there's a compiler warning about it.
[17:09:30] <Hfuy> Can I make the conversion explicit to stop it moaning?
[17:09:58] <OndraSter> wait, what warning?
[17:10:00] <OndraSter> there should be none
[17:10:08] <Hfuy> "conflicting types for MyFunction"
[17:10:18] <OndraSter> huh?
[17:10:23] <OndraSter> give us the code
[17:10:24] <Hfuy> Oh. Perhaps it's due to the "implicit declaration of MyFunction"
[17:10:31] <OndraSter> ..
[17:10:36] <OndraSter> you should learn the basics of C
[17:10:43] <Hfuy> I'm trying to do so.
[17:10:50] <Hfuy> I'm more a C# sort of guy.
[17:10:56] <OndraSter> (so am I, .NET ftw)
[17:11:09] * Hfuy ^5 OndraSter
[17:11:20] <OndraSter> anyway, I don't have any more timers! watchdog is taken and TIMER0 is taken as well! THERE ARE NO MORE REGISTERS!
[17:11:33] <OndraSter> I suppose I could switch to tiny25 and ignore the fact that it doesn't go below 2.7V
[17:11:36] <OndraSter> supposedly
[17:11:37] <izua> use a single timer for all timing purposes?
[17:11:38] <Hfuy> In the words of the internet, wtf is "void SetPortC(uint8_t val){...}" if not an explicit function declaration.
[17:11:52] <OndraSter> implicit declaration has no body
[17:12:02] <izua> and make software timers in its isr
[17:12:08] <OndraSter> izua, one runs display refreshing and the other one runs at completely different speed
[17:12:17] <OndraSter> I suppose that it is possible to be done
[17:12:18] <izua> you can downclock it?
[17:12:19] <Hfuy> Oh, hell, I'm declaring it after I'm calling it.
[17:12:22] <OndraSter> software 16bit counter
[17:12:25] <izua> clock++;
[17:12:36] <OndraSter> <OndraSter> software 16bit counter
[17:12:44] <izua> if (separateSoftwareTimerClock == 0xFFFFFFFF) win();
[17:13:02] <OndraSter> yes
[17:13:05] <OndraSter> that's what I ment by that
[17:13:14] <OndraSter> INC SOFT_COUNTER
[17:13:24] <OndraSter> BRNE END
[17:13:26] <OndraSter> ..
[17:13:43] <OndraSter> I want to differentiate between short tap and looooong tap :D
[17:13:57] <OndraSter> short tap = regular use, long tap = show options/change mode
[17:14:08] <Hfuy> register_t is undeclared.
[17:14:14] <OndraSter> register8_t
[17:14:17] <OndraSter> but that is register
[17:14:24] <OndraSter> register's value is uint8_t or char or anything
[17:14:46] <Hfuy> It doesn't even warn about the implicit conversion.
[17:14:52] <izua> i did it with some magic values from the debounce routine
[17:15:17] <izua> had an 16 bit shift register, took one button sample or so
[17:15:43] <izua> added a short click event on 0xFF0X (on release), and a long click on 0xFFFF samples
[17:15:54] <OndraSter> :)
[17:16:31] <izua> there's probably an easier way, but this was the shortest one i could do in assembly
[17:19:34] <Hfuy> So... to mask out pins B3, B4 and B5, I'd want 0b00111000?
[17:19:43] <Hfuy> This being "backwards"?
[17:19:53] <OndraSter> huh?
[17:19:56] <OndraSter> mask out?
[17:20:08] <Hfuy> I'm attempting to not conflict with the ISP pins, MOSI, MISO and SCK.
[17:20:19] <Hfuy> These being pins PB3, PB4 and PB5
[17:20:23] <OndraSter> oh
[17:20:25] <OndraSter> the opposite
[17:20:31] <OndraSter> 0b11000111
[17:20:37] <OndraSter> (if you want them to be high)
[17:20:46] <Hfuy> Er, I'm not sure I even want to touch them.
[17:20:58] <Hfuy> I probably shouldn't even set their DDR entries to high.
[17:21:22] <Hfuy> Anyway, I'm doing "val = val & ~0bxxxxxxxx", so I'm inverting it.
[17:21:55] <JyZyXEL> powering ATMega328 from 4 x AA batteries, 1 or 2 diodes? a load resistor?
[17:22:18] <Hfuy> I'm sure you could do that with a zener, maybe.
[17:25:22] <JyZyXEL> 4 fresh AA alkalines will generate around 6.5V, i think the absolute maximum for m328 is 6V
[17:26:50] <Hfuy> What do I want to do for the DDR bit for !RESET?
[17:26:52] <Hfuy> So it doesn't conflict?
[17:26:54] <JyZyXEL> so im thinking to be safe you should go with 2 diodes in series and a 10k load resistor?
[17:27:10] <Hfuy> Build it with a test load (a few LEDs) and see what happens?
[17:27:27] <OndraSter> or you know, automatic buck/boost SMPS
[17:27:43] <Hfuy> Overcomplexity alert.
[17:28:08] <Hfuy> What should I do about the data direction register bits for ISP pins such as !RESET, MISO, MOSI, etc?
[17:28:33] <Hfuy> Presumably it only cares about !RESET, as that's the only one likely to be pulled around by the programmer while the device is active.
[17:28:50] <OndraSter> err
[17:28:57] <OndraSter> RESET doesn't care about DDR
[17:29:01] <OndraSter> RESET is just reset
[17:29:05] <OndraSter> it DOESN'T CARE ABOUT ANYTHING!
[17:29:09] <Hfuy> It's shared with PC6 on the mega168.
[17:29:10] <OndraSter> just like women don't care about me
[17:29:22] <OndraSter> (didn't I just make that joke yesterday on another channel or was this just deja vu?)
[17:29:27] <OndraSter> it is not shared
[17:29:29] <OndraSter> it is RESET
[17:29:32] <OndraSter> if you disable it in fuses
[17:29:34] <OndraSter> it is PC6
[17:29:38] <Hfuy> Oh, I see.
[17:29:40] <OndraSter> but in order to use the RESET again you have to use high voltage
[17:29:44] <Hfuy> ...quite.
[17:29:46] <OndraSter> to set it back to reset
[17:29:51] <Hfuy> Wouldn't want to do that.
[17:29:55] <Hfuy> Bad idea.
[17:30:00] <OndraSter> if you need to - you will do :P
[17:30:51] <Hfuy> By the time you work out that PORTC is only 7 bits to begin with and you can't really use SCK, MISO, MOSI, or !RESET, you're kind of short of pins.
[17:30:59] <Hfuy> I only need 17, I think I have 18.
[17:31:51] <JyZyXEL> one diode with a 10k load resistor and its awfully close to the absolute maximum :))
[17:32:11] <JyZyXEL> im sure the voltage drop across the long battery lead will take care of the rest :))
[17:32:14] <Hfuy> Don't do that, then.
[17:32:20] <JyZyXEL> adafruit does it
[17:32:29] <Hfuy> Who?
[17:32:45] <JyZyXEL> http://www.ladyada.net/make/ledbelt/
[17:32:48] <Tom_itx> yup
[17:33:49] <JyZyXEL> only a series diode and then straight to ATMega32u4
[17:34:02] <JyZyXEL> and its a shame too because its a nice chip
[17:34:15] <Hfuy> Why is it a shame, if it works?
[17:34:32] <JyZyXEL> barely?
[17:36:36] <OndraSter> Hfuy, you can use SPI just fine
[17:36:53] <OndraSter> just make sure that the peripherals can take the programming
[17:58:46] <Kevin`> there'
[17:58:48] <Kevin`> blah
[17:59:20] <Kevin`> that's normally pretty easy, just put a high value resistor on the cs line for those devices so they ignore the bus by default
[18:00:02] <Tom_itx> just so they don't load the mosi miso too much
[18:05:40] <Hfuy> Wahey, I've made a 17-step rather-too-slow light sequencer using an AVR, one of Tom_itx's programmers, and an LED bargraph display.
[18:05:44] <Hfuy> I am weasel.
[18:05:56] <Hfuy> Now, about this timer-preloading malarkey...
[18:08:02] <Hfuy> Do I simply assign to TCNT1 to achieve this? Would TCNT1 = 32768 halve the timer period?
[18:08:22] <OndraSter> yes
[18:08:25] <Hfuy> ...yes, it would.
[18:08:28] <Hfuy> Sweet.
[18:08:48] <OndraSter> Tom_itx, I do wonder how will Dragon feel if I will put charlieplexed LEDs on the MISO/MOSI/SCK lines :)
[18:08:58] <OndraSter> I will drop the voltage down to 1.8V so the LEDs don't lit up
[18:09:37] <OndraSter> or just slow the ISP down to few kHz :D
[18:09:44] <OndraSter> (that too)
[18:11:22] <Hfuy> I assume doing powers is a bit intensive on a CPU with no barrel shifter.
[18:11:42] <OndraSter> on >8bits yes
[18:11:58] <OndraSter> btw, I made today these nice lookup tables for the LEDs... :D
[18:11:58] <OndraSter> http://pastebin.com/3BuyjBN6
[18:11:59] <Hfuy> Well, I guess this would be a constant.
[18:12:25] <Hfuy> I have a 17-segment bargraph display, and I need to detect when my count has hit the 17th.
[18:12:39] <Hfuy> I can type 131072, or have it calculate 2^17.
[18:12:42] <OndraSter> the mega drives the bargraph?
[18:12:47] <Hfuy> It does.
[18:12:56] <OndraSter> oh, I thought it would be like:
[18:12:56] <OndraSter> |
[18:13:00] <OndraSter> err
[18:13:03] <OndraSter> | - - -- - -
[18:13:05] <OndraSter> | | - - - - -
[18:13:08] <OndraSter> | | | - - - -
[18:13:11] <OndraSter> | | | | -----
[18:13:16] <OndraSter> as in slowly rising
[18:13:19] <OndraSter> not binary rising .)
[18:13:23] <Hfuy> It is.
[18:13:35] <OndraSter> well then it won't be 131072 will it?
[18:13:36] <OndraSter> it will be 17
[18:13:37] <Hfuy> I'm just shifting a single bit through a 32-bit word, so when that word equals 2^17, I've reached the end.
[18:13:42] <OndraSter> oh
[18:13:59] <Hfuy> This is just for test purposes, though. I want to make it behave like the esper in Blade Runner. You may know what I mean?
[18:14:10] <OndraSter> nop
[18:14:16] <Hfuy> Hold the phone.
[18:14:19] <OndraSter> I know only knight rider
[18:14:47] <Hfuy> Well, right now it looks like night rider, I was just getting the sequencing sorted out so it could sequence across several ports and come out right.
[18:15:20] <Kevin`> for stuff that happens in human-time you could do 64bit floating point math and probably be fine
[18:15:47] <Hfuy> Well, strictly speaking it's a constant at run time.
[18:16:07] <Hfuy> Anyway this is all irrelevant as this will not be in the final code - in the final code we let it fall off the end and keep injecting new random bits at the start.
[18:16:08] <Kevin`> if it's a constant at run time the compiler will optimize it out
[18:16:27] <Hfuy> I wonder if it would, though, given that the power is a library call.
[18:16:55] <Hfuy> Will it make that call at compile time and make the result constant?
[18:17:40] <Hfuy> Anyway: http://www.youtube.com/watch?v=QkcU0gwZUdg#t=0m30s
[18:17:45] <Hfuy> Look at the string of orange lights above the CRT.
[18:17:55] <Hfuy> It's a linear-feedback shift register.
[18:18:02] <Hfuy> Or rather a lot of them, in a chain.
[18:19:02] <Kevin`> you know what you could do that with? a shift register chip chain connected to noise and a clock (or spi if you want the microcontroller part ;p)
[18:19:16] <Kevin`> ofc, if you have a lot of extra output pins on your microcontroller, doing it there is no problem too
[18:19:29] <Hfuy> Actually it's a physical space issue. One chip is a nice solution.
[18:19:45] <Hfuy> And it's not a noise source, it's an XOR gate connected across (iirc) the 13th and 15th taps.
[18:19:57] <Hfuy> It's a basic type of PRNG. That display simply visualises its internal state.
[18:20:24] <Hfuy> I'm intending to emulate that in software, give or take the fact that I can't have more than 10 lights on at once or I'll overcurrent the AVR.
[18:21:39] <R0b0t1> That's not a PSRNG. It's a feedback shift register.
[18:21:59] <Hfuy> It's been widely described as a PRNG, but whatever.
[18:23:11] <OndraSter> my "random" generator simply adds 1 as long as the user has pressed the button + two LSb-s from ADCL that measures vcc/3 :D
[18:23:21] <OndraSter> adds 1 many times a second
[18:23:30] <OndraSter> well beyond user's reaction
[18:23:56] <R0b0t1> Hfuy: It's a deterministic sequence generator, but I wouldn't call it cryptographically secure or evenly distributed.
[18:24:18] <Hfuy> OndraSter: Sure, that's fine, that's the oldest trick in the book for e-dice. I've done that with 4017 decade counters. Nothing wrong with it.
[18:24:35] <Hfuy> R0b0t1: I understand that a lot of video games use it because it is very fast.
[18:24:45] <Hfuy> And more than good enough.
[18:25:03] <Hfuy> I believe a correct one will eventually go through all the possible combinations of that many bits.
[18:25:23] <R0b0t1> It's not good enough for anything that needs even distribution, though. And yes, that is true, but it can repeat.
[18:25:45] <Hfuy> well, an 8 bit one will, I believe, repeat every 256 iterations.
[18:25:53] <Hfuy> It's extremely pseudo.
[18:26:02] <Hfuy> But good enough for a movie prop blinkenlight.
[18:26:10] <izua> 255
[18:26:26] <izua> minus the forbidden state, where the lfsr won't run again
[18:26:34] <Hfuy> Ah, yes.
[18:26:55] <Hfuy> I can preset my code to ensure that doesn't happen due to edge startup conditions.
[18:27:30] <Hfuy> In C an || is non-exclusive, right? So how would I best code an exclusive-or, as is required for this?
[18:28:56] <Hfuy> Or just lost of nasty nested IFs?
[18:44:51] <izua> Hfuy: ^s
[18:46:46] <Hfuy> Nasty, nested IFs?
[18:47:27] <Hfuy> The nasty, nested IFs work, for what it's worth.
[18:48:54] <Hfuy> Anyone who can read .3gp videos and cares can see my little invention working here: http://filebin.ca/AdfmG8Tl0Cb/VIDEO0042.3gp
[18:50:48] <smeding> nested ifs aren't /that/ bad
[18:50:58] <smeding> izua: keep in mind that ^ is bitwise
[18:51:04] <smeding> and i don't think there's a ^^ :)
[18:52:23] <izua> hm?
[18:52:28] <OndraSter> I was hoping for some porn, Hfuy
[18:52:38] <izua> i haven't read the whole context i guess
[18:52:46] <Hfuy> OndraSter: e-porn :)
[18:52:47] <izua> what do you mean, ^^?
[18:53:00] <Hfuy> I needed to implement an XOR gate in code, basically.
[18:53:13] <Hfuy> For my linear-feedback shift register PRNG-style thing (see video above).
[18:53:34] <smeding> well, ^ is bitwise XOR
[18:53:43] <Hfuy> The only way I could work it out was to have two nested ifs. If A but not B, do this. If B but not A, do the same.
[18:53:48] <smeding> so it does an xor, but it does it for every bit in the words
[18:54:00] <izua> the orange thing in your video isn't really a prng
[18:54:12] <izua> it's more like a bunch of flip flops in a ring
[18:54:19] <Hfuy> izua: That point has been made. It's an extremely-pseudo random number generator :)
[18:54:20] <smeding> if A and B can only be 0 or 1, then bitwise xor is equivalent to logical xor
[18:54:45] <Hfuy> smeding: Basically, the job is to XOR bits 14 and 17 of a uint32_t
[18:54:45] <izua> smeding: yeah, but he can use masks to implement the 'taps'
[18:54:51] <Hfuy> And I do.
[18:55:03] <smeding> izua: yeah
[18:55:06] <izua> so don't use ifs
[18:55:25] <izua> there was some very neat code on wiki on regular style and galois style lfsr-s
[18:55:46] <smeding> (v&_BV(14)) ^ (v&_BV(17))
[18:55:57] <smeding> wait, that wouldn't work i think
[18:56:07] <Hfuy> This works: http://pastebin.com/PrF4brjr
[18:56:10] <Hfuy> I can try that if you like.
[18:56:16] <izua> you'd probably need the final tap
[18:56:19] <smeding> don't bother
[18:56:23] <smeding> the bits aren't lined up
[18:56:23] <smeding> :p
[18:56:48] <izua> but its worse fail is _BV()
[18:56:54] <Hfuy> The only other thing I need to be careful about is that this device, if it happens to illuminate 10 or more LEDs at once (which it occasionally does), is capable of over-currenting the AVR's port drivers.
[18:56:56] <smeding> what's wrong with _BV
[18:57:08] <Hfuy> Would it be reasonable simply to run it for a while and see if it gets hot?
[18:57:12] <smeding> i guess it might not be necessary
[18:57:31] <OndraSter> _BV() looks weird
[18:57:48] <izua> what's wrong with << x
[18:57:52] <smeding> afaik
[18:57:59] <smeding> afaik _BV is optimized better
[18:58:02] <OndraSter> Hfuy, always lit up only few of them :)
[18:58:04] <izua> one less character too
[18:58:09] <OndraSter> like first - only first 4 bits
[18:58:10] <Posterdati> hi
[18:58:10] <OndraSter> then another 4 bits
[18:58:11] <OndraSter> etc
[18:58:13] <izua> isn't it a macro?
[18:58:20] <OndraSter> _BV is a macro, yes
[18:58:20] <Hfuy> I could write code simply to not inject a 1 if it would violate the rules.
[18:58:29] <OndraSter> or that
[18:58:37] <Posterdati> please I need help with avr-g++, I've got "error: template with C linkage" if I use templeate
[18:58:43] <Posterdati> templates
[18:58:43] <Hfuy> But it's been running 10 minutes and I can't even tell if the case is warm.
[18:59:22] <Hfuy> Would it warn me by warming up if it was unhappy, or would it just die?
[18:59:45] <smeding> i've never tried
[19:00:09] <izua> what resistors are you using
[19:00:14] <Hfuy> I really am feeling disgustingly pleased with myself. I've duplicated a Blade Runner prop! Awesome!
[19:00:24] <Hfuy> izua: 100 ohms at 4 volts, which gives about 18.5mA per LED.
[19:00:27] <smeding> only part of one ;)
[19:00:30] <OndraSter> that's a lot
[19:00:38] <OndraSter> I drive LEDs at about 5 - 10mA
[19:00:46] <Hfuy> It is when the total load for the AVR is supposed to max out at 200mA overall.
[19:01:09] <OndraSter> only 200mA? usually it is 20 or 40mA per pin with 100mA per port/ gnc+vcc pair
[19:01:09] <Hfuy> Well, that's a very old display, it came out of an ancient photocopier control panel. They are not the latest, greatest LEDs. Probably 80s vintage.
[19:01:48] <OndraSter> even the small tiny13a has 40mA per pin with 200mA per chip (since it has single gnd/vcc pair)
[19:01:49] <Hfuy> I believe in the mega168 datasheet it's expressed as 200mA per gnd/VCC pair. And it only has one.
[19:01:54] <OndraSter> ah
[19:02:10] <OndraSter> I have got only mega32a from that range and it has two GNDs actually :)
[19:02:24] <Hfuy> That said I must be occasionally violating that, and it isn't even warm.
[19:02:59] <Hfuy> No, I lie, it does actually have two GND pins. And I am sinking, not sourcing.
[19:03:02] <smeding> it's probably as a sustained thing
[19:03:03] <Hfuy> I wonder if that makes it OK.
[19:03:15] <OndraSter> I still have dilemma... should I get rid of the extra LEDs and make it into *regular* 1 - 6 dice? :/
[19:03:41] <OndraSter> right now using regular 1 - 6 dice on it looks weird
[19:03:47] <OndraSter> since it has got a bunch of unused LEDs
[19:04:02] <Hfuy> Pics
[19:04:17] <OndraSter> http://clip2net.com/page/m12051/32021870 top
[19:04:22] <OndraSter> http://clip2net.com/page/m12051/32021889 bottom
[19:06:25] <OndraSter> 3.28 EUR (@ 12 LEDs) vs 2.85 EUR (@ 7 LEDs)
[19:07:01] <OndraSter> I can't make the board smaller
[19:07:08] <Hfuy> Cute.
[19:07:14] <OndraSter> yeah
[19:07:17] <Hfuy> Is this for tabletop wargamers, and the like?
[19:07:19] <OndraSter> but really, WHAT A DILEMMA
[19:07:32] <OndraSter> with 12 LEDs I can do simplified ASCII characters
[19:07:36] <OndraSter> so I can generate whatever I want
[19:07:39] <OndraSter> and show it as ASCII
[19:07:52] <Hfuy> For a start you can do 2D6
[19:07:55] <Hfuy> in one hit
[19:08:06] <OndraSter> fit on one board?
[19:08:14] <Hfuy> Here's the thing.
[19:08:19] <Hfuy> Nobody uses dice with more than 12 sides.
[19:08:27] <Hfuy> If you have 12, you can do anything.
[19:08:30] <OndraSter> I thought that DaD uses 20
[19:08:32] <Hfuy> If you have 6, well, it's 6.
[19:08:37] <Hfuy> ....oh well D&D :)
[19:09:35] <OndraSter> really, WHAT A DILEMMA!
[19:13:09] <Hfuy> Well, I solved my "current" issue in software.
[19:13:28] <Hfuy> Now it just counts how many lights are on, and if there's ten, it doesn't light another one.
[19:13:54] <Hfuy> Frankly it looks almost identical, if anything I rather prefer the sparser display.
[19:14:38] <Hfuy> OndraSter: I think I'd go for the 12.
[19:14:47] <Hfuy> Flexibility is good, and the cost increase really is trivial.
[19:15:02] <Hfuy> That is, if you don't want to go to 20. There are quite a few D&D people out there.
[19:15:06] <OndraSter> 15% more cost
[19:15:11] <OndraSter> 20 would require 5 IO pins
[19:15:18] <Hfuy> At that point you could just display it as an ASCII character, though.
[19:15:20] <OndraSter> which I do have
[19:15:23] <OndraSter> ye
[19:15:26] <OndraSter> I can do that on 12 already
[19:15:31] <OndraSter> a lot modified ASCII
[19:15:56] <Hfuy> Here's the logic of it to me: with 6, you can do 6 and not much more.
[19:16:02] <Hfuy> With 12, you can even do 100!
[19:16:06] <Hfuy> So it's a much better idea.
[19:16:56] <OndraSter> on the other hand 12 and ASCII etc is much less classicy-looking
[19:20:08] <Hfuy> Well, you can't do a classic dice layout with six anyway, since the 5 is a quincunx with the dot in the middle, as is the three.
[19:20:13] <Hfuy> You need seven.
[19:20:26] <Hfuy> And by the time you get to seven, you may as well use a seven-segment display digit.
[19:20:49] <OndraSter> no, 7 segment display is not dice looking!
[19:20:57] <OndraSter> with 7 dots
[19:21:04] <Hfuy> No.
[19:21:19] <Hfuy> But you were talking about a six dot display. Which would not simulate a real dice anyway.
[19:21:27] <OndraSter> I ment 7 dot of course
[19:21:32] <Hfuy> Sure okay.
[19:22:06] <Hfuy> Well, with the 12 you can do a 3x4 grid, which means you can do the classic dice layout in the top 3x3 area.
[19:22:15] <OndraSter> that's what it is now
[19:22:21] <OndraSter> but it looks weird when the bottom doesn't lit up :/
[19:22:46] <Hfuy> 128x128 TFT phone display with dice graphics!?
[19:22:55] <OndraSter> lol running from coin cell?
[19:23:05] <Hfuy> I think if you're going to do 6, it needs to be proper dice layout.
[19:23:06] <OndraSter> from tiny13a?
[19:23:19] <OndraSter> as in built it into a dice? :D
[19:23:20] <Hfuy> People who are used to reading dice can read a dice in a heartbeat, just from a glance, because that layout is familiar.
[19:23:26] <OndraSter> yes
[19:23:28] <Hfuy> So you need 7 dots.
[19:23:32] <OndraSter> that's why I'd prefer 7 dots
[19:23:38] <OndraSter> over 12 and 5 unused
[19:23:44] <Hfuy> I think if you're going to do 12, there is no dot pattern for that.
[19:23:52] <OndraSter> no
[19:23:53] <Hfuy> So at that point you need to display digits.
[19:24:16] <Hfuy> Then also you can do any number from 2-n.
[19:24:40] <Hfuy> It's two very different problems that you're trying to solve with the same display.
[19:24:46] <OndraSter> yes
[19:24:48] <OndraSter> well
[19:24:53] <OndraSter> I am not trying to solve it
[19:24:57] <OndraSter> I have no idea whether I should even try solving it
[19:25:07] <OndraSter> or just go for regular 7 dots
[19:25:13] <OndraSter> and screw the other options
[19:25:18] <Hfuy> I'm not getting at you. Just trying to verbalise the issues.
[19:25:50] <Hfuy> It does seem a bit of a feeble option though, with such computing horsepower available.
[19:26:24] <Hfuy> It strikes me that 3x4 fits inside 5x6, and 5x6 is enough to display digits.
[19:26:38] <Hfuy> It would keep the D6 layout centered.
[19:26:43] <Hfuy> And it would be enough to display digits.
[19:27:02] <Hfuy> Depends if you can soak the cost of the extra LEDs.
[19:27:40] <OndraSter> 5x6 for sure not, that's too much LEDs to drive
[19:27:54] <Hfuy> Sure.
[19:28:01] <Hfuy> Well, it's a tricky one.
[19:28:08] <Hfuy> I would say that you should try to do >D6 if you can/.
[19:28:31] <Hfuy> The audience for this is likely to be people who are more serious about tabletop wargames and suchlike, and those people are more likely to need Dn.
[19:28:56] <OndraSter> hmm
[19:29:07] <OndraSter> this is more targetted as a keychain
[19:29:20] <Hfuy> I think it still holds.
[19:29:30] <Hfuy> I have a friend who's seriously into Warhammer and all that stuff.
[19:29:40] <Hfuy> Although to be fair the mainstream stuff all just uses D6.
[19:30:57] <OndraSter> hmm
[19:31:22] <Hfuy> Tricky one.
[19:31:27] <Hfuy> Anyway, I must wander off and get some sleep.
[19:31:32] <OndraSter> bb
[19:32:06] <Hfuy> Thanks for all the help, folks.
[20:29:49] <R0b0t1> ooooooooooooooohhhhhhh!
[20:29:52] * R0b0t1 breaks into song
[20:30:03] * R0b0t1 doesn't know what to sing
[20:30:08] * R0b0t1 has one
[20:30:17] <R0b0t1> I've got a whale of a tale to tell you lad
[20:30:21] <R0b0t1> a whale of a tale or two
[20:30:27] <R0b0t1> I've got a whale of a tale to tell you lad,
[20:30:33] <R0b0t1> and I swear that it's all true!
[20:30:37] * R0b0t1 forgot the rest of the words
[20:50:06] <Tom_L> good
[21:26:00] <R0b0t1> On the ICSP 6-pin header, does +5V need to be present?
[21:26:47] <timemage> R0b0t1, if your programmer is powered by the board, yeah.
[22:20:20] <Microboter> does the following move the data between the {} to ram on execution or is it kept in flash "" static const unsigned char FONT6x8[97][8] = {} ""
[22:20:40] <Casper> yes
[22:21:16] <Microboter> yes to flash or ram ? :)
[22:21:44] <Casper> ram
[22:22:18] <Microboter> bleh, kk. thanks was hoping it would read that out of flash only when needed
[22:25:57] <Casper> it's toable
[22:26:00] <Casper> doablw
[22:26:04] <Casper> ... anyway
[22:26:23] <Casper> http://www.nongnu.org/avr-libc/user-manual/group__avr__pgmspace.html
[22:26:26] <Casper> have fun
[22:26:34] <Microboter> thanks !
[22:30:23] <Microboter> that does explain why data memory usage is way higher then i thought it should be
[22:34:24] <Casper> and remember, what goes to flash become constant
[22:34:37] <Casper> but good for strings and constants
[22:37:11] <Microboter> thanks again, look easy enough to define, but i will have to make some changes to lots of code for the reads
[22:37:53] <Casper> but will save you lots of ram
[22:38:07] <Casper> remember that it take more time to read from flash
[22:39:09] <Microboter> all of this is for 3 sets of fonts for a color lcd. Those 3 were eating close to 70% of my ram
[22:40:21] <Casper> :D
[22:42:11] <Microboter> thanks again, still cutting my teeth with C
[22:46:19] <Kevin`> the thing you have to be careful with, and aware of, is flash is a seperate memory space, not just constant