#avr | Logs for 2012-05-09

Back
[04:44:53] <OndraSter> is it just me, or is USB so... overcomplex?
[04:45:24] <Grievre> how is it overcomplex
[04:45:34] <OndraSter> all this endpoint stuff
[04:46:25] <Grievre> it's as complex as the devices that use it need it to be
[04:48:13] <OndraSter> :(
[04:48:54] <exDM69> like the logitech g940 joystick, which shows up as 3 hid devices but there's only 1 usb cord
[04:49:49] <exDM69> a lot nicer than having a gonzo-sized massive joystick with 15 analog axes and 50 buttons
[06:44:23] <mitsakos> hello, i'm have a connection with an SPI connection between a device (MASTER) and avr (SLAVE). the MASTER device sends clock to avr (SLAVE) continiuesly. I'm trying to send a byte from avr to device, with SPDR = 0x88;
[06:44:23] <mitsakos> while(!(SPSR & (1<<SPIF))); but nothing occured on AVR (SLAVE) MISO pin
[06:45:03] <mitsakos> no pulse
[06:51:50] <ziph> mitsakos: Sure the AVR knows that it has been slave selected?
[06:53:54] <mitsakos> well, SPCR has default values which are 0 which is MSTR=0 so spi is slave. Also SS pin is grounded
[06:54:11] <mitsakos> DDR_SPI |= (1<<MISO);
[06:54:16] <mitsakos> has configured as output
[06:54:19] <mitsakos> and all the other inputs
[06:55:18] <mitsakos> ziph
[06:56:19] <ziph> And the SS is configured as an input?
[06:59:04] <Tom_itx> common mistake on that is you forget the DDRx reg
[06:59:47] <mitsakos> yes
[07:00:07] <mitsakos> Tom_itx what do you mean?
[07:00:26] <Tom_itx> you need to set the pin direction register
[07:01:19] <mitsakos> //Configure Input
[07:01:19] <mitsakos> DDR_SPI &= ~(1<<SS);
[07:01:19] <mitsakos> DDR_SPI &= ~(1<<MOSI);
[07:01:19] <mitsakos> DDR_SPI &= ~(1<<SCK);
[07:01:19] <mitsakos> //Configure output
[07:01:20] <mitsakos> DDR_SPI |= (1<<MISO);
[07:01:21] <mitsakos> //SPE: SPI Enable
[07:01:23] <mitsakos> //MSB data word transmitt first
[07:01:25] <mitsakos> SPCR = (1<<SPE);
[07:01:36] <mitsakos> i don't think i have forgotten
[07:01:58] <mitsakos> #define DDR_SPI DDRB
[07:03:26] <buhman> wouldn't an army of 8-DIP attiny's all communicating over the same SPI bus be better than one big fat 40-DIP atmega?
[07:03:34] <Tom_itx> is that above the other lines??
[07:04:07] <buhman> is there a limit to the number of attiny's that can be addressed on the same bus?
[07:04:39] <Tom_itx> it's an 8 bit chip. think about it
[07:05:12] <buhman> 256 maximum?
[07:05:17] <Tom_itx> how many io does the master have to dedicate to SS?
[07:07:02] <ziph> That's nothing that some address decoding logic can't fix. ;)
[07:07:44] <buhman> Tom_itx: couldn't a shift register be used for SS?
[12:34:25] <OndraSter> so, I have met many board where decoupling caps were on the bottom of the board :o)
[12:34:36] <OndraSter> sure they were right below the chip
[12:34:40] <OndraSter> but on the bottom
[12:34:45] <OndraSter> any thoughts about that?
[12:34:49] <z1ph> it's easy
[12:34:54] <OndraSter> well yes
[12:35:00] <OndraSter> but if it is usable or not
[12:35:08] <z1ph> why wouldn't it be?
[12:35:18] <OndraSter> because the decoupling caps should be as close as possible
[12:35:23] <OndraSter> it adds a lil' of inductance
[12:35:27] <z1ph> how thick is your pcb?
[12:35:28] <OndraSter> on the other hand the ground connection doesn't
[12:35:31] <z1ph> mine's not very thick.
[12:35:33] <OndraSter> 1.6mm, but I can go lower
[12:35:49] <z1ph> so, put your decoupling caps 1.6mm further away from the chip and see if you think it's too far.
[12:35:55] <OndraSter> right.
[12:36:09] <OndraSter> because when dealing with 0.5mm pitch MLF the 0603 parts tend to get quite big
[12:36:24] <z1ph> hence putting them on the other side.
[12:36:39] <OndraSter> exactly
[12:44:53] <OndraSter> so did I mention that my teacher who was doing with me my long term project gave me his old analog scope plus his old wave gen? :P
[14:05:30] <OndraSter> EE's drug: xtal meth
[14:06:13] <Kevin`> hah
[14:09:46] <Toneloc> what do you guys think of the ATMEGA16A-PU ?
[14:10:08] <Toneloc> would they be a useful device for a beginner to 'cut their teeth' on ?
[14:10:39] <Toneloc> or perhaps they are a bit obsolete?
[14:12:19] <Kevin`> Toneloc: it would be fine, unless you really want one of the fancy features of the newer chips
[14:12:37] <Kevin`> Toneloc: peripherals (when they are present) and coding is pretty much the same across the entire line
[14:16:07] <Toneloc> yes, Im just asking because a friend offered me 10 of these ATMEGA16A-PU for a good price
[14:16:46] <Toneloc> the fact that it has a ADC and UART should make these interesting to use
[14:17:34] <Toneloc> and 32 GPIO
[14:17:58] <Toneloc> and internal oscillator - actually, this chip sounds really cool
[14:18:16] <Toneloc> way more capable than ATTINY2313
[14:19:29] <Casper> mega16 used to be THE starter part
[14:19:39] <Toneloc> Kevin`- thanks for your advice
[14:19:45] <Casper> now you have better chip for about the same price
[14:19:54] <Toneloc> Casper- oh, okay
[14:20:01] <Casper> hence why it used to be and not anymore
[14:20:24] <Toneloc> hmm, what would the best price for 10 of the new replacement be?
[14:20:31] <Casper> tiny are stripped down version of the mega, with lots of things removed
[14:20:50] <Toneloc> yeah, I want something I can use for lots of things
[14:21:03] <Toneloc> I think ATMEGA16A-PU fit the bill well
[14:21:50] <Toneloc> my friend is giving these to me for a good price, which is welcome to people with light pockets like me:)
[14:22:19] <OndraSter> define good price :)
[14:22:35] <Toneloc> 17 dollars for 10 off
[14:22:37] <Toneloc> ATMEGA16A-PU
[14:22:40] <OndraSter> not bad
[14:22:45] <Casper> so 1.7$/each, not bad
[14:22:47] <Casper> good price
[14:22:55] <Toneloc> yeah, thats what I thought too
[14:22:56] <Casper> they sell for 5$cad each
[14:23:25] <Toneloc> I think its his way to be good to me:)
[14:24:09] <Toneloc> where do you guys buy your AVR's ?
[14:24:50] <OndraSter> till last project locally
[14:24:54] <OndraSter> but when I found the prices...
[14:25:00] <OndraSter> on other places
[14:25:29] <Kevin`> Toneloc: normally from the large distributors on the internet
[14:26:32] <Toneloc> Kevin`, I guess farnell,digikey etc. ?
[14:27:00] <Kevin`> mouser normally, but i'm not that picky
[14:27:19] <Toneloc> I see those cheap AVR on ebay from Chinese sellers, anyone here ever get some from them?
[14:27:43] <Toneloc> yeah, i seen mouser is quite a bit cheaper for some stuff
[14:29:38] <OndraSter> I found awesome deal, but it is not breadboard-able without soldering and getting adapter :)
[14:29:45] <OndraSter> it is top class device though :D
[14:31:45] <Toneloc> ah, SMD= Stressful Mounting Device !
[14:32:03] <OndraSter> heh
[14:32:11] <Toneloc> OndraSter-did you buy form china?
[14:32:15] <Toneloc> *from
[14:32:18] <OndraSter> sure, but not atmel chips
[14:32:34] <Toneloc> atmel clones?
[14:32:45] <OndraSter> I didn't have the balls to test it :)
[14:32:47] <OndraSter> I am poor student
[14:32:56] <Toneloc> haha
[14:33:05] <Toneloc> afraid it will kill the programmer?:P
[14:33:08] <OndraSter> no
[14:33:11] <OndraSter> afraid it will be money wasted
[14:34:04] <Toneloc> oh, okay
[14:34:10] <Toneloc> I thought you bought them
[14:35:22] <budwaa> Hi, if my avr645 is reset by the watchdog timeout would global variables be reinitialized? If for they are normally initialised from there definition?
[14:36:26] <Casper> budwaa: yes and no
[14:36:34] <budwaa> ^^
[14:36:46] <Casper> afaik, ram isn't affected by reset, but registers are
[14:37:03] <Casper> but your code might be initialising the variable at startup
[14:37:12] <budwaa> I take it the compiler generates some code to initialise the global variables at startup? If that is true then it must depend where the reset starts the code?
[14:37:59] <Casper> it depend how the variables was declared... the reset entry point is always the same, no matter what reset source is used
[14:41:34] <budwaa> Say just a global variable like uint8_t globalVar = 10;
[14:45:24] <Casper> that would be reinitialised to 10
[14:45:47] <Casper> as you are explicitelly telling the compiler to initialise it to 10
[14:49:27] <budwaa> Ok but say for uint8_t array[10]; this would have the same values as the previous time?
[14:51:16] <Casper> that I can not say, chance is that yes, but look up if it get initialised... a good sign that it do not is that the compiler will throw warning
[14:51:24] <Casper> but
[14:51:32] <Casper> it would be a bad idea to do it
[14:51:41] <Casper> bad coding practice
[14:57:56] <Toneloc> would ATMEGA8-16PU be a better buy than a ATMEGA16A-PU ?
[14:58:16] <Toneloc> I found them a good bit cheaper than what my friend was offering
[14:58:29] <Casper> mega8 are smaller than the 16
[14:58:36] <Toneloc> http://www.ebay.com/itm/10PCS-NEW-IC-ATMEL-DIP-28-ATMEGA8-16PU-/140730966675?pt=LH_DefaultDomain_0&hash=item20c4382293
[14:58:58] <Casper> yeah smaller
[14:59:08] <Toneloc> also $6.30 cheaper
[14:59:16] <Toneloc> *$6.20
[14:59:25] <Toneloc> is it worth the price difference ?
[14:59:40] <Casper> dip28 for the 8, dip40 for the 16
[15:00:01] <Casper> and your ebay will take 2-8 weeks delivrary since it come from china
[15:01:02] <Toneloc> Casper- I guess the extra GPIO is a good difference
[15:01:37] <Toneloc> things from China can be here in roughly 1-2 weeks
[15:01:40] <Toneloc> sometimes longer
[15:01:56] <Casper> here it's 4-7 weeks
[15:02:42] <Toneloc> Casper-which would you go for?
[15:04:15] <Toneloc> I think you are a ATMEGA16 guy at heart;)
[15:08:02] <Casper> I'ld go for the 16, or even better: 644
[15:10:59] <Toneloc> 0.0 - that is a very spendy mcu :P
[15:11:22] <Casper> the 644 yeah, hence why I'ld go for a smaller one :D
[15:11:23] <OndraSter> (me is hinting at atxmega256a3u but... that is not something you should start with... plus it is SMD only! :D)
[15:11:48] <Casper> the 644 is a good beginer IC since it's a full featured, and have everything
[15:12:00] <Casper> lots of ram, lots of flash, lots of eeprom, lots of features
[15:12:00] <OndraSter> seriously, since I saw that $5.1 pricetag, I just can't close the tab with it lol
[15:12:24] <Casper> but it is NOT a good one for a project
[15:12:29] <Casper> it'S too expensive
[15:12:33] <Kevin`> one of the smaller (physically) xmega devices and a little dip adapter board would work pretty well
[15:13:05] <OndraSter> blah, the a3 series with 64 pins is 9x9mm :)
[15:13:31] <OndraSter> the ones with 44 pins are 7x7mm
[15:13:44] <Kevin`> OndraSter: the important part being the slightly lower pitch qfp and lower pin count is easier to solder
[15:13:56] <OndraSter> depends on skill
[15:14:10] <OndraSter> I am actually going to use QFN :D
[15:14:20] <Kevin`> you can drag solder any of the qfp chips, not sure how it depends on skill
[15:14:29] <Kevin`> I suppose qfn would :)
[15:14:30] * Casper wonders what to throw in on that digikey order...
[15:14:38] <Casper> only 3 hours left to complete the order
[15:14:46] <Kevin`> only 3 hours?
[15:14:47] <OndraSter> Casper, GPS module, wifi module, GSM (GPRS) module
[15:14:51] <OndraSter> so you have something to play with .)
[15:14:56] <Toneloc> why do digikey limit?
[15:15:05] <Casper> I'm considering more smps stuff
[15:15:12] <Kevin`> where's the 3 hours coming from
[15:15:22] <Casper> Toneloc: 7:30pm local time is the limit for the order being processed today
[15:15:27] <Toneloc> i mean, is it a daily cut off limit for ordering?
[15:15:28] <Kevin`> is there some special "get $500 of parts free" thing?
[15:15:33] <Toneloc> ah, okay !
[15:15:34] <Casper> it's 4:05pm
[15:15:50] <Casper> I wants the battery I'm ordering tomorrow
[15:15:56] <OndraSter> heh
[15:16:10] <Toneloc> I was disheartened recenly when I seen on Tayda's facebook page that they had a 20% off day:(
[15:16:28] <Casper> I'm surprised that 2x 12v 17ah fit in the 8$ shipping
[15:16:51] <OndraSter> car batteries? :D
[15:17:00] <Toneloc> btw, I think 644 is overkill for me
[15:17:13] <Toneloc> doesnt seem to offer enough value to me
[15:17:20] <Toneloc> Im sure it does for someone else
[15:17:33] <Toneloc> it has a bootloader
[15:17:38] <Casper> Toneloc: the atmega16 are good
[15:17:42] <Casper> all mega have a bootloader
[15:17:52] <OndraSter> I started with mega32 myself
[15:17:56] <Toneloc> what does it do?
[15:17:57] <OndraSter> about 3? years? ago
[15:18:07] <OndraSter> ti allows you to flash the chip through some kind of peripheral
[15:18:11] <OndraSter> like UART or I2C or so
[15:18:20] <Toneloc> ah, serial port?
[15:18:26] <OndraSter> yep
[15:18:28] <OndraSter> for example
[15:18:31] <Toneloc> thats neat
[15:18:35] <Casper> what is a good rail to rail input-output opamp that work at 5V?
[15:18:45] <Toneloc> I dont have a proper programmer
[15:18:56] <OndraSter> Casper, I tend to use or at least look at ADI parts lately, but mouser hasn't got any ADI parts :(
[15:19:15] <Toneloc> just a thing I made last summer with an octal buffer transceiever and a parallel port cable and lots of wire
[15:19:40] <OndraSter> bootloader isn't pre-programmed
[15:19:51] <Toneloc> I have to put a led in randomly between two wires- then it magically works, well, eventually
[15:20:07] <Toneloc> I assume it adds capacitance
[15:20:19] <Toneloc> but really, its a crummy way of working
[15:20:40] <Toneloc> oh, so you would need to get someone to put the bootloader on it for you
[15:20:58] <OndraSter> ye
[15:21:23] <Toneloc> :(
[15:21:36] <Toneloc> that sort of defeats the purpose for me
[15:21:46] <Toneloc> but, I guess for firmware upgrades
[15:21:58] <Toneloc> to devices etc, its a great idea
[15:22:34] <Casper> Toneloc: the bootloader is nothing more than a program
[15:22:46] <Toneloc> Yeah, I understand that
[15:22:49] <Casper> you need a programmer to flash it, then you can bypass your programmer...
[15:22:58] <Toneloc> I thought they burned it on at the factory
[15:24:14] <OndraSter> if you'd be ordering few Ks of pieces..
[15:24:15] <Toneloc> the 16 it is !
[15:24:28] <Toneloc> I will get them from my friend
[15:25:02] <Toneloc> OndraSter- im not ta the level yet- I still have to deeply consider buying 10 :P
[15:25:36] <OndraSter> :D
[15:26:05] <Toneloc> whats the cheapest programmer I could get for it?
[15:26:25] <Toneloc> I seen you can use the launchpad to do avr programming
[15:27:00] <Toneloc> I wouldnt be opposed to building another programmer, or perhaps even building a bus pirate :)
[15:27:10] <Toneloc> I won a free pcb for that!
[15:29:45] <Casper> Toneloc: do you have a parallel port?
[15:32:11] <Toneloc> yes, I do
[15:32:35] <Tom_itx> get a 74hc244 and make a programmer
[15:32:41] <Toneloc> the programmer I built was for parallel port- because I didnt have a DB9 shell spare :(
[15:33:51] <Toneloc> Tom_itx- yeah, I used a different octal buffer, I made it work
[15:33:56] <Toneloc> but it wasnt reliable
[15:34:06] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/avr/ispdongle.pdf
[15:34:10] <Toneloc> but, I could tolerate it for the odd time I use an AVR
[15:34:21] <Tom_itx> or get one of my usb programmers
[15:34:39] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/boards/USBTiny_Mkii/USBTiny_Mkii_index.php
[15:36:03] <Toneloc> yeha, i built this
[15:36:04] <Toneloc> http://wiredworld.tripod.com/tronics/atmel_isp.html
[15:36:51] <Toneloc> I think thats the same thing
[15:37:45] <Casper> isn't ls incompatible with cmos parts?
[15:40:03] <Toneloc> I used a CD74HC245E for my circuit
[15:42:45] <Casper> DAMN inductors are fucking expensive!
[15:42:56] <Casper> 4.91$ for a simple inductor... damn
[15:43:22] <Toneloc> must be a high current one?
[15:43:41] <Casper> 1mH 2.4A
[15:44:13] <OndraSter> huh
[15:44:17] <OndraSter> $4.91 for inductor
[15:44:23] <OndraSter> my mains transformer is $3 :)
[15:44:26] <OndraSter> 3VA..
[15:44:32] <OndraSter> but IT IS MAINS TRANSFORMER DAMNIT
[15:44:34] <OndraSter> :D
[15:45:12] <Casper> I'm buying ONE of them, so I can have a known one so I can wind my own...
[15:46:20] <Toneloc> I was bought one of these for doing the same thing>>
[15:46:21] <Toneloc> http://www.amplifier.cd/Test_Equipment/other/LCR_451.html
[15:48:33] <Casper> sadly, those are expensive as hell
[15:50:05] <Toneloc> Casper- Yes, it was expensive
[15:50:14] <Toneloc> but you can make your own
[15:50:25] <Toneloc> lots of designs out there
[15:50:32] <Casper> yeah... next step is to actually calibrate my oscilloscope
[15:50:35] <Toneloc> or buy a cheap one from ebay
[15:50:48] <Casper> then I'll make/buy a signal generator
[15:51:35] <Toneloc> I bought a valve signal generator in my infinite wisdom...
[15:51:56] <Toneloc> it is a sweep generator/heater - not a signal generator!
[15:52:07] <Toneloc> Im going to build a signal generator too
[15:52:50] <Toneloc> I bought a Rigol oscilloscope last year as I was fed up with my analog scopes laying down when I needed them
[15:55:39] <Casper> Toneloc: the problem is I want one that go high enought in frequency, and that is the hardest part :(
[15:56:25] <Toneloc> yeah, analog for high frequency is cheaper
[15:56:40] <Toneloc> over 100Mhz things get expensive quickly
[15:56:45] <Casper> I want precision...
[15:56:55] <Casper> really, 0-5MHz would be fine
[16:04:35] <OndraSter> signal generator?
[16:04:38] <OndraSter> I am designing one
[16:04:43] <OndraSter> hopefuly one that could be sold :)
[16:06:09] <OndraSter> square-triangle-sine, upto ~20MHz usable, above that could be happening glitches (really depends on the main DDS chip itself, it goes as high as 37.5MHz for C version or 25MHz for B version)
[16:06:23] <OndraSter> plus PWM output
[16:06:48] <Casper> What about the voltage linearity?
[16:07:40] <OndraSter> 0-10V or so I am targetting
[16:07:50] <OndraSter> linearity..
[16:08:04] <OndraSter> really, until I build it and measure it, can't say precisely :)
[16:08:25] <Casper> food time, bbl