#avr | Logs for 2014-12-16

Back
[02:56:04] <umquant> ifI am writing a serial controlable servo, is it best to just use a lookup table for possible angles + timer values?
[03:29:22] <kline> umquant: if you really have nothing better to do with the space, sure, but the formula that converts angle to time value is trivial
[04:04:23] <umquant> kline: I was just thinking a LUT might perform much better than a calc
[04:05:42] <kline> umquant: given the control pulses are relatively slow for servos, youre not bottlenecked by the performance of that calculatino
[04:06:20] <umquant> Gotcha! Thank you
[04:19:45] <umquant> kline: is the type of equation you are talking about? http://people.rit.edu/sxn6226/320/project2/servo_calculator.html
[04:20:02] <kline> umquant: im, just off to a meeting, back in 15
[04:32:42] <kline> umquant: perhaps. essentially youre applying the proportion of the angle to the proportion of the on/off time of the pule
[04:35:01] <kline> with the range of the pulse being 1-2ms, you have a window of 1ms + proportion, so if the servo is centered, thats (90/180 * 1) + 1 = 1.5ms (which is indeed halfway between 1 and 2 ms)
[04:45:40] <umquant> The servo I have has a range of .6ms to 2.1ms from 0-60 degrees
[04:48:58] <umquant> 0-150 degrees
[05:04:13] <kline> umquant: then just apply those numbers instead of mine
[05:04:39] <kline> (x/60 * (2.1 - 0.6) + 0.6
[05:05:08] <kline> (add an extra ")")
[06:53:38] <MarkX> Hi
[06:53:57] <MarkX> i remember a little while ago someone recommended a website where i can find reference drawings for footprints
[06:54:10] <MarkX> not exactly "international standards" but more like guidelines
[06:54:24] <MarkX> anyone have any idea what i'm talking about?
[07:32:18] <Tom_itx> MarkX, alot of websites have those
[07:37:16] <MarkX> Tom_itx: i think i found the one i was looking at before
[07:37:19] <MarkX> jedec
[07:37:39] <MarkX> but i don't remember it being this hard to find out a standard for a package like tqfp44
[07:40:34] <Tom_itx> atmel has em too if you look
[08:40:12] <MarkX> so i lost my entire schematic
[08:40:17] <MarkX> due to stupidity
[08:40:29] <MarkX> but now i'm redoing everything
[08:41:04] <MarkX> the old one had a mixture of thru hole and surface mount components
[08:41:31] <MarkX> with this new design, should I stick to one
[08:41:38] <MarkX> type of component?
[08:42:33] <LeoNerd> Lately I find I just surface-mount everything except the bits I can't get hold of that way - usually connectors
[08:42:48] <MarkX> right on
[08:42:51] <LeoNerd> My HVSP boards are surface apart from the Bus Pirate connector and the two ZIF sockets
[08:43:03] <MarkX> i know there is no rule for it but i figured i'd get into the good practices now rather than later
[08:45:35] <LeoNerd> GAHHHH! Why does seemingly everyone doing anything with AVR chips always quote the Arduino IO port numbers? That's useless to me
[08:45:40] <LeoNerd> Means I have to cross-convert them again
[08:46:00] <LeoNerd> It's bad enough on the 328, but when people start inventing pin numbers on tiny chips as well, that's even worse
[08:47:53] <Casper> what do you mean? like PA2 ?
[08:48:25] <MarkX> LeoNerd: for your thru-hole components like transistors or caps, do you have a standard hole size that you use?
[08:48:38] <LeoNerd> Casper: yes
[08:48:53] <LeoNerd> MarkX: I use SOT-23 transistors and caps in either 0603 or 0805
[08:48:58] <Casper> PA2 is the official way to call a pin on avr
[08:49:09] <LeoNerd> (or bigger like e.g. I can't find 10uF smaller than 1206)
[08:49:22] <LeoNerd> Casper: Yes, I'm aware
[08:49:52] <LeoNerd> Casper: I dislike when people name them in Ardunio-speak on online articles, board layouts, breakout board silkscreen, etc...
[08:50:12] <MarkX> LeoNerd: sorry, are those measurements?
[08:50:23] <Casper> PA2 is not arduino naming
[08:50:26] <Casper> but atmel one
[08:50:33] <LeoNerd> Yes.. I know
[08:50:33] <MarkX> oh durr
[08:50:35] <MarkX> they are not
[08:50:43] <MarkX> sot 0603. gotcha ;)
[08:50:44] <LeoNerd> I am complaining about the ARDUINO naming..l where you just number pins 0, 1, 2,...
[08:51:11] <Casper> o.O
[08:51:14] <LeoNerd> Casper: I dislike this pin naming => https://www.tindie.com/products/densikit/ontiny2313/
[08:51:25] <LeoNerd> I would have preferred those pins be labeled PAn, PBn, PCn,...
[08:51:32] <Casper> damn time flies
[08:51:36] <Casper> I'm late
[08:51:37] <Casper> gtg
[08:52:11] <LeoNerd> I honestly don't knwo why Arduino decided they had to rename all the pins. It just causes confusion
[08:52:26] <Rickta59> isn't that stuff from the wiring framework?
[08:52:34] <LeoNerd> Yah
[08:52:44] <LeoNerd> I suppose not -directly- Arduino's fault in that case
[08:58:04] <MarkX> another quick question
[08:58:09] <MarkX> someone here recommended a pcb print service
[08:58:21] <MarkX> they have their own channel on freenode
[08:58:27] <MarkX> i can't remember the name, any ideas?
[08:59:12] <LeoNerd> OSHpark?
[08:59:16] <LeoNerd> The purple boards
[08:59:47] <MarkX> the website had black boards
[08:59:54] <MarkX> on the home page there was a board in the shape of a bug
[09:00:01] <LeoNerd> Ah; dunno that one
[09:00:31] <MarkX> found it!
[09:00:33] <MarkX> hackvana
[09:22:12] <LeoNerd> Random thoughts out loud: Both PIC and ARM chips lately seem to be going the route of having "configurable" IO pins - that the peripheral modules have various IO pins internally, that are assignable to physical pins in a dynamic way
[09:22:25] <LeoNerd> Are any AVR chips capable of that yet - or in the pipeline, as it were?
[09:23:33] <rue_more> LeoNerd, you sure you dont just want to go to an fpga?
[09:23:38] <LeoNerd> For instance: I'm stuck on a tiny84, for having a pin clash between the 16-bit timer1 and the USI, because they share IO pins. On a dynamically configurable device that wouldn't happen; I could just set them differently.
[09:24:02] <rue_more> ah
[09:24:06] <rue_more> what about the 841
[09:24:13] <LeoNerd> rue_more: If you can find me an FPGA that has a full CPU core, SPI, UART, I²C, timers, analog components,.... for GBP2, then sure ;)
[09:24:24] <rue_more> well you need to upload one to it
[09:24:25] <LeoNerd> The 841 doesn't have assignable pins either
[09:24:43] <rue_more> I heard something about it a while ago
[09:25:15] <LeoNerd> E.g. compare to the PIC18 series and the LPC81x ARM-based chips
[09:25:45] <LeoNerd> Also, look at the data sheet pinout diagram on the tiny841 - that's getting rediculous with pin names. Assignable pins would make that neater, if nothing else :)
[09:25:51] <rue_more> I ditched the stupid PICS quite a while back
[09:26:18] <LeoNerd> The pins just become IO0, IO1, IO2, IO3, etc... and you have a blob of memory to say what virtual pins (like UART0_TX) are connected to what physical ones
[09:26:18] <rue_more> isn't the 84 an 8 pin device?
[09:26:25] <LeoNerd> 84 is 14pin
[09:27:00] <LeoNerd> Yah - _generally_ I much prefer AVRs to PICs, but that ability of dynamic assignable pins on the PIC18 just doesn't compare to anything the ATmega chips have
[09:27:02] <LeoNerd> Or tiny
[09:27:03] <rue_more> hmm
[11:36:12] <hetii> Hi :)
[11:39:25] <LeoNerd> Afternoon
[14:38:12] <hetii> twnqx`: hi, have a question about your code that you used with flash for loging purpose.
[14:38:42] <hetii> as I see you don`t use one method to send and get data from spi.
[14:39:09] <hetii> but for eg few times call spi_write and at the end spi_read
[14:39:43] <twnqx`> read does dummy writes
[14:39:47] <hetii> or like: spi_write(RDID);vendorid = spi_read (); deviceid = spi_read ();
[14:40:03] <twnqx`> write ignores the return valu
[14:40:05] <twnqx`> e
[14:40:31] <twnqx`> the return value for the command is irrelevant; when reading, what you write is irrelevant
[14:40:33] <hetii> but what you send in real world when you read ?
[14:40:38] <twnqx`> 0
[14:40:55] <twnqx`> right, i never posted the spi code :P
[14:41:44] <twnqx`> but i don't have access to it atm, it's on the other OS of the other PC :P
[14:43:51] <hetii> twnqx`: this is how I do it http://pastebin.com/fqe2EyiL
[14:44:29] <hetii> so I write and send the data at this same time
[14:48:15] <hetii> ok but now when you for eg call spi_write(RDID) then what is in incouming buffer ?
[14:48:50] <twnqx`> i wanted more speed than that
[14:48:50] <twnqx`> that's how you have to do it :P
[14:48:51] <twnqx`> but
[14:48:52] <twnqx`> the return value of the command is irrelevant (there is no data)
[14:48:52] <twnqx`> so don't be confused
[14:48:53] <twnqx`> the relevant reads (normally) start on the second write
[14:48:54] <twnqx`> iirc a friend had a chip that was a bit different :P
[14:50:46] <hetii> ok can I use my methods instead yours and just write 0 ?
[14:50:54] <twnqx`> discarded
[14:51:04] <twnqx`> there is no return value on RDID
[14:51:19] <twnqx`> the chip doesn't know the command yet, how/what should it reply
[14:51:41] <hetii> I see.
[14:52:04] <hetii> Ok make a bit even more sense cause its in middle of proccesing it
[15:02:53] <hetii> what about spi_bulk_write_read (bufferfill, buffers[active_buffer]); and while (spi_inuse ()); ?
[15:03:27] <hetii> suppose in second you check some spi register until is ready
[15:04:23] <twnqx`> bulk_read_write is basically for (i=0; i<bufferfill; i++) buffers[i]=read_write (buffers[i]);
[15:04:45] <twnqx`> inuse is well...
[15:05:11] <twnqx`> i can trigger the spi asynchronously, like hand a buffer over, and have the transfer happen in interrupt context
[15:05:35] <twnqx`> and inuse signals whether such a buffer is being transmitted or if it's done
[15:05:42] <twnqx`> irrelevant if you use soft spi
[15:06:35] <hetii> yep just for test will use softspi but then will swith it to hardware.
[15:41:19] <LeoNerd> Doh; I just missed RikusW
[15:59:57] <Ristovski> Guys, what do you think is the best DIY programmer?
[16:00:05] <Ristovski> the tinyAVR ISP seems nice
[16:00:17] <LeoNerd> I quite like my HVSP burner... but then I'm biased ;)
[16:00:23] <LeoNerd> Also I really like having that RESET pin
[16:00:26] <LeoNerd> And debugWire
[16:01:03] <Ristovski> LeoNerd, hmm
[16:01:41] <Ristovski> LeoNerd, well, I'm looking for the best of the DIY ones
[16:01:54] <Ristovski> there are like 5 that are well known, I just dont know which one could be the best
[16:01:55] <LeoNerd> Mine was DIY.. I made it myself
[16:02:18] <Ristovski> LeoNerd, Really? How much did it cost in parts?
[16:03:31] <LeoNerd> Hmm.. A good question. *grin* One I have to work out given I'm plannign to start selling them
[16:03:44] <Tom_itx> u are?
[16:03:48] <Ristovski> lol
[16:03:53] <LeoNerd> The most expensive part is the LTC1262 :(
[16:04:06] <LeoNerd> They're like... GBP4.and-a-bit
[16:04:12] <Tom_itx> is that the 12v thing?
[16:04:16] <LeoNerd> Yah
[16:04:22] <Tom_itx> those are cheap
[16:04:37] <LeoNerd> Really? I can't find them for less than 4
[16:04:42] <Ristovski> LeoNerd, Basically I'm planning on getting an arduino, and when I'm done with that, I will use the ISP sketch to program a ... programmer
[16:06:26] <Tom_L> .57 / 100
[16:06:35] <Tom_L> http://www.mouser.com/ProductDetail/STMicroelectronics/ST662ACD-TR/?qs=%2fha2pyFaduiYma%252bgFCm6VMa%252bWb0u7q4d8BptPAIPFyE%3d
[16:06:47] <Tom_L> http://www.digikey.com/product-detail/en/ST662ACD-TR/497-6542-1-ND/1865353
[16:06:51] <Tom_L> DK is always higher
[16:07:00] <LeoNerd> Huh.. see; I switched from the ST662 to LTC1262 because they seemed to be cheaper
[16:07:11] <Tom_L> well they're not
[16:07:17] <LeoNerd> Hrm...
[16:07:21] <LeoNerd> Fair enough
[16:07:31] <Tom_L> maybe from element13
[16:07:36] <Tom_L> 14?
[16:07:39] <Tom_L> some damn element...
[16:08:11] <LeoNerd> I'll take another look then
[16:08:33] <Tom_L> max version is higher
[16:09:02] <LeoNerd> Eh, anything will do
[16:09:22] <Tom_L> http://www.mouser.com/Search/Refine.aspx?Keyword=MAX662ACSA%2b
[16:09:29] <Tom_L> i mean... if you really wanna pay more..
[16:10:28] <Tom_L> DK doesn't stock the max part
[16:11:10] <LeoNerd> I'll see what I can find then
[16:12:48] <Tom_L> heck, i bet china gives em away
[16:13:42] <Tom_L> http://www.ebay.com/itm/L78L05ACD13TR-ST-MICROELECTRONICS-L78L05ACD-IC-REG-LDO-5V-0-1A-8-PIN-SOIC-/111233013952?pt=LH_DefaultDomain_0&hash=item19e60118c0
[16:13:50] <Tom_L> nearly
[16:13:57] <LeoNerd> That's not it
[16:14:02] <Tom_L> arrg
[16:14:22] <Tom_L> http://www.ebay.com/itm/10pcs-ST662ACD-ST662A-Manu-ST-SOP-8-DC-DC-converter-for-flash-memory-programming-/321465176111?pt=LH_DefaultDomain_0&hash=item4ad8d1502f
[16:14:41] <Tom_L> about a buck a piece
[16:14:53] <LeoNerd> Huhyeahj
[16:15:18] <Tom_L> http://www.ebay.com/itm/10pcs-ST-ST662A-ST662ACD-ST662-SOP8-DC-DC-CONVERTER-FOR-FLASH-MEMORY-PROGRAMMING-/141013413563?pt=LH_DefaultDomain_0&hash=item20d50deebb
[16:15:23] <LeoNerd> Ah, I guess it was more expensive when I was looking for singles. Perhaps if I shift the first three I've got, I'll get a bigger batch
[16:15:40] <malinus> >100% original and brand new!
[16:17:29] <Tom_L> http://tom-itx.no-ip.biz:81/~webpage/boards/new_batch/USB_chips.jpg
[16:17:32] <Tom_L> go big or go home!
[16:18:07] <LeoNerd> Hah
[16:18:22] <LeoNerd> Well, I think an HVSP burner is a faaaairly niche product. I'll have to see how it goes
[16:18:36] <Tom_L> yeah
[16:19:53] <malinus> Tom_L: you still making those?
[16:19:56] <LeoNerd> Though for my next board, I'll mount a little one on top, as an STK500 clone, which will also do standalone fuse fiddling
[16:20:09] <Tom_L> malinus yes
[16:20:25] <LeoNerd> I already have the clone part working in 2.4Ki of flash, so that leaves me over 5K to work that in somehow
[16:20:36] <malinus> Tom_L: I'm wondering, how many have you sold? If not the exact number,at least give me the number of 0's :)
[16:20:39] <LeoNerd> Oh.. that reminds me: A dilema occurs to me with that board
[16:21:00] <Tom_L> i'm not entirely sure but around 4-500
[16:21:08] <malinus> oh nice
[16:21:13] <LeoNerd> a tiny841 is perfect for it, except I need a few more slow IO lines for Vprg/Vtg control and some status LEDs. So I could easily put a '595 on the board to drive those. But then that's two chips
[16:21:22] <malinus> Tom_L: I'm looking at one right now :3
[16:21:24] <LeoNerd> Orrrrr... I could put a bigger chip on and drive them all directly.
[16:21:31] <malinus> (one of those 4-500)
[16:21:40] <Tom_L> you better get a spare
[16:21:54] <malinus> you don't trust your quality :O?
[16:22:01] <Tom_L> of course i do
[16:22:03] <LeoNerd> Thing is, I can't find one that's actually better than just using the SR; in terms of cost or board size
[16:22:06] <LeoNerd> Soo... meh.
[16:22:55] <Tom_L> malinus, i've had maybe 2 or 3 go bad but suspect it was a noob issue
[16:23:07] <malinus> Tom_L: have there been any firmware that I should care about in the last 2 years time?
[16:23:12] <Tom_L> i doubt it
[16:23:16] <malinus> firmware update, that is
[16:23:26] <Tom_L> firmware is pretty solid
[16:23:37] <Tom_L> last couple updates were to keep it working under stuido 6.2
[16:24:03] <malinus> I'm using avrdude, so not really relevant
[16:24:15] <Tom_L> nope
[16:24:58] <Tom_L> have you tried bumping up the spi rate on it?
[16:25:19] <Tom_L> i've always left mine at the default 250khz rate
[16:25:25] <Tom_L> i bumped it up to 2Mhz the other day
[16:25:34] <Tom_L> what a difference!
[16:25:47] <malinus> can you do that trough avrdude somehow?
[16:25:50] <Tom_L> just stay under 4x the clock rate
[16:25:52] <Tom_L> yes
[16:25:54] <Tom_L> i forget how
[16:26:25] <Tom_L> just remember the rate is stored so if it quits programming, don't forget to set it back lower again
[16:26:34] <Tom_L> on a chip with a 1Mhz internal osc for example
[16:27:19] <malinus> yeah
[16:27:56] <Tom_L> iirc he stores that parameter in eeprom
[16:28:06] <malinus> he?
[16:28:12] <Tom_L> dean
[16:28:16] <Tom_L> the lufa guy
[16:28:18] <malinus> oh the MKII?
[16:28:21] <Tom_L> yes
[16:29:06] <N1njaneer> Tom_L: Yes, remember new chip bring-up requires it to be at 125Khz for reliable operation
[16:29:21] <LeoNerd> *ahem* or HV ;)
[16:29:32] <LeoNerd> Though to be fair everything else does PP
[16:30:16] <Tom_L> N1njaneer i thought default was 250Khz
[16:30:20] <N1njaneer> At least you don't need a $400 programmer like the several others I have on my desk at the moment :(
[16:30:36] <Tom_L> that covers the 1Mhz default on most chips
[16:30:50] <N1njaneer> Tom_L: 250Khz may work, but the spec is officially "less than 1/4th clock rate" which 250Khz would be exactly 1/4th.
[16:31:38] <Tom_L> true.
[16:31:41] <N1njaneer> Generally for production programming I start the programmer at 125Khz, blow the clock fuses to get it to final (generally 8 or 16Mhz) then move to a much higher speed to program the flash contents. Gets the cycles down pretty short, which is important when you have 800 boards you have to program through :)
[16:31:42] <Tom_L> i've never had it fail
[16:32:19] <Tom_L> yeah
[16:32:46] <Tom_L> dinner...
[16:32:51] <N1njaneer> When doing hundreds of units, it's easier for me to play it conservatively since it ultimately saves time knowing that every units will definatively program the fuses correctly. If it gets screwed up because of bad SPI transaction, you can theoretically brick the chip.
[16:33:03] <Tom_itx> yeah i agree
[16:33:13] <LeoNerd> Oh! I've just realised what was confusing me
[16:33:17] <LeoNerd> There's two "Tom_*"s
[16:33:34] <N1njaneer> LOL, yes! Or as we like to call them "Tom A" and "Tom 1"
[16:34:09] <LeoNerd> Surely TOM0 and TOM1?
[16:46:06] <malinus> heh
[16:50:37] <Tom_itx> clones
[16:56:40] <hetii> what about stk500v2 ?
[16:56:55] <LeoNerd> Mine is v2
[16:57:11] <LeoNerd> (Well, AVR068)
[16:57:13] <hetii> in Avr-dooper its code that can be easly grabed and use on any other platform
[16:57:33] <hetii> I tested this with lpc1769
[16:57:53] <hetii> and was able to cooking few atmegas
[16:59:20] <hetii> protocol itself try to define some timming on SCK line when data go throught spi but as I tested simply delay_ms() is enought to do the same
[17:04:23] <SKiTZO> I have an el-cheapo chinese demo board with atmega32L that sports a micro usb connector
[17:04:41] <SKiTZO> I guess to use the usb for communication I will have to implement some sort of software stack (v-usb)
[17:05:19] <SKiTZO> I am fairly new to this, and my searches online have got me nowhere. What would I have to put into my code on chip + in driver software to have 2 way coms over usb?
[17:06:01] <hetii> SKiTZO: all depend what you want to have at the end of the day
[17:06:09] <hetii> if just bootloader in this board
[17:06:18] <hetii> then you could use USBasploader
[17:07:48] <hetii> if you want to have it as a programmer then some usbasp/mk2/avrdooper or similar.
[17:08:35] <hetii> USBasploader is nice (you can even use RST pin and detect if was pressed and then go to bootloader section)
[17:08:58] <SKiTZO> heii, I dont want to use it for loading software, I want to use it to send commands
[17:09:05] <hetii> but sometimes you need to retry transmission
[17:09:08] <SKiTZO> like serial interface
[17:09:30] <hetii> then you can use avr cdc project
[17:10:56] <SKiTZO> *googling
[17:12:17] <N1njaneer> SKiTZO: I would honestly just get a board with an ATMEGA32U2 or U4 if you wanted native USB support, rather than bit-bang software emulation.
[17:12:47] <N1njaneer> Or just use an FTDI as a serial port to make it really easy if you just need to send moderate amounts of data.
[17:13:20] <SKiTZO> I don't hav time to source another board. I am working on a deadline and my goal is to have my current board controlled over USB before I go to bed tonight :D
[17:13:34] <N1njaneer> Mmm, good luck with that!
[17:13:50] <SKiTZO> But your advice is appreciated,let's have that as plan B
[17:13:51] <SKiTZO> :D
[17:14:05] <N1njaneer> Find a USB bit-bang implementation that you can compile for AVR
[17:14:30] <N1njaneer> I know there are some out there, but I only do USB with chips that have USB natively built-in so I can't point you to anything more specific.
[17:14:31] <SKiTZO> it seems "V-USB" and "LUFA" are the dominant ones
[17:14:45] <N1njaneer> AFAIK LUFA does NOT support bit-bang USB
[17:14:52] <Tom_itx> nope
[17:15:07] <SKiTZO> you are right
[17:15:17] <SKiTZO> V-USB it is then
[17:15:27] <hetii> SKiTZO: then look at V-usb there are many examples
[17:15:32] <hetii> how to control gpios
[17:17:56] <hetii> How I hate windows OS ...
[17:20:14] <hetii> after 7 years of not using It I just got one notebook to install windows 8.1 and is that same crapy ...
[17:22:18] <hetii> Why M$ is not able to write one good software to manage partitions in installation process...
[17:22:33] <SKiTZO> hetii, word. I am down to 0 computers running that stuff
[17:23:39] <hetii> Me to, but this not belong to me :)
[17:34:52] <hetii> twnqx`: What kind of data I need to send to clear check engine status by (over canbus) OBD2 ?
[17:35:07] <twnqx`> lol
[17:36:04] <twnqx`> can you chat me up tomorrow during the day? :P
[17:36:12] <hetii> sure :)
[17:36:14] <twnqx`> all my source code is on the linux drive
[17:36:21] <twnqx`> and i am currently playing some games :)
[17:36:25] <hetii> no problem at all :)
[17:36:38] <hetii> lucky guy
[17:36:47] <hetii> you have time for it :)
[18:08:37] <malinus> twnqx`: most games run on linux in the year of 2014
[18:09:38] <twnqx`> let's say
[18:09:44] <twnqx`> none of those i play :P
[18:10:24] <malinus> yeah the windows 95 minesweeper doesn't have a linux version. But you can try using wine
[18:10:38] <twnqx`> do you think far cry 4 would work well in wine?
[18:11:07] <malinus> how in the world would I know. yes?
[18:11:19] <malinus> there is winehq for that
[22:24:44] <SKiTZO> v-usb was actually quite nice :D
[22:25:07] <SKiTZO> mission accomplished
[22:36:00] <N1njaneer> Got it working?