#avr | Logs for 2016-10-24

Back
[07:23:47] <cehteh> even the old one had "Non Commercial" license for the free version iirc
[07:24:37] <cehteh> and then its very limited
[09:43:25] <rue_house> iirc the linux one didn't require much of anything
[09:45:09] <rue_house> if I were a robot, I'd not have to shave... myself anyhow
[09:46:25] <LeoNerd> There's a song by Squeeze to the title "She's lucky she doesn't have to shave"
[09:46:42] <rue_house> dont know them
[09:46:55] <LeoNerd> 80s rock of some flavour
[10:32:27] <Duality> are only make files allowed, or any type of build script
[10:32:35] <LeoNerd> ?
[10:32:43] <Duality> topic
[10:33:02] <LeoNerd> Oh.. huh. noidea
[10:33:57] <Duality> that link just points to the homepage no explanation nothing
[10:34:29] <Duality> i have one that is pretty universal, but uh it's in python (scons)
[10:34:58] <LeoNerd> Every time I see mention of scons, I really want to put an 'e' in its name to become scones
[10:35:10] <Duality> :D
[10:35:24] <LeoNerd> But that leads to debates about jam-first or cream-first
[10:35:38] <Duality> cream-first <-
[10:35:56] * LeoNerd shalln't be drawn on the issue :P
[10:37:44] <Duality> omg the scone wars are a thing in the interwebs
[10:37:45] <Duality> :D
[11:34:23] <lochs> i have a makefile in php (tartelettes)
[12:11:10] <Duality> lochs: is that a thing ?
[12:31:29] <skz81> Duality, yes actually it's a kind of little pies... Ho you meant " makefile in php", not "tartelettes", maybe
[12:38:53] <Duality> yea i thought maybe there is build script code that is called tartelettes in php
[12:39:07] <Duality> but i could only find the pies
[13:58:20] <Lambda_Aurigae> build script can be written in just about anything. I've done csh scripts for build environments in the past.
[13:59:21] <bss36504> gradle is a pretty cool build system
[14:03:04] <Lambda_Aurigae> the sick twisted bastards who invented make and ant should be committed, hanged, shot, drawn and quartered, burned at the stake, then the remains fired into the sun....just to be safe.
[14:03:20] <specing> hah
[14:03:30] <bss36504> I mean for it's time, make was pretty good
[14:03:42] <Lambda_Aurigae> yeah, for about 30 minutes
[14:04:14] <Lambda_Aurigae> it is very powerful and versatile for what it is...will give it that.
[14:04:56] <bss36504> nah, it was designed well before "modern" "software" projects (as opposed to "programs"). The bastards who should be shot are the people who continue to use it for real, actual continuous integration type stuff. But I think that's a pretty small minority of die hards
[14:06:17] <Lambda_Aurigae> like the linux kernel!
[14:06:18] <Lambda_Aurigae> hehe
[14:10:31] <Lambda_Aurigae> I wonder what kind of system microsoft uses to build windows.
[14:10:47] <Lambda_Aurigae> and if it is done in one big run or has to be done as a bunch of separate builds.
[14:11:17] <bss36504> It would take literally days and days to compile a complete OS every time. Thats the point of continuous integration build systems
[14:11:53] <Lambda_Aurigae> I remember doing a full build emerge on gentoo back in the pentium days.
[14:11:59] <Lambda_Aurigae> that did take days and days to build.
[14:12:01] <bss36504> I imagine they use whatever build system Visual Studio uses, which may still be make, but I doubt it since VS is a pretty top tier IDE
[14:14:00] <bss36504> Just glanced, I think it's very unlikely that they use Make in VS. It might be a custom thing specific to VS, it seems to integrate distributed building right into the IDE
[14:14:11] <specing> Lambda_Aurigae: its Microsoft Buildows
[14:14:26] <bss36504> lol
[14:19:55] <WormFood> with distributed compiling, you don't need days
[14:23:18] <specing> WormFood: but you need a license for that
[16:29:38] <specing> Are there any lists on what assortments to buy off ebay&co?
[16:29:48] <specing> resistor/zener/transistor/... packs
[16:42:30] <specing> http://www.ebay.com/itm/310pcs-31-Values-2V-36V-1-2W-0-5W-Zener-Diode-DIY-Kit-Set-Assorted-Assortment-/322140426367?hash=item4b0110d07f:g:hyMAAOSwyQtVxPy1
[16:42:36] <specing> anything wrong with these?
[16:42:43] <specing> the prices are all over the place
[16:42:47] <specing> across ebay
[16:42:57] <specing> for zener diode asortments
[16:57:09] <cehteh> i never buy assortments, just buy what i need, prolly in 100's, so after some time i got a stash of useful thing
[16:57:43] <cehteh> assortments with 10 of each means you run low in the most common parts in no go and have a huge pile of unused things
[16:59:22] <LeoNerd> Yah
[17:01:19] <specing> assortments are for unexpected needs. Usually prototypes don't require more than 10 of some value
[18:16:17] <joebobjoe> Can anyone help me determine if this datasheet is wrong? Under the HVSP instruction set, there are a few oddities. How is it possible to only provide a 9 bit address for "Read Flash Low and High Byte" when flash has 2K words?
[18:16:37] <LeoNerd> Which chip?
[18:16:39] <joebobjoe> http://www.atmel.com/images/atmel-2586-avr-8-bit-microcontroller-attiny25-attiny45-attiny85_datasheet.pdf
[18:16:44] <joebobjoe> LeoNerd: ATtiny85
[18:17:14] * LeoNerd has written a working HVSP implementation :)
[18:17:30] <joebobjoe> LeoNerd: awesome
[18:17:37] <LeoNerd> Also, those bitstreams in the datasheets have a number of weird edge-cases in them
[18:17:53] <LeoNerd> They're not great.. better is to study them all to work out the pattern and then throw away the DS and recreate it ;)
[18:17:58] <joebobjoe> Also, it says "Repeat Instr. 2 for a new 256 byte page." yet in section 20.7.2 it says "Address High byte needs only be loaded before programming or reading a new 256 word window in Flash or 256 byte EEPROM."
[18:18:08] <LeoNerd> HVSP is in fact the same HVPP core that the bigger chips use, with a couple of shift-registers in front of it
[18:18:15] <LeoNerd> The SII stream becomes the handshaking lines
[18:18:35] <LeoNerd> Yes - the addresses latch high and low separately
[18:18:49] <joebobjoe> Also, do I need to provide CLI while I'm waiting for the device to finish the write?
[18:18:59] <LeoNerd> No
[18:19:07] <joebobjoe> ok
[18:19:07] <LeoNerd> SCI is purely for clocking data into the shift registers
[18:19:27] <joebobjoe> LeoNerd: will HVSP work even if I have set an external clock with fuses?
[18:19:40] <LeoNerd> https://metacpan.org/pod/Device::Chip::AVR_HVSP is my implementation, if it matters
[18:19:49] <LeoNerd> Yes - that's one of the points about HVSP
[18:20:03] <LeoNerd> It talks -directly- to the HVxP programming core on the flash controller, so it totally bypasses the CPU entirely
[18:20:11] <joebobjoe> LeoNerd: ah, ty I will take a look later
[18:20:38] <cehteh> disabling reset? .. fun :)
[18:20:56] <LeoNerd> cehteh: That's one reason. Another is to use dW
[18:21:15] <cehteh> never used, are there any free implementations for dW?
[18:21:22] <cehteh> reverse engineered?
[18:21:32] <joebobjoe> LeoNerd: is dW proprietary
[18:21:37] <cehteh> yes
[18:21:52] <joebobjoe> cehteh: do they publish a protocol sheet?
[18:21:58] <LeoNerd> Atmel don't.
[18:22:01] <cehteh> nop
[18:22:02] <LeoNerd> Other people might ;)
[18:22:15] <LeoNerd> RikusW + a friend of his whose name escapes me have looked into it; I've played with it a bit too
[18:22:19] <cehteh> joebobjoe: why do you need HVSP? .. or moreover for what do you need the reset line?
[18:22:28] <cehteh> i guess you want one i/o more?
[18:22:35] <joebobjoe> LeoNerd: Anyway, do you see what I'm talking about with the flash-related instructions
[18:23:05] <joebobjoe> LeoNerd: I they only ever provide 9 bits, yet you need 11 bits to address all 2k words
[18:23:26] <cehteh> joebobjoe: i sometimes worked around that by keeping it as reset, and on startup i check if the chip was resetted by button press
[18:23:39] <LeoNerd> So, to set the flash address, there's two instructions you need to use; we call the PLL (page latch low) and PLH (page latch high)
[18:23:55] <cehteh> aka you can use the reset as simple io line for a button as is without all the pita coming with reset disabling
[18:23:56] <LeoNerd> Between them they just distribute the conceptually 16-bit flash address between them
[18:24:13] <joebobjoe> cehteh: ah, ty
[18:24:16] <cehteh> of course that wont work for everything
[18:25:51] <joebobjoe> LeoNerd: what does it mean "Repeat Instr. 1 for a new 256 byte page." for instruction "Load Flash High Address and Program Page"... instr. 1 has an "a" field
[18:25:57] <LeoNerd> joebobjoe: https://metacpan.org/source/PEVANS/Device-Chip-AVR_HVSP-0.04/lib/Device/Chip/AVR_HVSP.pm#L457 in particular, are the names we came up with
[18:26:17] <LeoNerd> https://metacpan.org/source/PEVANS/Device-Chip-AVR_HVSP-0.04/lib/Device/Chip/AVR_HVSP.pm#L774 the actual flash writing code
[18:26:42] <LeoNerd> Ahyes, I think that's probably a typo or something, or maybe a holdover from the tiny45 chip
[18:26:47] <LeoNerd> or even the 28
[18:26:48] <LeoNerd> 25
[18:27:33] <LeoNerd> Or more likely even the tiny13 - the 1KiB chip. 1KiB == 512 flash words. So 9 bits to address them
[18:27:35] <LeoNerd> That feels plausible
[18:28:17] <joebobjoe> LeoNerd: so the 0_0000_000a_00 should be 0_aaaa_aaaa_00 ?
[18:28:18] <LeoNerd> Don't forget that the flash programmer works entirely in 16bit words - so the "address" here is half the byte address
[18:28:26] <LeoNerd> Yah most likely
[18:28:35] <joebobjoe> Is Atmel idiots or something?
[18:28:43] <LeoNerd> Again - if in doubt, HVSP is just HVPP with a shift-register frontend
[18:28:45] <LeoNerd> No; just busy
[18:29:01] <LeoNerd> Very few people really ever play with HVSP, so there's not a lot of time dedicated to the writeup of it
[18:29:19] <LeoNerd> Anyway - compare the SDI/SII bitstreams with the better-documented (because many more chips use it) HVPP
[18:29:49] <joebobjoe> LeoNerd: it also says to repeat instr. 1 for a new 256 *byte* page... Shouldn't it mean *word*?
[18:29:55] <LeoNerd> you'll work out that 6 of the SII bits in HVSP correspond to the 6 HVPP handshaking lines, and the SDI bits are just the parallel 8bit data IO lines
[18:30:04] <joebobjoe> LeoNerd: The ATtiny85 doesn't have a HVPP
[18:30:07] <LeoNerd> So if you can't work out how to do something in HVSP, read about HVPP instead :)
[18:30:13] <LeoNerd> It does, in a sense
[18:30:33] <LeoNerd> Every Atmel chip has the same flash programmer core. On chips with hardware HVPP lines, those connect directly onto it
[18:30:42] <joebobjoe> LeoNerd: yea but there is no documentation for the HVPP of the ATtiny85
[18:30:58] <LeoNerd> The tiny13/25/45/85 being 8bit chips, are too small. so they put a shift register in front of the parallel HVPP lines, turning it serial
[18:31:09] <LeoNerd> No, but HVPP is basically the same on *any* Atmel chip
[18:31:13] <LeoNerd> Well, any AVR8 chip
[18:35:51] <joebobjoe> LeoNerd: Having these kinds of mistakes in the HVSP part of the datasheet makes me wonder what other stuff could be wrong
[18:35:58] <joebobjoe> Now I don't trust any of the numbers haha
[18:37:13] <LeoNerd> Yeah - best not to stare too closely ;)
[18:39:18] <LeoNerd> See my analysis
[18:39:18] <joebobjoe> LeoNerd: your wiki?
[18:39:18] <LeoNerd> ?
[18:39:18] <LeoNerd> I don't have a wiki
[18:39:18] <LeoNerd> (though I ought to .. need to find something I can apt-get install foo an there it is)
[18:41:30] <joebobjoe> LeoNerd: I don't know ruby but I see you use Futures.. nice
[18:42:09] <LeoNerd> perl actually, but yes
[18:42:22] <joebobjoe> LeoNerd: sry I meant perl
[18:42:42] <LeoNerd> The spelling is very similar. 4 letters, second of them a vowel
[18:42:46] <LeoNerd> It's an easy mistake
[18:43:33] <LeoNerd> I tend to do most things with Futures these days..
[18:43:53] <joebobjoe> LeoNerd: what kind of computer is this library meant to run on
[18:44:43] <LeoNerd> Surely "anything that'll run perl"?
[18:44:49] <LeoNerd> It's not restricted further than that
[18:46:22] <joebobjoe> LeoNerd: how do you talk to the cables you support?
[18:46:25] <joebobjoe> Like bus pirate
[18:46:55] <LeoNerd> Oh.. yah. Bus Pirate or FTDI or anything supported directly by Linux native GPIO
[18:47:00] <LeoNerd> Or write me another adapter :)
[18:49:26] <joebobjoe> LeoNerd: just curious, how do you communicate with another device on the machine, like bus pirate? Does it make itself available in /dev or something? How do you determine which device is the bus pirate? (sorry a little off-topic, but I can't read perl) :(
[18:50:19] <LeoNerd> Ah, the bus pirate in particular is annoying - it's just an FT232R as a serial bridge onto a PIC24
[18:50:30] <LeoNerd> So it's indistinct from any other FTDI-based adapter
[18:50:45] <LeoNerd> for my personal one, I have a udev rule that recognises the FDTI chip's serial number and makes a /dev/buspirate symlink
[18:51:04] <LeoNerd> But *most* of the time, you can probably guess correctly that /dev/ttyUSB0 is it, because most people won't have multiple devices in at once
[18:53:15] <LeoNerd> https://metacpan.org/source/PEVANS/Device-BusPirate-0.13/lib/Device/BusPirate.pm#L37 <== my not-particularly-advanced method of identifying the BP
[18:53:30] <LeoNerd> "It's probably /dev/ttyUSB0 but if the user cared to specify an environment variable then we'll trust that instead"
[18:54:30] <joebobjoe> LeoNerd: ah! I see!
[18:54:46] <LeoNerd> The adapter that uses the FTDI FT232H is much nicer. That chip has a specific VID/PID combination I can hunt for instead
[18:54:53] <LeoNerd> Plus that chip is much nicer generally
[18:55:03] <LeoNerd> The more I play with it the more I dislike the BP. Generally horrible device
[18:55:15] <LeoNerd> Buuuut lots of people have them and it is common, so... otta support it too
[18:55:17] <LeoNerd> *gotta
[18:56:34] <joebobjoe> LeoNerd: gotcha. I have one of those arduino-compatible digispark things that use an ATtiny85... It uses V-USB to communicate with the computer, haha. Should never have bought one.
[18:56:51] <LeoNerd> *shudder*
[18:56:53] <LeoNerd> Runawayyyyy!
[18:57:14] <LeoNerd> My USBASP isn't allowed in the lab. It point-blank refuses to talk to my USB3 hub
[18:57:24] <LeoNerd> So I have a proper pololu board out there instead. much nicer
[18:58:40] <joebobjoe> LeoNerd: The V-USB is not fully compliant with the USB spec, electrically
[18:58:48] <joebobjoe> As you know
[18:58:58] <joebobjoe> But nobody told me that
[18:59:19] <LeoNerd> Yah. definitely
[18:59:44] <LeoNerd> It works on a good day with the wind in the right direction... but I wouldn't rely on it for production purposes
[18:59:59] <joebobjoe> I wonder why you always have to re-plug in USB devices after you eject them from mac
[19:10:29] <joebobjoe> eh, I keep getting distracted. Back to reading the ATtiny85 spec sheet.
[19:10:51] <LeoNerd> I'm off to bed soon, but if you find any more questions about HVSP feel free to give me a poke. I know it prettmuch inside-and-out by now. Here possibly, or PM or email.
[19:11:09] <joebobjoe> LeoNerd: thank you sir
[19:11:16] <joebobjoe> I'm going to try it with my raspberry pi first
[19:11:17] <joebobjoe> I wish atmel would allow user revisions to their spec sheet. They really need to fix some of this stuff
[19:11:17] <LeoNerd> There might *even* be an adapter module for that too
[19:11:18] <LeoNerd> It's that broadcom chip I seem to recall
[19:11:18] <joebobjoe> LeoNerd: oh! one more question. do I have to turn off the clock while waiting for an HVSP operation to complete?
[19:11:18] <LeoNerd> No, it really doesn't matter
[19:11:18] <LeoNerd> The SCI line is purely the clock line on those shift-registers
[19:11:18] <LeoNerd> It's totally unrelated to the CPU core clock
[19:11:20] <joebobjoe> LeoNerd: But shouldn't the shift registers have to stay set
[19:11:20] <joebobjoe> during the operation
[19:11:23] <LeoNerd> Well, they're latched through
[19:11:26] <LeoNerd> I don't *quite* know why HVSP uses an 11bit clock cycle, but one reason it's >8 is so that there's a clock edge to perform the write latch
[19:11:28] <LeoNerd> Oh actually that said, after actually performing a flash write, I do wait for it to finish
[19:11:28] <LeoNerd> https://metacpan.org/source/PEVANS/Device-Chip-AVR_HVSP-0.04/lib/Device/Chip/AVR_HVSP.pm#L802
[19:11:37] <joebobjoe> LeoNerd: I guess if you issued more instructions you'd latch the shift register during an operation
[19:12:01] <LeoNerd> Yes.. notsure offhand what effect that would have
[19:12:02] <LeoNerd> best not to ;)