#avr | Logs for 2015-06-28

Back
[03:19:12] <Jartza> allo
[04:20:46] <blathijs> Jartza: Didn't the Arduino-supplied toolchain work? AFAIK they track the official atmel releases now.
[12:09:07] <Jartza> blathijs: no idea, I don't use arduino
[12:10:53] <Tom_itx> (sm)
[12:15:55] <LeoNerd> Huh.. This is ... interesting
[12:16:08] <LeoNerd> 5mm WS2812 takes colours in a different order to the 5050s that I have
[12:16:17] <LeoNerd> RGB vs GRB
[15:19:21] <megal0maniac> Tom_itx: Still selling programmers?
[15:43:56] <Tom_itx> i have a few
[15:44:11] <Tom_itx> not on the website now
[15:51:01] <megal0maniac> Ah, alright. Got some people here who are getting frustrated with USBASP :P
[15:51:10] <Lambda_Aurigae> hehe.
[15:53:16] <Lambda_Aurigae> I bet 80% or more of the problems with programmers I see are due to usbasp or similar v-usb based programmers.
[15:54:12] <megal0maniac> I have a JTAGICE3 and my life is better for it
[15:54:57] <Lambda_Aurigae> I have 3 programmers....a usbasp I made for fun, my original stk200 parallel port clone built with a 74ls244, and my tom-itx programmer..
[15:54:59] <Tom_itx> well if somebody want's one i have a few
[15:55:06] <Lambda_Aurigae> I use the stk200 more than anything else
[15:55:09] <megal0maniac> And the dev board that RikusW built, which covers TPI, HVSP/HVPP and 'magic' ignoring of DWEN fuse for when the JTAGICE3 isn't enough
[15:55:15] <Lambda_Aurigae> and have had more problems with the usbasp than anything else.
[15:55:25] <megal0maniac> That's because it's horrible :)
[15:55:50] <Lambda_Aurigae> I mostly use it as a bad example.
[15:55:55] <Tom_itx> i've got a few 74244 too
[15:55:56] <Lambda_Aurigae> the stk200 is faster.
[15:56:15] <Lambda_Aurigae> the ones I make with the kids are 74125 based.
[15:56:21] <Lambda_Aurigae> they work great.
[15:56:36] <Lambda_Aurigae> I also give them p-4 computers with parallel ports.
[16:02:36] <ambro718> Hi. Can someone tell the performance difference for CRC-CCITT implemented using avr-libc's _crc_xmodem_update versus a lookup table in program memory (https://github.com/MarlinFirmware/Marlin/blob/Release/Marlin/Sd2Card.cpp#L425) ?
[16:03:44] <Lambda_Aurigae> well, I would assume one calculates and the other uses a lookup table?
[16:04:01] <Lambda_Aurigae> speed vs size
[16:04:04] <ambro718> speed
[16:04:08] <Lambda_Aurigae> lookup table is faster
[16:04:16] <Lambda_Aurigae> calculating takes less program space.
[16:04:36] <specing> LUT is 2 cycles
[16:04:50] <specing> after you have the address
[16:06:50] <ambro718> this is the asm for the avr-libc function, https://github.com/vancegroup-mirrors/avr-libc/blob/master/avr-libc/include/util/crc16.h#L178
[16:07:18] <ambro718> 25 instructions
[16:07:23] <Lambda_Aurigae> as I said.
[16:07:27] <Lambda_Aurigae> much smaller footprint
[16:07:31] <Lambda_Aurigae> takes a lot longer to do.
[16:14:03] <ambro718> ok I'll go with the LUT, thanks
[17:03:22] <blathijs> megal0maniac: If your JTAGICE3 cable ever breaks, you might be interested in this: http://www.avrfreaks.net/forum/want-prevent-jtagice3-cable-breakage-use-converter-board
[17:03:40] <blathijs> Or perhaps even it didn't break yet
[17:08:11] <megal0maniac> blathijs: Thanks! I'll look into that. The cable is quite fragile, but I'm gentle with it
[17:14:15] <blathijs> megal0maniac: Mine broke within 6 months IIRC, I wasn't even using it often. I'm just puzzled why atmel didn't use regular flatcables with a converter to a small connector instead
[17:40:21] <Strangework> I am using a linuxgpio programmer to burn my attiny24a. The upload is properly verified, though only 58 of the 181 bytes are written - what could I be doing wrong?
[17:41:11] <Tom_itx> add delay
[17:42:25] <Strangework> What do you mean by that, Tom_itx?
[17:42:33] <Lambda_Aurigae> yup...sounds like programming it too fast.
[17:43:06] <Strangework> This sounds like separate from baudrate, how do I add 'delay'?
[17:43:12] <Lambda_Aurigae> he means you need to add a delay to the programming speed..
[17:43:22] <Lambda_Aurigae> slow it down..
[17:43:40] <Lambda_Aurigae> not knowing anything about your particular programmer, it's hard to say how.
[17:44:41] <Strangework> So would you explain to me where this delay needs to occur? It sounds like it should be placed after the reset pin is set high, though I am not sure if I follow.
[17:45:07] <Lambda_Aurigae> your programmer is running too fast for the chip to accept the data.
[17:45:15] <Lambda_Aurigae> you have to slow it down some.
[17:45:31] <Strangework> Does that mean chopping down the baudrate?
[17:45:31] <Lambda_Aurigae> or, at least, that's what it sounds like.
[17:45:57] <Lambda_Aurigae> the bit rate at least.
[17:46:27] <Tom_itx> there are 2 places to add delay, one is -B and i forget the other one
[17:46:28] <Lambda_Aurigae> most decent programmers have a way to slow down the programming speed.
[17:46:52] <Tom_itx> avrdude i assume
[17:47:48] <Strangework> Yeah, I'm using avrdude, programming the chip by bitbanging GPIO pins on my beaglebone
[17:48:26] <studentt> hello, when a uC says active mode 200uA of current cunsumption, does it mean when it runs with all periphereal and making some calculations?
[17:48:39] <studentt> like ADC and SPI etc... ?
[17:49:06] <Lambda_Aurigae> I'm guessing 200uA would be without i/o...just the processor running flat out.
[17:49:41] <studentt> ok you ahve an idea how much current would be drawn with 1 channel ADC running at 1Hz and SPI ?
[17:49:52] <studentt> ..then with some conversions
[17:50:05] <Lambda_Aurigae> no clue...I would have to put a meter on one and see.
[17:59:30] <Strangework> So I've done some reading - the -B option certainly cets the bitclock, it accepts some number of microseconds. I believe the attiny24a can have a speed of 4Mhz, though I think factory new chips have fuses set to cut that by a factor of 8. I tried using the parameter -B 0.5, though operation is still the same.
[17:59:46] <Strangework> Is my rationale so far correct?
[18:00:38] <Lambda_Aurigae> I think all attiny and atmega chips ship set at 1MHz internal clock.
[18:00:59] <Lambda_Aurigae> 8MHz internal oscillator and div by 8 fuse bit set.
[18:01:16] <Lambda_Aurigae> or, rather, all that I have ever used.
[18:01:22] <Lambda_Aurigae> never used an attiny24a though.
[18:03:11] <Tom_itx> Strangework, -B32 would be optimal i think
[18:04:41] <Strangework> Hm. Still the same results, though why do you say 32?
[18:05:19] <Tom_itx> just a WAG
[18:06:25] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/usbtiny_programmer/testing_index.php
[18:06:47] <Tom_itx> You can use the -B option to specify the ISP speed. By default the value is 10 which means 100KHz clock, this is good for target clock speeds > 500KHz. If you want the high speed clockrate (400KHz) for target frequencies > 4MHz you can use "-B 1" to speed up programming
[18:07:02] <Tom_itx> SPI clock frequency in KHz = 1000/(1.5+B) where B is the delay value
[18:07:29] <Tom_itx> In general, the clock frequency should be at least 4 times larger than the target clock frequency. Try "-B 32" if you're having clocking issues, that should handle even 128khz clocks
[18:08:50] <Lambda_Aurigae> http://www.avrfreaks.net/forum/clock-default-attiny24
[18:11:55] <Strangework> hmmm...
[18:12:37] <Lambda_Aurigae> that chip needs time to write to flash...that time is dependent on how fast the internal clock runs.
[18:14:34] <Strangework> Though when I see the B parameter very high, the situation does not change. Going by the formula on Tom_itx's page, 32 should cut down the rate enough. Using larger parameters does not change output either
[18:14:53] <Lambda_Aurigae> ok, then we eliminated the obvious problem
[18:15:32] <Lambda_Aurigae> next possibility is wiring
[18:16:39] <Strangework> hm hold on. I think I just found something that might clear this up
[18:16:42] <Lambda_Aurigae> everything wired up right? no loose connections.
[18:17:20] <Strangework> I was burning on a .hex file with a size 181b. When I burn the file, it reports only 58 bytes written. I used avr-objcopy to turn the hex into a bin - the resultant bin is 58b
[18:17:42] <Lambda_Aurigae> oh..
[18:17:43] <Lambda_Aurigae> duh!
[18:17:50] <Lambda_Aurigae> .hex file has more than just data in it.
[18:18:05] <Lambda_Aurigae> and your data is in text format in the file...so 2 bytes per byte of data..
[18:18:24] <Lambda_Aurigae> along with location data on each line of the hex file.
[18:19:23] * Strangework 's face meets keyboard
[18:19:26] <Strangework> adodijoadidowjdoidwi101ed
[18:20:08] <Thrashbarg> heh
[18:20:33] <Strangework> well - that's good. It seems like good enough reason to believe the ISP works. Now it just seems like my script just doesn't work - I'll have to figure that out
[18:20:41] <Lambda_Aurigae> it happens.
[18:20:55] <Lambda_Aurigae> try reading the data back and see what's on the chip.
[18:21:08] <Lambda_Aurigae> oh, make sure you erase the chip each time you program it too.
[18:31:41] <Strangework> Lambda_Aurigae, I've pulled it back as a .bin and compared it against the original .bin - it's still the same! Sounds like good news all around!
[18:31:54] <Lambda_Aurigae> good
[18:32:49] <Strangework> It really just seems like it's a problem with my script. Without a bootloader installed, the uC should just boot straight into my uploaded program, yeah?
[18:33:01] <Lambda_Aurigae> well,
[18:33:05] <Lambda_Aurigae> depends on how fuses are set.
[18:33:13] <Lambda_Aurigae> if the fuses are set to boot to bootloader, no.
[18:33:49] <Lambda_Aurigae> if bootloader fuses are set to boot to main program then you are good...and it won't boot to the bootloader no matter what is loaded.
[18:34:37] <Strangework> I've been wondering for a while how I'm supposed to interpret fuses. Could you recommend a good resource to figure out each fuse?
[18:34:40] <Tom_itx> hrm
[18:34:48] <Lambda_Aurigae> google?
[18:35:07] <Lambda_Aurigae> the datasheet.
[18:35:12] <Tom_itx> http://www.engbedded.com/fusecalc/
[18:35:25] <Lambda_Aurigae> aawww...I was gonna make him google it...
[18:35:27] <Lambda_Aurigae> hehe
[18:35:44] <Strangework> ^ I've been on that site before, for some reason I always eat shit when I'm on it.
[18:35:49] <Strangework> Lemme give it a lookthru
[18:36:08] <Tom_itx> well compare what it says to the data sheet for verification
[18:36:56] <Lambda_Aurigae> there are so many resources like that out there these days....when I started with AVR chips back 15ish years ago there was squat out on the web.
[18:39:25] <Lambda_Aurigae> I remember reading the atmega32 datasheet cover to cover twice before my first chip got to me.
[18:42:09] <Strangework> Dang, good shit
[18:42:50] <Lambda_Aurigae> it's been a few years since I did that though.
[18:43:09] <Lambda_Aurigae> these days I'm reading something much more complex...pic32 datasheets.
[18:43:20] <Lambda_Aurigae> with avr it's one file..everything you ever needed to know about the chip.
[18:43:31] <Lambda_Aurigae> with pic and pic32, it's a dozen or more.
[18:46:48] <Strangework> Why is that?
[18:47:17] <Lambda_Aurigae> why am I reading pic32 manuals?
[18:47:42] <Lambda_Aurigae> more powerful chip with hardware usb in a 28pin dip package.
[18:48:58] <Strangework> I mean - why is it that pic manuals are so much thicker?
[18:49:33] <Lambda_Aurigae> the chips are much more complicated.
[18:49:45] <Lambda_Aurigae> specially the pic32
[18:50:01] <Lambda_Aurigae> which isn't even a pic processor but a mips processor.
[18:52:04] <Strangework> Aside from just getting some variety, why do you use pic devices over avr devices?
[18:52:17] <Lambda_Aurigae> in this case, several reasons.
[18:52:24] <Lambda_Aurigae> hardware usb in a dip package
[18:52:33] <Lambda_Aurigae> 256k flash and 32k sram in a dip package
[18:52:46] <Lambda_Aurigae> ability to execute code from sram,,,in a dip package.
[18:53:12] <Lambda_Aurigae> and 83dmips at 50mhz in a dip package.
[18:53:39] <Lambda_Aurigae> with an external 10MHz crystal.
[18:54:41] <Lambda_Aurigae> all of which being something AVR doesn't provide me in a dip package...I like working on solderless breadboards without having to make little adapter boards for smt stuff.
[18:56:00] <Lambda_Aurigae> and I work with kids in the 12 to 18 year old range, teaching them microcontrollers, electronics, and robotics as a side thingie.
[18:56:16] <Strangework> Ah :D That's a pleasant gig
[18:56:21] <Strangework> Do they warm up to you?
[18:56:24] <Lambda_Aurigae> it's a hobby thing really.
[18:56:29] <Lambda_Aurigae> kids usually like me.
[18:56:37] <Lambda_Aurigae> I like kids so long as they are well behaved and intelligent.
[18:57:00] <Strangework> Most of the participant children are there on their own volition, yeah?
[18:57:07] <Lambda_Aurigae> all of them are.
[18:57:15] <Lambda_Aurigae> it's done in my shop across the street.
[18:57:28] <Lambda_Aurigae> as I said, it's a hobby thing.
[18:57:32] <Lambda_Aurigae> not a real school.
[18:58:03] <Lambda_Aurigae> some are doing it for scouts or 4h projects
[18:58:09] <Lambda_Aurigae> others, just for the fun of it.
[18:58:13] <Lambda_Aurigae> boys and girls.
[18:59:12] <Strangework> Damn cool thing.
[18:59:36] <Lambda_Aurigae> helps that I can get free samples from the various manufacturers for most of the stuff we play with.
[18:59:49] <Lambda_Aurigae> and people are always giving me older computers.
[19:00:11] <Lambda_Aurigae> so we have plenty of p-4 class machines I can put linux on...they have parallel and serial ports so making avr programmers is easy.
[19:00:35] <studentt> somebody worked with low power uC applications ?
[19:00:36] <Lambda_Aurigae> for the pic stuff I have a single pickit-3 that we put bootloaders on the pic32 chips with then program through the bootloader.
[19:00:52] <Lambda_Aurigae> studentt, depends on what you mean by low power.
[19:01:04] <Strangework> That reminds me - what did oyu mean by 'hardware usb'?
[19:01:06] <Lambda_Aurigae> most of mine will run from 3 AAA batteries, at least for a while.
[19:01:50] <Lambda_Aurigae> Strangework, as in, usb hardware onboard...like the avr chips with hardware usb..
[19:01:52] <studentt> uA's
[19:02:06] <studentt> think we chatted earlier
[19:02:32] <studentt> ide like to know how much SPI running slow consumes
[19:02:43] <studentt> ..current
[19:02:54] <studentt> and how much when the uC is doing some conversion calc's
[19:03:04] <Lambda_Aurigae> Strangework, there are a few atmega chips with usb hardware built in...like the atmega32u4
[19:03:13] <Lambda_Aurigae> hook an ammeter to one and test.
[19:03:48] <studentt> yes..i will
[19:03:56] <Tom_itx> studentt, about an ounce when idle and a bit more under load
[19:04:07] <studentt> ounce ?
[19:04:11] <studentt> Tom_itx
[19:04:12] <Lambda_Aurigae> Strangework, there is software for the avr to bitbang usb on any atmega and many attiny chips...called v-usb...it is a fun toy at best but you can buy usbasp based programmers that use this software...
[19:04:38] <Lambda_Aurigae> Tom_itx, unless I power it from a car battery then it uses several pounds no matter what.
[19:04:42] <Tom_itx> restructure your question and i bet the answer hides in the data sheet
[19:05:17] <Lambda_Aurigae> Strangework, with the pic32 chip I'm using I can do usb device or usb-otg-host.
[19:05:29] <Lambda_Aurigae> without using an external usb chip.
[19:06:00] <Strangework> Lambda_Aurigae - So you can use USB natively without needing to simulate it with bitbanging?
[19:06:04] <studentt> Tom_itx: id like to know how much current does the SPI and ADC periphereal consummes when operating
[19:06:09] <Lambda_Aurigae> Strangework, yes.
[19:06:33] <Lambda_Aurigae> there are a bunch of atmega and at90usb chips that can do it too...but they are all surface mount package only.
[19:07:01] <Strangework> Lambda_Aurigae, a while ago I read about FTDI and how they bridge usb and rs232 for use with Arduino boards. I heard some people speak about it negatively. Would you know why?
[19:07:23] <Lambda_Aurigae> you only get CDC..usb serial..
[19:07:34] <Tom_itx> studentt, best bet would be to measure it but there may be graphs toward the back of the PDF that may indicate power useage
[19:07:38] <Lambda_Aurigae> you can't simulate a keyboard or mouse or joystick with the FTDI usb-serial chips.
[19:08:15] <Lambda_Aurigae> Tom_itx, unfortunately, those don't get into the individual peripheral current draws.
[19:08:21] <Lambda_Aurigae> just an active processor running.
[19:08:33] <Lambda_Aurigae> and idle
[19:08:39] <Tom_itx> so back to measuring it
[19:08:48] <Lambda_Aurigae> pretty much.
[19:10:57] <Lambda_Aurigae> there are so many variables in how you use the ADC that saying how much current it uses when running is rather,,,impossible.
[19:11:29] <Lambda_Aurigae> run it the way you are going to in the final product and measure.
[19:11:36] <Lambda_Aurigae> part of the design process.
[19:12:12] <Lambda_Aurigae> theory is great but it often falls short of reality.
[19:12:29] <studentt> think so, they dont have graphs like that
[19:12:50] <Strangework> Lambda_Aurigae, that makes sense. Would you be able to simulate a keyboard or joystick if you had appropriate RS-232-style drivers to handle the device as such?
[19:12:59] <Lambda_Aurigae> Strangework, yeah...
[19:13:08] <Lambda_Aurigae> serial mouse anyhow.
[19:13:18] <Lambda_Aurigae> not sure anything but linux still supports the serial mouse.
[19:13:49] <Lambda_Aurigae> never seen a serial keyboard myself...but I suppose you COULD write a serial keyboard driver.
[19:14:25] <Lambda_Aurigae> well, technically at and ps-2 keyboards are serial but not rs232 serial.
[19:16:19] <Strangework> So what do you have in mind for your PIC project, Lambda_Aurigae?
[19:17:03] <Lambda_Aurigae> learning and teaching.
[19:17:16] <Lambda_Aurigae> but I am using them to build a VGA display adapter.
[19:18:58] <Lambda_Aurigae> I am getting 800x600 VGA with a 400x300 resolution...right now I'm working on the double buffering and triple buffering system.
[19:21:21] <Lambda_Aurigae> I have gotten full 800x600 resolution but trying out something different to save memory and cut down the number of chips I use because the video memory is actually external spi interfaced sram chips.
[19:21:48] <studentt> guys :
[19:21:49] <studentt> The current consumption is a function of several factors such as: operating voltage, operating frequency, loading of I/O pins, switching rate of I/O pins, code executed and ambient temperature. The dominating factors are operating voltage and frequency.
[19:22:16] <Lambda_Aurigae> yeah.
[19:22:25] <Lambda_Aurigae> so?
[19:24:35] <Lambda_Aurigae> spi does some loading on certain i/o pins.
[19:25:04] <Lambda_Aurigae> depending on the speed of spi, and the actual data, that loading can change.
[19:25:50] <studentt> indeed
[19:25:51] <Lambda_Aurigae> switching rate changes with speed and with data..
[19:26:00] <studentt> so you run it at very low speed to save power
[19:26:02] <studentt> uthats it
[19:26:18] <studentt> but operating voltage and frequency is dominating
[19:26:33] <Lambda_Aurigae> well, running it at low speed, when it is sending a 1 the pin is high longer than if it is running at a higher speed.
[19:26:41] <Lambda_Aurigae> dominating, yes...
[19:27:07] <Lambda_Aurigae> but you seem to want definite numbers with certain things running or not and we have no way of giving you those numbers.
[19:28:39] <studentt> na just an order
[19:28:51] <studentt> of magnitude
[19:29:01] <Strangework> Sounds like a stimulating project. When the adapter is ready, how do you relay it information and what do you display?
[19:29:46] <Lambda_Aurigae> Strangework, display anything...full graphic display...communication via spi, i2c, or usart in theory.
[19:29:54] <studentt> for my project a few hundreds of uA or some mA's make all the differences
[19:30:14] <Lambda_Aurigae> studentt, then I suggest getting out your microammeter and get to work.
[19:51:26] <studentt> fiy ive found a graph for the atmega328 for ADC Current vs. VCC
[19:51:59] <studentt> a few other periphereal as well
[19:53:04] <studentt> but not uart / spi and such
[21:51:28] <aandrew> same with you guys in here: if you're not playing tis-100 in steam you ought to be