#avr | Logs for 2016-08-10

Back
[08:38:02] <GilDev> On my tiny13A, if I use the 128 kHz clock, with the 256 clock division factor, I can run it at 500 Hz, am I right? oO'
[08:43:01] <LeoNerd> That sounds correct.. if a little slow for most purposes :)
[08:46:17] <GilDev> Nice! It's a low-voltage cutoff system so I don't care, I just want the lowest current consumption possible
[09:11:27] <GilDev> Well… I did that, and now I can't program it anymore ^^'
[09:15:25] <GilDev> Alright, so I got my tiny13a with 128 kHz clock and 256 division factor, using Arduino as ISP (some code I found online to program those chips at 128 kHz), and now I can't program it anymore. Any thoughts?
[09:15:58] <GilDev> Guess I should find a new sketch for my Arduino as ISP
[09:18:23] <_ami_> GilDev: did you set fuses correctly? ext. clock selected?
[09:18:40] <GilDev> I use the internal 128 kHz clock
[09:18:52] <GilDev> And it works, I was able to program it at this speed
[09:19:05] <GilDev> But now that I set the 256 division factor, won't work
[09:20:17] <_ami_> GilDev: do you have usbasp or other programmer with you?
[09:20:29] <GilDev> Nope not where I am right now
[09:20:41] <_ami_> could you try with that? just query the status
[09:20:43] <_ami_> hmm
[09:20:53] <GilDev> I found some sketch
[09:20:59] <GilDev> https://github.com/lmpipaon/ArduinoISP_slow_SCK
[09:21:22] <GilDev> Seems nice but it says it's not working with 256 prescaler?
[09:21:30] <_ami_> you need to probably lower the speed of your programmer which is in your case is Arduino.
[09:21:46] <GilDev> Okay I see
[09:22:12] <GilDev> So with a sketch like the one I just sent?
[09:22:18] <_ami_> i am not sure.
[09:22:42] <_ami_> i don't use arduino as a programmer. usbasp works very fine for my needs.
[09:23:03] <_ami_> btw, i would suggest you to do some experiment with avrdude..
[09:23:14] <GilDev> I'm ready to do some
[09:23:24] <_ami_> avrdude -c arduino -p attiny13a -B 250
[09:23:40] <_ami_> do google abt how to use avrdude in case of arduino is the programmer.
[09:24:02] <GilDev> Alright
[09:24:08] <GilDev> Thanks I'll look into that
[09:26:01] <_ami_> GilDev: in case of usbasp as a programmer, i just do avrdude -c usbasp -p attiny13a
[09:26:08] <_ami_> -U flash:w:main.hex
[09:27:13] <GilDev> Yes but that will not solve it
[09:28:07] <_ami_> did you try with avrdude?
[09:28:32] <_ami_> all i want to see if -B 250 will slow down the arduino ISP
[09:28:45] <_ami_> then it should work IMHO
[09:28:53] <GilDev> It gives me nothing
[09:29:03] <_ami_> umm.. what do you mean nothing?
[09:29:08] <_ami_> did it print some error?
[09:29:40] <GilDev> Not in sync, like without it
[09:29:53] <GilDev> I'll try with the original Arduino ISP sketch
[09:30:07] <_ami_> ah, ok
[09:30:11] <_ami_> check this: https://typeunsafe.wordpress.com/2011/07/22/programming-arduino-with-avrdude/
[09:31:00] <GilDev> Alright, without -B250 : Device signature = 0x00ff00
[09:31:07] <GilDev> With: Device signature = 0xff0000
[09:31:11] <GilDev> That's all that is changing
[09:31:32] <_ami_> could you show the full output? at pastebin?
[09:31:50] <GilDev> I know how to falsh with arduinoisp and avrdude, it's just my tiny13 low clock that's messing up everything
[09:32:17] <_ami_> GilDev: to solve this, you need to slow down your ISP
[09:32:43] <_ami_> -B 250 should done that?
[09:32:45] <_ami_> -B <bitclock> Specify JTAG/STK500v2 bit clock period (us).
[09:33:22] <GilDev> It has some effect
[09:33:23] <_ami_> -B 250 => 4 Khz
[09:33:32] <GilDev> Signature change when I change the -B value
[09:33:33] <Lambda_Aurigae> your programming speed needs to be 1/4 or less the main cpu clock speed.
[09:33:40] <GilDev> Alright
[09:33:53] <GilDev> So 125 Hz or less
[09:33:57] <Lambda_Aurigae> yup.
[09:34:05] <Lambda_Aurigae> says so right in the datasheet.
[09:34:11] <LeoNerd> Uhm
[09:34:12] <GilDev> Thanks sorry
[09:34:26] <LeoNerd> When you RESET to enter ISP mode, the clock prescaler is set back to fuse default
[09:34:34] <LeoNerd> The software-set one doesn't apply
[09:34:53] <GilDev> But why did it worked before and not anymore? I only changed that software thing
[09:35:14] <Jartza> eve ning
[09:35:29] <Jartza> oh... trigger happy spacebar
[09:35:33] <GilDev> It seems clock prescaler is related, as in the ArduinoISP sketch I sent
[09:35:45] <_ami_> LeoNerd: -B 8000 should work then?
[09:36:42] <GilDev> Yep, does nothing
[09:37:42] <_ami_> Jartza: Hello man, long time, no see! :)
[09:37:54] <GilDev> As I said, I got this sketch, which seems nice: https://github.com/lmpipaon/ArduinoISP_slow_SCK
[09:38:07] <GilDev> But eh… It says 256 prescaler does not work
[09:39:38] <Jartza> _ami_: hi... been busy working :P
[09:40:01] <_ami_> Jartza: nice! :)
[09:40:21] <Jartza> well, it's nice to have work, that's for sure :)
[09:40:45] <_ami_> finally i able to setup ltc1799 and ltc6900. soldering was tricky but enjoyed it! :)
[09:40:56] <_ami_> TSOT-23-6 pkging
[09:41:16] <_ami_> Jartza: i think i heard abt these chips from you only :)
[09:43:49] <_ami_> GilDev: http://www.avrfreaks.net/forum/cannot-program-attiny13-any-more-slow-clock
[09:44:24] <GilDev> Yeah I saw that, but it's someone using usbasp and Studio
[09:46:51] <_ami_> LeoNerd has mentioned abt it, that software override won't work.
[09:55:40] <GilDev> If these software prescaler does not change programming speed, I should still be able to upload code, as before…
[10:09:26] <_ami_> GilDev: no, i meant abt -B flag in avrdude
[10:09:43] <_ami_> -B flag should work with usbasp
[10:09:58] <GilDev> Oh okay
[10:10:45] <_ami_> LeoNerd: is this the case with arduino as ISP only?
[10:10:57] <LeoNerd> I've no idea, never used arduino as ISP
[10:11:24] <_ami_> LeoNerd: few people claims that -B flag works with usbasp?
[10:11:29] <LeoNerd> OK?
[10:13:26] <_ami_> LeoNerd: http://www.avrfreaks.net/forum/cannot-program-attiny13-any-more-slow-clock =>
[10:14:59] <LeoNerd> Yes..?
[10:15:11] <LeoNerd> I'm not sure what you're wanting from me at this point
[10:15:26] <_ami_> (07:37:12 PM) LeoNerd: When you RESET to enter ISP mode, the clock prescaler is set back to fuse default ==> this does not hold true for usbasp. seems like true for arduino as IS
[10:15:26] <_ami_> P
[10:15:28] <_ami_> ISP*
[10:15:38] <LeoNerd> ??
[10:15:45] <LeoNerd> It's a property of the target chip, not the programmer talking to it
[10:15:58] <LeoNerd> When you pull that RESET line low, the chip resets back to whatever the fuses say are defaults
[10:16:37] <LeoNerd> Now -additionally-, if you're in the situation where you still have that DIV8 fuse set then you have a problem
[10:16:52] <LeoNerd> 128kHz / 8 == 16kHz basic fCPU
[10:17:15] <LeoNerd> You have to ISP at no faster than 1/4 of fCPU, so you need to ISP at no faster than 4kHz
[10:17:27] <_ami_> LeoNerd: its about communicating to target chip with programmer. -B flag will slow down the spi communication between target and programmer?
[10:17:32] <LeoNerd> So now you're in a situation where you need to tell your ISP, whatever ISP that is, to run at 4kHz
[10:17:40] <_ami_> yeah,
[10:17:42] <LeoNerd> Some programmers can do that, some can't
[10:17:43] <_ami_> -B does that.
[10:17:48] <LeoNerd> -B might do that, in some cases
[10:17:52] <_ami_> for usbsap
[10:17:55] <_ami_> at least.
[10:18:00] <LeoNerd> I've personally never managed to make that work
[10:18:19] <_ami_> LeoNerd: it works with latest usbasp firmware.
[10:18:38] <LeoNerd> Right. Yah; I tried flashing that onto my board and it stopped working. ;)
[10:18:47] <LeoNerd> So it's possible mine isn't the right board
[10:19:00] <LeoNerd> Anyhow... you have the basic facts much as I do
[10:20:17] <_ami_> LeoNerd: "avrdude: warning: cannot set sck period. please check for usbasp firmware update." -> did you use to get this annoying message from usbasp programmer?
[10:20:39] <LeoNerd> Yup
[10:20:59] <_ami_> i worked on usbasp bootloader recently. managed to write one for my atmega16a, :)
[10:21:37] <_ami_> USBASP_FUNC_SETISPSCK ==> is the command send by avrdude.
[10:21:57] <_ami_> so if you don't handle it and not return 1, avrdude complains
[10:23:34] <_ami_> For my bootloader, i did not need to handle this command since i am emulating usbasp protocol into my bootloader. basically no spi speed concept for me.
[10:24:52] <_ami_> but recent usbasp programmer firmware has this code to handle SETISPSCK request from avrdude. hence if GilDev uses the latest usbasp isp, -B should work and it should solve his problem.
[10:25:34] <GilDev> Yeah but I don't have a usbasp on my hand right now
[10:26:20] <LeoNerd> I think I own at least 4 devices theoretically capable of performing AVR ISP
[10:26:42] <LeoNerd> A silly usbasp, a nice pololu, and the bus pirate and FT232H can both be easily talked into doing SPI
[10:30:08] <LeoNerd> Hrm.. no -c ft232h in avrdude
[10:30:12] <LeoNerd> I wonder if I should write one
[10:30:43] <GilDev> I got one of those
[10:33:17] <LeoNerd> I like it.. moreso than the BP, anyway
[10:33:39] <LeoNerd> Much nicer performance.. and I don't -particularly- miss the lack of analog ability. I didn't really use that on the BP
[10:33:53] <LeoNerd> One thing both are missing is any sort of interrupt ability. You have to just poll the GPIO pins :/
[10:34:16] <GilDev> Yay! Fixed my problem
[10:34:28] <GilDev> I asked on StackExchange
[10:34:35] <LeoNerd> Ah good ol' SE
[10:34:36] <GilDev> “Holding the device in reset while powering it on will prevent the code from running”
[10:34:50] <GilDev> Well, it works, it now programs well
[10:34:55] <LeoNerd> \p
[10:35:04] <LeoNerd> You might want to clear the CKDIV8 fuse, if you're running at 128k
[10:35:13] <LeoNerd> It's really not needed down there and clearly just gets in your way
[10:35:18] <GilDev> Already done
[10:35:23] <LeoNerd> When I say "clear", I mean "unprogram", i.e. set back to 1.
[10:35:27] <LeoNerd> Silly inverted logic
[10:35:36] <LeoNerd> That's Never Caused Me Any Problem Before
[10:36:16] <GilDev> Yeah yeah done
[10:36:38] <GilDev> I used a “fuse calculator”, helps me a bit
[10:37:01] <LeoNerd> I've -almost- finished writing my avr-fuses
[10:37:05] <GilDev> Omg everything works well now!
[10:37:17] <GilDev> I'm so happy, thanks to my family and everyone who supported mo!
[10:37:20] <GilDev> me*
[10:37:24] <LeoNerd> The intention being avrdude -p m328p `avrfuses -p m328p CKDIV8=0 CK_SUT= ... whatrever here`
[10:37:36] <GilDev> That's nice
[10:37:37] <LeoNerd> I.e. it outputs the -U commandline args suitable to avrdude
[10:37:46] <GilDev> I like that
[10:38:12] <LeoNerd> I was held back for a long time for not having the default values of the fuses
[10:38:43] <LeoNerd> Turns out I was looking at a particular version of the XML device info files from after they added the fuse bit values, but before they added the initival
[10:38:52] <LeoNerd> Which is quite a narrow version range. I was just unlucky to get that version :)
[10:46:59] <_ami_> GilDev: cool. you brought back it to life from being DEAD. :P
[10:47:05] <GilDev> Yeah! =)
[10:53:31] <GilDev> Alright guys, everything works! Could someone please check my code, just to tell me if I made it right or not? It's really not long https://gist.github.com/GilDev/ad78a1bac8396d84d01dceb6294f3fe0
[10:53:50] <GilDev> And yeah that's a lot of comments!
[11:06:19] <_ami_> GilDev: nice, a schematic of circuit would be nicer though to understand what this code does.
[11:12:21] <GilDev> Yeah sure
[11:12:44] <GilDev> I'll write an article soon I think to explain how I got myself into avr programming with this =)
[11:15:23] <_ami_> GilDev: nice, please do share the link with us when you do.
[11:15:37] <GilDev> Sure
[11:15:54] <GilDev> It will take some time though, need to translate it in English afterwards
[11:16:02] <GilDev> I should finish my portfolio first, I'll put it on it =)
[12:17:07] <_ami_> In case of HC595, the byte MISO would be always what i just sent on MOSI?
[12:17:55] <_ami_> byte read at MISO*
[12:22:51] <_ami_> Also i don't find in hc595's DS about CPOL & SPHA values. i know its CPOL=0 and CPHA=0 but where it is mentioned?
[12:25:46] <LeoNerd> Since you're not reading from the 595, it half doesn't matter
[12:26:08] <LeoNerd> You can use 0/0 or 1/1; either way, you'll clock data out of the master on the rising edge of SCK, which is what the 595 wants
[12:26:45] <_ami_> aha, makes sense. got it.
[12:33:36] <_ami_> LeoNerd: thanks LeoNerd, you are one of the best!
[12:33:46] <LeoNerd> Hah.. /one of/?
[12:34:03] <_ami_> :D Lambda_Aurigae is the one too. :)
[12:34:11] <_ami_> Zarta too
[12:34:22] <_ami_> carabia also.
[12:34:25] <_ami_> Casper also
[12:35:00] <_ami_> cehteh too but he seems busy these days.
[12:35:55] <cehteh> what?
[12:36:06] <_ami_> one of the best! :D
[12:36:15] <cehteh> uhm
[13:05:46] <sebus> Arrrgh, _ami_, he's good too.
[13:06:47] <sebus> GilDev I am wondering.. How stable adc measurement is on internal vref?
[13:08:41] <sebus> Nice code, anyway
[13:38:32] <Lambda_Aurigae> someone used my name in vain!
[14:53:54] <Tom_itx> gosh Lambda_Aurigae it!
[14:55:42] * Lambda_Aurigae AM IT!
[14:55:56] <Lambda_Aurigae> http://jezebel.com/a-woman-was-fatally-shot-by-police-during-a-live-gun-de-1785067870
[14:55:59] <Lambda_Aurigae> my home town!
[14:56:02] * Lambda_Aurigae am sooo proud!
[15:11:31] <bss36504> Lambda_Aurigae: Oh jeez....
[15:14:36] <learath> Lambda_Aurigae: I'm still trying to figure out WTF
[15:15:19] <learath> like, how do you, as a professional police officer, end up with a live weapon in a training exercise?
[15:18:48] <bss36504> Even well intentioned people do stupid things. Even stupid people can slip into smart-people jobs. Ever worked with a dumb coworker in an office? Same thing just with more occupational hazard.
[15:19:03] <bss36504> Even smart people do stupid things
[15:26:28] <Tom_itx> it's about as stupid as hurling yourself down a water slide at 70mph
[15:27:04] <Tom_itx> http://gawker.com/kansas-lawmakers-10-year-old-son-dies-on-worlds-tallest-1784955505
[15:28:04] <Tom_itx> his head was severed by one of the straps holding the netting after the raft went airborn because of too little weight in the front (the 10yr old)
[15:29:08] <Tom_itx> as long as thrill seekers seek, there will be someone there to satisfy their need be it safe or not
[15:38:50] <LoRez> Tom_itx: was his family in the raft with him?
[15:40:57] <Lambda_Aurigae> LoRez, unfortunately, no.
[15:41:23] <LoRez> fortunately no I'd say. I'd hate to watch my kid get killed that way.
[15:41:42] <Lambda_Aurigae> learath, as for the shooting. That's the third shooting that I know off offhand where a cop should have known better and discharged a firearm where it shouldn't have been loaded...
[15:41:43] <Lambda_Aurigae> but
[15:41:52] <Lambda_Aurigae> all guns are loaded...period.
[15:42:00] <Lambda_Aurigae> I don't care if it's in pieces...it's still loaded.
[15:42:32] <Lambda_Aurigae> there was the cop who shot himself in the leg while telling a bunch of students at a school that he was a professional and knew what he was doing...drew the gun from holster and shot himself in leg in process.
[15:42:54] <Lambda_Aurigae> then he filed a lawsuit against the parent who was filming it and posted the video on youtube.
[15:43:45] <Lambda_Aurigae> LoRez, if you know them kansas lawmakers, they are the ones who don't believe in science. They started the teaching of creationism in science class as fact and evolution as just a whim.
[15:44:15] <GilDev> sebus: Does not seems to be perfect, but it works. Maybe I'll take more measurements in the future to test that
[15:44:20] <learath> Lambda_Aurigae: agree.
[15:44:37] <GilDev> I'm still on my low-voltage-cutoff system, having trouble with transistors now =)
[15:44:38] <Lambda_Aurigae> the other police shooting was the cop in the pawn shop....pawn shop worker handed the cop a gun from the case...the cop raised the gun and dry-fired it...without checking it...only, it wasn't a dry fire...and missed another customer by inches.
[15:44:39] <LoRez> Lambda_Aurigae: seems irrelevant to the discussion.
[15:44:53] <GilDev> I have no idea how to make them work
[15:45:01] <Lambda_Aurigae> LoRez, probably is...but, I'm a general bastard.
[15:45:11] <Lambda_Aurigae> GilDev, transistor is a valve.
[15:45:22] <GilDev> Yeah I know the basic concepts
[15:45:28] <Lambda_Aurigae> for a BJT transistor, you apply current to the base and it controls the valve.
[15:45:37] <Lambda_Aurigae> for a mosfet or fet, you apply voltage
[15:45:39] <GilDev> I got a PNP one
[15:45:48] <GilDev> http://www.wakamatsu-net.com/biz/get_document%20(2).pdf
[15:45:57] <GilDev> Another datasheet: http://products.semelab-tt.com/pdf/bipolar/2N2906.pdf
[15:46:04] <Lambda_Aurigae> http://www.electronics-tutorials.ws/transistor/tran_3.html
[15:46:18] <GilDev> Yeah I was looking at that
[15:46:28] <Lambda_Aurigae> so, what's not to understand?
[15:46:49] <GilDev> Hum…
[15:47:06] <GilDev> First the value of the resistance I need to put between base and ground
[15:47:25] <Lambda_Aurigae> ok..back up...what are you wanting to do with it?
[15:47:41] <GilDev> Power some microcontroller with LEDs
[15:47:59] <GilDev> Just think of LEDs
[15:48:19] <Lambda_Aurigae> http://www.electronics-tutorials.ws/transistor/tran_4.html
[15:48:36] <Lambda_Aurigae> look about 1/3 down the page.
[15:48:47] <Lambda_Aurigae> wait..that's an npn...low side...
[15:49:01] <Lambda_Aurigae> almost halfway down...
[15:49:06] <Lambda_Aurigae> pnp transistor switching circuit.
[15:49:17] <GilDev> Got it
[15:49:24] <Lambda_Aurigae> pnp transistor is going to be high side...connected between VCC and the LED.
[15:50:00] <Lambda_Aurigae> what you really want, mostly, is a limiting resistor.
[15:50:06] <Lambda_Aurigae> use 1K and see what happens..
[15:50:10] <Lambda_Aurigae> or 10K
[15:50:27] <Lambda_Aurigae> in place of that NOT gate goes your microcontroller.
[15:51:33] <GilDev> Okay
[15:51:54] <Lambda_Aurigae> I would try a 10K and see what happens...if it doesn't turn on fast enough, try a 1K resistor.
[15:52:46] <Lambda_Aurigae> remember, however, that when you turn on the output pin of the microcontroller, unless you set it otherwise, it is going to be default low...so the LED will light up.
[15:52:59] <Lambda_Aurigae> or am I backwards?
[15:53:02] <GilDev> Yeah
[15:53:08] <GilDev> No you're right I think
[15:53:15] <Lambda_Aurigae> yeah...
[15:53:30] <Lambda_Aurigae> because you are driving high side...low feed to the base will turn the transistor on.
[15:53:52] <Lambda_Aurigae> if you used NPN then it would be low side and you will be turning it on with a high input.
[15:53:53] <GilDev> Yeah
[15:54:00] <GilDev> Okay alright
[15:54:11] <Lambda_Aurigae> this is why a push/pull with NPN and PNP works
[15:56:21] <Lambda_Aurigae> http://cq.cx/interface.pl
[15:56:26] <Lambda_Aurigae> good site to read.
[16:00:26] <GilDev> Thanks!
[16:11:12] <Lambda_Aurigae> http://www.ti.com/ww/en/techdays/2016/index.html
[16:11:16] <Lambda_Aurigae> I wanna go!
[16:11:19] <Lambda_Aurigae> it's even near me.
[16:11:23] <Lambda_Aurigae> and FREE!
[16:17:54] <sebus> Lambda_Aurigae lucky :C
[16:21:47] <carabia> Lambda_Aurigae, I hope they have free shizzle!
[16:23:25] <Mr_Sheesh> I have a weird one. Looking at something, trying to use the least uC power possible here; I have a situation where the same sound is made fairly often, and I want to use that as a trigger to send in a keystroke to log it (long story.) If I can I want to avoid doing an FFT on it, should be able to do something more like "is the sound's length in the right range?" or something, anyone done something
[16:23:25] <Mr_Sheesh> akin to that? (Could just low pass filter a rectified audio signal I'd think and that should do it, this doesn't have to be complex.) May just have to try it :)
[16:25:34] <sebus> Also about switching transistor on/off.. If too much current will be applied on base, then it become slower to switch it off again. Be careful in hi-speed switching circuit. ^ Lambda_Aurigae ; GilDev.
[16:26:01] <GilDev> Thanks
[16:26:17] <GilDev> It's just to power on a system and power off when voltage is low, so really low speed switching =)
[16:27:17] <carabia> for hi-speed switching you oughta use a fet anyway
[16:29:22] <GilDev> Alright, I calculated something, looks like I need ± 10 kΩ resistor for my base
[16:29:30] <Lambda_Aurigae> Mr_Sheesh, band pass audio filter if it is an audio tone.
[16:29:57] <Lambda_Aurigae> GilDev, like I said, try 10K and play around from there.
[16:30:15] <Lambda_Aurigae> it's called a hacker's guess.
[16:30:28] <GilDev> Yeah, but I like maths better =)
[16:30:33] <Lambda_Aurigae> bah.
[16:30:34] <Lambda_Aurigae> hack it!
[16:30:35] <GilDev> Anyway I got this calculus: (5-1.3)/(0.150/40)
[16:30:42] <Lambda_Aurigae> then make the math fit when it works.
[16:30:45] <GilDev> Gives me almost 1
[16:30:46] <GilDev> k
[16:31:02] <GilDev> Sorry I said 10k, it was 1k
[16:31:24] <Mr_Sheesh> It's a device that I can't really tear open - creating the same complex sound every 2-3 seconds, but I think it's the only sound that short, mainly want to just log when it's made
[16:31:28] <GilDev> There are 32 LEDs, not sure 10k would be enoush
[16:31:56] <Lambda_Aurigae> Mr_Sheesh, I used to use band pass filtering with walkie talkies and 2-transistor oscillators with multiple resistors and buttons to make RC car controllers when I was 14....35 years ago.
[16:33:14] <Mr_Sheesh> It's not the frequencies it makes, tho; It makes OTHER sounds too and those can be in the same frequency range. It's discriminating the sound's length, THAT is unique
[16:33:26] <Lambda_Aurigae> you COULD use a frequency to voltage converter hooked to an ADC and watch for a proper voltage input.
[16:33:52] <Lambda_Aurigae> so you need to do a bandpass plus watch for it coming in on the microcontroller somehow.
[16:34:16] <GilDev> Well, works with 10k
[16:34:54] <Lambda_Aurigae> you need a way in the microcontroller to "hear" that sound...the band pass filter will do your discrimination for you....then you need to watch for that frequency on an i/o pin and when it catches the pulse rate, time it.
[16:35:18] <Lambda_Aurigae> GilDev, if your math says 1K fits, 10K should work but be a bit slow with the turnon time.
[16:35:30] <GilDev> I don't care about the time
[16:35:40] <GilDev> Just about giving me enough power, not consuming too much
[16:35:48] <GilDev> I really don't know a lot about transistors
[16:36:02] <Lambda_Aurigae> the higher that resistor, the less base current is consumed.
[16:36:13] <Lambda_Aurigae> up to a point when it won't saturate.
[16:36:16] <Mr_Sheesh> It's a sound, not a fixed frequency, Lambda_Aurigae. Think of hearing a nut cracking, for example, you can tell it's not a footstep as it's shorter, sorta like that
[16:36:37] <Lambda_Aurigae> I've been known to do that with a variable resistor...turn it up till it don't work then back down till it works and just a bit more..measure, and find a resistor close match.
[16:36:52] <Lambda_Aurigae> Mr_Sheesh, then you are going to need some DSP
[16:37:16] <Lambda_Aurigae> a human mind can discriminate that....doing it with an 8-bit microcontroller,,,,gooood luck.
[16:37:39] <Mr_Sheesh> Which is what I'm trying to avoid :) I'll try it, if it won't work based on the sound's length then I'll try something else. WOrth playing :)
[16:38:13] <Lambda_Aurigae> if it is making lots of other sounds then discriminating one particular type of sound is not something an avr will be able to do in realtime.
[16:38:15] <Lambda_Aurigae> if at all.
[16:38:42] <GilDev> Great idea
[16:38:45] <Lambda_Aurigae> picking out a particular frequency or pulse pattern, yeah...
[16:38:46] <Mr_Sheesh> uC's are GREAT at telling period of something, they suck at other things LOL. It's not many other sounds, it's just that there's no LED I can tap off, just a sound output. Pain in the butt rules on this project LOL
[16:38:51] <GilDev> But can't do it right now
[16:39:37] <GilDev> So if I understand there's a clear separation for when it saturates and when it does not? So whatever resistor I choose, it works or does not works, but very little chance to get something in between?
[16:40:43] <Lambda_Aurigae> Mr_Sheesh, look at the sound on an oscope..see if there is an underlying frequency that a bandpass filter can filter...then feed that to an op-amp and feed that through a diode to a cap...then you can get a voltage on the cap while that frequency is present...measure that voltage time and you are golden...
[16:41:13] <Lambda_Aurigae> without a frequency to pass on...just feeding audio in, someone talking nearby might give you similar results.
[16:42:09] <Lambda_Aurigae> listening for sound...doable...listening for a particular sound pattern...needs dsp.
[16:42:51] <Lambda_Aurigae> maybe something that could be done with an atxmega or dspic33 series chip.
[16:44:17] <Mr_Sheesh> It can run off the headphone jack, fortunately. I'd already thought of this all, pretty sure it'll work, I think internally each of these sounds is a .mp3 file, or a .wav file, something like that. So unless two sounds stomp on each other it should work :)
[16:52:36] <Lambda_Aurigae> so..feed the audio to an op-amp...from that through a diode to your input..and put a cap between the input and GND...you should be able to see a voltage build up on the cap if done right.
[16:53:06] <Lambda_Aurigae> might take some tweaking, or, FSM forbid, math to figure out the right values and settings...but should be doable.
[16:53:17] <Mr_Sheesh> Analog is like that LOL
[16:53:26] <Lambda_Aurigae> black magic of the worst kind!
[16:54:09] <Mr_Sheesh> Save us, Bob Pease! Ohnoes :/
[16:54:32] <Lambda_Aurigae> Only the IPU can save us.
[16:54:36] <Lambda_Aurigae> Bob just laughs
[16:54:49] <Lambda_Aurigae> and the FSM just waits with his noodly appendages to take us straight to heck.
[17:12:35] <Mr_Sheesh> ugh maintenance? UGH.
[20:23:50] <carabia> yay, my stm32f7 programs.
[20:24:25] <carabia> praise be to the openocd
[20:25:20] <carabia> it's a bit of a pain they don't have compiled binaries available for download of their dev-branch, they release binaries and an "official version" once in a blue moon
[20:30:01] <Lambda_Aurigae> obsessive compulsive disorder is now open source?
[21:12:12] <carabia> Lambda_Aurigae, could sure be. I believe this one is the on-chip debugger though
[21:38:19] <carabia> First time I'm even touching a CM7. I already hate the HAL-lib STM provides for the CM7. the stdperiph-lib they have for the cm3/4 (at least) is waaaay nicer.
[22:01:44] <carabia> I'd go as far as to saying they've managed to clusterfuck it even more than the cm0+ asf by atmel