#avr Logs

Aug 18 2017

#avr Calendar

12:04 AM day_ is now known as daey
12:23 AM enh: https://www.electronicspoint.com/threads/what-to-do-when-plastic-becomes-sticky.214720/
12:23 AM enh: Never tried. Did any of you try this?
12:24 AM enh: 1:53 am in extreme NE of Brazil now.
12:55 AM enh: sooo silent here
12:56 AM enh: Can you guys suggest me a good laser diode for cutting 3mm plywood? Mine is only 500mW and, when cuts through dark thin paper I commemorate a lot.
02:26 AM enh: http://www.ebay.com/itm/Focusable-450nm-3W-Blue-Laser-Module-TTL-Carving-Burning-Engraning-Gift-Goggles/112386250526?_trkparms=aid%3D222007%26algo%3DSIM.MBE%26ao%3D2%26asc%3D45728%26meid%3De962ea9d31574ac9bd009f7a05837aff%26pid%3D100005%26rk%3D5%26rkt%3D6%26mehot%3Dpp%26sd%3D292072195109&_trksid=p2047675.c100005.m1851
04:07 AM polprog: how easy is soldering QFN?
04:07 AM polprog: or maybe
04:07 AM polprog: how easy is to fuck up a qfn job
04:13 AM dgriffi: if you get it aligned right and have good liquid flux, fairly easy
04:15 AM _ami_: polprog, got hot air gun and solder paste?
04:15 AM polprog: yeah
04:16 AM polprog: pb paste
04:16 AM _ami_: then it should not be difficult job
04:17 AM polprog: thanks
04:17 AM polprog: good
04:26 AM dgriffi: basically brush a solder over the pins
04:32 AM _ami_: polprog, have solder wick nearby in case you fuck it up ;)
04:32 AM polprog: hope i wont
04:32 AM polprog: ive got 4 chips and 4 pcbs
04:33 AM polprog: no second chances
04:33 AM polprog: but that's in the evening
04:33 AM _ami_: polprog, is it a avr board?
04:33 AM polprog: kindof
04:33 AM _ami_: ok
04:33 AM polprog: dont have the pcbs yet
04:34 AM _ami_: seeedstudio has delayed my pcbs.. still in processing. :/
04:34 AM _ami_: ordered on 7th Aug
04:34 AM _ami_: 11 days
04:34 AM polprog: :(
04:34 AM _ami_: not gonna use them next time.
04:48 AM ohsix: heh friend was teaching a class and had his delayed too
04:48 AM ohsix: did they tell anyone about the color changeover?
05:51 AM Emil: R0b0t1`: what is=
05:51 AM Emil: rue_shop2: *
05:53 AM hetii: hi :)
05:55 AM hetii: Do you know some generic hardware independent library with effects for ws2812 like led strips?
05:56 AM hetii: I know about http://fastled.io/ but looking something more generic.
05:58 AM Emil: >hardware independent
05:58 AM Emil: http://i0.kym-cdn.com/photos/images/newsfeed/001/183/604/ee9.png
06:00 AM hetii: Emil, imho effect can be written as a separate library and then linked in final project.
06:02 AM Emil: Well duh, an api is of course good
06:02 AM Emil: but you'll need a driver for each device
06:03 AM Emil: If you want "hardware independence" then just make a hal api
06:04 AM Emil: like set_led(id, led, struct colour) or set_leds(id, length, strcut colour*)
06:04 AM Emil: or something like that
06:07 AM hetii: yep the driver is not the point, just ask if maybe there is already such library if not I will create one.
06:08 AM Emil: eh
06:08 AM Emil: Just create your own api
08:55 AM remkooo1 is now known as remkooo
09:02 AM Emil: Hmm
09:02 AM Emil: What should I use for adjustable pulse generator
09:02 AM Emil: like say every 60 seconds, or every 600 seconds
09:03 AM Emil: say from 1 second to 1 hour
09:03 AM Emil: adjustable
09:03 AM Emil: Low power
09:03 AM Emil: perhaps some attiny that I talk to digitally
09:07 AM LeoNerd: I need a log10() function on an AVR. Anyone any suggestions? Does libc have one?
09:07 AM Emil: it does iirc
09:08 AM Emil: http://www.atmel.com/webdoc/avrlibcreferencemanual/group__avr__math_1ga3630cb8cef4560cf0d92e82ae05b03f0.html
09:08 AM Emil: http://www.nongnu.org/avr-libc/user-manual/group__avr__math.html
09:08 AM LeoNerd: Hrm... double->double though. I was sortof hoping for a scaled integer (u)int32_t one
09:09 AM Emil: How much error are you willing to tolerate?
09:09 AM LeoNerd: Hmm.. I'm only displaying a dB value on a voltmeter (it's for relative measurements), so I guess if I can get 4 digits of precision out of it that's probably good enough. maybe 5
09:10 AM Emil: Ah
09:10 AM Emil: So for display only
09:10 AM polprog: could use a lookup table
09:10 AM Emil: Well in that case it doesn't even need to be that efficient
09:10 AM polprog: or extrapolate from one
09:10 AM Emil: polprog: that's my idea, too
09:10 AM Emil: if you really need fast
09:10 AM LeoNerd: Oh indeed not; it's only displayed about 8 times a seconde
09:10 AM Emil: lookup with interpolation
09:10 AM LeoNerd: It doesn't need to be fast
09:10 AM Emil: LeoNerd: then just use the libc log10
09:10 AM LeoNerd: Hmmm
09:10 AM Emil: It doesn't take that many cycles
09:48 AM LeoNerd: Emil: https://stackoverflow.com/questions/32159300/compute-logarithmic-expression-without-floating-point-arithmetics-or-log also interesting
09:48 AM LeoNerd: The algorithm has a nice parallel to multiply/divide also
09:49 AM LeoNerd: That approach looks easily extensible, and suited to table lookups
10:00 AM JanC is now known as Guest43740
10:00 AM JanC_ is now known as JanC
10:28 AM woddy1 is now known as woddy
11:16 AM Emil: LeoNerd: yeah I think I've seen that one before
11:17 AM LeoNerd: https://www.quinapalus.com/efunc.html explains in more detail
11:20 AM LeoNerd: The advantage of this technique is that I can build in the scaling of the result of the function myself right into the tables it uses
11:20 AM Emil: Here's a question, though
11:20 AM LeoNerd: What I actually want to calculate is 20000 * log10(x) but I can perform the 20000 * multiplication implicitly in the table
11:20 AM Emil: So I need to latch a gate
11:21 AM Emil: But integrating a physical button is annoying
11:21 AM Emil: So I've been toying around with the idea of using the 50Hz leakage to latch
11:22 AM polprog: a long cable, a schmitt trigger and youre good
11:22 AM Emil: So when an user takes his finger to a battery powered device's pad it would capacitively couple and latch
11:22 AM Emil: But I'm not entirely sure if it works
11:22 AM Emil: I should try it
11:22 AM Emil: I think it might
11:22 AM bss36504: Emil: why not just use one of the qtouch latch chips?
11:22 AM Emil: bss36504: because battery powered
11:23 AM Emil: and that's another microcontroller to integrate
11:23 AM bss36504: What? no. There are SOT23 Qtouch chips that support a single button and use uA
11:23 AM Emil: interesting
11:23 AM Emil: Link?
11:23 AM bss36504: hold on...
11:24 AM Emil: Because qtouch is atmel's trademark
11:24 AM polprog: i could use those... cool
11:24 AM Emil: I thought you meant avrs
11:24 AM bss36504: http://www.atmel.com/products/touchsolutions/bsw/dedicated-touch-devices.aspx
11:24 AM Emil: Oooh
11:24 AM polprog: would a soldermasked big pad of copper work as the capacitor for such a chip?
11:25 AM bss36504: polprog: yes
11:25 AM Emil: Dat price, though
11:25 AM bss36504: Look at the app notes
11:25 AM bss36504: classic RTFM
11:25 AM polprog: Emil: try with a schmitt trigger first
11:26 AM bss36504: Emil: 58 cents?
11:26 AM Emil: bss36504: mouser only had qfn
11:26 AM Emil: but yeah sot-23-6 on digikey
11:26 AM bss36504: http://www.microchipdirect.com/ProductDetails.aspx?Category=AT42QT1010
11:26 AM bss36504: Thats where I was looking.
11:26 AM bss36504: Mouser is also usually more expensive than digikey, at least in my experience. Gotta support that pretty website somehow ;)
11:27 AM Emil: Iiiimma buy a bunch
11:27 AM Emil: bss36504: it depends on what you get
11:27 AM bss36504: Indeed
11:27 AM bss36504: but, 60 cents on digikey isnt too bad.
11:28 AM bss36504: and 17uA of current consumption at 1.8V, that's pretty snazzy
11:29 AM Emil: 17uA is quite a lot actually
11:31 AM Emil: It's only some 200 days on a single cr2032
11:31 AM bss36504: A lot less than you could do with discrete chips though
11:31 AM Emil: bss36504: if I'm triggering a latch on capacitively coupled high voltage
11:31 AM bss36504: add an attiny to power gate stuff and go into low power mode every 100ms
11:31 AM Emil: Then I'm using less
11:32 AM Emil: The problem is though that that qtouch one _works_
11:32 AM bss36504: No man, the latch circuitry is gonna burn power like a mofo. I don't care if youre using 7400 series chips or making it out of discrete fets, it's going to be more leaky and use more power than 17uA
11:33 AM bss36504: also, The AT42QT1010 has a low power mode
11:34 AM Emil: bss36504: I doubt it
11:34 AM Emil: But I should test it
11:34 AM bss36504: you doubt the leakiness of discrete components or the sleep mode? Cause the former is an educated guess and the latter is a fact lol
11:34 AM bss36504: Just simulate it
11:36 AM Emil: leak of discrete
11:36 AM Emil: but if that thing has a low power mode
11:36 AM Emil: nice
11:37 AM bss36504: you know what uses 0uA? A switch :P
11:38 AM Emil: Ah
11:38 AM Emil: I fucking knew it
11:38 AM Emil: https://emil.fi/jako/kuvat/2017-08-18_19-07-28_c3udcyRW.png
11:38 AM Emil: bss36504: that's what I have, pretty much
11:38 AM Emil: The 17uA mode is in low power when your supply is 1.8 volts
11:39 AM Emil: In fast mode it's a lot more
11:39 AM Emil: Ten times more
11:41 AM bss36504: indeed.
11:41 AM bss36504: in fairness, I really just skimmed the DS
11:41 AM bss36504: I figured I'd leave the rest to the interested party ;)
11:42 AM Emil: heh
12:12 PM Emil: Hahah
12:12 PM Emil: it works just like it should
12:15 PM bss36504: what does?
12:16 PM Emil: Capacitive coupling to pin
12:17 PM Emil: The only issue is that I need to latch quickly enough so I can't use my newer idea
12:17 PM Emil: which hinges on using a normal button
12:17 PM Emil: But I have to use my older design
12:17 PM Emil: Which adds two more mosfets
12:18 PM polprog: so how are you coupling this eventually
12:18 PM polprog: just a floating pin?
12:18 PM Emil: kinda
12:18 PM polprog: trivial
12:18 PM Emil: Now the question is wheter or not it works reliably everywhere
12:18 PM Emil: (and how reliably)
12:19 PM Emil: and if I should add an avr to periodically wake it up
12:19 PM polprog: tsk tsk esd protection
12:19 PM Emil: polprog: I haven't forgotten that
12:19 PM polprog: :P
12:19 PM Emil: The coupling is through a human
12:19 PM Emil: so that's like at least a 10 MOhm
12:20 PM Emil: And then there'
12:20 PM Emil: 's clamping diodes integrated
12:20 PM Emil: Finaly thing is that there's a voltage divider
12:20 PM polprog: nice
12:20 PM polprog: :)
01:34 PM Emil: Hmmmmm
01:34 PM Emil: Now the question is if I want to use the actual modules
01:34 PM Emil: I think I do
01:34 PM Emil: sorry
01:34 PM Emil: actualy chips instead of modules
01:35 PM Emil: (esp8266)
01:35 PM Emil: RF design here I come
01:35 PM Emil: and actually, esp8285 instead of 8266
01:45 PM polprog: lol
01:45 PM polprog: Dave Jones looks exactly like Hank Hill
01:45 PM polprog: lol
01:45 PM HighInBC: hehe
01:45 PM HighInBC: and sounds like mickey mouse
04:05 PM carabia: sup, avr? =D
04:12 PM carabia: Tom_L: do you still log this channel?
04:14 PM bss36504: carabia: !!!
04:14 PM bss36504: Welcome back
04:14 PM carabia: Hahaha, I wanted to see under which name I was here... Hence the logs :D
04:15 PM carabia: turns out I was right :)
04:15 PM bss36504: indeed
04:15 PM carabia: And on an unrelated note, I'm already loving the current topic. It has something very... heartwarming to me.
04:15 PM bss36504: let me guess, it rhymes with STM32
04:16 PM carabia: How'd you know?!
04:17 PM carabia: Also, bss36504 do you remember there was this brazilian guy who was working on this kind of a modular design of... I wonder what it was. Might have had something to do with avionics?
04:17 PM bss36504: yeah actually... I think it was enh
04:17 PM carabia: And if he's still around. He left me his email-address but seems like I lost it along the way
04:18 PM carabia: Yeah cool, lately been wondering what he's up to, and if the thing took off
04:18 PM bss36504: carabia: This project? https://hackaday.io/project/11724-yauvc-yet-another-unmanned-vehicle-controller
04:18 PM carabia: Yes!
04:18 PM bss36504: He just linked it yesterday or the day before so it was still in my history haha
04:19 PM carabia: Yeah, maybe he's around here soon enough, would like to talk to him. Can just highlight him a bit more. enh !
04:20 PM carabia: Anyway, bss36504 how have you been holding up? Did you ever manage to realize any of those internet-of-thongs ideas that we so brilliantly devised?
04:22 PM bss36504: Been doing alright, but no, unfortunately no smart toilets haha
04:22 PM bss36504: Finally doing some actual circuit design for work....which is what I was hired for a year ago
04:23 PM polprog: oh, hi
04:23 PM polprog: heard about you once
04:23 PM carabia: bss36504: yeah, sounds like typical management
04:23 PM carabia: and polprog if that was for me, i'm sure it wasn't anything nice
04:24 PM polprog: carabia: why, havent heard anyone talk abd about you here
04:24 PM polprog: bad*
04:25 PM bss36504: mostly just "anyone seen carabia on here lately?"
04:25 PM polprog: :D
04:25 PM carabia: i haven't been here in ages, and i gave up reading arduinoday
04:25 PM carabia: arduinoaday, perhaps
04:26 PM polprog: apropos arduino
04:26 PM polprog: i'll see if that "programming in electronics" course i signed up for is worth anything
04:27 PM carabia: now however, it seems like i can more freely spread the word of arms, given the topic, perhaps i gotta cut down on the old shit-flinging business though
04:29 PM carabia: polprog: this is uni or?
04:29 PM polprog: organized by local uni
04:29 PM polprog: for highschoolers
04:29 PM carabia: alright
04:30 PM carabia: seeing as you're here though, are you sure it's worth it?
04:30 PM carabia: or are you here of... outsider interest, so to speak
04:31 PM polprog: honestly
04:31 PM polprog: it's more because i dont wanna sit at home all day...
04:31 PM polprog: actually i have a "job", it's just not much hapenning in it now
04:32 PM carabia: what do you do?
04:32 PM polprog: a data logger prototype
04:32 PM polprog: for a local firm
04:34 PM polprog: awesome
04:34 PM polprog: th aprts just came in
04:34 PM polprog: the parts*
04:34 PM carabia: hmm, cool. what's it logging?
04:34 PM polprog: temp
04:36 PM carabia: is there some niche involved in terms of size constraints or, the likes?
04:39 PM Emil: carabia: wait
04:39 PM Emil: carabia: didn't you fucking disappear or something
04:40 PM Emil: carabia: matey
04:40 PM Emil: carabia: do an arm guide like this https://emil.fi/avr
04:40 PM Emil: carabia: I'll buy you a beer
04:51 PM carabia: well, you mean for a specific chip?
04:52 PM carabia: and well i got kicked and i figured i'd lay low. kind of forgot about #avr until recently
04:56 PM carabia: could easily write one for something popular, like the stm32f103 m3
04:56 PM Emil: yeah
04:56 PM Emil: that'd be awesome
04:56 PM carabia: might just do something like that
04:57 PM Emil: carabia: that guide is applicable to pretty much any avr
04:57 PM Emil: carabia: superb!
04:57 PM carabia: Emil: yeah, i know. just that it even shows a pinout
04:57 PM carabia: though, you can generalize arm-stuff as well. but figures it would be nice to be specifically for something that's easily available, cheap and generally applicable to many things
04:58 PM Emil: yeah that's fine
04:59 PM carabia: that's a really beginner-approach, so i would probably take one of those popular breakout boards as an example, they're populated with pin headers, etc as m3 doesn't come in anything but smt, + aux circuitry
04:59 PM Emil: That's fine
05:00 PM Emil: Even taking one of those bluepills is fine
05:00 PM Emil: The software side is the problem
05:03 PM Sokomine: emil: seems to be a good tutorial. perhaps you ought to mention https://github.com/mjoldfield/Arduino-Makefile as well. with that it boils down to creating a simple makefile, make; make upload (or make ispload); and optionally make monitor
05:04 PM LeoNerd: I do those. Except I call it "make install"
05:04 PM polprog: mine's called make flash
05:04 PM Sokomine: :-)
05:05 PM Sokomine: it's good that the tutorial mentions the options for avrdude for doing it manually. might be intresting sometimes as well
05:05 PM polprog: this is a very good idea
05:06 PM polprog: especially -vvv comes in handy when things go wrong
05:06 PM Sokomine: i'm currently fighting to understand timers, interrupts and pwm. seems that a led, a servo motor and a normal dc motor are very diffrent things when it comes to which frequency fits :/
05:08 PM polprog: if you need some help just tell us
05:08 PM Sokomine: hm, yes. you still have to believe what the compiler tells you :) first time i tried to program another chip using an arduino avrdude kept telling me to check my wires. trouble was: it was right. there really was a broken wire
05:08 PM Sokomine: thank you :-)
05:08 PM polprog: for every computer error there are two human errors including blaming the computer
05:08 PM Sokomine: it's mostly trying to learn, but it'd be helpful to be able to ask sometimes
05:09 PM polprog: it's never wrong to ask
05:09 PM Sokomine: i hate broken wires. don't know why they gather up on me :/
05:10 PM polprog: heh, i remember sometimes it takes 30 minutes to sort avrdude out. then it works all day long :D
05:10 PM Sokomine: :-)
05:11 PM Sokomine: the servo motor is almost doing what it ought to do by now. i'm using the arduino for testing for now as that's easier, but i want the final cirquit to be controlled by an attiny2313. doesn't make it easier with them having diffrent frequencies and capabilities and register names
05:13 PM bss36504: Position servo or continuous rotation? Either way, most servos kind of suck in my experience. As in, they don't really hold position well (in the case of the former) and the speed control isn't always very linear (in the case of the latter)
05:13 PM polprog: watch out because attiny2313 has only 2kb of flash, while atmega328pb has 32k of flash
05:13 PM Sokomine: for the servo, a prescaler of 64 with timer0, all at 16mhz, seems to be too fast. i have to let it overflow 2-4 times for operation
05:13 PM Sokomine: position servo. took an old one from remote controled models
05:14 PM polprog: cant you use a bigger prescaler?
05:14 PM Sokomine: i'm aware of that. the 2kb flash limit forced me to abandon the arduino libs. they're too big for that purpose
05:15 PM polprog: also, are you toggling the pin on every overflow interrupt?
05:15 PM Sokomine: while it runs on the arduino, yes, a bigger prescaler might be the solution. just have to adjust that later on to the slower attiny
05:15 PM polprog: that's quite frequent even for a servo, i think, (31khz)
05:16 PM Sokomine: no, right now i can't toggle it at each overflow interrupt. they're comming too fast for that. i'm mostly in the trying-to-learn-and-understand-phase, so i'm experimenting a bit
05:16 PM polprog: you could try to change the fusebits to use the internal oscillator... that's risky but it could make the 328 be a bit more like t2313
05:16 PM polprog: the ISRs (interrupts) cant be too fast to toggle a pin...
05:16 PM Sokomine: so, for the servo, i need a much slower speed. the same timer0 is also used for reading commands from a particular remote. but there's time to spare - the ir's commands are much slower even
05:16 PM polprog: it literally takes 2 cycles...
05:17 PM Sokomine: er, not slower. but...handled diffrently
05:17 PM polprog: t2313 has two timers, one 8 bit and one 16 bit
05:17 PM polprog: you could use the 8 bit one for servo and the 16 bit one for IR
05:18 PM Sokomine: 31khz? no, i think it's much slower. i don't use pwm direclty. i use a combination of interrupts and timer capture to emulate a pwm frequency. at first i passed the pwm freqency to the servo directly. it protested loudly
05:18 PM polprog: hmm
05:18 PM polprog: i dont have much experience in driving servos
05:19 PM Sokomine: i found documentation about them. apparently, they need a pulse from 1-2 ms - and after that a long pause
05:20 PM Sokomine: so..i'm optimistic about that. a larger prescaler on the faster arduino would help, but on the tiny i'll need a diffrent one. alltogether they're relatively slow things
05:21 PM Sokomine: but there are also dc motors. a l293d shall drive 2 motors. and now i was checking on which frequency they want...first considered using timer1 for them...but now i read about some frequencys beeing a huge drain on the ears
05:23 PM Sokomine: one site recommended using 5-15khz for a motor's pwn signal. with the 1mhz the attiny has, and even a prescaler of 0, timer0 would produce a signal of no more than about 4khz if i'm not mistaken?
05:23 PM polprog: no
05:23 PM polprog: the bigger the prescaler the slower the timer
05:23 PM Emil: Sokomine: servos are super simple
05:24 PM Emil: 50Hz signal (so 20ms T)
05:24 PM Emil: And then 1-2ms pwm pulse
05:25 PM Sokomine: emil: i first thought i ought to reserve one of the pwm outputs for them. but that does not seem to be the way to go. found an intresting approach to control several servos by sending their pulses sequentially and resetting the timer capture value after each impulse
05:25 PM Emil: Sokomine: with prescaler of 1 (0 means timer is not running most often) your 1MHz clock will produce ~4kHz
05:25 PM Emil: Sokomine: yeah you'd probably want to use pwm to control a servo
05:26 PM Sokomine: emil: ah. so i got that right with a max of 4khz on the tiny@1mhz?
05:26 PM polprog: if your CPU runs on 1MHz, and your prescaler is, say, 2, the timer will increase every 2 ticks, which will mean it overflows every 512 ticks (for an 8 bit timer). 1MHz/512 = around 2khz
05:26 PM polprog: Sokomine: you got it righ
05:26 PM Sokomine: thank you :-) it does seem a bit difficult to get at first
05:26 PM polprog: you can speed it up or fine tune by setting the initialvalue of the timer each interrupt
05:26 PM polprog: so it counts from, say 128 to 255 instead from 0
05:26 PM Sokomine: but that would give me less range to control the motors
05:27 PM Emil: But if you want to control multiple servos then software interrupts are fine
05:27 PM Emil: There's a tiny amount of jitter depending on the instruction being executed
05:27 PM Emil: but it's fine
05:27 PM polprog: you could make the timer interrupt every 100 cycles of you set the value to 155
05:28 PM Sokomine: emil: yes, that page semed to suggest something similar. it combined both. and i'm using something similar for now in order to not to have to adjust the timing values for the ir remote
05:28 PM polprog: and prescaler to 0
05:28 PM Emil: Sokomine: Your tiny can also run at 8MHz
05:28 PM Emil: polprog: prescaler 0 means timer doesn't run
05:28 PM Sokomine: emil: but then i'd have to use some fuses? or can i tell it in the program?
05:28 PM polprog: whoops
05:28 PM polprog: :D
05:28 PM polprog: Emil: youre rite
05:29 PM Emil: Sokomine: CLKPR=(1<<7); CLKPR=0;
05:29 PM polprog: dont set it to 0 because the timer will divide the clock by zero and it will destroy the time and space. it's against OSHA.
05:29 PM Emil: Sokomine: That might bypass the fuse
05:30 PM Emil: but I don't remmeber
05:30 PM Sokomine: oh? that does it already?
05:30 PM Emil: Sokomine: fuses are really easy to program
05:31 PM Sokomine: polprog: :) i already tortured the poor ir receiver thing by connecting ground, vcc and signal wrong. got hot...but survived. amazing thing
05:31 PM Emil: Sokomine: alternatively
05:31 PM Emil: Sokomine: #include <avr/power.h> and then clock_prescale_set(clock_div_1)
05:31 PM Emil: ;
05:32 PM Sokomine: i'd prefer to avoid to have to connect a crystal. they seem to be optional
05:32 PM Sokomine: that sounds good :-)
05:32 PM Emil: crystals are kawaii
05:32 PM Sokomine: what's kawaii?
05:32 PM Emil: Highly recommended
05:33 PM Sokomine: even for that purpose?
05:33 PM NoHitWonder^: <avr/power.h> << this is pretty new?
05:34 PM Emil: NoHitWonder^: no
05:34 PM Emil: NoHitWonder^: old as fuck
05:34 PM Emil: http://www.nongnu.org/avr-libc/user-manual/group__avr__power.html
05:34 PM Emil: It also features only the clock_prescale_set :D
05:34 PM Emil: but also has macros
05:34 PM NoHitWonder^: ok
05:35 PM Emil: Good night
05:35 PM NoHitWonder^: nite
05:36 PM polprog: "what's kawaii?" "highly recommended" lol
05:38 PM Sokomine: sleep well
05:38 PM polprog: nite
05:39 PM Sokomine: but: why is a crystal recommended? it's not going to be a clock. the ir signals are...rater inpreceise in their timing and get decoded by allowing for a range of timer ticks. the servo...not sure if any derivation might be detectable there
05:40 PM gregor2: Can somebody help me?
05:41 PM gregor2: I am trying to program for a atmega328p for the first time. I am using usbasp and avrdude and always get this error:
05:41 PM gregor2: avrdude: error: programm enable: target doesn't answer. 1
05:41 PM gregor2: avrdude: initialization failed, rc=-1
05:41 PM Sokomine: that clock_prescale_set will be very helpful. thank you again
05:41 PM polprog: gregor2: try with more verbosity : -v
05:42 PM gregor2: Same thing again. What do you want to know?
05:43 PM polprog: post the output to some paste bin,
05:43 PM ohsix: where do i look to find otu what the .x?? linker script variations are for
05:43 PM ohsix: avr-gcc/binutils
05:44 PM NoHitWonder^: have you considered using servo controler?
05:44 PM gregor2: https://pastebin.com/YCKNHu4K
05:44 PM polprog: gregor2: check the connections,
05:45 PM polprog: check if nothing shorting or anything
05:45 PM gregor2: it seems that everything is alright
05:45 PM Sokomine: NoHitWonder^: is there a lib for servos? but then...the tiny has only 2 timers, i want to control 2 motors, receive ir signals and control 1-2 servos (mostly in order to get familar with interrupts and timers)
05:45 PM gregor2: i tried it with external power source and over usb
05:45 PM polprog: stupid question, is the avr powered up?
05:45 PM polprog: ok
05:45 PM ohsix: looks like on fedora, it's binutils upstream, there's a patch from atmel but it is unrelated
05:45 PM gregor2: I used the jumper on the usbasp.
05:46 PM polprog: i dont rember what did it do
05:46 PM gregor2: http://www.avrfreaks.net/sites/default/files/USBasp_ISP_interface_%2528header%2529.png
05:46 PM polprog: ok i remember now
05:47 PM gregor2: This is the picture i used as reference for connecting.
05:47 PM gregor2: And the datasheet of the atmega328p
05:47 PM Sokomine: gregor2: in my case programming another avr via an arduino failed due to one of my wires having a shortcut
05:47 PM gregor2: Wires having a shortcut?
05:47 PM polprog: well, check for shorts
05:48 PM gregor2: how?
05:48 PM gregor2: The ribboncable?
05:48 PM NoHitWonder^: Sokomine i mean a chip that takes care of the PWM, you control it via i2c/spi
05:48 PM Sokomine: er, beeing broken :-) don't know a more appropriate english term
05:49 PM polprog: rc=-1 means that the connections are wrong, the micro is not powered properly or there's something wrong with the clock, like no crystal present when the avr is set to be clocked from external crystal
05:49 PM gregor2: Yes i know what you mean.
05:49 PM gregor2: I have a crystal
05:49 PM NoHitWonder^: https://cdn-shop.adafruit.com/datasheets/PCA9685.pdf like this
05:49 PM polprog: did you by chance take out the chip from an arduino?
05:49 PM Sokomine: NoHitWonder^: i've seen them advertised, and they're probably great if all you want is to control some servos without much fuss. though that software pwm on a tiny might work very fine already
05:49 PM NoHitWonder^: yeah
05:49 PM gregor2: But i have bought the avr right now.
05:50 PM polprog: hmm
05:50 PM gregor2: Its the first time i use it.
05:50 PM gregor2: Should i try removing the crystal?
05:50 PM Sokomine: do you have other chips at hand and can you try with one of them?
05:50 PM polprog: hmm, i guess
05:50 PM gregor2: yes
05:51 PM gregor2: i have tree of them and i have tried two.
05:51 PM polprog: they are clocked from the internal osc i believe
05:51 PM polprog: check the power connections
05:51 PM gregor2: Is this a problem?
05:51 PM gregor2: If i have an external crystal connected but the chip is configured to use the internal clock?
05:52 PM polprog: i think it will just ignre the crystal
05:52 PM polprog: also, you can post a photo of the whole setup
05:53 PM ohsix: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=ld/scripttempl/avr.sc;h=010b218c53857075eb8958eed4b1c037a487eb38;hb=2870b1ba83fc0e0ee7eadf72d614a7ec4591b169
05:55 PM gregor2: where can i post photos
05:56 PM polprog: gregor2: it's most likely a bad connection or old firmware on USBasp (i had that in mine)
05:56 PM polprog: imgur
05:57 PM polprog: heh, it's late, imma go to sleep
05:57 PM polprog: good luck
05:59 PM gregor2: Do i have to upload a firmware onto the usbasp if i bought it?
06:02 PM gregor2: can i mess anything up if i update the firmware>
06:02 PM gregor2: like brick the usbasp?
06:07 PM gregor2: nothing is working here
06:09 PM ohsix: finally https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=ld/emulparams/avr5.sh;h=2d0fc4fab87edb2309f31edc2e803eb316005a9a;hb=2870b1ba83fc0e0ee7eadf72d614a7ec4591b169
06:09 PM ohsix: <3 binutils but finding the source of something in glibc/gcc/binutils is always an adventure
06:12 PM gregor2: I also can not update the firmware.
06:12 PM gregor2: avrdude: error: usbasp_transmit: error sending control message: Broken pipe
06:13 PM gregor2: Here is what i typed: avrdude -p m8 -c usbasp -U lfuse:r:test
06:14 PM gregor2: This should work shouldnt it? I set the service jumper.
06:19 PM gregor2: What can happen if i flash something on my usbasp?
06:21 PM Casper: a programmer will not program itself
06:22 PM gregor2: I am about to try this: avrdude -p m8 -c usbasp -U flash:w:usbasp.atmega8.2011-05-28.hex -U hfuse:w:0xc9:m -U lfuse:w:0xef:m
06:22 PM gregor2: So i cant do this that way?
06:22 PM gregor2: I would need a second programmer?
06:27 PM Lambda_Aurigae: the usbasp does not have a self-programming bootloader, sorry.
06:27 PM Lambda_Aurigae: usbasp is probably the most common and most cussed at programmer out there.
06:29 PM gregor2: But its ulikely that the firmware already on the usbasp isnt able to program my atmega328p isnt it?
06:30 PM Lambda_Aurigae: very likely
06:30 PM Lambda_Aurigae: what is your atmega328p clock speed
06:30 PM Lambda_Aurigae: ?
06:31 PM gregor2: i dont know
06:31 PM Lambda_Aurigae: if it is factory new then it is 8MHz with div8 clock prescaler on the internal RC oscillator...meaning 1MHz.
06:31 PM gregor2: its new
06:31 PM Lambda_Aurigae: the usbasp default programming speed is too fast.
06:31 PM Lambda_Aurigae: you have to slow it down.
06:31 PM gregor2: ah
06:32 PM gregor2: so i need the jumper to slow down?
06:32 PM Lambda_Aurigae: every usbasp I've ever seen comes with code on it to make it run fast and only the ones with jumpers work by default.
06:32 PM Lambda_Aurigae: there is an avrdude command to run it slower but that doesn't generally work on default usbasp code...the usbasps out there on the market are running ancient code and need to be updated.
06:33 PM gregor2: i have bought it there
06:33 PM gregor2: http://www.ebay.de/itm/-/322650171790
06:33 PM gregor2: but how can i update it?
06:33 PM Lambda_Aurigae: with another programmer
06:34 PM gregor2: why should i need the usbasp then?
06:34 PM Lambda_Aurigae: the usbasp is an interesting toy but not something I would rely on...it is a major hack.
06:34 PM gregor2: If i had another one?
06:34 PM Lambda_Aurigae: I use a homemade stk200 clone..it works..has worked from day one and never had a problem with it in 15 years.
06:34 PM gregor2: Great that this was told me now.
06:35 PM gregor2: so how can i slow down the sck?
06:35 PM polprog: tbh i expected that as this was the case with mine usbasp :/
06:35 PM Lambda_Aurigae: depnds on your usbasp
06:35 PM gregor2: Or what do i ave to slow down again?
06:35 PM Lambda_Aurigae: if it has the jumper to slow it down, use it.
06:35 PM Lambda_Aurigae: the programming speed.
06:35 PM gregor2: yes it has
06:35 PM gregor2: i will try that one.
06:35 PM Lambda_Aurigae: guessing you haven't actually read the datasheet on the atmega328p or understand how programming works, eh?
06:36 PM polprog: the programmer that never ever failed me was the parport one :D
06:36 PM gregor2: no just trying
06:36 PM Lambda_Aurigae: polprog, same here..stk200 clone parallel port interfaced programmer.
06:36 PM Lambda_Aurigae: gregor2, read...read read read.
06:37 PM Lambda_Aurigae: I don't let my students touch a microcontroller until they have read the datasheet cover to cover.
06:37 PM polprog: the truth is out there, as they used to say in the X files
06:37 PM polprog: man avrdude
06:37 PM Lambda_Aurigae: and none of the ardweeny crap for us either.
06:38 PM gregor2: ITS working
06:38 PM gregor2: Thanks bro!!
06:39 PM polprog: \o/
06:39 PM gregor2: My LED is finally blinking
06:39 PM gregor2: So
06:39 PM gregor2: I am about to break something right?
06:39 PM Lambda_Aurigae: what I told you about the jumper and clock speeds are all available for a 20 second google search too.
06:39 PM gregor2: If i go on like that?
06:40 PM Lambda_Aurigae: like what?
06:41 PM polprog: like not reading
06:41 PM polprog: probably yes. and if not youll get frustrated
06:41 PM polprog: avr datasheets are the best ones ive seen
06:42 PM polprog: they even include code examples!
06:42 PM Lambda_Aurigae: someone once told me AVR was too complex and he was going over to modern ARM...two days later he was back to AVR.
06:43 PM polprog: ok, insomnia attack over, its 1 am here, good night
06:43 PM Lambda_Aurigae: a week later he bought an ardweeny kit at radio shack,,,paying 10 times what it would have cost him online.
06:53 PM papirkopi is now known as grafi_
06:54 PM grafi_ is now known as papirkopi
06:54 PM gregor2: great
06:54 PM gregor2: I just set CKSEL to 110.
06:55 PM gregor2: What does that mean? Have i ruined everything?
06:55 PM gregor2: Oh no
06:55 PM gregor2: I have ruined everything
06:56 PM enh: carabia is back?
06:56 PM gregor2: carabia?
06:56 PM gregor2: Is it possible to undo this?
06:57 PM Lambda_Aurigae: did not read?
06:57 PM Lambda_Aurigae: what is CKSEL 110 according to the datasheet?
06:58 PM enh: where the hell is carabia now?
06:58 PM Lambda_Aurigae: who the hell cares?
06:58 PM enh: I do!
06:58 PM enh: :)
06:58 PM enh: Troll wars will restart!
06:59 PM enh: amazing!
06:59 PM enh: Trolls are back!
07:00 PM Lambda_Aurigae: gregor2, CKSEL is 4 bits...so you set it to 0b0110 ?
07:00 PM enh: all right, Lambda_Aurigae?
07:00 PM Lambda_Aurigae: enh, have fun.
07:01 PM enh: I try
07:01 PM gregor2: no
07:01 PM gregor2: to 0011
07:01 PM Lambda_Aurigae: gregor2, cksel 0b0110 is low frequency external crystal oscillator at .4 to .9 mhz...so you will need an oscillator running at that frequency.
07:01 PM Lambda_Aurigae: you said 110
07:01 PM gregor2: because i messed up again
07:01 PM Lambda_Aurigae: duh...and I went backwards.
07:01 PM Lambda_Aurigae: anyhow..
07:02 PM Lambda_Aurigae: you set it to 0011?
07:02 PM gregor2: yes it seems like
07:02 PM Lambda_Aurigae: that is internal RC oscillator at 128Khz.
07:02 PM gregor2: avrdude: safemode: Fuses OK (E:07, H:D9, L:63)
07:02 PM Lambda_Aurigae: http://www.engbedded.com/fusecalc/
07:02 PM gregor2: so?
07:02 PM gregor2: Its running very slow?
07:02 PM Lambda_Aurigae: means it's running REAAAALLY SLOOOOOOWWWWWWW...
07:02 PM gregor2: oh noQ
07:03 PM gregor2: I will never save it annymore?
07:03 PM Lambda_Aurigae: your usbasp might not work at that speed...not sure.
07:04 PM Lambda_Aurigae: you would need a programmer that can go really slow or a HVPP to reprogram the fuses.
07:04 PM Lambda_Aurigae: programming speed needs to be 1/4 main clock as I recall.
07:04 PM gregor2: Oh NO!!!!
07:04 PM gregor2: Its that easy to fuck things up?
07:05 PM gregor2: Ok
07:05 PM gregor2: Now i will read the datasheet
07:05 PM gregor2: you won!
07:06 PM gregor2: I cant just reset this annyhow?
07:08 PM Sokomine: gregor2: i bought an arduino uno for getting started. they're quite practical (nice little holes to plug wires in) and can also act as programmers for other avrs
07:09 PM Lambda_Aurigae: gregor2, not without different programming hardware, no, you can't just reset it.
07:10 PM gregor2: I am lucky i still have 2 of them!
07:10 PM Lambda_Aurigae: unless your usbasp can go down to 32KHz programming speed.
07:10 PM gregor2: What if i had an AVR dragon?
07:10 PM Lambda_Aurigae: a dragon can do HVPP
07:10 PM Lambda_Aurigae: high voltage parallel programming
07:10 PM Lambda_Aurigae: which can bypass what you did to the fuses.
07:10 PM gregor2: And that can save everything?
07:11 PM gregor2: I actually wanted to buy one.
07:11 PM Lambda_Aurigae: not everything but 99%, so long as the magic blue smoke hasn't escaped.
07:11 PM gregor2: ah i see
07:11 PM gregor2: the blue smoke.
07:11 PM Lambda_Aurigae: if you see the blue smoke it's too late.
07:11 PM gregor2: how sad
07:11 PM Lambda_Aurigae: however, it is difficult to kill an avr and make the smoke escape
07:11 PM Lambda_Aurigae: not impossible, just difficult.
07:12 PM Lambda_Aurigae: much easier to kill a pic or 8052 or arm chip.
07:13 PM gregor2: Time for the second one
07:13 PM gregor2: place your bets lease
07:14 PM Lambda_Aurigae: it is, however, very easy to make an AVR not your friend by screwing with fuses.
07:14 PM Sokomine: do you have to set the fuses? maybe starting with them remaining as they are for first tries might be safer
07:14 PM gregor2: the led is blinking
07:14 PM Lambda_Aurigae: if you don't understand,,,and quadruple check before doing a triple check, DON'T TOUCH THEM!
07:14 PM gregor2: OK
07:14 PM gregor2: So
07:14 PM gregor2: dont touch the fuses
07:14 PM gregor2: now
07:15 PM gregor2: I have an 12mhz crystal
07:15 PM gregor2: and two capacitors
07:15 PM gregor2: if i set the fuses like this
07:15 PM gregor2: lfuse: 0x67
07:15 PM gregor2: It should work right?
07:16 PM gregor2: should i give it a try?
07:17 PM gregor2: lfuse: 0x77
07:17 PM gregor2: better try that one?
07:17 PM Sokomine: can't you try it without external crystal first? without setting the fuses? so that you can be sure that your programmer as such works and so that you get used to your tools before doing more dangerous stuff
07:18 PM gregor2: Of course i can
07:18 PM Sokomine: i know that fuse values exist. Lambda_Aurigae seems to be an expert. he told you to rtfm :-)
07:18 PM Lambda_Aurigae: I also posted a link for the avr fuse calculator
07:18 PM Lambda_Aurigae: USE it!
07:18 PM gregor2: The dangerous fuses
07:19 PM Lambda_Aurigae: I am remoted in to my home computer via slow cell jetpack link so I'm not going looking up fuses for you.
07:19 PM Lambda_Aurigae: I will give you the tools...but you have to use them.
07:20 PM Lambda_Aurigae: I'm also working on getting halfway hammered so in about 15 minutes anything I might say is suspect.
07:20 PM Lambda_Aurigae: am out camping...sitting by the campfire with my little laptop.
07:21 PM Tom_L: so go hug nature, not technology
07:21 PM * LeoNerd must finish avr-fuse sometime
07:21 PM gregor2: Its so hard
07:21 PM gregor2: those fuses
07:21 PM Sokomine: oh, that sounds fine, Lambda_Aurigae. hope you have a nice evening there, camping. it's rainy over here
07:22 PM Tom_L: http://www.engbedded.com/fusecalc/
07:22 PM LeoNerd: The idea being avrdude -p m328pb `avrfuse -p m328pb --defaults CKSEL=XTAL whatever...`
07:22 PM LeoNerd: very Makefile-friendly
07:22 PM gregor2: whats the difference between full swing and low power?
07:22 PM gregor2: I dont want to ruin another chip
07:25 PM gregor2: What option should i use?
07:26 PM gregor2: BOD, fast rising or slow rising power?
07:27 PM gregor2: 0x77
07:27 PM gregor2: will that work?
07:29 PM gregor2: 2 18pf capacitors and one 12mhz oszillator.
07:29 PM gregor2: that should work right?
07:30 PM enh: Lambda_Aurigae: I wish you a nice camping. Such a nice activity.
07:31 PM Lambda_Aurigae: nice and relaxing.
07:31 PM gregor2: Come on guys.
07:31 PM gregor2: You wont tell me?
07:31 PM Lambda_Aurigae: gregor2, just a minute.
07:31 PM Lambda_Aurigae: I'm on drink #3.
07:31 PM enh: :)
07:31 PM gregor2: oh no
07:31 PM gregor2: I will NOT try that out.
07:31 PM Sokomine: :-)
07:31 PM gregor2: Forget it
07:32 PM gregor2: i will buy a hv programmer.
07:32 PM Lambda_Aurigae: -U lfuse:w:0xf7:m -U hfuse:w:0xd9:m -U efuse:w:0xff:m
07:32 PM Sokomine: why that, gregor2? what do you want to achieve anyway?
07:33 PM enh: When I disappear from the grid I'll spend all non raining nights out, just contemplating life near nature.
07:33 PM Lambda_Aurigae: someone else can check my numbers...that gives longest startup time for best stability.
07:34 PM enh: which mcu?
07:35 PM Lambda_Aurigae: atmega328p
07:35 PM enh: LOW_FUSES=0xE2
07:35 PM enh: HIGH_FUSES=0xD9
07:35 PM enh: EXTENDED_FUSES=0x07
07:36 PM enh: burn_fuses:
07:36 PM enh: $(AVRDUDE) -c $(AVRDUDE_PROGRAMMERID) -v -p $(PROGRAMMER_MCU) $(AVRDUDE_PORT) -e $(AVRDUDE_BAUD) -U lfuse:w:$(LOW_FUSES):m -U hfuse:w:$(HIGH_FUSES):m
07:36 PM Lambda_Aurigae: hmmm...might want to disable boot reset
07:36 PM enh: I use these. Internal oscillator.
07:36 PM Lambda_Aurigae: F7 D8 FF
07:36 PM Lambda_Aurigae: D9 has the bootloader on reset enabled...D8 disables that.
07:36 PM gregor2: you say f7 d8 ff?
07:36 PM enh: humm
07:37 PM Lambda_Aurigae: that's what i'm seeing...not seeing double yet.
07:37 PM enh: :)
07:37 PM enh: You see 16 bits or 8 bits per fuse, Lambda_Aurigae?
07:37 PM Lambda_Aurigae: don't quote me yet.
07:37 PM Lambda_Aurigae: enh, 12
07:37 PM enh: i see
07:38 PM Lambda_Aurigae: was right the first time...d9
07:38 PM Lambda_Aurigae: you had it right enh.
07:38 PM enh: uff
07:38 PM Lambda_Aurigae: not used to using the fuse calculator.
07:38 PM Lambda_Aurigae: I usually do it manually.
07:38 PM Lambda_Aurigae: but too lazy tonight.
07:38 PM enh: that 1 menas unprogrammed makes me crazy
07:38 PM enh: means
07:38 PM Lambda_Aurigae: yeah.
07:39 PM gregor2: so you have SUT set to 11?
07:39 PM enh: SUT stands for...
07:39 PM Lambda_Aurigae: yup...longest startup time and all that.
07:39 PM enh: ok
07:39 PM gregor2: ah yes
07:39 PM Lambda_Aurigae: and, I'm gonna go fix something stronger.
07:39 PM Lambda_Aurigae: only up to 10 bits per byte.
07:40 PM Lambda_Aurigae: laters.
07:40 PM enh: The best part of these fuse settings is that they work for me. I'm deeply afraid of changing them.
07:40 PM gregor2: whats ckdiv8 and ckout
07:40 PM Lambda_Aurigae: ckdiv8 divides the clock by 8
07:40 PM Lambda_Aurigae: READ the manual!
07:40 PM enh: I tried to activate the external xtal and bricked many MCUs.
07:40 PM gregor2: yes i know
07:40 PM Lambda_Aurigae: ckout sends the master clock out a pin.
07:40 PM gregor2: but why do i need that?
07:41 PM Lambda_Aurigae: for daisy chaining clock source.
07:41 PM enh: if you run on internal oscillator *8MHz) ckdiv 8 means your mcu will run at 1MHz
07:42 PM enh: One more thing I learned today. Daisy chainning a clock source. Nice idea.
07:42 PM gregor2: but full swing is the right thing?
07:42 PM Sokomine: is there a reason why it does so? the presacler seems fine for timer operations, and lower speeds may save energy i guess...but why divide clock by 8? just curious
07:42 PM Lambda_Aurigae: for the fun of it.
07:42 PM enh: To make your MCU run very slow, I guess.
07:43 PM Sokomine: :-)
07:43 PM Lambda_Aurigae: https://drive.google.com/open?id=0BxaP1wMEe_6aZWU0Uy1Ta3otZzQ
07:43 PM Lambda_Aurigae: my camper.
07:43 PM Lambda_Aurigae: I believe you can start it slow then turn off the div/8 in code to speed it up.
07:43 PM Lambda_Aurigae: energy saver/turbo mode.
07:43 PM gregor2: I want to change as less as possible
07:44 PM gregor2: so if i just set lfuse to 0x77 am i good?
07:44 PM enh: changing as less as possible can be changing nothing
07:44 PM gregor2: I want to use the crystal with as less as possible change to the fuses.
07:44 PM enh: nice camper!
07:44 PM enh: can't you run on internal oscillator?
07:45 PM enh: When you fix all the other problams you can always come and mess with the xtal
07:45 PM enh: problems... My keyboard is soo ignorant
07:46 PM enh: I'm in deep need to contemplate the night sky
07:46 PM Sokomine: enh: what i really want to do with an avr in the end is to re-use a very old laptop keyboard. but that's more of a...mechanical...issue than anything else
07:46 PM gregor2: There are no other problems.
07:46 PM enh: living in the city sucks all my life energy
07:46 PM gregor2: Thats all i want
07:46 PM gregor2: Use an external oscillator.
07:46 PM gregor2: Thats my goal
07:47 PM enh: ok, gregor2.
07:47 PM gregor2: then i will throw everything away.
07:47 PM enh: Please share your experience. I tried a few times and then desisted.
07:47 PM enh: This is the last item in my long list
07:48 PM gregor2: i will try 0x77 now ok?
07:48 PM enh: But I'm very curious on how to make that cristal work, and what is all that swing thing.
07:48 PM gregor2: If it doesnt work, its you fault.
07:48 PM enh: You have only one MCU?
07:48 PM gregor2: No just kidding
07:48 PM enh: You can put that in my fault list
07:48 PM gregor2: I have two left.
07:48 PM gregor2: One is broken.
07:48 PM gregor2: or
07:48 PM enh: Brick two, make one work
07:48 PM Lambda_Aurigae: it's just bent
07:49 PM gregor2: The fuses are just messed up.
07:49 PM enh: Maybe putting the mcu inside a cup with salt water and connecting to an AC outlet will reset the fuses.
07:49 PM gregor2: Lambda_Aurigae, do you think setting lfuse to 0x77 and leave everything else alone will work?
07:50 PM Lambda_Aurigae: let me look.
07:50 PM gregor2: so that would be
07:50 PM enh: The cat is a male, Lambda_Aurigae?
07:50 PM gregor2: Full swing crystal, slow rising power.
07:50 PM gregor2: thats it.
07:50 PM enh: We have three female cats.
07:50 PM Lambda_Aurigae: no...calico...almost always female.
07:51 PM Lambda_Aurigae: umm...77 is NOT full swing crystal.
07:51 PM Lambda_Aurigae: 77 is internal RC oscillator according to the fuse calc.
07:51 PM Lambda_Aurigae: or the fuse calc is not working.
07:51 PM gregor2: what?
07:51 PM gregor2: am i stupid?
07:52 PM Lambda_Aurigae: no
07:52 PM Lambda_Aurigae: this fuse calc isn't working for me.
07:52 PM Lambda_Aurigae: 77 just seems all wrong though.
07:52 PM Lambda_Aurigae: aaaand
07:53 PM Lambda_Aurigae: I put the number in the wrong hole.
07:53 PM gregor2: in the datasheet it says CKSEL[3:0] 0111 is full swing crystal.
07:53 PM gregor2: which is 7 isnt it?
07:53 PM Lambda_Aurigae: I had put the number in hfuse rather than lfuse.
07:53 PM Lambda_Aurigae: yeah..77 should work.
07:54 PM gregor2: and and SUT i will set to 11 so thats also 7
07:54 PM gregor2: i will try that one
07:54 PM gregor2: If it wokrs the LED will blink faster.
07:54 PM gregor2: If it doesnt.
07:54 PM gregor2: well
07:55 PM enh: DO you have a hot air rework station, gregor2?
07:55 PM gregor2: It kind of worked
07:55 PM Lambda_Aurigae: you should go F7 though to get full 12MHz
07:55 PM gregor2: But its goning slower now
07:55 PM gregor2: i do?
07:56 PM Lambda_Aurigae: 77 keeps the div/7 fuse programmed.
07:56 PM Lambda_Aurigae: div/8
07:56 PM gregor2: with F7 isnt the speed devided by 4?
07:56 PM Lambda_Aurigae: no.
07:56 PM Lambda_Aurigae: divided by 8
07:56 PM Lambda_Aurigae: hence the name div/8
07:56 PM enh: 77 is div8
07:56 PM Lambda_Aurigae: or CKDIV8
07:56 PM Lambda_Aurigae: yes.
07:56 PM gregor2: I see
07:56 PM gregor2: you are right
07:57 PM gregor2: 0 is programmedd
07:57 PM enh: http://www.engbedded.com/fusecalc/
07:57 PM Lambda_Aurigae: with it at F7 then the div8 is off...
07:57 PM gregor2: With 8 it is going even slower.
07:57 PM gregor2: it seems
07:57 PM gregor2: of faster
07:58 PM gregor2: maybe it is PWM.
07:58 PM enh: http://www.ebay.com/itm/152552874043, http://www.ebay.com/itm/122450244745, http://www.ebay.com/itm/222295207860
07:58 PM enh: I'm thinking of upgrading my laser head from 808nm 500mw to this one.
07:59 PM enh: Anybody have any experience with these?
07:59 PM gregor2: 0x87 is not really working.
07:59 PM gregor2: 0x77 is working.
07:59 PM Lambda_Aurigae: F7
07:59 PM gregor2: The LED just stays on
07:59 PM gregor2: omg
08:00 PM Lambda_Aurigae: going 12 times faster than before.
08:00 PM gregor2: I nearly messed up again
08:00 PM gregor2: with that 8
08:00 PM gregor2: could hav been desastress.
08:00 PM Lambda_Aurigae: as I said earlier
08:00 PM Lambda_Aurigae: quadruple check your fuses before you triple check them.
08:00 PM gregor2: But now it is blinking faster
08:00 PM gregor2: It works now
08:00 PM gregor2: You are right
08:01 PM gregor2: lets see what that 8 did.
08:02 PM gregor2: cheramic resonator.
08:02 PM gregor2: i dont have one.
08:02 PM gregor2: seems like i was lucky
08:02 PM enh: cehteh: ?
08:02 PM gregor2: now if i remove the crystal it should stop working?
08:02 PM enh: Are you around?
08:03 PM Lambda_Aurigae: sometimes ceramic resonator settings will work with crystal...and versa visa..but not always.
08:03 PM Lambda_Aurigae: yes..
08:03 PM Lambda_Aurigae: remove the crystal and no clock source.
08:05 PM enh: I wonder when we will be able to install antigravity thrusters on campers and just fly away
08:05 PM gregor2: ok
08:05 PM gregor2: Achived my goal for toay
08:05 PM gregor2: Let a LED blink
08:05 PM gregor2: how awsome
08:05 PM gregor2: and now
08:05 PM gregor2: I will go to bed
08:06 PM enh: Sleep well, gregor2.
08:06 PM gregor2: Thank you
08:06 PM gregor2: I will be more carefull with those fuses.
08:07 PM enh: nah... Just kepp a good set of values in a makefile and forget that stuff
08:07 PM gregor2: yes
08:07 PM gregor2: once i have found the right ones, just keep them.
08:08 PM gregor2: ok
08:08 PM gregor2: then
08:08 PM gregor2: good night
08:08 PM gregor2: well i guess
08:09 PM gregor2: Its another time at your place
08:09 PM enh: here it is almost 10pm
08:09 PM gregor2: i see
08:09 PM enh: round planet stuff
08:09 PM gregor2: its 2:38 here.
08:12 PM enh: I hope a 6W laser can cut deeper than a half watt one
08:35 PM Sokomine: probably. just be careful to protect your eyes when using it
08:38 PM enh: Always important
08:38 PM Lambda_Aurigae: artificial eyes are cheap and easy to acquire.
08:38 PM Lambda_Aurigae: hard to see with though.
08:39 PM enh: I had some experience with high power lasers...
08:39 PM enh: did my masters using one
08:42 PM enh: Which mount would you select? This http://www.ebay.com/itm/222295207860, this http://www.ebay.com/itm/332255821489 or that http://www.ebay.com/itm/231265029321 ?
08:57 PM gregor2: guys, guys!
08:57 PM gregor2: I did it
08:57 PM gregor2: I just saved it!!
08:57 PM gregor2: I saved my mcu!!
08:57 PM gregor2: Its back!!
08:57 PM enh: from what?
08:57 PM gregor2: I restored my fuses.
08:58 PM gregor2: Remember when i set it to the internal 128khz oscilattor?
08:58 PM gregor2: I got it
08:59 PM gregor2: like this
08:59 PM gregor2: avrdude -p m328p -c usbasp -B 2000 -i 2000 -U lfuse:w:0xf7:m -v
08:59 PM Sokomine: congratulations :-) how did you get it back to work?
08:59 PM gregor2: What do you say now?
08:59 PM gregor2: You are not so tough now are you?
08:59 PM gregor2: Just kidding
09:00 PM enh: Where is carabia? He would love to answer this question
09:00 PM gregor2: To answer?
09:00 PM gregor2: Why answer?
09:00 PM enh: Wake up trolls!
09:01 PM enh: Trolls are sleeping.
09:02 PM enh: Congratulations, gregor2. Should'nt you be sleeping?
09:02 PM gregor2: No
09:02 PM gregor2: Yes
09:02 PM gregor2: I should
09:02 PM gregor2: But then i thought
09:02 PM gregor2: NO!!
09:02 PM gregor2: It cant be like that.
09:02 PM gregor2: I cant stay this weekend if my mcu is broken!
09:03 PM gregor2: Tell my girlfriend that i messed up a mcu??!
09:03 PM gregor2: NO!!\
09:03 PM gregor2: Never
09:03 PM gregor2: I will never mess one up!!
09:03 PM enh: sure
09:04 PM gregor2: Not me!!!
09:04 PM Lambda_Aurigae: just another dead cockroach for the pile.
09:04 PM gregor2: But
09:04 PM gregor2: i burned up one LED!
09:04 PM gregor2: With a shortcircuit!!
09:04 PM Lambda_Aurigae: didn't put a resistor on it?
09:04 PM gregor2: Never mind!
09:04 PM gregor2: yes exactly
09:05 PM Lambda_Aurigae: 330ohm resistor minimum for beginners.
09:05 PM gregor2: I didnt had a breadboard back then
09:05 PM gregor2: And i wanted to let one shine!
09:05 PM gregor2: But accidentally ...
09:05 PM gregor2: yes uhm
09:05 PM gregor2: Just touched the wrong wire.
09:05 PM gregor2: But now
09:06 PM gregor2: All of my mcus are back!
09:06 PM gregor2: Great!
09:07 PM enh: And the LED shone
09:08 PM day_ is now known as daey
09:16 PM gregor2: ok
09:16 PM gregor2: I find that all very exciting
09:16 PM gregor2: but now i have to go to bed
09:16 PM gregor2: good
09:16 PM gregor2: night
09:23 PM day_ is now known as daey
09:32 PM enh: Good night, gregor2
09:37 PM day__ is now known as daey
10:15 PM day_ is now known as daey