#avr | Logs for 2016-01-28

Back
[02:34:13] <Lambda_Aurigae> Deskwizard, it's been used for autobaud work for many years.
[02:34:22] <Lambda_Aurigae> decades even.
[02:34:49] <Deskwizard> Lambda_Aurigae: yeah I bet it is, I just wish I thought of that before
[02:34:58] <Deskwizard> its almost like im cheating now hehehe
[02:35:15] <Lambda_Aurigae> yup.
[02:35:31] <Deskwizard> its still a bit dicky but for a first draft, im fine with it hehe
[02:35:50] <Lambda_Aurigae> heck, even the ds89c450 chip uses it still...an 8052 clone with a high speed core.
[02:38:01] <Deskwizard> I see!
[02:38:18] <Deskwizard> (its very foggy, but I see :P)
[02:38:23] <Deskwizard> https://github.com/deskwizard/AVR_CodeReference if you want to give your impressions
[02:38:40] <Deskwizard> or anyone else for that matter :)
[02:47:47] <Lambda_Aurigae> it is almost 2:30AM here...I'm only awake due to leg cramps.
[02:48:03] <Lambda_Aurigae> reviewing code,,,,hmmm.
[02:49:03] <nuxil__> :)
[02:49:16] * nuxil__ sips his morning tea
[03:00:29] <Lambda_Aurigae> am playing Oolite here myself.
[03:00:49] <Lambda_Aurigae> thinking of going to take a bath or maybe get on the exercise bike for an hour or so.
[03:11:19] <nuxil> at 3 am ?
[03:14:15] <Deskwizard> nuxil: theres a time for things? :P
[03:14:25] <nuxil> yea
[03:14:31] <Deskwizard> Lambda_Aurigae: no worries mate :)
[03:14:45] <Deskwizard> nuxil: uhm... someone forgot to tell me that ;)
[03:14:46] <nuxil> sleep during the night
[03:14:49] <nuxil> :p
[03:15:14] <Deskwizard> this is usually around the time at which i ask myself if I stay up or go to sleep
[03:16:30] <Deskwizard> anyhoo, quick question if anyone knows
[03:16:41] <Deskwizard> lets say I have a function with only this line: UDR = byteToSend;
[03:16:52] <Deskwizard> do I have to cli()-sei() it ?
[03:17:05] <Deskwizard> or its fine since its 8 bit register?
[03:17:28] <Lambda_Aurigae> I don't see any reason you would need to.
[03:18:19] <Deskwizard> Lambda_Aurigae: if it would be >= 16bit I might need to, correct? just trying to see if I understood things correctly
[03:19:10] <Lambda_Aurigae> if you were doing something that needed it to be all set at once, then, yes.
[03:19:18] <Deskwizard> mkay, ty
[03:28:43] <nuxil> what does sai and cli do?
[03:28:49] <nuxil> *sei
[03:28:58] <Lambda_Aurigae> set and clear global interrupt enable
[03:29:12] <nuxil> ok
[03:30:13] <nuxil> so why did they not name it like sgi and cgi
[03:30:25] <Lambda_Aurigae> set enable interrupts
[03:30:29] <Lambda_Aurigae> clear enable interrupts
[03:30:47] <LeoNerd> the flag is called I, in SREG
[03:31:00] <LeoNerd> SEt I; CLear I
[03:31:35] <nuxil> :)
[03:41:30] <Deskwizard> nuxil: hehehe I asked myself the same question a couple days ago
[03:43:38] <nuxil> Deskwizard, speaking of naming things. may i ask why you called your project AVR_CodeReference
[03:43:38] <nuxil> and not AVR_Blinky or something :p
[03:44:19] <Deskwizard> 'cause its starting with a blink, but wont end there :P
[03:45:18] <Deskwizard> that way whatever code I'll use, if its buggy, its my own fault hehehe
[03:45:19] <nuxil> i saw the name AVR_CodeReference and though of a huge project with all kinds of referances. :p
[03:46:00] <nuxil> so whats your plan with it. if its not ending with a blink :p
[03:46:10] <Deskwizard> nuxil: tbh its mostly learning, its by no mean meant to be used with anyone else
[03:46:54] <Deskwizard> just have all the basic stuff nailed down, something I can use as a kind of back end
[03:47:10] <Deskwizard> so whatever I wanna do I dig there, theres code for that :P
[03:47:19] <nuxil> ok
[03:47:46] <Deskwizard> if it ends up being useful to someone else, well, cool
[03:50:35] <nuxil> i want to make bluetooth led lighting controled by the pc or the phone. using some apa 102 led strips
[03:50:54] <nuxil> :P
[03:51:00] <Deskwizard> nice :)
[03:51:13] <Deskwizard> i LOVE rgb leds hehe
[03:51:23] <nuxil> yea
[03:51:36] <Deskwizard> I had at some point 4 rgb strips reacting to music and all, was neat
[03:51:50] <nuxil> nice
[03:52:04] <nuxil> reacting to sound level ?
[03:52:13] <Deskwizard> frequency peaks
[03:52:18] <nuxil> dude'
[03:52:27] <nuxil> show me tga code
[03:52:27] <Deskwizard> used a ... msgeq7 I think it was, it detects 7 frequencies, you get serial data out
[03:52:32] <nuxil> *tha
[03:52:33] <Deskwizard> you're welcome ;)
[03:52:48] <Deskwizard> uhm, let me check, video of it I have for sure
[03:53:09] <Deskwizard> code I dont think so, but honestly it was just a bunch of IFs
[03:53:27] <Deskwizard> read msgeq7 - > find peak, set color, repeat
[03:53:28] <nuxil> never mind
[03:53:53] <Deskwizard> aight
[03:54:16] <nuxil> i see that the chip you used is a 7 band graphic equalizer
[03:54:42] <Deskwizard> yeah, I cheated :P
[03:55:15] <Deskwizard> i was just using that chip as any other sensor, read data > react accordingly
[03:55:33] <Deskwizard> other side was a LED driver so, yeah
[11:10:10] <julius> in this ADC code: http://paste.debian.net/375184/ why is the led always on? as far as i understand it, the led should be on for about half a turn and then go off
[11:11:01] <julius> circuit is built up like this: http://www.learningaboutelectronics.com/Articles/AVR-potentiometer-circuit.php
[11:11:53] <julius> i did test the circuit with different code, there it works nicely. controls 2 leds, while below half the resistance of the potentiometer led 1 is on, and goes off when resistance rices and at the same time led 2 goes on
[11:23:19] <Deskwizard> julius: same AVCC ?
[11:23:41] <Deskwizard> well, AREF
[11:24:49] <julius> aref is not connected
[11:24:54] <julius> its set to internal
[11:25:11] <julius> oh wait, it is physically connected
[11:25:31] <julius> avcc to avcc adc
[11:27:12] <Deskwizard> avcc = ADC power, vcc = chip power (assuming168/328)
[11:27:44] <Deskwizard> if your using the same chip, wired the same way, and the only difference is the code, id watch what's the ADC reference first
[11:28:18] <Deskwizard> or if you have uart on both, print out your register settings over uart with working code, do the same with non working code and compare
[11:28:57] <Deskwizard> might just be a = instead of |= somewhere that disables something that shouldnt be or something like that
[11:54:53] <Jartza> Deskwizard: I have macros to avoid that kind of situations :)
[11:54:55] <Jartza> https://gist.github.com/Jartza/29f70ad559a0f1e7b6ae
[11:55:13] <Jartza> basically the last 4 macros in that file, rest are just helpers for those 4 macros
[11:59:44] <Deskwizard> hehehe yeah I have similar ones also :)
[12:00:10] <Deskwizard> and one thats different from every other I saw on the internet for a unknown reason
[12:00:18] <Deskwizard> the standard one wouldnt work on me
[12:00:32] <Deskwizard> or I was using it wrong lol
[12:59:43] <tekkkz> morning
[13:00:20] <tekkkz> im on an 32u4 with the default dfu bootloader. how can i upload a program via dfu with avrdude?
[13:08:18] <LeoNerd> Should be able
[13:08:22] <LeoNerd> I've managed it before
[13:08:30] <tekkkz> ahh
[13:08:35] <tekkkz> programmer needs to be flip1
[13:08:44] <tekkkz> ^^
[13:08:51] <LeoNerd> There's a little trick to resetting it; if you're using the right combination of USB-UART driver inside the main program, and DFU bootloader, you can do it without needing to press the button :)
[13:09:02] <LeoNerd> Otherwise it'll require you to hit that boot button
[13:09:16] <LeoNerd> Which I often find terribly tedious
[13:09:17] <tekkkz> oh okay cool, ill have a look at it
[13:09:21] <tekkkz> yeah true
[13:11:05] <LeoNerd> https://twitter.com/cpan_pevans/status/600974479016222720 also :)
[13:11:18] <LeoNerd> It does the reset logic for you
[13:11:29] <LeoNerd> I should file a bug on avrdude to get them to add that as a core feature, in fact
[13:14:19] <tekkkz> im rebooting, cu
[13:34:22] <tekkkz> LeoNerd, still here?
[13:34:53] <tekkkz> I failed setting the fuses. I set on my board, which have a 16mhz crystal, following: Ext. Low-Freq. Crystal; Start-up time: 1K CK + 65 ms; [CKSEL=0100 SUT=10]
[13:35:06] <tekkkz> now its not responding anymore, what should i do now?
[13:35:34] <LeoNerd> Hi
[13:36:00] <LeoNerd> Well, easiest solution would be to apply a low-frequency crystal to the xtal pins, thus giving it the clock it wants
[13:37:18] <tekkkz> huh?
[13:37:24] <tekkkz> what do you mean?=
[13:42:21] <tekkkz> can i generate such signal with my arduino?
[13:42:29] <tekkkz> and just connect a pin to the xtal1 of my m32u4?
[13:42:39] <tekkkz> even if the 16mhz is connected there?
[13:42:58] <tekkkz> LeoNerd,
[13:42:59] <tekkkz> ?
[13:47:02] <LeoNerd> Well... you -could- do that too but I don't know if that'd upset the clock hardware
[13:47:22] <LeoNerd> Safest and nicest would be to just give the chip the actual clock signal that your fuses have told it to expect
[13:48:18] <m3chanical> which means buying a new crystal probably?
[13:48:37] <LeoNerd> If you don't have lowfreq one, sure...
[13:48:54] <LeoNerd> You might get away with feeding in a ~32kHz signal into the xtal1(?) pin...
[13:49:02] <LeoNerd> (just check that 1 is the input)
[13:49:18] <m3chanical> i wonder if i can get assorted frequency crystals from aliexpres. hmm
[13:49:43] <LeoNerd> I have a Si5351A breakout board.. that's good for generating any named frequency from basically-DC up to 25MHz
[13:49:46] <LeoNerd> :)
[13:50:06] <LeoNerd> I keep meaning to get around to putting it in a box with a front panel and turning it into a real piece of equipment
[13:50:19] <m3chanical> oh cool. i need to get some upgrades at some point. just operating with a multimeter and a bunch of components lol
[13:50:49] * LeoNerd nod
[13:50:53] <tekkkz> mhh
[13:50:58] <tekkkz> i have a smd soldered board
[13:50:59] <LeoNerd> You can never have enough equipment, I find ;)
[13:51:01] <tekkkz> i cant do anything
[13:51:08] <tekkkz> how can i rescue it now ..
[13:51:09] <LeoNerd> Ah.. that could be a little trickier then
[13:51:30] <LeoNerd> Well,... lacking any ability to change the clock peripherals in hardware, you'd next be looking at resetting the fuses using HVPP
[13:51:47] <tekkkz> also not possible for me
[13:52:15] <LeoNerd> Should be doable.. if you have another MCU board around (like an arduino) that can generate the required signals.
[13:52:19] <LeoNerd> You'd just need a +12V source then
[13:52:30] <m3chanical> i've been wanting a nice o'scope for a while. totally going to start saving up.
[13:52:46] <tekkkz> LeoNerd, how / what must i do?
[13:52:58] <LeoNerd> I would be pimping out my HVSP board currently, only that doesn't really directly help you .. yet.
[13:52:59] <LeoNerd> :)
[13:53:19] <LeoNerd> It's for doing HVSP on the tiny85/84-sized chips, it doesn't really help you with HVPP on the larger chips
[13:53:51] <m3chanical> sorry - joined really late. are you able to pull the chip out and tinker with it outside of the circuit board?
[13:54:06] <LeoNerd> Seems not - it's on a prefab PCB
[13:54:13] <m3chanical> ahh. >.>
[13:54:15] <m3chanical> that's tough
[13:54:35] <LeoNerd> If you had an HVPP adapter, or an HVSP adapter and two shift registers (74'595 for example), you could also do it
[13:54:52] * LeoNerd is intending to make... you guessed it ... more equipment, to help with that...
[13:56:25] <LeoNerd> But in summary those are your two main options. Your problem is that the clock fuses don't match the clock peripheral hardware
[13:56:45] <LeoNerd> So you must change one of them to match the other. Changing the fuses right now requires HVPP; changing the hardware requires a bit of soldering
[13:57:06] <m3chanical> definitely a good lesson to be learned i think.
[13:57:17] <LeoNerd> :)
[13:57:46] <LeoNerd> There's a reason I built my ATtiny HVSP board first
[13:57:55] <LeoNerd> It ensured I now can't get into a situation I can't get myself out of again
[13:59:41] <LeoNerd> I might make a fancier HV{S,P}P board someday
[13:59:55] <LeoNerd> But I've nothing terribly convenient I can offer currently
[14:01:52] <nikomo> I just, didn't set incorrect fuses. That's been working nicely.
[14:06:53] <martinus> Only time I was unlucky enough to incorrectly configure the fuses on an ATmega168 I was lucky enough to set them for the 1MHz internal resonator. :)
[21:18:36] <flyback> so
[21:23:02] <flyback> apprentely this is a match for a hakko fx-888d
[21:23:10] <flyback> I am still skeptical but thinking about it
[21:23:11] <flyback> http://www.sra-solder.com/aoyue-2930-programmable-digital-soldering-station
[21:41:12] <Deskwizard> I bought some aoyue from there in the past, I can only recommand
[21:43:23] <flyback> yeah I got a 968 classic
[21:43:36] <flyback> great unit but the 35w iron is too weak and the sparkfun 50w iron I got sucked too
[21:43:49] <flyback> but the hot air gun is still excellent on the 968
[22:03:41] <Deskgod> N1njaneer: I just wanted to tell you... 2272, not 2400 ... I get it now ;) hehehe
[22:03:48] <Deskgod> thanks
[22:04:22] <Deskgod> flyback: I think the one we bought was the newer 968
[22:04:53] <Deskgod> I havent had much experience with hakko, coworker had a older model station, worked very well, I had the standard light blue weller myself, loved it
[22:05:27] <flyback> yeah I got my 968 right before 968A came out
[22:05:29] <flyback> story of my life
[22:05:39] <flyback> can't upgrade the iron from the 35 to 70 watt digital on it
[22:05:40] <flyback> but
[22:05:44] <Deskgod> ah that sucks
[22:05:55] <flyback> for $15 I can upgrade the hot air heater to the 968A heater which is a better design
[22:06:01] <flyback> and mine is 7 yrs old it's getting due to burn out anyways
[22:06:17] <flyback> I don't regret it either way
[22:06:34] <flyback> even the weak 35w iron was 1000x better than any radio shack or $5 wand I used all my life never knowing better
[22:06:37] <Deskgod> yeah for 15$ its a no brainer, loke the price on their parts, cant say anything about that, especially if you're in the US with sra-soldering
[22:06:45] <flyback> that's where I got mine
[22:06:55] <flyback> good group
[22:06:56] <Deskgod> flyback: ah man i know what you mean, i had those little things for a while also lol
[22:06:59] <flyback> seem fair about prices etc
[22:07:14] <flyback> I still remember my pencil accident in 93
[22:07:20] <flyback> last year of hs
[22:07:33] <flyback> set the side of my hand down on top of a iron that been plugged in for 30m
[22:07:38] <flyback> instand 2nd degress
[22:07:39] <Deskgod> yeah I bought multiple items there, even with the shipping and export fes to canada, they have great service and I tend to stick to that
[22:07:41] <flyback> screamed for 2 hrs
[22:07:49] <Deskgod> thats for sure :| outch
[22:08:27] <Deskgod> all I have left atm is the weller pencil iron, thankfully I can manage but still, damn I miss a station hehe
[22:08:43] <Deskgod> local reseller is the cheapest of all ebay for hakko...
[22:09:24] <Deskgod> dude swore by it, but thats like selling a iphone to an android dev... gonna need a lot more than meh weller is shit... screw you.
[22:09:25] <Deskgod> lol
[22:09:37] <flyback> hehe
[22:09:56] <Deskgod> i should have used pic/avr as a reference thought now that I think of it hehe
[22:10:19] <Deskgod> but yeah apparently the FX-888d is great, faster to heat up, better heat transfer
[22:13:38] <Boarlock> whats up
[22:14:38] <Deskwizard> Boarlock: learning about ring buffers... nothing up, all going in circle :P
[22:14:39] <Deskwizard> you ?
[22:14:49] <Boarlock> ring buffers?
[22:14:58] <Boarlock> noting much just chilling
[22:15:55] <Boarlock> was about to get my illegal on, but first wanted to surf Irc
[22:16:57] <m3chanical> i have a Hakko FX-888d. It's amazing
[22:19:48] <Deskwizard> m3chanical: good to know :) ill probably get that then, since I can get it cheapest locally in like 20 minutes
[22:21:08] <m3chanical> Awesome. I highly recommend it. I'm sure there are better ones, but for the $100 or so that I got it for it's totally my favorite
[22:27:17] <Deskwizard> m3chanical: thanks for the info, greatly appreciated :)
[22:28:55] <m3chanical> Deskwizard, you're welcome! ^^
[23:00:28] <martinus> Deskwizard: I have an analogue controlled Hakko FX-888, can also report that it's awesome.
[23:01:40] <martinus> One thing to note though is that if you're mail-ordering it you'll probably get it with a fine conical tip, it's worth picking up some flat-tips too for more general-purpose soldering.
[23:02:14] <Deskwizard> martinus: thanks :) luckyly I can get them locally
[23:02:43] <Deskwizard> yeah those pointy tips dont give much surface to work with, I rarely use them
[23:05:05] <martinus> If there are analogue versions available I would get one in preference to the digital version. Quickly being able to turn a knob to the desired temp is better than holding a button down to increase or decrease temp. That being said, the build quality is excellent in both versions so it's not a deal-breaker.
[23:06:13] <Deskwizard> martinus: yeah same here but they discontinued the analog one I think, but like you said, no deal breaker, not like I change it often enough or of a big enough range for it to bother me much
[23:06:33] <Deskwizard> in the end its just a temp sensor with feedback ffs... lol
[23:07:19] <Deskwizard> you know what I'd like to find tips for? that radio shack bulb desoldering iron
[23:07:26] <Deskwizard> that worked surprisingly well
[23:07:27] <Deskwizard> lol
[23:07:44] <Deskwizard> if the only tip that came with it wouldnt desintegrate itself...
[23:36:30] <martinus> Anyone used HC-06 or equivalent bluetooth modules with AVR/arduino?
[23:38:30] <Deskwizard> martinus: I did, a while back
[23:38:44] <martinus> Any major issues?
[23:39:23] <Deskwizard> as long as you get them on the little breakout boards, i dont remember any... dont forget io is 3.3v iirc though
[23:39:38] <Deskwizard> only reason I havent soldered mine down today
[23:39:55] <Deskwizard> so, bug me tomorrow, I'll rig something if you have issues :P
[23:41:07] <martinus> Looking into ordering a couple of the modules on ebay (many appear to be 5V) but thanks for the offer. :)
[23:42:08] <Deskwizard> martinus: I know the breakout boards I got have VCC up to 5v and 3.3 IO, but eyah others might be different, just keep an eye out for such thing if it matters for you
[23:42:45] <Deskwizard> iirc there was different models of the HC0x, some are just slave, some do both, etc... iirc HC06 did both but again, might be worth double-checking
[23:43:25] <martinus> Will do. Hoping for a more positive experience than I had with Nrf24L01+ boards. :D
[23:44:07] <Deskwizard> :|
[23:44:12] <Deskwizard> dont scare me
[23:44:18] <Deskwizard> I havent tried mine out yet
[23:44:33] <Deskwizard> didnt go well ? (obvioudly)
[23:44:38] <Deskwizard> obviously*
[23:46:58] <martinus> They were very flakey. I could get them to communicate some of the time. They weren't the ultra-cheap ebay specials either.
[23:49:27] <Deskwizard> mine are... I guess its a good thing I left them aside for now then hehehe
[23:49:37] <Deskwizard> like, COB, nothing else