#avr | Logs for 2017-01-20

Back
[00:00:19] <Funklord> Be aware that AVR documentation generally speaks in terms about one series of MCUs or a single MCU as if it's the only one that exists.
[00:02:10] <Funklord> I mean the AVR32 is still an AVR, and it has almost nothing in common with ATmega etc.
[00:03:57] <Levitator> Thanks!
[00:24:55] rue_house changed topic of #avr to: 8 bit atmel microcontrollers. suggest a hilight for the day to Rue_house. Todays hilight: http://extremeelectronics.co.in/avr-tutorials/ps2-keyboard-interface-with-avr-mcu/
[02:11:05] <carabia> chisight: no, never had that problem with eclipse. though, haven't used it in quite a while.
[02:12:05] <shangul> i didn't get my answer yet...
[02:12:41] <chisight> crazy_im1: interesting. when i looked, eclipse didn't have any import from cubemx at all and cubemx didn't have any export to eclipse.
[02:22:24] <chisight> sorry crazy_im1. bad tab complete.
[02:22:34] <chisight> carabia: interesting. when i looked, eclipse didn't have any import from cubemx at all and cubemx didn't have any export to eclipse.
[02:25:16] <carabia> chisight: when was this?
[02:25:26] <chisight> a year or so ago.
[02:26:38] <chisight> the cubemx says: version 4.14.0 stem32cube v1.0
[02:26:59] <chisight> -e
[02:27:34] <carabia> quite sure it has the option already
[02:27:57] <carabia> for me it always had issues with setting right include directories, but that was easily fixed
[02:28:30] <chisight> "it" being eclipse having and import, or cubemx having an export?
[02:28:45] <carabia> cubemx
[02:29:03] <chisight> so i was just too early.
[02:30:11] <carabia> i mean, even a year ago
[02:31:35] <chisight> really? where?
[02:31:56] <carabia> when you set the export format you select sw4stm32
[02:32:30] <chisight> looks like it was may 2016 that i last messed with it.
[02:32:45] <chisight> setting sw4stm32 is exactly what i do.
[02:33:10] <chisight> that generated code that works, but doesn't generate an eclipse project.
[02:33:30] <carabia> yeah, sw4stm32's eclipse with stm's preinstalled libs, arm-gcc, openocd and err gdb
[02:34:20] <chisight> i don't mean that project, i mean bare eclipse using nothing but tools included with eclipse or in the eclipse marketplace.
[02:35:40] <carabia> well of that i'm not sure. not sure how much their version differs from a vanilla version. If you make cubemx bundle all the libs, I don't think it's too hard to import it
[02:37:00] <chisight> there is a 3rd party python script that does the work. you create a blank eclipse project per the authors instructions and then run their import script and it brings in your cubemx export to sw4stm32.
[02:37:53] <carabia> well, i guess you can do it that way if you insist on a vanilla eclipse
[02:39:28] <chisight> i don't remember the precise reason for not using OpenSTM32, but i think it was something closed about that project.
[02:39:50] <carabia> though i ca't imagine why wouldn''t you be able to import the project with a vanilla eclipse
[02:39:53] <carabia> can't
[02:40:06] <carabia> and my fingers seem busted, can't type
[02:40:38] <chisight> there just isn't an option in eclipse at all.
[02:41:07] <chisight> no import function that even attempts to deal with cubemx
[02:42:12] <carabia> i'm actually interested enough to check that out. need to grab a copy of cubemx and vanilla eclipse
[02:43:12] <chisight> this is luna. mars didn't work yet.
[02:43:59] <carabia> i'm getting whatever is the latest in arch repos
[02:44:39] <carabia> gonna have to pop away anyway, letting them download as st's site is dying on me
[02:45:33] <chisight> eclipse.org isn't responding at all for me.
[02:48:13] <chisight> eclipse.org is back. neon still doesn't work. mars is supposed to work now, but wasn't in march when i tried. luna worked back then (and still works for me)
[02:50:54] <_ami_> chisight: using avr ecclipse plugin to build AVR projects?
[02:51:05] <carabia> _ami_: nah
[02:51:30] <chisight> _ami_: we're a bit off topic, this is stm32 with cubemx.
[02:51:33] <carabia> wait, that was a trap
[02:52:05] <_ami_> ah, ok
[02:53:22] <chisight> without hardware debugger support for atmega328p, i don't feel eclipse would offer a whole lot of value to me over vi and make.
[02:54:18] <chisight> and i can't afford a hardware debugger unless a client buys it. (via a paid project for avr)
[03:04:35] <Emil> chisight: it doesnt
[03:05:07] <Emil> and unless you program in assembly a hardware debugger is quite unnecessary
[03:06:18] <chisight> carabia: found the issue with why i don't use sw4stm32, aka System WorkBench, aka AC6, aka openstm32, aka sw4stm32. it requires registration.
[03:07:08] * inflex stays with vim + make still
[03:07:21] <inflex> but to be fair, never done a project over 16K
[03:07:32] <chisight> Emil: difference of opinion. i'm not saying that hardware debugging is necessary, i'm saying that support for graphical hardware debugging is all that eclipse brings to the table for me.
[03:07:52] <inflex> ( though I use vim for other massive projects, 250k LoC )
[03:09:25] <carabia> chisight: yeah not just that, but it integrates into the ide
[03:09:55] <carabia> but, it's sluggish as fuck. so therefore i haven't used eclipse in quite a while
[03:10:13] <chisight> sorry carabia, the Emil reply was about eclipse and avr. this is getting convoluted. we should probably not talk stm32 here.
[03:11:09] <carabia> feel free to head over to stm32, where they talk about well, just about everything else except the topic
[03:11:37] <chisight> i agree that eclipse is sluggish, but this rather old desktop still handles it pretty well.
[03:11:52] <carabia> I've got emil ignored so my comments might be a bit crossed at times
[03:12:57] <chisight> carabia: are you on a different nick in ##stm32?
[03:13:48] <carabia> I'm not there at all
[03:13:56] <chisight> heh
[03:14:53] <chisight> i went there to talk to you. :-p
[03:15:16] <carabia> too bad. the channel's not worth it
[03:15:34] <chisight> yeah, i've been there before and came to the same conclusion.
[03:19:25] <carabia> so yeah, can import into neon, but i haven't set up any toolchains yet, and you would have to modify the project file to use your toolchain instead of the one cubemx generates as that's probably closely tied to sw4stm32 configuration
[03:20:32] <carabia> ...probably
[03:21:03] <carabia> ...instead of the one cubemx suggests, rather than generates
[03:21:09] <chisight> neon doesn't run at all for me. the menus are so screwed up that it's not usable.
[03:24:48] <carabia> i just pulled the latest from arch repos, seems to be 4.6.2
[03:26:11] <chisight> i pulled from eclipse.org. maybe arch patched it to actually work.
[03:26:45] <carabia> don't know. commie stuff is so screwy, nahm sayin?
[03:26:56] <chisight> lol
[03:28:09] <carabia> so moral of the story here is, drop $5k and get keil and be done with it
[03:29:26] <chisight> um... i'll stick to luna for now. i don't have an active client project for any platform right now so nobody is going to pay for keil.
[03:29:59] <carabia> keil won't run on commie platforms, though
[03:31:03] <chisight> another reason i won't use them. not that i have 5k to spend on it.
[03:31:10] <carabia> anyway so it appears i should probably get on with something i am paid to do, rather than not
[03:31:19] <carabia> so, catch ya later
[03:31:30] <chisight> yeah, i probably should sleep. have a better one.
[06:00:46] <Emil> carabia: wtf, what did I do to you, now
[06:06:47] <Haohmaru> guilty by default
[06:07:18] <_ami_> what did he do?
[06:13:18] <Emil> Well, whatever
[09:34:40] <rue_house> why, in an age of 3Ghz computers, is a TEXT EDITOR considered sluggish?
[09:36:02] <rue_house> I really need to finish my editor one day
[09:39:30] <rue_house> oh bugger close sourced the keyboard library
[09:46:22] rue_house changed topic of #avr to: 8 bit atmel microcontrollers. suggest a hilight for the day to Rue_house. Todays hilight: http://www.ablab.in/line-follower-robot-with-avr-atmega16-microcontroller-using-analog-ir-sensor/
[10:02:29] <carabia> rue_house: eclipse is an IDE, not merely a text editor. There's actually a world of difference
[10:03:05] <specing> use GNU Emacs
[10:04:07] <carabia> yeah... i like to have just a single operating system
[10:05:08] <carabia> i imagine with that webkit integration someone's doing you can get emacs pretty fucking sluggish too
[10:07:10] <rue_house> sorry, its a text editor
[10:08:25] <carabia> well it is, and more
[10:24:41] <skz81> Leviator >> and what if your OTA update fails ? You end with a remote device that can't reboot or even not return in OTA/flash mode....
[10:25:21] <skz81> esp8266 has a special flash mapping for that
[10:26:42] <skz81> with room for current version AND next one. When doing OTA current version downloads the next into the dedicated zone, checks the sum/validty whatever and only then, updates the boot/app startup address
[10:29:10] <skz81> there is NOTHING like that natevly in AVR, you may need an external flash or something. Or at least the assurance that if one update fails the device can reboot and retry
[10:34:26] <glagnar37> i use an atmega2560 for my boards and since my code size generally comes in fairly small, before doing a firmware update i copy the old firmware to the second half of progmem
[10:34:39] <glagnar37> if the firmware update fails, restoring the original is possible
[10:35:33] <glagnar37> my updates are done via usb though and are a bit more stable than an ota update
[10:42:01] <LeoNerd> Oopsie. ATtiny13 does not like 30V. Nor does a WS2812
[11:05:32] <Lambda_Aurigae> skz81, actually, if you are using a bootloader, so long as it does not rely on the main program to initiate the bootloader, then yes, the AVR has that failback ability.
[11:05:49] <Lambda_Aurigae> usually the bootloader does not overwrite itself and has an external trigger of some sort....
[11:06:09] <Lambda_Aurigae> bootloader starts first, checks for trigger condition, then either bootloads or falls through to the main program.
[11:07:53] <skz81> Lambda_Aurigae, my point was more about the "data line", can it restarts as well ? If it's some radio bitstream that cycles every N seconds, OK, just wait the next cycle
[11:08:41] <skz81> but if the source "believe" the device is updated while it is not, it will lead to uncomfortable situations ;°)
[11:08:45] <Lambda_Aurigae> that's all in error correction of your incoming data.
[11:09:02] <Lambda_Aurigae> which is necessary to build into the bootloader system.
[11:09:19] <Lambda_Aurigae> gather a block of data, verify it with crc or some other method, then write to flash.
[11:09:51] <Lambda_Aurigae> one way I've seen is every byte is sent first forwards then backwards then an xor of the two...
[11:10:13] <Lambda_Aurigae> if any of the 3 bytes don't match then you ask for a resend.
[11:11:05] <skz81> here you garanty integry of data but not completeness ! anyway, I was just meaning : <<when you do OTA you have to think of "what if it goes wrong while I'm actually NOT physically here">>
[11:11:39] <Lambda_Aurigae> watchdog to restart the machine back into bootloader mode.
[11:11:42] <carabia> it is important to garanty integry
[11:12:14] <Lambda_Aurigae> you know how many bytes you need to send..you tell the bootloader that's how many it's supposed to get...if it gets anything different,,,ask for resend!
[11:12:19] <skz81> carabia, yes but not only. The start of of binary code is rarely operational without the end :p
[11:12:36] <carabia> Lambda_Aurigae: are you am like garanty integry??
[11:12:43] <skz81> ask for resend! >> can you even ? You have to yhink of that
[11:13:19] <carabia> skz81: do you even garanty integry?
[11:13:34] <skz81> guarantee integrity ok
[11:13:45] <skz81> you guys !
[11:14:08] <skz81> carabia, by myself, I don't
[11:14:58] <carabia> Lambda_Aurigae: you should not be loitering in irc, you should be witnessing your nation finally getting its bearings back after too many years of neg... cough i mean...
[11:16:40] <carabia> woah i almost said negro. i meant nigger
[11:17:54] <carabia> damn, was thinking out typing again. Sorry
[11:18:57] <Lambda_Aurigae> That's gonna happen whether I watch or not.
[11:19:47] <carabia> but you'll have a story to tell. -- "I was there, when the world started to heal"
[11:20:02] <Lambda_Aurigae> yeah, right.
[11:20:44] <carabia> now let's just hope he'll strike a deal with the russians and leaves this silly band of dipshits called the EU embarrassed with their pants down
[11:20:47] <Lambda_Aurigae> I'll give him a chance. Nothing else I can do other than attempted assassination, but I don't feel like doing the jail time.
[11:24:04] <carabia> this is simply amazing in every prospect.
[11:24:53] <carabia> to me naturally the possible implications on EU are the most interesting bit
[11:27:05] <Lambda_Aurigae> you think he would actually bomb the EU for pissing on his cornflakes?
[11:32:06] <carabia> eu's not pissing in his flakes, and no he wouldn't bomb it. the question is directly not one of the eu. it is of russia
[11:33:03] <carabia> and the question is not of bombing anything, really. don't twist my words
[11:38:47] <kre10s_> has anyone ever implemented a buck/boost converter in software?
[11:39:35] <kre10s_> well. not the actual converter obviously, but the controler.
[11:41:13] <Lambda_Aurigae> kre10s_, yes...several people have....
[11:41:28] <Lambda_Aurigae> not me specifically, but I saw it on hackaday or one of those sites a while back.
[11:41:34] <Lambda_Aurigae> they used a PIC though.
[11:41:43] <carabia> real question is where does a need for such an idiotic idea stem from, though
[11:43:00] <Lambda_Aurigae> to learn how it works maybe?
[11:43:04] <Lambda_Aurigae> or, for the fun of it.
[11:43:30] <carabia> fun means do your own homework
[11:43:41] <carabia> so does the first option, though, too
[11:47:47] <kre10s_> Take a chip like the LTC3789. really cool. 4-38v input 12v output. now what I want to do is switch the input and output pins. or... reverse the controler.
[11:49:37] <kre10s_> basically buck/boost in either direction.
[11:50:33] <Lambda_Aurigae> that's gonna require more than just switching things around in a processor.
[11:50:49] <Lambda_Aurigae> two complete circuits more or less.
[11:51:05] <Lambda_Aurigae> or one boost/buck converter with an H-bridge type switch around it.
[11:54:25] <kre10s_> right. but since the buck boost converter already has 4 fets in it. I wanted to avoid adding more fets. theoretically the buck boost topology should be reversable.
[11:55:21] <Lambda_Aurigae> if you say so.
[11:55:34] <Lambda_Aurigae> that's black magic almost as bad as RF.
[11:56:13] <kre10s_> rf?
[11:59:43] <Lambda_Aurigae> Radio Frequency
[12:00:00] <Lambda_Aurigae> Radios...making things talk at a distance...the blackest of black magic!
[12:03:28] <skz81> I really doubt you can "reverse" (most of) buck/boost converter
[12:03:49] <skz81> anything that works a bit like a SMPS, even
[12:04:03] <kre10s_> why?
[12:04:18] <skz81> look how SMPS works
[12:05:24] <cehteh> there are switching circruits which are symetrical
[12:05:29] <cehteh> but normal ones are not
[12:06:06] <cehteh> https://en.wikipedia.org/wiki/%86uk_converter
[12:06:08] <kre10s_> buck boost _is_ symetrical. Asumming that the controler has it's own power supply... I don't see why not.
[12:06:25] <cehteh> err damn
[12:06:34] <cehteh> https://en.wikipedia.org/wiki/%C4%86uk_converter
[12:09:39] <carabia> I have always wondered how cuck converters work
[12:09:54] <cehteh> on another thing i was once thinking about a avr massaging its own voltage
[12:11:27] <kre10s_> like with a divider?
[12:12:22] <kre10s_> well.. looks like it's going to be two circuits. anything else is either more work or silly.
[12:12:58] <Lambda_Aurigae> feed 5V in...use a variable voltage regulator to cut it down to 3.3V....at the same time, control an external clock source...so when you run at 1MHz you can drop the voltage....if you need more speed, kick up the voltage then kick up the speed!
[12:14:08] <Lambda_Aurigae> or feed 3.3V and boost it to 5V when you need to up clock speed.
[12:21:23] <cehteh> with fet/lc as input, the challenge is to kickstart the bootup
[12:23:05] <Lambda_Aurigae> supercap!
[12:23:16] * Lambda_Aurigae shrugs as he has no clue where he pulled that one out of.
[15:36:19] <Jan-> hihi avr people
[15:47:31] <Lambda_Aurigae> hello Jan-
[15:49:23] <Jan-> oh hey lambda
[15:49:30] <Jan-> I'm trying to figure out how to get SPI going on this atmega328.
[15:49:40] <Jan-> I shall bother you if I get stuck. In the meantime, have a little cake.
[15:49:45] * Jan- offers Lambda_Aurigae a little cake
[15:50:15] <Lambda_Aurigae> I'm diabetic
[15:50:27] <Jan-> It's virtual.
[15:50:37] <Jan-> Zero carbohydrate exchange.
[15:53:41] <Jan-> when people are are using 1<<DDB5, are the DDB constants set to just... er.... well, five, in that case?
[15:54:22] <bss36504> yup
[15:54:33] <Jan-> so instead of, say, DDRB |= (1<<DDB5) | (1<<DDB3) | (1<<DDB2);
[15:54:51] <Jan-> I could just DDRB |= 0b00110100
[15:54:52] <bss36504> DDB5 is sort of a trivial example, but when you have some sort of weirdly-named bit, like in a timer, it's easier to read
[15:55:00] <bss36504> but yes, that would work too
[15:55:12] <Jan-> there's also SPCR |= (1<<SPE) | (1<<MSTR);
[15:55:13] <Jan-> teehee
[15:55:22] <bss36504> Yeah, so that, to me, reads easier
[15:55:48] <Jan-> it says I have to set up the timing too
[15:55:50] <Jan-> SPE just enables SPI
[15:55:55] <Jan-> MSTR sets it to be a master, I guess.
[15:56:00] <Jan-> is the timing implicit
[15:56:10] <bss36504> The timing is set via the prescaler value
[15:57:13] <Jan-> this guy's example says "enable spi, master, set clock rate fck/16" followed by just those two bit shifts
[15:57:21] <Jan-> is 16 the default or something
[15:57:33] <bss36504> Yeah, so that third clause is in reference to the prescaler value
[15:57:42] <bss36504> Theres a table in the datasheet
[15:57:55] * Jan- headscratch
[15:57:56] <Jan-> OK wait one
[15:58:22] <Jan-> to be fair this is atmega88 code and I'm on a 328
[15:58:28] <Jan-> but it seems to be the same, at least for SPI
[15:58:58] <bss36504> Page 167-168
[15:59:42] <bss36504> In the SPCR register, the SPR1:0 bits control the SPI clock rate based on the values indicated in table 19-5
[15:59:55] <bss36504> 19-5 is on page 168, SPCR is on 167
[15:59:56] <Jan-> I'm looking at http://www.atmel.com/Images/Atmel-2585-Setup-and-Use-of-the-SPI_ApplicationNote_AVR151.pdf but it's a bit screenreader unfriendly
[16:00:13] <bss36504> Look at the datasheet for the chip: http://www.atmel.com/images/Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet_Complete.pdf
[16:00:21] <Jan-> sure I have it open already
[16:00:41] <Jan-> I'm confused by the fact that the example code mentions setting the prescaler, but doesn't seem to do it, that's all
[16:01:17] <Jan-> seems to need (1<<SPR0) too
[16:01:26] <bss36504> Ok, check out those pages in the DS though. The App notes are kind of sparse on details usually, they only provide a rough outline on how to set stuff up sometimes.
[16:01:55] <bss36504> yes the 1<<SPR0 into SPCR would be correct for a SPI clock of fcpu/16
[16:01:56] <Jan-> these data direction register assignments... does DDB1 DDB2 imply that those constants only work for DDRB? I mean, 5 is 5
[16:02:12] <bss36504> no technically it would also work for other ports
[16:02:17] <bss36504> they're just #defines
[16:02:24] <bss36504> not any particular intelligence behind them
[16:02:35] <Jan-> so PORTB |= (1<<DDB2); would set PB2 high.
[16:02:48] <bss36504> But for readability I would suggest not doing something like DDRA | = (1<<DDB1)
[16:02:51] <bss36504> yes, that would be fine
[16:02:56] <bss36504> just ugly looking haha
[16:03:11] <Jan-> well, it's in nrf_init so hey
[16:03:27] <bss36504> ew
[16:03:34] <Jan-> ew/
[16:03:42] <bss36504> these atmel Applications/Systems engineers shouldnt get away with this
[16:03:59] <bss36504> At my last company, our Systems Engineers would make like $500 for writing app notes
[16:04:08] <bss36504> but they were actually helpful
[16:04:13] <Jan-> what's up
[16:04:19] <bss36504> Atmel app notes are hit or miss.
[16:04:42] <bss36504> huh?
[16:04:48] <Jan-> and to clear a bit I'd, er, PORTB &= ~(1<<DDBx)?
[16:04:55] <bss36504> yeah
[16:05:04] <bss36504> that is correct
[16:05:21] <Jan-> just like normal C
[16:05:25] <Jan-> mmkay
[16:05:30] * Jan- can do this! Jan- can do this!
[16:05:53] <bss36504> It's 100% normal C
[16:06:02] <Jan-> C with this many bit shifting operations is not normal. :)
[16:06:15] <bss36504> Well...it is in embedded
[16:06:29] <bss36504> "here at atmel, we strive to bring some normalcy to your normal C"
[16:06:40] <Jan-> I'm a javascript person.
[16:06:44] <Jan-> Normal C seems primitive to me.
[16:06:48] <Jan-> This seems...
[16:06:51] <Jan-> ...clockwork?
[16:07:09] <bss36504> ew, js is gross, buddy
[16:07:20] <Jan-> I make no excuse for most javascript
[16:07:31] <Jan-> it is *possible* to write nice javascript. I strive to :)
[16:07:35] <bss36504> I'm just unnecessarily biased towards most web languages though :)
[16:07:44] <Jan-> I've also done some C#
[16:08:26] <Jan-> can I ask a weird figurative quetsion
[16:09:27] <bss36504> sure
[16:09:40] <Jan-> most people seem to write functions called spi_send and spi_receive
[16:10:00] <Jan-> whereas from what I've read about it, spi_transact or spi_rw would be more, er, representative
[16:10:11] <kre10s_> Jan-: just out of curiosity... are you using an nrf905?
[16:10:24] <Jan-> no, an nrf24l01.
[16:10:31] <bss36504> yeah, spi_transfer is pretty common also.
[16:10:37] <kre10s_> Jan-: I write only one function for spi.. uint8_t spi_byte(uint8_t b);
[16:10:53] <Jan-> is it normal to just busy-wait with while(!(SPSR & < (1<<SPIF)));
[16:11:11] <Jan-> or is there a thing_done interrupt
[16:11:21] <bss36504> spi_send and spi_recieve are usually just convenience wrappers around a transfer function of some kind. spi_send would just be: return spi_transfer(0);
[16:11:22] <Jan-> oh I made it unsigned char, but yes.
[16:11:57] <bss36504> I'd get into the habit of using the uintx_t types, also
[16:12:11] <Jan-> oh. more portable?
[16:12:16] <bss36504> yeah
[16:12:23] <bss36504> and again, conveys your intention better
[16:12:40] <bss36504> "this function sends/receives exactly one byte"
[16:12:44] <Jan-> I see.
[16:12:50] <Jan-> there's no hardware buffering on the SPI, then
[16:13:04] <Jan-> if I want to send 10 bytes, I send one, busy wait until it's done, then rinse and repeat?
[16:13:06] <bss36504> well there is, until you read from the SPDR register
[16:13:11] <bss36504> yes
[16:13:12] <bss36504> correct
[16:13:18] <Jan-> ooh, primitive :)
[16:13:24] <Jan-> this is like, Z80 primitive
[16:15:44] <Jan-> aww isn't avrdude polite
[16:17:43] * Jan- patpats avrdude on the head like a playful puppy
[16:19:47] <Jan-> er. Why isn't uint8_t declared in this scope?
[16:19:52] * Jan- pokes at gcc with a sharp stick
[16:20:13] <bss36504> #include inttypes.h
[16:20:38] <Emil> rather use stdint
[16:20:46] <bss36504> yup just about to correct myself
[16:20:47] <bss36504> sorry
[16:20:49] <Emil> inttypes is full of things youbdont use
[16:20:50] <bss36504> stdint
[16:21:00] <Jan-> bear in mind this is in the arduino IDE, I'm just not using the arduino code.
[16:21:06] <Jan-> so I guess this may be a real ale C thing
[16:21:25] <Emil> Jan-: the ide doesnt include its shit if you code in pure Avr C
[16:21:33] <Jan-> ohdear.
[16:21:35] <bss36504> Why do people insist on using the arduino "IDE"
[16:21:43] <Emil> bss36504: it is convenient
[16:21:43] <Jan-> TOTA.
[16:21:45] <Emil> for soma
[16:21:47] <Emil> some*
[16:22:20] <bss36504> Eh, hardly IMO. If youre going to use that hunk of shit, why not just use a text editor and the command line? And this is from me, a guy who likes his IDEs.
[16:22:24] <carabia> javascript is great and performant language which is concise and consistent throughout
[16:22:30] <carabia> ...
[16:22:35] <Jan-> jesus it is?! :D
[16:22:35] <Emil> it is not about text editing
[16:22:43] <Emil> it is about the tools integrated
[16:22:47] <bss36504> I use atmel studio. I would rather use notepad and a command line before the arduino IDE
[16:22:51] <bss36504> yeah what tools?
[16:22:53] <Jan-> yeah it's not great
[16:22:57] <Jan-> what I really want is visual studio
[16:22:58] <Jan-> but eh.
[16:23:05] <Jan-> visual studio ftw etc
[16:23:12] <carabia> yes totally, i would program my microcontrollers in nodejs if i could
[16:23:13] <Emil> >atmel studio
[16:23:13] <bss36504> a compiler? An avrdude wrapper? so fucking what lol
[16:23:18] <Emil> look who's talking d
[16:23:20] <Emil> :D
[16:23:22] <carabia> im working on a nodejs interpreter as we're speaking
[16:23:22] <bss36504> Jan-: Just use Atmel studio. Its based on Visual Studio
[16:23:42] <Emil> Ooor
[16:23:44] <Jan-> errr, how do I include inttypes.h
[16:23:48] <Jan-> I'm not sure the arduino distribution even has it
[16:23:50] <Emil> ...
[16:23:52] <bss36504> no no, use stdint.h.
[16:23:56] <bss36504> inttypes was my mistake
[16:23:58] <Emil> #include <libraryname>
[16:24:10] <Jan-> yeah, I know, but the file has to exist
[16:24:26] <bss36504> well if it's in the search path of the compiler it should find it
[16:24:28] <carabia> javascript is specced by some retarded reality-alienated monkeys/niggers (redundant, i know) who insist on backwards compatibility and what not... well it's web again. Good shit.
[16:24:33] <Emil> It came about when you installed your compiler
[16:24:35] <Emil> and libc
[16:24:37] <Emil> and bintools
[16:24:40] <Jan-> hohoho
[16:24:54] <Jan-> do I want stdint.h, inttypes.h, or what
[16:25:01] <bss36504> stdint
[16:25:02] <Emil> Jan-: yli have programmed in C before, roght?
[16:25:02] <carabia> and also if C is too "primitive", do the specing and go Ada. I hear it's amazing
[16:25:29] <Jan-> I quite like the primitive...ness
[16:25:31] <Emil> Jan-: are you even listening to whay bss36504 and I are saying? :D
[16:25:32] <bss36504> I'm such a microcontroller elitist that I only use template metaprogramming in C++
[16:25:38] <bss36504> Emil: lol
[16:28:25] <Jan-> emil yeah, I'm just also trying to fix the problem
[16:28:28] <Jan-> I think I got it
[16:28:31] * Jan- hammers on GCC with mallet
[16:29:07] <Emil> Jan-: if you want "low level" you can look at the end of emil.fi/avr
[16:29:07] <Jan-> _delay_us() seems to be available, which is good.
[16:29:10] <Emil> ...
[16:29:14] <Emil> Jan-: pls
[16:29:26] <Emil> Jan-: have you programmed in C before?
[16:29:32] <Emil> Or c++?
[16:29:41] <Emil> Or what have you programmed in before?
[16:30:11] <Jan-> I have a bit of C. Loads of javascript, a bit of C#
[16:30:25] <Emil> This is important because you seem to be doing a FUCKTON of silly things
[16:30:53] <Jan-> I'm a beginner. Sue me.
[16:30:57] <Emil> Jan-: okay first of all, the libraries that are available, if you #include them, are list...
[16:31:00] <Emil> .......
[16:31:06] <Emil> Jan-: do you want help or not?
[16:31:30] <Jan-> Er... well, maybe, I think I'm doing OK right now.
[16:31:35] <Emil> If you want to shoot yourself we wont stop you
[16:31:39] <specing> Jan- doesen't know C. SAD!
[16:31:48] <Jan-> I'm about to actually try reading a register via SPI. If it doesn't work, I may end up bug fixing.
[16:32:03] <carabia> shit this is exciting
[16:32:06] <bss36504> Look. Im the best at C. Just ask anyone. Truly I am.
[16:32:08] <Emil> But from experience I can tell you that it is much more effective to listen
[16:32:19] <Emil> And stop doing silly things
[16:32:20] <carabia> can confirm. bss is a fucking god
[16:32:44] <bss36504> you know it, I know it, everyone knows it. My programs are YUGE.
[16:32:54] <bss36504> you know who has bad code? JINA
[16:33:09] <Emil> Jan-: so do you want us to give you help or not?
[16:33:11] <bss36504> (that's china for those of you who don't speak Trump)
[16:33:21] <carabia> rumor has it the yugeness of his programs is only matched by his penis.
[16:33:31] <bss36504> lol
[16:33:32] <bss36504> I gotta go home. See you all monday
[16:33:39] <Jan-> Emil: Erm... well, no, not right now. We'll see.
[16:33:41] * bss36504 ...out
[16:33:41] <Emil> bss36504: see ya
[16:33:45] <Jan-> nini bss
[16:33:49] <carabia> ...
[16:33:53] <carabia> boring
[16:34:19] <Emil> carabia: perhaps if you unignored me we could have some fun ;);)
[16:34:41] <Emil> (Still salty for not knowing what you ignored me for)
[16:36:10] <Jan-> ohdear this isn't working right.
[16:37:08] <kre10s_> lol.
[16:38:27] <Jan-> ah. wrong pin.
[17:02:22] <Jan-> why do some of these examples set the SPI SS pin as output, and some don't
[17:12:42] <kre10s_> Jan-: no idea. but probably because they don't need it. like in master mode, they may use a different pin. or in slave mode in which case it is an input not an output.
[17:12:52] <Jan-> Hmm.
[17:13:13] <Jan-> Well, my code isn't behaving as expected. And I'm sure the electronics are right, because if I run an arduino library and have it send stuff to anotehr radio module, it works.
[17:14:17] <Jan-> Right now, when I read the SPI I/O register "SPCR" I get either 0, 255, or very rarely something like 3.
[17:14:21] <Jan-> What I expect is 14.
[17:16:22] <Jan-> Aha! fixed it!
[17:16:25] * Jan- is a genius
[18:16:30] <Jan-> can I actually have a 40 bit number, or do I just need to send five uint8_ts in an array
[18:16:43] <specing> the former
[18:17:09] <Jan-> so I can have foo = 0x123456ABCD
[18:17:30] <Jan-> what on earth type is that
[18:17:41] <specing> well actually you can only have a 64-bit number
[18:17:47] <Lambda_Aurigae> uint_64t?
[18:17:56] <specing> unlike Ada, C cannot give you arbitrary bitness numbers
[18:18:08] <Jan-> boo
[18:18:14] <Lambda_Aurigae> err..uint64_t
[18:18:20] <Jan-> uint40_t?
[18:18:22] <Jan-> :D
[18:18:29] <Lambda_Aurigae> that's not predefined.
[18:18:38] <Jan-> I'll just use int foo[5]
[18:18:45] <Jan-> these radio modules use a 40 bit address
[18:18:53] <specing> type I is Integer range 0..2**40-1; -- Ada
[18:19:02] <specing> for A'Size use 40;
[18:19:16] <Lambda_Aurigae> http://www.atmel.com/webdoc/AVRLibcReferenceManual/group__avr__stdint_1gad27ed092432b64ff558d2254c278720f.html
[18:19:18] <Jan-> it's just that C is a bit backward about passing arrays into functions.
[18:19:21] <Jan-> Which smells, by the way.
[18:19:58] <Jan-> I suppose I could just have void setRadioAddress(byte address1, byte address2...
[18:20:00] <Lambda_Aurigae> you pass an array as a pointer.
[18:20:07] <Jan-> Yes, but pointers smell worse.
[18:20:18] <Lambda_Aurigae> they work just fine for me.
[18:20:25] <Jan-> yeah, but.
[18:20:29] * Jan- wrinkles her face
[18:20:30] <Lambda_Aurigae> but, I've been using them for 30ish years.
[18:20:43] <Lambda_Aurigae> so, go back to javascript.
[18:20:52] <Lambda_Aurigae> or Ada
[18:20:58] <Jan-> I also couldn't find a way to return an array from a function without calling it unit8_t *myfunct(...)
[18:22:53] <Lambda_Aurigae> put the array in a struct
[18:22:56] <Lambda_Aurigae> you can return a struct
[18:23:20] <Jan-> the only reason there are even structs in C# is for interop with unmanaged code, y'know.
[18:23:36] <Lambda_Aurigae> yeah, so?
[18:23:49] <Jan-> although!
[18:23:57] <Jan-> I did write a struct object for javascript, so I could more easily write wave files with it.
[18:24:04] <Lambda_Aurigae> we were using structs before C# was a fart bill gates' toilet.
[18:24:23] <Jan-> Yeah, you can tell, by the way all the documentation is bound in triceratops hide :)
[18:25:36] <Lambda_Aurigae> also did early object oriented development using structs as an early class-like container for functions and variables and all that.
[18:25:50] <Jan-> yes I did sort of get structs as a proto-object
[18:26:18] <Jan-> rather like homo erectus is a sort of proto-human :)
[18:26:56] <Lambda_Aurigae> so, if you don't like C, use something else.
[18:27:09] <Jan-> well it seems appropriate to an 8 bit microcontroller that goes at 16 mhz.
[18:27:19] <Jan-> but I'm going to keep snickering at how 1970s it is :)
[18:27:33] <Lambda_Aurigae> it still works.
[18:27:46] <Jan-> setting switches on the front panel and pressing a CLOCK button works.
[18:27:53] <Lambda_Aurigae> yup.
[18:27:55] <Lambda_Aurigae> have done that.
[18:27:58] <Lambda_Aurigae> with an AVR actually.
[18:27:59] <Jan-> Woah.
[18:28:03] * Jan- carbon-dates Lambda_Aurigae
[18:28:12] <Lambda_Aurigae> and with a TI-980B dual processor mini
[18:28:38] <Jan-> you know there's a youtube video where some guy builds an 8 bit CPU out of logic gates.
[18:28:40] <Lambda_Aurigae> I built an avr programmer with debounced switches and buttons once just to prove to myself that I could.
[18:29:00] <Jan-> the primary deciding factor in how many instructions it would have appeared to be "how many nand gate chips have I got"
[18:29:02] <Lambda_Aurigae> my 3rd computer was a homemade 4-bit unit made from logic gates.
[18:29:09] <Lambda_Aurigae> yupyup.
[18:29:32] <Jan-> you'd approve of a fun side project we have
[18:29:50] <Lambda_Aurigae> my parts came from old logic boards that were going to be thrown away by a xerox repair tech,,,in the early 80s.
[18:29:53] <Jan-> someone wanted to make a replica star trek phaser prop and needed a 16 led bar graph display, with "up" and "down" buttons, for the power setting.
[18:30:00] <Jan-> And the challenge was: do it in discrete logic.
[18:30:11] <Jan-> we got it down to four chips.
[18:30:12] <Lambda_Aurigae> doable.
[18:30:37] <Jan-> one oscillator/counter, one four to 16 decoder, one 4 bit magnitude comparator and one 4 bit up/down counter.
[18:30:39] <Lambda_Aurigae> depending on what chips you have, I can imagine less than that.
[18:30:46] <Lambda_Aurigae> maybe 3....maybe...
[18:30:57] <Jan-> it's tricky to make it not over and underflow. you want it to stop at the top and bottom.
[18:31:11] <Lambda_Aurigae> yeah...that would be a problem with only 3.
[18:31:28] <Jan-> we're pretty sure you can do that with the underflow and overflow outputs on the up/down counter, since they're delayed 2 gate delays.
[18:31:30] <Lambda_Aurigae> but overflow/underflow could be fed back to stop the counter.
[18:31:36] <Jan-> so you can use them to do a parallel load and a reset respectively.
[18:31:56] <Jan-> but it might be a bit dicey timing wise.
[18:32:27] <Jan-> then you magnitude compare the oscillator/counter and the up/down counter, and when one's bigger'n the other, you blank the LEDs.
[18:32:35] * Jan- thought this was quite crafty
[18:32:37] <Lambda_Aurigae> my 4-bit computer had an 8x8 pixel display even....memory mapped video even.
[18:33:09] <Jan-> did you use static ram chips, or did you just use lots of latches
[18:33:34] <Lambda_Aurigae> I put LEDs on 16 4-bit memory locations that were done with flipflops made from nand gates.
[18:33:50] <Jan-> woah, you're dedicated.
[18:34:01] <Lambda_Aurigae> the rest of the memory was done with flipflop chips.
[18:34:05] <Jan-> plan B on the bar graph was some sort of left/right shift register. but most of those seemed to be four bits wide only.
[18:34:16] <Jan-> so you'd need heaps
[18:34:38] <Lambda_Aurigae> hey, I powered it with a 10A car battery charger...probably overkill but it was the only thing I had to power that many TTL chips...
[18:34:55] <Jan-> most of the chips we found were 75LSxxxx
[18:35:00] <Jan-> so they'd be fairly low power I think
[18:35:11] <Jan-> but the counter/oscillator one was a what, 4060?
[18:35:22] <Lambda_Aurigae> consider what I was working with...74 series from the late 70s/early 80s.
[18:35:24] <Jan-> maybe there's a 74 series chip.
[18:35:39] <Jan-> do you happen to know if there is a 74 series counter/oscillator like a 4060?
[18:36:13] <Jan-> I mean we could use any oscillator and then just a 4 bit counter, but that's another chip
[18:36:18] <Lambda_Aurigae> http://www.onsemi.com/pub_link/Collateral/MC74HC4060A-D.PDF
[18:36:37] <Jan-> Oh. they made a non-mos one?
[18:36:50] <Lambda_Aurigae> drop in compatible apparently.
[18:36:58] <Jan-> better on battery power I guess
[18:37:53] <Jan-> If you happened to know of a 16 output serial to parallel shift register that goes left *and* right, we can probably do it in one chip :)
[18:38:45] <Jan-> why is everything from the late 70s four bits wide, anyway
[18:39:11] <Lambda_Aurigae> because things back then were all 4 bit.
[18:39:25] <Lambda_Aurigae> people didn't think in 16 or 32 or 64 bit mode.
[18:39:28] <Lambda_Aurigae> it was too massive.
[18:39:47] <Jan-> but even then, these four bit things only have about 20 gates on them or something
[18:40:05] <Jan-> I guess they didn't have double digit nanometer manufacturing then
[18:40:21] <Lambda_Aurigae> nope.
[18:40:29] <Lambda_Aurigae> micrometer was closer to it.
[18:40:34] <Jan-> are these things still made or are we all buying new old stock
[18:40:39] <Lambda_Aurigae> yes
[18:40:44] <Jan-> I notice some of them are getting very expensive
[18:40:51] <Lambda_Aurigae> some are still made..just new tech versions.
[18:41:06] <Lambda_Aurigae> most discreet logic has been replaced with microcontrollers really.
[18:41:16] <Jan-> well yes.
[18:41:28] <Lambda_Aurigae> but TI still makes a lot of discreet stuff.
[18:41:29] <Jan-> although I think you would actually struggle to drive sixteen LEDs with an atmega328.
[18:41:34] <Lambda_Aurigae> nope.
[18:41:39] <Lambda_Aurigae> no problem at all.
[18:41:49] <Jan-> I'm thinking current
[18:41:50] <Lambda_Aurigae> maybe not real bright, but no problem.
[18:41:53] <Jan-> ...yeah.
[18:41:59] <Jan-> yay charlieplexing!
[18:41:59] <Lambda_Aurigae> or, alternate them.
[18:42:11] <Jan-> to be fair our discrete design would be 1:16 multiplexing.
[18:42:19] <Lambda_Aurigae> I've run 64 LEDs with an atmega32.
[18:42:53] <Lambda_Aurigae> cycling through 8 rows of 8 at a time.
[18:42:58] <Jan-> oh I'm being told that one prop we made had an atmega168 in it running a 17-led linear feedback shift register (loved by sci fi prop people) and the modern leds were so powerful they were run at 1 milliamp each anyway.
[18:43:01] <Lambda_Aurigae> didn't even use drive transistors.
[18:43:37] <Lambda_Aurigae> although I usually use uln2008 for driving bright LEDs like that.
[18:43:45] <Jan-> we use those too.
[18:44:00] <Jan-> the big problem we have is output control, for movie props where you can't strobe them
[18:44:04] <Lambda_Aurigae> heat sink them and you can drive a truck starter with one...or twenty..
[18:44:04] <Jan-> it's quite hard
[18:44:35] <Lambda_Aurigae> that's why to use the uln2008...
[18:44:41] <Lambda_Aurigae> 8 LEDs per.
[18:44:49] <Lambda_Aurigae> they can handle the current and then some.
[18:44:51] <Jan-> well yes, but you can't have proper DC intensity control.
[18:45:06] <Jan-> you end up needin filtered PWM to some sort of current source arrangement.
[18:45:15] <Jan-> I'm not sure if a uln chip could help with that. maybe.
[18:45:19] <Lambda_Aurigae> PWM with a cap across the LED
[18:45:29] <Jan-> you can do that but that's a big cap
[18:45:48] <Lambda_Aurigae> with modern tech, it's not so much.
[18:46:04] <Lambda_Aurigae> they've gotten physically smaller of late.
[18:46:27] <Jan-> I wonder if a uln2008 would be usable as a driver using filtered pwm, are they designed to handle digitally signals or will they follow linearly
[18:46:51] <Lambda_Aurigae> they are nice transistor darlington pairs...
[18:47:07] <Jan-> mmmmnnn.
[18:47:14] <Lambda_Aurigae> grr..
[18:47:16] <Lambda_Aurigae> 2803
[18:47:17] <Jan-> we actually ordered a great box of those things.
[18:47:18] <Jan-> for movie props.
[18:47:22] <Lambda_Aurigae> where the heck did I pull 2008?
[18:47:28] <Jan-> er, I thought it was 2008
[18:47:31] <Lambda_Aurigae> uln2803
[18:47:45] <Jan-> well, there's a 2003
[18:47:51] <Lambda_Aurigae> yeah.
[18:47:57] <Lambda_Aurigae> I'm thinking three different things.
[18:48:04] <Jan-> half an amp at 50 volts
[18:48:06] <Jan-> they really kick ass
[18:48:18] <Jan-> people use them to make stepper motor drivers too
[18:48:26] <Lambda_Aurigae> 2803 is darlingtons with hard switching.
[18:48:34] <Lambda_Aurigae> yeah..that's where I use them mostly.
[18:48:42] <Lambda_Aurigae> driving 24V steppers from copiers.
[18:48:54] <Jan-> do they have logic on the inputs, or could you treat them as linear devices
[18:49:34] <Lambda_Aurigae> uln2003 was the 7 gate version.
[18:49:49] <Lambda_Aurigae> I think they are logic gate fed darlington switches.
[18:49:50] <Jan-> I think those are the ones we got
[18:49:54] <Jan-> for driving 7 segment displays
[18:50:02] <Lambda_Aurigae> on/off...no linear for that.
[18:50:05] <Jan-> hmm.
[18:50:16] <Jan-> once you get into filtering pwm and driving transistors it all gets a bit unreliable and hairy
[18:50:58] <Jan-> this is why I started looking at C, normally for movie props you're just doing blinkenlights so obviously, you just do it in arduino.
[18:51:19] * Lambda_Aurigae cringes
[18:51:40] * Jan- shows Lambda_Aurigae several schedules of costs for movie props
[18:51:42] <Jan-> Cringe more.
[18:51:46] <Jan-> Speed is of the essence.
[18:52:22] <Lambda_Aurigae> I can develop on bare hardware with C just as fast as people do on the arduino platform.
[18:52:43] <Jan-> The problem was that people started saying "ooh, you can do insert-cute-display-type really cheap now" and we'd have to say, er, no, it's going to flicker unless we take special measures.
[18:52:52] <Lambda_Aurigae> with much less overhead, so can run the processor slower and get the same results usually.
[18:53:38] <Jan-> someone used one of those cheap chinese seven segment display boards on a movie
[18:53:40] <Jan-> it flickers like crazy
[18:54:00] <Lambda_Aurigae> I worked with someone online,,,something like 8 or 10 years ago,,,maybe in here, doing display thingies for movie props.
[18:54:16] <Jan-> might even have been me, if it was 6 years ago
[18:54:18] <Lambda_Aurigae> doing syncronized displays so they didn't flicker.
[18:54:28] <Jan-> this project is a movie strobe light.
[18:54:42] <Jan-> we have to figure out how to make an AVR pulse an LED really brightly, and ideally with variable intensity.
[18:54:51] <Jan-> one of those high power led modules, y'know
[18:55:13] <Lambda_Aurigae> so you need variable current drive.
[18:55:26] <Lambda_Aurigae> constant current power supply...that's adjustable.
[18:55:35] <Jan-> since it's a strobelight, we were assuming we'd probably overdrive it quite a bit.
[18:55:50] <Jan-> perhaps just charge a large capacitor up to a predetermined voltage and let it go.
[18:55:54] <Jan-> like a real xenon strobe.
[18:56:06] <Lambda_Aurigae> ouch.
[18:56:11] <Lambda_Aurigae> LEDs don't like that for very long.
[18:56:36] <Lambda_Aurigae> to vary the intensity of an LED you ideally want to vary the current through the LED
[18:56:52] <Lambda_Aurigae> hence an adjustable constant current power supply.
[18:57:23] <Lambda_Aurigae> and trigger the pulse through an IGBT maybe.
[18:57:53] <Lambda_Aurigae> or just a good mosfet.
[18:58:23] <Jan-> it's a bit tricky because we probably only want a 1/48 second flash
[18:58:46] <Jan-> if we use a proper led driver, it will want us to modulate the input power, but that'll be laggy, while it starts up
[18:58:57] <Jan-> if we break the connection between the driver and the LED, the driver's going to overshoot anyway.
[18:59:06] <Jan-> it is a puzzlement.
[18:59:07] <Lambda_Aurigae> then a power mosfet for drive.
[18:59:32] <Jan-> I'm not sure what the maximum instantaneous current through the LED is.
[18:59:38] <Lambda_Aurigae> all of it.
[18:59:42] <Jan-> the hundred watt ones are usually about 30V.
[18:59:53] <Jan-> so full power is about 3-4 amps
[19:00:05] <Lambda_Aurigae> too bad there aren't good digital variable resistors.
[19:00:11] <Lambda_Aurigae> err
[19:00:17] <Lambda_Aurigae> digital variable power resistors.
[19:00:48] <Lambda_Aurigae> got an adjustable constant current bench supply?
[19:01:08] <Jan-> sure
[19:01:52] <Jan-> it's probably okay to overdrive the led a bit, for those brief instants. MORE POWER, etc.
[19:02:46] <Lambda_Aurigae> use a power mosfet and a microcontroller to pulse the output from the constant current supply...vary current to vary intensity.
[19:03:02] <Lambda_Aurigae> just a theory as I don't have any really bright LEDs like that to play with.
[19:03:09] <Jan-> they're really cheap these days.
[19:03:18] <Jan-> although ones with good color rendering are more
[19:03:21] <Lambda_Aurigae> yeah..just don't have any as I have no need for them.
[19:04:21] <Jan-> I'm not sure how to come up with a tiny little constant current supply that won't overshoot, is all.
[19:04:24] <Lambda_Aurigae> I just got 2000 white and 2000 varied color(red, blue, green, yellow) LEDs for 10 bucks a couple weeks ago..
[19:04:39] <Lambda_Aurigae> complete with wired sockets to put them in...well,,,they are in the sockets.
[19:04:55] <Lambda_Aurigae> 90% discount sale on christmas lights.
[19:05:24] <Lambda_Aurigae> http://www.powerstream.com/constant-current.htm
[19:05:30] <Lambda_Aurigae> probably not powerful enough though.
[19:05:35] <Lambda_Aurigae> but quick search turned up that.
[19:06:03] <Jan-> one of the things about this is that it's a sort of miniature light that's easy to hide around sets
[19:06:16] <Jan-> the concept is that it's an interactive lighting effect to later support the addition of what looks like pyrotechnics.
[19:06:28] <Jan-> pyrotechnics are expensive on movies because they take a lot of time to reset.
[19:06:40] <Jan-> so we want them to be tiny, almost something you can throw down and scatter around.
[19:06:41] <Lambda_Aurigae> so use a smoke puffer and flashers.
[19:06:55] <Jan-> we could just use lots of individual leds. which might be fine.
[19:07:08] <Jan-> (and hey, switch sections of them out... actually that's not bad)
[19:07:21] <Lambda_Aurigae> more LEDs for more intensity.
[19:07:25] <Jan-> yes.
[19:07:34] <Lambda_Aurigae> even add some varied color in there for different effects.
[19:07:34] <Jan-> maybe use those ULN series chips for 7 intensity levels.
[19:07:50] <Jan-> well colored flashing is the 2.0, so you can do police lights etc.
[19:08:52] <Jan-> the other thought is that if we get the timing right, which is part of the requirement anyway, we can actually pulse-duration-modulate them. but we'd have to be very sure we knew it would be OK.
[19:09:37] <Lambda_Aurigae> have to time to recording frames I take it?
[19:09:51] <Lambda_Aurigae> film or digital recording or both?
[19:10:07] <Jan-> both potentially
[19:10:41] <Jan-> it's designed to solve two problems. first is just seeing the flash. it's notorious for real blank firing handguns to produce a flash you don't see, because the duty cycle on the camera is only 50% (usually)
[19:11:05] <Jan-> second is rolling shutter cameras, so you don't have the light turn on or off during the sensor readout, which produces "flash banding" (see youtube)
[19:13:10] <Lambda_Aurigae> I'm familiar with the effect.
[19:13:31] <Lambda_Aurigae> did stop action and full action 8mm film work in highschool.
[19:15:00] <Jan-> well there you go
[19:15:27] <Jan-> the idea is that we provide timing adjustment buttons and a mode where it deliberately puts a flash band on the picture, and you adjust till it stops rolling through.
[19:15:38] <Jan-> then it should stay in sync for usably-long-enough
[19:16:29] <Jan-> anyway you understand why I wasn't keen to do this in arduino.
[19:16:30] <Lambda_Aurigae> yeah. somewhere, sometime, I saw a camera that had an IR flashy on it to trigger frame syncing events.
[19:16:56] <Jan-> that's how we do gunfire.
[19:17:10] <Jan-> there's a fake "laser sight" on the rifle which emits infrared signals when the actor pulls the trigger.
[19:17:22] <Jan-> These lights will support triggering from that.
[19:17:59] <Lambda_Aurigae> that's called miles gear...
[19:18:05] <Lambda_Aurigae> military laser tag!
[19:18:05] <Lambda_Aurigae> hehe
[19:18:24] <Lambda_Aurigae> with real guns, blanks, and laser tag gear attached.
[19:18:52] <Jan-> I think it's called MILES here.
[19:18:57] <Jan-> but I know what you mean
[19:19:03] <Jan-> oh, you said.
[19:19:48] <Jan-> point is, everyone hates having real guns on a movie set.
[19:24:26] <Lambda_Aurigae> yeah.
[19:24:46] <Lambda_Aurigae> when I was a kid I helped out with my dad on a local theatre as stage hand.
[19:24:55] <Lambda_Aurigae> we had a guy shot himself in the head with a blank.
[19:24:58] <Lambda_Aurigae> killed him.
[19:25:08] <Lambda_Aurigae> he was futzing around before a performance.
[19:25:28] <Lambda_Aurigae> didn't realize that a blank still has enough pressure to shatter bone if you press the barrel against your temple.
[19:27:25] <Jan-> oh.
[19:27:27] <Jan-> well yes.
[19:27:36] <Jan-> you aware of the brandon lee incident?
[19:28:12] <Lambda_Aurigae> vaguely.
[19:28:31] <Lambda_Aurigae> too many people shot on set over the years.
[19:28:49] <Jan-> mainly it's just cost and inconvenience
[19:29:01] <Jan-> actors hate firing guns, they're so loud
[19:29:17] <Jan-> there's huge restrictions on what you can do, the staffing and insurance costs a fortune
[19:29:20] <Jan-> and then you miss the flash!
[19:30:09] <Jan-> anyway, I'm going to sleep. thanks for the interesting chat :)
[19:30:43] <Lambda_Aurigae> I've got a few ogres to slay.
[20:32:40] <guanche> hi, anybody ever used a stepper motor as a knob?
[20:33:11] <guanche> I'm trying to use a small one in a poject, and while looking for info, found this schematics:
[20:33:21] <guanche> http://home.clear.net.nz/pages/joecolquitt/stepper_as_encoder_simple.gif
[20:33:40] <guanche> whose source is at this page:
[20:33:43] <guanche> http://home.clear.net.nz/pages/joecolquitt/stepper_as_encoder.html
[20:34:22] <Lambda_Aurigae> guanche, kinda....I've played with it a little.
[20:34:32] <Lambda_Aurigae> found that rotary encoders are just easier to do.
[20:34:37] <guanche> and I wanted to ask why does it say "body" there, or is it that I'm supossed to solder the voltage divider after the diodes to the stepper's armature and tie it to ground?
[20:34:53] <Lambda_Aurigae> oh, I have to read that website?
[20:35:19] <guanche> they should yes, I just wanted to try with the steppers, I've got many small ones, not usable for anything but almost knobs
[20:35:20] <Tom_L> sure so you can answer all the questions
[20:35:42] <guanche> no, just looking at the schematics would be enough
[20:35:58] <Lambda_Aurigae> Body doesn't mean squat to me.
[20:36:04] <Lambda_Aurigae> unless it's the body of the stepper.
[20:36:09] <Lambda_Aurigae> like, the frame of it.
[20:36:29] <guanche> yes, that's what I thougth, but never seen that before
[20:36:32] <Lambda_Aurigae> but, body, as a technical term, means nothing.
[20:36:43] <Lambda_Aurigae> could mean you have to glue it to your torso for all I know.
[20:36:51] <guanche> haha
[20:37:18] <Tom_L> the bad thing is the faster you turn the stepper the more voltage you'll get from it
[20:37:44] <Lambda_Aurigae> yup.
[20:37:59] <guanche> and why would it be bad? the opamp would work as buffer until 36V, wouldn't it?
[20:38:04] <Lambda_Aurigae> there was just an article on hackaday about that.
[20:38:24] <Lambda_Aurigae> using a stepper motor controller and sensing system through that.
[20:39:10] <guanche> not that you could turn it fast enough to get up to 36v due to cogging, I guess
[20:39:52] <Lambda_Aurigae> depends on the motor.
[20:40:02] <guanche> oh, it's up to vcc, isn't it? still I could live with that, I'm gonna have to try the circuit to see if I get to understand it
[20:40:31] <guanche> the one I have is38.5 ohm, a pretty small one
[20:41:08] <Lambda_Aurigae> http://hackaday.com/2017/01/18/use-a-brushless-motor-as-a-rotary-encoder/
[20:42:36] <guanche> heh, looks nice, a bit expensive encoder though
[20:42:53] <Lambda_Aurigae> there's ways to do it cheaper
[20:42:54] <guanche> but at least seems to work reliably at low revs
[20:43:17] <Lambda_Aurigae> I recently went to a junk yard and got a bunch of dead radios and stripped the rotary encoders out of them.
[20:43:32] <guanche> I pulled my hairs off a year ago trying to use an hdd motor, could never get the atmega to use it reliably
[20:44:26] <guanche> well, I've seen these, but don't have any arround, and as I have plenty of these really small steppers, wanted to try and see if I could give them any practical use
[20:44:56] <guanche> because being these small, I don't think I'll ever use it as motors
[20:45:47] <Lambda_Aurigae> force feedback for joysticks!
[20:45:59] <guanche> my original idea is to use them as knobs, and then set 5 push-buttons up, down, left, rigth and center, so that I can use it as, that hehe
[20:46:15] <guanche> knob/joysticks, toghether with an lcd
[20:46:48] <guanche> the buttons would be behind the motor
[20:46:52] <Lambda_Aurigae> I'm using mine as position sensors for milling machine build and 3d printer build.
[20:47:21] <guanche> nice
[20:51:02] <guanche> http://www.mitsumi.co.jp/latest/Catalog/pdf/motor_m35sp_11nk_e.pdf
[20:51:07] <guanche> that's the motor I have
[20:51:26] <Lambda_Aurigae> make a chain clock.
[20:52:33] <guanche> though mine's says 38.5 ohms on the label
[20:52:50] <guanche> and it's not 24V either
[20:53:06] <Lambda_Aurigae> 95% of what I have are 24V
[20:53:22] <Lambda_Aurigae> the rest are 5V
[20:54:02] <guanche> iirc, I took it appart from 5v circuitry
[20:54:29] <Lambda_Aurigae> I've run the 24V ones at 5V...so long as there's not too much torque, they will run.
[20:54:32] <guanche> high-output torque: 11.3mN, hehe
[20:54:43] <guanche> yeah, probably
[23:39:05] <_ami_1> sabor: meh, the default library of kicad is not that great.. e.g. 74hc595 pins naming looks so different than what i have seen earlier.
[23:39:10] <_ami_1> confusing sometimes
[23:40:54] <sabor> _ami_1: every datasheet also looks a bit different, that's completely normal ;)