#avr Logs

Feb 23 2017

#avr Calendar

12:20 AM daey_ is now known as daey
05:53 AM enhering: Good morning
05:55 AM Lambda_Aurigae: morning
05:55 AM Lambda_Aurigae: it's still too early to use that dirty 4 letter G word with morning though.
05:57 AM Lambda_Aurigae: mindw0rk, atmega32 or similar 40pin avr has 32 i/o pins.
06:46 AM Tom_itx is now known as Tom_L
08:04 AM _enhering_ is now known as ENHering
08:39 AM arij is now known as arij_work
10:03 AM ENHering is now known as enhering
10:19 AM rcc is now known as jadew`
12:21 PM mindw0rk: I got bunch of atmega16u4
12:22 PM mindw0rk: figured the 16kb of flash will be plenty.
12:27 PM polprog: i like atmega16, they are quite universal
12:30 PM Jartza: 16kB is very much
12:31 PM polprog: thats why im looking forward for attinys to be delivered
12:36 PM LeoNerd: 16U4 is literally just a smaller flash version of 32U4?
12:36 PM LeoNerd: (As compared 8/16/32U2 which is a stupid pointless chip, IMHO)
12:38 PM mindw0rk: LeoNerd, yeah
02:50 PM polprog: how do i change the freq of the internal RC oscillator? fuses?
02:53 PM Casper: yes fuses
02:54 PM Casper: the clock source fuses
02:54 PM Casper: be carefull, the wrong fuse can make a semi bricking
03:03 PM polprog: and the unbricking, i heard that you need HVSP, right?
03:05 PM malinus: polprog: nah you can just attach the correct source
03:06 PM Casper: nahh normally you can't disable the serial programming with a serial programmer
03:06 PM Casper: but you can screw up the clock source
03:07 PM Casper: you can recover the avr with another avr
03:15 PM polprog: thanks
03:16 PM polprog: i wont touch it until necesary ;)
03:19 PM malinus: What's up with PROGMEM? Shouldn't declering arrays const be enough? Is that just avr-gcc being picky?
03:32 PM polprog: theres a whole page about PROGMEM on avr-libc's site
03:36 PM malinus: sure, but is should do the same thing const does on most platforms
03:37 PM Emil: I think there was a good explanation to why using const wasnt preferres
03:37 PM Emil: wasnt preferred*
03:39 PM malinus: right I found the paragraph. Thanks - even though I do not agree with the avr-gcc/avr-libc developer who decided on that :)
03:40 PM Emil: Yeah
03:40 PM Emil: but using const is quite easy
03:40 PM Emil: sorry progmem
03:42 PM Jartza: evening
03:43 PM polprog: im sick and tired soldering this test rig all day long, and now avr dragon fails to communicate with mega8
03:43 PM polprog: shite
03:43 PM polprog: what did i forget
03:44 PM malinus: Emil: yeah and it works on other compilers
03:44 PM malinus: (arm-gcc)
03:44 PM Jartza: malinus: it's not fault of avr-gcc or avr-libc developers
03:44 PM Jartza: it's about architecture
03:44 PM malinus: huh?
03:44 PM Jartza: the const-thing
03:45 PM malinus: yeah, but how is it a architecture thing?
03:45 PM xentrac: Hi. If I want to test and debug some LCD-driving and keyboard-scanning code for an AVR on Linux with free software, what's the best emulator to use?
03:45 PM xentrac: I mean other than testing and debugging it on theactual device.
03:45 PM polprog: xentrac, there's simulavr
03:45 PM polprog: but i think it's limited
03:45 PM Jartza: I'm been using simaavr
03:46 PM Jartza: simavr, even
03:46 PM xentrac: simavr and simulavr are two alternatives?
03:46 PM Jartza: malinus: because variables are always in ram and harvard only executes code from flash
03:46 PM Jartza: even if it's const, it's a variable
03:47 PM xentrac: simulavr seems to be in the Linux Mint repositories, soI'll try that! Thank you!
03:47 PM Jartza: const defines that the variable should never change, but it doesn't change the fact that it's still in ram as it's the only place where AVR stores variables.
03:47 PM xentrac: Jartza: even if you never take its address, eh? sounds fixable
03:48 PM Jartza: and MOST avrs don't have memory mapped flash
03:49 PM xentrac: I mean it might not fit into GCC's architecture very well, but there's no reason in the definition of C that f(k) shouldn't generate a read-program-memory instruction to fetch the value of k if it's a constant. or even inline its value with an immediate instruction
03:49 PM xentrac: an instruction iwth an immediate operand, I mean
03:49 PM polprog: xentrac, simulavr is assigning internal reg vaules in a way you can debug stuff using gdb
03:49 PM polprog: i havent used it at all
03:49 PM polprog: but it's not something like spice
03:50 PM xentrac: Jartza: is simavr simulavr or is it an alternative?
03:50 PM Jartza: alternative
03:50 PM xentrac: is it better?
03:50 PM Jartza: https://github.com/buserror/simavr
03:50 PM Jartza: don't know
03:50 PM Jartza: I rarely use simulators, this one did work pretty well on mac
03:50 PM xentrac: I'll take a look
03:50 PM polprog: tell me how it is :P
03:51 PM xentrac: polprog: its README claims it can dump waveforms toview in gtkwave
03:51 PM xentrac: simavr's
03:51 PM xentrac: which sounds like it would work great for debugging the LCD driving
03:52 PM polprog: xentrac: wow
03:52 PM polprog: simavr
03:52 PM xentrac: heh, actually that's one of the examples it gives in theREADME
03:52 PM xentrac: I've never used gtkwave because I am a totalnoob when it comesto hardware
03:53 PM xentrac: which is my excuse for why my spacebar doesn't work reliably, sorry
03:53 PM polprog: off topic slightly, ive used sigrok, quite good for scope-PC comms
03:54 PM xentrac: right now I'm hacking on an RPN calculator program I want to rebrain a four-function pocket calculator with, by drilling out the potted die that runs its normal functionality and replacing it with an ATMega328
03:54 PM polprog: RPN <3
03:55 PM polprog: cool project
03:55 PM xentrac: weirdly I can't find any reports of anyone having done this previously, but I can't be the first person the idea has occurred to
03:55 PM polprog: im fightin with a proto of a thermocouple reflow controller
03:56 PM xentrac: after six hours of hacking I have a working decimal-floating-point calculator running on Linux; by contrast my hardware skills are so poor that on Sunday it took me like four hours to hack a variable-voltage emitter follower onto an ATXpower supply output
03:56 PM polprog: PSA: check hardware first, always
03:56 PM xentrac: haha
03:56 PM polprog: MOSI had a bad solder joint
03:56 PM polprog: [facepalm]
03:57 PM polprog: well an RPN calculator was probably my most advanced C program for a computer that i did all by myself
03:59 PM polprog: http://m.imgur.com/WQhqFiE
04:12 PM Mali: xentrac: don't know if simavr is better, I've never used simulavr but simavr is good enough for me
04:15 PM polprog: should avcc be connected if adc in not used?
04:19 PM xentrac: surely it can't hurt? and leaving CMOS connections floating is a recipe for problems
04:19 PM xentrac: I should say: and isn't it a recipe for problems to leave CMOS connections floating?
04:19 PM xentrac: since if it weren't I could easily be mistaken
04:21 PM xentrac: simulavr also has a thing to dump VCD files that I guess gtkwave or sigrok could read?
04:24 PM xentrac: weird, the version of it in LinuxMint claims to not support the ATMega328, just 8, 16, 103, and 128 — must be a super outdated version?
04:24 PM xentrac: 0.1.2.2 from 2004
04:32 PM polprog: it works now
04:32 PM polprog: im done for today
04:33 PM xentrac: congratulations!
04:34 PM xentrac: you should break something now so you have a problem to get started on tomorrow morning
04:34 PM polprog: ill go to bed now xD
04:34 PM polprog: see you later
04:34 PM xentrac: haha
04:34 PM xentrac: thanks for your help
04:37 PM xentrac: heh, simavr uses GLUT for its GUI. good call
05:06 PM xentrac: hmm, sigrok now supports decoding the secret PDI debugging interface for the ATxmega
05:06 PM LeoNerd: Mmmmm ;)
05:06 PM LeoNerd: I'll have to write a PD for the parts of dW we have decoded sometime
05:06 PM LeoNerd: That could be fun
05:07 PM xentrac: oh that sounds awesome!
05:07 PM xentrac: yeah, I'd love to beable to use debugWIRE
05:07 PM LeoNerd: I have RikusW's notes on the subject
05:07 PM xentrac: and having a partial decoder would be a big step in that direction
05:08 PM LeoNerd: It's not a complete understanding but we have some idea how it works
05:11 PM xentrac: :)
05:22 PM arij_work is now known as arij
05:25 PM NoHitWonder2: hi
05:25 PM NoHitWonder2: have any of you guys used freertos with avr?
05:26 PM LeoNerd: Not personally.. the sorts of things I do on AVR tend to be so tiny-small I can actually write that level of thing for it myself
05:26 PM LeoNerd: ... if at all
05:32 PM massprog: what books or tutorial should I use for learning avr?
05:33 PM LeoNerd: What sorts of things do you know already?
05:35 PM massprog: I know logical circuits
05:35 PM LeoNerd: Any computer programming experience?
05:36 PM specing: do you know illogical circuits?
05:36 PM NoHitWonder2: datasheet is a good resource if you know C already
05:38 PM massprog: LeoNerd: I know c
05:39 PM LeoNerd: Ah well, if you know C that should get you a fair way already
05:39 PM LeoNerd: C is quite convenient on an AVR
05:39 PM Lambda_Aurigae: NoHitWonder2, once...found it totally overkill.
05:40 PM Lambda_Aurigae: massprog, depends on what you want to do....google search for avr tutorial...there are hundreds of them out there.
05:40 PM Lambda_Aurigae: if you want to learn avr assembly there is a very old but still very good assembly tutorial at http://www.avr-asm-tutorial.net/avr_en/
05:41 PM Lambda_Aurigae: I started with avr assembly on that site back,,,16ish years ago.
05:41 PM LeoNerd: I've only ever once found assembly of much use on AVR, and that was for a custom WS2812 driver I wrote
05:41 PM LeoNerd: Unless you need cycle-perfect timing, C should be sufficient
05:42 PM Lambda_Aurigae: LeoNerd, agreed....
05:43 PM massprog: LeoNerd Lambda_Aurigae thanks
05:43 PM Lambda_Aurigae: but knowing assembly,,,knowing deep down how the chip works,,,helps understand how things aren't working in C or other languages.
05:43 PM Lambda_Aurigae: in my opinion.
05:43 PM specing: Can I recommend Ada?
05:43 PM Lambda_Aurigae: specing, NO, you can't!
05:43 PM Lambda_Aurigae: :}
05:43 PM * LeoNerd idly wonders if Adafruit are anyhow related to the Ada language
05:45 PM NoHitWonder2: massprog https://www.newbiehack.com/MicrocontrollerTutorial.aspx if you a beginner with MCUs
05:45 PM LeoNerd: Oh.. yes; that's a point... C on a little 8bit micro with a few Ki of RAM is quite different to C on a cluster of machines in a data centre ;)
05:46 PM LeoNerd: I have a friend who works on large data computing at google.. we sometimes compare stories
05:46 PM LeoNerd: "Yeah I'm really happy; today I managed to save 6 bytes of RAM by adjusting the shape of my data structure". "What's a byte?"
05:47 PM Emil: massprog: if you have no previous experience with avr you can try https://emil.fi/avr
05:47 PM Emil: massprog: you can substitute the raw circuit with an arduino one, too
05:48 PM Emil: Lambda_Aurigae: the more I do things with AVR the more I find the need to use ASM
05:48 PM Emil: which I don't know yet
05:49 PM Lambda_Aurigae: hehe.
05:49 PM Lambda_Aurigae: I found that out long before microcontrollers...back in the vic-20 and z80 days
05:49 PM Lambda_Aurigae: which is why the second language I taught myself was 6502 assembly...after BASIC.
05:50 PM LeoNerd: Mmmm... Z80. Is that the one with the HCF instruction?
05:50 PM Emil: LeoNerd: people like those are the why to why we have buzzwords like hadoop
05:50 PM specing: Lambda_Aurigae: but why :(
05:50 PM specing: LeoNerd: no
05:50 PM Emil: LeoNerd: https://aadrake.com/command-line-tools-can-be-235x-faster-than-your-hadoop-cluster.html
05:51 PM specing: I do not recommend asm Emil
05:51 PM Emil: specing: because ADA is, wel, unfunctional
05:51 PM specing: its a downward spiral
05:51 PM Emil: specing: why not?
05:51 PM Emil: :DD
05:51 PM Emil: Hahah
05:51 PM specing: I've been there
05:51 PM Lambda_Aurigae: specing, just,,,because.
05:51 PM Emil: specing: but I want to go there by my own will
05:52 PM Emil: I'm pretty much pushing the avr to its limits
05:52 PM LeoNerd: Emil: Eh; you say that, but I think Google handles this particular thing quite well. Internally, everything (CPU time, RAM, disk space, network bandwidth, etc..) is budgeted in units of "engineer-hours". Like; you can buy more RAM at a cost given in terms of how much engineering time that's equivalent to
05:52 PM Emil: Doing simple things but they need to happen really god damn fast
05:52 PM Lambda_Aurigae: Emil, no... Jartza is pushing the avr to its limits...hehe
05:52 PM Emil: LeoNerd: sure
05:52 PM LeoNerd: Emil: I found that an excellent focus for the mind. There's no point you spending 5 hours saving a small amount of RAM usage, if it doesn't save you at least 5 engineer-hours of RAM
05:53 PM Emil: Lambda_Aurigae: Jartza is doing complex things that push the avr to its limits, those require algorithms. I just pust the avr to its limits while doing simple things
05:53 PM Lambda_Aurigae: LeoNerd, unless you do it for the fun of it.
05:53 PM specing: Emil: may I recommend stm32?
05:53 PM LeoNerd: Lambda_Aurigae: But then you are /literally/ wasting company time ;)
05:53 PM Emil: specing: if you can provide an adequate getting started with it
05:53 PM Lambda_Aurigae: not if I'm doing it for a hobby..which I am...but, that's me.
05:53 PM Emil: specing: that's comparable to https://emil.fi/avr
05:53 PM LeoNerd: Well sure you can do that in your *own* time :)
05:54 PM Emil: specing: I actually have to STM32L4KC nucleo boards but ##stm32 is a shill's nest
05:54 PM Emil: s/to/two
05:54 PM Emil: Haven't gotten around doing anything with them, even though I'd really like to branch to arm
05:55 PM LeoNerd: Ahyes, I bought one of those STM32F103 boards for $4.. no idea what I'm gonna do with it yet
05:55 PM Lambda_Aurigae: LeoNerd, got a couple of them myself...I made blinky lights and usb-hello-world programs so far...
05:55 PM Emil: LeoNerd: and wasting 5 hours to save ram might mean you can have massive savings in massproducing a device ;)
05:55 PM Emil: LeoNerd: we are hardware-people, mostly
05:55 PM LeoNerd: Emil: Yah, that's harder to measure
05:55 PM Emil: With software it is a different thing, yes
05:56 PM LeoNerd: Google are primarily services; they host the software they write
05:56 PM Emil: I know
05:56 PM LeoNerd: So it's much easier to say what the actual money+power+everythingelse cost of each of these resources is, as compared engineer time
05:56 PM Emil: But 5 hours is cheap
05:57 PM Emil: With google, saving those 6 bytes could be absolutely worth it when scaled to millions of instances
05:58 PM Emil: Lambda_Aurigae: you use the hal, right?
05:58 PM Emil: How's the usb hal on it?
05:58 PM Emil: Which framework did you use?
05:58 PM LeoNerd: 5 hours of google engineer time isn't *that* cheap. But yes- certainly 6 bytes could multiply up quite a lot depending on machine count
05:58 PM Lambda_Aurigae: Emil, horrid, complex, pain in the arse....
05:58 PM Emil: Lambda_Aurigae: figured
05:58 PM LeoNerd: I'm sure google engineers know how to multiply numbers together and take that into account though ;)
05:58 PM Emil: LeoNerd: ;)
05:59 PM Lambda_Aurigae: http://libopencm3.org/docs/latest/stm32f0/html/modules.html
05:59 PM Lambda_Aurigae: gonna try that next.
06:00 PM Emil: I've heard good things of opencm3
06:00 PM NoHitWonder2: yeah that st's HAL library sucks, i had to write my own i2c driver
06:01 PM NoHitWonder2: because there wasnt a way to do write + read
06:01 PM Emil: NoHitWonder2: hm?
06:02 PM Emil: What do you mean by write+read?
06:02 PM LeoNerd: repeated start maybe?
06:02 PM NoHitWonder2: yes repeated start
06:02 PM Emil: i2c is cancerous, you should get away from it ,)
06:02 PM Emil: ;)
06:02 PM Emil: It doesn't even support multiple same chips on a single bus
06:03 PM Emil: It always reverts to either SPI style with CS (perhaps through a gpio multiplexer itself, that can be on the same bus!)
06:03 PM LeoNerd: Emil: easily solved by a 1G66 and a "slave select" pin per chip ;)
06:03 PM Emil: or 1 wire
06:03 PM Emil: LeoNerd: hehe, like I said ;)
06:03 PM LeoNerd: Actually another trick is that if the chip has even just one address pin, you can mux any number of them together by using that as an SS pin, SPI-style
06:03 PM Emil: And the i2c protocol is horrible
06:04 PM LeoNerd: It's not great, no. But I find it OK enough for those little 8bit GPIO expanders, so I can hang front-panel LEDs and buttons off oit
06:04 PM Lambda_Aurigae: Emil, sure it does....if they have multiple address capability.
06:05 PM Emil: Lambda_Aurigae: which is often 1 other address, or if you are very lucky, 8
06:05 PM Lambda_Aurigae: you can often run 4 or 8 of the same chip on one bus as they usually have 2 or 3 address lines.
06:05 PM Emil: Lambda_Aurigae: but that's horrible perf
06:05 PM Emil: And requires hardware modifications
06:05 PM Emil: While with glorious SPI it just werks
06:05 PM Lambda_Aurigae: I built an LED display with 8 PCF8574 and 8 PCF8574A chips....64 rows and 64 columns...on one i2c bus.
06:05 PM LeoNerd: Lambda_Aurigae: A few of the MCP I²C chips use a single address pin as a crude analog input, to give it lots of addresses
06:05 PM Lambda_Aurigae: refresh rate was HORRID though..hehe
06:05 PM Emil: shiver
06:06 PM LeoNerd: 3 bit (with 7 levels) flash DAC
06:06 PM LeoNerd: er.. flash ADC
06:08 PM Emil: I don't know if you can tell but my hate for i2c mostly comes from haven't been able to write my own i2c driver
06:08 PM Emil: SPI was a fucking piece of cake
06:09 PM LeoNerd: I've managed I²C just fine on AVRs, both the real TWI module and via the USI
06:09 PM Emil: from not being able to write*
06:09 PM LeoNerd: ... and the FT232H
06:09 PM Lambda_Aurigae: I have no problem with i2c on avr and pic32 chips.
06:09 PM Lambda_Aurigae: I have a stack of pcf8574 series chips to use up so I have to!
06:09 PM LeoNerd: mmm
06:09 PM Emil: Well, once my screens from ebay arrive I must do it
06:10 PM LeoNerd: Lambda_Aurigae: I once went horribly wrong with those PCFs... I didn't appreciate how vitally important that trailing "A" is on the model number
06:10 PM Lambda_Aurigae: hehe.
06:10 PM Lambda_Aurigae: different address range.
06:10 PM Lambda_Aurigae: that's what it's for.
06:10 PM LeoNerd: I wanted 8574s.. the company was selling 8574As, and I thought "oh that'll just be some improved spec or something. it'll be fiiiine"
06:10 PM LeoNerd: nope
06:10 PM Lambda_Aurigae: TI sent me dozens of them some years back.
06:11 PM LeoNerd: Yeah, I know the difference /now/
06:11 PM Lambda_Aurigae: 3 each of the plain and A variants....in every package available.
06:11 PM Lambda_Aurigae: so, from dip to these tiny things that look like fleas.
06:11 PM Lambda_Aurigae: well, small ants anyhow.
06:11 PM LeoNerd: Ricegrains
06:11 PM Emil: LeoNerd: if it was just a change of address then you should have been just fine with changing a single line of code ;)
06:11 PM LeoNerd: .. actually I shouldn't call them that
06:12 PM LeoNerd: 0603s tend to be /smaller/ than rice
06:12 PM Emil: Hmm
06:12 PM LeoNerd: Carrawayseeds
06:12 PM Lambda_Aurigae: LeoNerd, yeah..think there are some of thsoe too...no leads, just pads on the underside and not much bigger than a grain of rice.
06:12 PM Emil: Any of you know what flip flop (with hysterisis) I should get
06:12 PM Emil: if I only care about pulses
06:12 PM Lambda_Aurigae: depends on what you want to do with it.
06:12 PM Emil: that is onl one input
06:13 PM Emil: Lambda_Aurigae: turning a momentary button into a ltach
06:13 PM Emil: latching one*
06:14 PM Emil: Any pointers
06:14 PM Emil: ?
06:15 PM Lambda_Aurigae: jk flipflop maybe?
06:15 PM Lambda_Aurigae: by tying the two inputs together, a pulse will toggle the outputs.
06:15 PM Lambda_Aurigae: but you need to debounce a button input or it just twiggles
06:16 PM Emil: Of course
06:16 PM Emil: Mate, I've been here long enough, you should know me a bit better already ;)
06:17 PM Lambda_Aurigae: one never assumes
06:17 PM Lambda_Aurigae: besides
06:17 PM Lambda_Aurigae: I'm a bastard
06:18 PM Emil: Lambda_Aurigae: but JK-flipflops have a clock input
06:18 PM Lambda_Aurigae: aahh..so they do.
06:18 PM Lambda_Aurigae: you want a toggle without a clock...
06:19 PM Emil: yeah
06:19 PM Lambda_Aurigae: so
06:19 PM Lambda_Aurigae: hold J and K high
06:19 PM Lambda_Aurigae: and use your button to toggle the clock line
06:20 PM Emil: That sounds horrible :o
06:20 PM Emil: It would work, though
06:20 PM Lambda_Aurigae: think outside the straight jacket.
06:21 PM Emil: But mommy I don't want to
06:21 PM Lambda_Aurigae: https://cdn.instructables.com/FBX/HWZS/GD0R1HIK/FBXHWZSGD0R1HIK.MEDIUM.jpg
06:22 PM Lambda_Aurigae: http://www.instructables.com/id/Use-a-Momentary-or-Tactile-Switch-as-a-Pushbutton-/step3/Using-the-J-K-flip-flop/
06:22 PM Emil: Horrible resolution, is there a better one?
06:22 PM Lambda_Aurigae: there
06:22 PM Lambda_Aurigae: dunno if there is a better resolution
06:22 PM Lambda_Aurigae: but that was first hit for "use a jk flipflop as switch with push button"
06:22 PM Lambda_Aurigae: and they do exactly what I said.
06:22 PM Emil: >No filtering cap
06:23 PM Emil: Why does that instructables even try
06:23 PM Lambda_Aurigae: http://electronics.stackexchange.com/questions/4060/make-a-momentary-switch-control-a-toggle
06:23 PM Lambda_Aurigae: or do it with a D flipflop
06:23 PM Emil: Lambda_Aurigae: do you know of a jk flip flop that has hysteresis built in
06:23 PM Lambda_Aurigae: no clue.
06:23 PM Lambda_Aurigae: why do you need that?
06:24 PM Emil: Lambda_Aurigae: because having hysteresis provides better filtering than just a cap
06:24 PM Emil: And I mean a lot better
06:24 PM Lambda_Aurigae: oh.
06:24 PM Lambda_Aurigae: yeah,,,no clue.
06:24 PM Lambda_Aurigae: I use a combination of resistor and capacitor.
06:25 PM Lambda_Aurigae: resistor in line between button and capacitor..
06:25 PM Emil: yeah obviously with a resistor
06:25 PM Lambda_Aurigae: that way there is a slow-ish charge up.
06:25 PM Lambda_Aurigae: eliminates the heavy charge spike too.
06:25 PM Emil: yeah
06:28 PM Lambda_Aurigae: also, with the right combination...depending on the circuit and circumstances, one can make it so the button press has to be for a predefined duration to activate the digital input.
06:28 PM Lambda_Aurigae: so a quick push of the button wouldn't charge the cap far enough to trigger..
06:29 PM Lambda_Aurigae: I've done them where you have to hold the button for half a second before triggering.
06:29 PM Lambda_Aurigae: biiiig honking cap.
06:30 PM Lambda_Aurigae: but, ultimately, why use a flipflop and all that when you can use an attiny and debounce in code?
06:30 PM Emil: Lambda_Aurigae: because I'd like it to be very low power and work in a certain hard to engineer for situation
06:30 PM Emil: But using an attiny13 did cross my mind :D
06:31 PM Emil: If the hardware was a bit different I would have already implemented it with one
06:31 PM Lambda_Aurigae: I would say a microcontroller would be better overall...but don't know the circumstances.
06:31 PM Emil: Lambda_Aurigae: the problem is that I'd like to fit it inline with the load (which is probably a led)
06:32 PM Emil: I'll probably just have to find a small enough physical latch
06:32 PM Emil: s/I'd like to/it will be
06:33 PM Lambda_Aurigae: resistor, cap, flipflop(which is probably going to be a dual) or an attiny and small mosfet driver chip...microchip makes little 8pin ones that rock.
06:33 PM Emil: I'm modifying a torch :D
06:33 PM Lambda_Aurigae: torch as in burny thing or torch as in british flashlight?
06:33 PM Emil: Flashlight
06:33 PM Emil: And a long shelflife is extremely important
06:34 PM Lambda_Aurigae: physical switch is better.
06:34 PM Emil: Yeah
06:34 PM Emil: I know
06:34 PM Emil: If only I could find one that fits :D
06:34 PM Lambda_Aurigae: hmmm.
06:35 PM Emil: It can be somewhat wide but should only be ever so tall
06:35 PM Lambda_Aurigae: attiny in super low power mode....button on interrupt to wake up.
06:35 PM Lambda_Aurigae: I would almost go with a picopower pic as they tend to have a lower current draw in their super sleep modes.
06:38 PM cehteh: bootstrap the 'turn on' by a fet / button only, leave the tiny completely switched off
06:39 PM Lambda_Aurigae: could, yes.
06:39 PM Lambda_Aurigae: having the tiny sensing that button input when it's on and somehow turning the fet back off...would require a pair of fets I think..
06:40 PM Lambda_Aurigae: no
06:40 PM Lambda_Aurigae: could be done with one.
06:40 PM Lambda_Aurigae: and a diode.
06:41 PM Lambda_Aurigae: sensing on the button side of the diode and turning off on the fet side of the diode....
06:41 PM Lambda_Aurigae: doing a pull up/down with one i/o pin and sense with another...
06:41 PM Lambda_Aurigae: doable.
06:45 PM Lambda_Aurigae: button to diode to fet....fet providing power to both tiny and light....
06:45 PM Lambda_Aurigae: tiny i/o pin connected to button/diode connection and another connected to diode/fet connection.
06:45 PM Emil: https://www.alibaba.com/product-detail/RoHs-Compliant-250v-led-latching-pcb_1209922270.html
06:45 PM Lambda_Aurigae: on boot, tiny sets diode/fet side to high to maintain fet on.
06:45 PM Emil: Ooh
06:46 PM Lambda_Aurigae: that works too.
06:46 PM Emil: Lambda_Aurigae: the problem with semis is that it would be inline
06:47 PM Emil: Meaning if my power source is a 3.7V lipo and leds are 3v white leds :D
06:47 PM cehteh: http://tinyurl.com/j4zpdtb
06:47 PM Lambda_Aurigae: yeah....there's problems.
06:47 PM Lambda_Aurigae: better to use a physical switch.
06:47 PM Emil: cehteh: that doesn't work
06:47 PM cehteh: isnt complete
06:47 PM Emil: cehteh: ah
06:48 PM cehteh: you need to tap the gate and maintain it from the µC after booted, switch will allow you to boot it up
06:50 PM cehteh: mhm i wonder at what point of brownout/reset the µC switches the pins to high-z
06:51 PM cehteh: anyway thats just some brainfart, needs some work
07:00 PM Emil: https://www.youtube.com/watch?v=PePulXD3KLg
07:00 PM Emil: Here's a video of what I'm trying to modify
07:02 PM Lambda_Aurigae: what's the wire hanging out the back end?
07:03 PM Emil: It's where the old switch was
07:03 PM Emil: It was a tactical lamp
07:04 PM Emil: You know, with a lanyard
07:04 PM Lambda_Aurigae: so, pull on it to turn the light on?
07:04 PM Emil: Connec the wries and the light turns on
07:05 PM Emil: and no pull, press on the momentary pad
07:05 PM JanC_ is now known as JanC
07:06 PM Emil: tactical flashlight with pressure switch to google
07:08 PM Emil: Heh, it's always fun hunting for parts on ebay
07:09 PM Emil: once you find what you are looking for, just look at the same devices listed on the page
07:09 PM Emil: And you get the thing for way cheaper
07:30 PM Tachyon` is now known as Tachaway
08:28 PM JanC_ is now known as JanC