#avr | Logs for 2013-11-08

Back
[00:03:11] <twnqx> blargo_: if is has two serial ports and your gps and cell have those, two...
[00:03:13] <twnqx> too*
[00:04:39] <blargo_> how much memory would I need? I was looking at the "trinket" which has a gpio and USB port
[00:04:45] <blargo_> w/o serial tho
[00:07:24] <Casper> depend on what you need to buffer
[00:07:50] <Casper> I'ld say that you need to buffer 1 gps line + 1 modem line
[00:08:02] <Casper> + some extra ram space
[00:08:05] <hackvana> blargo_: t85 doesn't have enough power to decode raw GPS signals, you need a GPS chip or module
[00:08:18] <hackvana> Those modules usually emit coordinates over serial lines
[00:09:02] <hackvana> If you had a board with a GPS module, a GSM module and a t85, the t85 would have enough power to funnel data from GPS over GSM.
[00:11:27] <blargo_> hackvana: nice! any idea what units to use? Can you run serial thorough GPIO ports
[00:11:36] <hackvana> sort of
[00:11:57] <hackvana> The t85 doesn't have hardware async, so you have to do it in software. But it can be done.
[00:13:41] <hackvana> t85 is from the ATtiny family. If you use something from the ATmega family, it has hardware async. Much easier...
[00:13:52] <blargo_> is it a good beginner project? caould I use this": http://learn.adafruit.com/category/trinket
[00:13:59] <hackvana> blargo_: Folks in the #highaltitude channel might be able to help you
[00:15:20] <blargo_> cool
[00:16:41] <hackvana> blargo_: Note, you've been asking whether the t85 can do the job. Yes it can, but it would also require a lot of skill.
[00:16:54] <blargo_> hackvana: in what way
[00:17:02] <hackvana> If you haven't had much experience in embedded software, you might find it easier to grab a more capable chip
[00:17:15] <hackvana> For example, doing serial in software
[00:18:00] <blargo_> oh ok
[00:19:35] <blargo_> hackvana: whereas the atmega already has libariers that do that?
[00:19:51] <hackvana> The atmega can do serial in hardware
[00:20:17] <hackvana> http://www.pjrc.com/teensy/index.html
[00:20:52] <hackvana> My suggestion: Find a project that already has a GPS and GSM module
[00:20:57] <blargo_> hackvana: oh ok thats why the trinket dosent have serial port
[00:21:07] <hackvana> Yes
[00:21:22] <blargo_> an atmega that has gps module?
[00:21:31] <hackvana> I didn't say that
[00:21:31] <blargo_> or will i have to buy a module seperatly
[00:23:01] <blargo_> hackvana: teensy looks good!
[00:24:18] <hackvana> I suggest you ask in #highaltitude
[00:24:54] <blargo_> thx
[00:25:05] <hackvana> You might find this interesting: http://www.open-electronics.org/how-to-send-and-receive-sms-with-gsmgprs-gps-shield/
[00:25:31] <blargo_> thanks
[00:26:15] <hackvana> My guess is that you want to make a tracker to track where someone or something goes, for example, a car.
[00:29:18] <blargo_> actually its for a daquri machine to be rented
[00:29:21] <hackvana> If so, just buy something to do the job, like this: http://www.goodluckbuy.com/mini-gps-tracking-device-gsm-gprs-gps-tracker-tk102-sd-card-.html
[00:29:27] <blargo_> in case of theft etc
[00:30:43] <blargo_> can i use that open electroincs shiled for arduino with an ATMEGA
[00:32:05] <blargo_> hackvana: yea thats pretty much it. but i wanted to do it as a project anyhow
[00:35:05] <hackvana> Sure. But there's going to be a fair amount of learning involved. It's not going to put itself together.
[00:35:32] <blargo_> i want to learn, so that i can point to it and say here is a porject i made
[00:35:49] <blargo_> build up a bunch more of those projects in hope of future employment
[00:42:36] <hackvana> Learning's good.
[00:46:21] <blargo_> any good resocure u know for geting started in avr
[00:48:36] <blargo_> can i use linux to program the teensy
[00:55:47] <w|zzy> are you home now abcminiuser ?
[00:56:20] <abcminiuser> Just about to leave for work
[00:57:07] <w|zzy> I meant Australia.
[00:59:36] <abcminiuser> Ah no, leaving 6th dec
[00:59:43] <abcminiuser> Talk tonight, off now for work
[01:34:02] <blargo_> can i run avr programs in an "emulator" inlinux
[01:34:12] <blargo_> so i can practice deving before i get a board
[02:02:53] <inflex> lo there abc...damn, he's gone
[04:17:47] <megal0maniac_afk> HA! Beat the system. I will have Spotify :)
[08:14:48] * Gerritjan is away (auto-away after 2hrs of inactivity) - (02:59 pm)
[08:45:21] <megal0maniac_afk> So, it turns out that you can use the Saleae Logic as a frequency/signal generator, pulse counter, pwm generator and I2C master
[08:46:43] <jadew> of course, it's just a devboard for that cypress chip :P
[08:48:39] <megal0maniac_afk> Well yeah
[08:49:00] <megal0maniac_afk> It never occurred to me that you could switch between firmwares on the original device as well
[08:49:42] <beaky> hello
[08:49:47] <beaky> how do i find out the frequency of my avr
[08:49:55] <megal0maniac_afk> But then I tried it, and it worked. eeprom writes are done by the cypress utility, so you don't even have to open it up
[08:49:56] <Tom_itx> you need their dev software don't you?
[08:50:08] <megal0maniac_afk> Tom_itx: Yeah, but it's a 17mb download
[08:50:11] <Tom_itx> can you save the original?
[08:50:16] <megal0maniac_afk> Tom_itx: Yip
[08:50:20] <Tom_itx> cool
[08:50:27] <megal0maniac> I was a little aprehensive but I had to know
[08:51:22] <megal0maniac> The usbee software is horrible though, but it works
[08:55:02] <jadew> yeah, you can switch between those two
[08:55:42] <jadew> megal0maniac, you got the original thing?
[08:56:11] <megal0maniac> jadew: Yeah. That's why I didn't try it before now. Didn't occur to me that you could :)
[08:56:56] <Tom_itx> where do you hook into it?
[08:57:00] <Tom_itx> usb?
[08:57:13] <jadew> Tom_itx, yeah
[08:58:14] <Tom_itx> if i get curious enough, some day i'll try it
[08:58:48] <megal0maniac> Tom_itx: You just replace the driver (with testsigning off), dump another .hex file onto it and write some bytes to the eeprom. It's all gui based and takes about 5 mins to do once you know the drill
[08:58:57] <Tom_itx> would be nice if you could have signal gen on an output and the rest logic in
[08:59:03] <jadew> I have a usbee clone that I want to make into a custom sniffer for my analyzer, but I can't seem to find the time for it
[08:59:18] <Tom_itx> anyway, time to run
[08:59:39] <Tom_itx> megal0maniac, write up a drill sheet for it :D
[08:59:52] <jadew> haha, good idea
[08:59:56] <jadew> please do
[08:59:56] <Tom_itx> bbl
[09:00:00] <jadew> see ya
[09:00:03] <megal0maniac> Heh :P
[09:00:06] <Tom_itx> i'll ban you if you don't
[09:00:11] <megal0maniac> :(
[09:00:14] <Tom_itx> heh
[09:00:31] <jadew> you got homework lol
[09:00:39] <megal0maniac> Off I go
[09:28:45] <beaky> hello
[09:29:22] <beaky> running the attiny85 from internal pll makes its system clock go 16mhz. but the max frqeuency of the tiny85v is 10mhz. does that mean my tiny85v is running at 10mhz?
[09:39:14] <megal0maniac> beaky: No, it just means that you're running it out of spec
[09:39:20] <megal0maniac> jadew: Done :P
[09:39:20] <beaky> ah
[09:39:40] <beaky> so it is 16Mhz, but the tiny85v is not designed for that?
[09:39:47] <megal0maniac> Correct
[09:40:02] <beaky> ah damn
[09:40:11] <beaky> what will happen
[09:40:17] <beaky> if i ran it
[09:40:21] <OndraSter> burrrrrrrrrrrrrrrrrn
[09:41:01] <megal0maniac> beaky: It might be unstable. No guarantees
[09:41:01] <beaky> lol
[09:41:30] <beaky> ok i will use clkdiv8, that way the 16 mhz becomes 2! :D
[09:41:33] <jadew> megal0maniac, awesome, where is it? :D
[09:41:35] <beaky> well within spec
[09:42:30] <megal0maniac> beaky: Why not just run it at 10?
[09:42:47] <megal0maniac> Or even 8, which is more standard
[09:45:09] <megal0maniac> jadew: Do you want it too?
[09:45:20] <jadew> yeah
[09:46:39] <beaky> how do i run it at 8
[09:46:49] <beaky> but keep the PLL for the peripherals
[09:47:51] <megal0maniac> jadew: https://docs.google.com/document/d/1T8bXbJrOfNZVgM1E81HE93kwem_jZ_hoFTximVJOlV0/edit?usp=sharing
[09:48:49] <jadew> megal0maniac, that's great, thank you
[09:51:04] <megal0maniac> Oh whoops. Left out the USB drivers
[09:51:09] <megal0maniac> But they're there now
[09:51:16] <megal0maniac> It really is dirt simple
[09:51:36] <megal0maniac> Tom_itx: ^
[10:10:59] <beaky> i love my avr
[10:11:53] <beaky> avr is the best
[10:27:03] <beaky> how do I do DAC with avr
[10:27:11] <beaky> with attiny85
[10:29:35] <bss36504> Use a PWM and a low pass filter
[10:29:55] <bss36504> or make a DAC with an opamp and some resistors
[10:30:04] <bss36504> or buy a DAC chip
[10:31:51] <beaky> ah
[10:31:57] <beaky> i love opamps
[10:32:21] <bss36504> you dont say
[10:32:33] <beaky> I love electronics!
[10:32:37] <beaky> even though i suck so bad
[10:34:11] <bss36504> I think you're confusing a lack of skill with a lack of knowledge. If you take the time to learn something fundamentally, you will get better.
[10:35:47] <megal0maniac_afk> I tried to make a DAC with an opamp, but it didn't work. Realised you need a second, higher supply for the opamp supply otherwise you'll never reach full resolution
[10:36:01] <beaky> yeah ive been bitten by that caveat of opamps
[10:36:26] <beaky> or maybe it would work with rail-to-rail opamps, hmm...
[10:36:36] <megal0maniac_afk> Same thing
[10:37:22] <beaky> opamps are lame why cant they do it with only Vcc as power
[10:37:35] <beaky> i guess i should buy a dac ic
[10:37:56] <megal0maniac_afk> beaky: They can, just make V- gnd
[10:38:34] <bss36504> or use the PWM option. at 250KHz, most things wont even care. Throw a decoupling cap on it, it will be basically DC
[10:38:54] <beaky> wow thats genius
[10:39:09] <beaky> so at 50% duty cycle i have a 2.5V amplitude sine wave
[10:39:23] <megal0maniac_afk> pretty much
[10:39:41] <megal0maniac_afk> You'll see lots of mention of using PWM with a low pass filter
[10:52:29] <megal0maniac_afk> beaky: Even the cheapest xmega has a DAC
[10:53:29] <megal0maniac_afk> At least 2 channels, 12bit
[10:56:37] <megal0maniac_afk> Oh hang on, that's not right. At 50% duty cycle with a low pass filter, you'll have 2.5V DC. Your DC voltage scales with your duty cycle
[10:57:02] <megal0maniac_afk> Not a sine wave. You need to make a sine wave in software and modulate the duty cycle
[11:04:35] <theBear> what ? at 50% dutycycle you have a 2.5v straight line
[11:04:49] <theBear> damned why doesn't this channel scroll this week ?
[11:05:08] <bss36504> I feel like I missed something that only megal0maniac_afk saw.
[11:07:36] <beaky> oh right
[11:08:26] <beaky> bss36504: "16:23 < beaky> so at 50% duty cycle i have a 2.5V amplitude sine wave" im wrong it should be a straight 2.5V DC voltage
[11:08:39] <beaky> what if i want a sine wave?
[11:09:39] <beaky> oh
[11:12:58] <megal0maniac_afk> beaky: You see it now? :)
[11:13:42] <bss36504> Oh yeah, totoally missed that haha. carry on :)
[11:14:24] <beaky> so i just vary the duty cycle really fast
[11:15:58] <bss36504> yes, in a sinusoidal fasion.
[11:16:24] <megal0maniac_afk> The faster you change the duty cycle, the higher the frequency
[11:16:32] <OndraSter> wat
[11:16:37] <OndraSter> oh
[11:16:38] <OndraSter> sine, yes
[11:17:47] <beaky> I love pwm it is so flexle
[11:17:48] <megal0maniac_afk> beaky: You could start with a square/sawtooth wave
[11:17:58] <megal0maniac_afk> You can do those with just a for loop
[11:18:21] <OndraSter> for sine I suggest lookup tables
[11:18:27] <OndraSter> or what about cos wave?
[11:18:29] <OndraSter> or tg wave? :D
[11:19:36] * RikusW suggests a shockwave ;)
[11:20:38] <megal0maniac_afk> Yeah precalculated LUT. Calculating sine on AVR is expensive
[11:21:07] <OndraSter> calculating sine on anything withotu FPU is quite costly
[11:22:28] <megal0maniac_afk> OndraSter: How would you suggest adjusting freq?
[11:22:58] <OndraSter> of?
[11:24:21] <megal0maniac_afk> Sine wave
[11:24:29] <megal0maniac_afk> Ah, nevermind :)
[11:24:30] <megal0maniac_afk> http://pastebin.com/VahGt0LX
[11:25:11] <megal0maniac_afk> Oh wait. I'm not sure that helps
[11:25:16] <megal0maniac_afk> But the look up table is there
[11:25:46] <OndraSter> well you will be changing the data... at slower rate :P
[11:26:08] <OndraSter> or skipping some, if you get to speeds where it would take too much processing time and don't care for "perfect" sine
[11:27:57] * megal0maniac_afk ponders interpolating sine waves
[11:35:42] <megal0maniac_afk> OndraSter: Can you implement some kind of LUT which is accessible from the event system?
[11:36:48] <N1njaneer> Make the LUT a 2^n size as well, which makes the math really really each to step through the table :)
[11:37:28] <megal0maniac_afk> N1njaneer: Yip, that one is 128 samples
[11:37:54] <N1njaneer> And you also only need 1/4 of a sine LUT if you do some additional mathings.
[11:38:16] <N1njaneer> Take advantage of the waveform symmetries for maximum justice.
[11:38:46] <N1njaneer> (useful on space-constrained devices!)
[11:39:03] <megal0maniac_afk> I actually wanted to write a signal gen app for Rockbox, since you can code in C, there's an API to make some stuff easier, and it's assumed that every target has a 16bit DAC
[11:39:49] <megal0maniac_afk> Someone started, but didn't finish, and it doesn't compile and I don't know why because it all goes way over my head at this point :)
[11:40:47] <N1njaneer> megal0maniac_afk: Did I show you the synthesis stuff I did a while back? Not microcontroller-based, but still all real-time stuff from the PC side. It makes math look fun. :D
[11:41:16] <megal0maniac_afk> The dmx lighting systems?
[11:41:25] <N1njaneer> Laser stuff
[11:41:36] <megal0maniac_afk> Ah, yes. That was awesome
[11:41:42] <megal0maniac_afk> So much math :P
[11:42:08] <N1njaneer> https://www.dropbox.com/s/qs03cagdhkzwzm3/morefunmath.jpg are some nice examples of output
[11:42:43] <megal0maniac_afk> It makes me want to say laplace
[11:43:59] <N1njaneer> All of the waveforms in the oscillators are LUT-based, and I want to say they are either 16 or 17-bit lengths; can't remember. But you can run them between 0.0001Hz and 24Khz, since the sample output frequency is 48Khz.
[11:44:33] <N1njaneer> Just depends on how fast you step the LUT index
[11:46:18] <N1njaneer> Easier with a PC or prerendering fixed data in to a table, but in the case where you are running on something without sin() function, you can easily use the simple spring equation w/o damping to produce a perfect sinusoidal oscillation, which you can capture straight in to RAM and use as a lookup table. Look ma, no math.h needed!
[11:49:30] <N1njaneer> But I'm ramblig. I just love sharing the love of this stuff with people! :D
[11:49:54] <N1njaneer> I've done a lot with a lot of different things, and I want to help others to similarly enjoy their own engineering adventures.
[11:50:05] <N1njaneer> Even beaky porting Linux to his ATTINY!
[11:50:14] <megal0maniac_afk> N1njaneer: Sorry, went afk for a second
[11:51:59] <megal0maniac_afk> Good points. LUT is definitely the way to go with limited resources. Square/sawtooth/triangle is just on/off or ramp so no calc needed
[11:52:04] <megal0maniac_afk> Although...
[11:52:16] <megal0maniac_afk> You need to be able to control the frequency
[11:52:40] <megal0maniac_afk> In any case, this is the (unfinished) signal generator code that someone else wrote http://pastebin.com/VahGt0LX
[11:54:44] <megal0maniac> I don't want sweeps, but I do want different waveforms
[11:55:03] <megal0maniac> -> notation is strange
[11:56:04] <N1njaneer> Yeah, you just need to create a bit of math to control the LUT index stepping. Generally for fixed-integer stuff, you can easily do something like a 16-bit accumulator whereby the top 7 bits work as the index to your table (assuming it's 128 entries) and then you use the bottom 9 bits as the fractional portion. That way you have 1/512 sub-index-steppings to work with, so for instance if you
[11:56:04] <N1njaneer> increment the index by 1, it will take 512 increments to move the LUT to the next slot. Or you step by 512 and you move one slot in the LUT, ec.
[11:56:05] <N1njaneer> etc.
[11:57:10] <N1njaneer> The bit-depth of the stepping accumulator really comes down to the frequency-range requirements of your system. But if you set it up like this, overflow will effectively auto-modulus for you and handle the wrap-around with a simple AND and shift operation :)
[11:58:15] <N1njaneer> And you can always go over to a 32-bit long integer if you need a whole lot more precision, etc.
[11:58:29] * megal0maniac is still trying to understand the accumulator part
[12:01:13] <megal0maniac> Okay, I get it, but why would you want so many sub-steppings?
[12:01:23] <N1njaneer> Frequency-control granularity
[12:01:46] <N1njaneer> For easy math, say the table it 100 entries long
[12:01:58] <N1njaneer> Let's say your sample rate is 100 samples output per second.
[12:02:26] <N1njaneer> If you use a whole accumulator without fraction for stepping the index, your increment can only be a whole number.
[12:03:02] <N1njaneer> This results in the frequency output being 0 Hz for 0, 1 Hz for 1, 2 Hz for 2, etc
[12:03:22] <N1njaneer> Because you HAVE to step the index by a minimum of "1" each time you output
[12:03:53] <N1njaneer> Does that make sense so far?
[12:03:54] <megal0maniac> Ah, so you step the accumulator instead and that bumps up the LUT index every 512 bits
[12:05:24] <megal0maniac> But that only helps with lower frequencies. And with a 128 index LUT and a 44.1khz sample rate, your "native" frequency is only 344Hz
[12:05:51] <megal0maniac> And you'd seldom go lower than that anyway
[12:09:33] <N1njaneer> It helps with the lower frequencies, but it also happens with RESOLUTION of frequency possibility.
[12:11:37] <megal0maniac> Ah, I see
[12:11:48] <N1njaneer> If the system can go down to, say, 0.1Hz, you have a GRANULARITY of 0.1Hz through the whole range.
[12:11:52] <megal0maniac> Except that would break the sinewave, would it not? Since sine isn't linear
[12:11:58] <N1njaneer> So you can do 400.1 or 32.6Hz, etc
[12:13:07] <N1njaneer> Nope, you are just skipping (or doubling) samples in the sine wave at a linear rate (based on the speed the accumulator is having a value added to it) so you get a different output.
[12:14:10] <N1njaneer> Remember that at the end of the day you are only approximating a sine wave with discreet samples anyhow. It's not an analog-true sinewave. The question is simply if the approximation is adequate for what you are doing with it. And of course a bit of low-pass filtering on the DAC output can help smooth it further, etc.
[12:14:29] <N1njaneer> Make sense?
[12:15:12] <N1njaneer> In this scenario of implementation, the lowest frequency you can drive the LUT at defines the ultimate stepping resolution for the entire frequency range.
[12:15:51] <N1njaneer> This method also gives you a super simple way to linearly vary the speed of the system, rather than the exponentiation that can inadvertantly come from other methods.
[12:16:35] <megal0maniac> I'm a step behind you, but only 1 ;)
[12:18:18] <wip> Tom_itx, about the fact of disabling the reset pin and still being able to reprogram the firmware using a bootloader, looks like it's possible in the end: https://github.com/bluebie/micronucleus-t85
[12:18:36] <wip> "Once bootloaded, an ISP or HVSP programmer can disable the reset pin..."
[12:19:13] <megal0maniac> wip: Ah, sorry. I was going to answer that :P
[12:21:30] <N1njaneer> megal0maniac: I should start making a list of Interesting Things to write articles about based on some of the discussions in here. I could do it more justice with diagrams and pseudocode examples :)
[12:22:04] <bss36504> Any thoughts on why my SPI programming works great but stupid dW wont engage?
[12:22:06] <N1njaneer> I have just been struggling with topic ideas to elaborate on if I start a N1njaneer Technical Blag
[12:22:40] <N1njaneer> bss36504: Haven't used dW yet, so no ideas to suggest here. Have you tried turning it off and back on again? :D
[12:23:04] <bss36504> I hate it, but some targets support only dW.
[12:23:12] <bss36504> I'll figure it out eventually
[12:24:50] <beaky> hello
[12:25:13] <N1njaneer> "Back in MY day we didn't
[12:25:18] <megal0maniac> bss36504: Which target?
[12:25:24] <megal0maniac> N1njaneer: I agree :D
[12:25:28] <megal0maniac> I'd pay for that
[12:25:33] <megal0maniac> Whoops
[12:25:38] <megal0maniac> I didn't say anything
[12:25:42] <megal0maniac> :P
[12:25:51] <megal0maniac> bss36504: Sorry, I mean which programmer
[12:25:57] <N1njaneer> "Back in MY day we didn't HAVVVE all this.... FANCY DEBUG STUFF... We used i/o pins and oscilliscope and LICKED WIRES WITH OUR TOUNGE as a logic probe, and WE LIKED IT!!" :D
[12:26:31] <megal0maniac> I licked a 1/4" jack once. It was plugged straight into a mixer, with phantom power :/ Ow
[12:26:42] <N1njaneer> (ala http://www.youtube.com/watch?v=BbU4Cb4A4-o Dana Carvey on SNL)
[12:27:27] <N1njaneer> I acutally was doing AVR debugging in a hotel room once, and I was decoding binary addresses with a pad of paper, 8 probe-points, and my tounge. It works. XD
[12:27:30] <bss36504> megal0maniac: JTAGICE3 targeting a 32U2
[12:28:13] <megal0maniac> N1njaneer: But it's less fun with 48VDC
[12:29:05] <N1njaneer> megal0maniac: Lick the 48VDC through a 10K or 1M resistor. That part is key :)
[12:29:24] <megal0maniac> bss36504: You could try manually enabling dwen first?
[12:29:45] <megal0maniac> Although if dW REALLY doesn't want to engage, then you're stuffed
[12:30:53] <megal0maniac> I think I've had the same issue. Clicking all of the buttons solved it eventually. It was one of /those/ issues
[12:31:53] <bss36504> megal0maniac: yeah, I'm hesitant to do that since I don't have my hot air station nearby, and I've bricked a couple chips before doing that.
[12:33:29] <megal0maniac> bss36504: RikusW implemented automagic dW disabling for regular ISP programming. Just add a pull-up. I killed a board like that too, since there was a cap interfereing with the reset signal
[12:33:45] <megal0maniac> Then I tried HVPP and I think I killed it properly
[12:34:06] <N1njaneer> megal0maniac: HVPP doesn't mean 3-phase 440V, though! :D
[12:34:21] <megal0maniac> And then I tried to mail it to RikusW and it got lost on the way. So that was the end of that
[12:34:32] <megal0maniac> N1njaneer: It's all about context. Context is key
[12:35:07] <bss36504> megal0maniac: There is no way I'm going through the effort of hooking my TQFP32 chip to the dragon for HVPP :P AFAIK, atmel studio was supposed to take care of the switch to dW, but it's saying there is a problem with it. I have 4.7K pullup on my reset line. Too much? Too little?
[12:36:30] <megal0maniac> Fun fact for the day: TPI devices will only program at 5V. However, just to confuse you, they respond to all commands at lower voltages. You can program, read signature, everything. Except none of the bits stick, so verification fails because the flash doesn't actually get written to
[12:36:39] <megal0maniac> Bloody frustrating if you don't realise you're on 3v3
[12:36:46] <OndraSter> hmm
[12:36:54] <OndraSter> nice
[12:37:02] <megal0maniac> bss36504: 10K is recommended, and there's one built into the jtagice3
[12:37:09] <OndraSter> I hope that tiny13 has got no issues at programming when running off a coin cell
[12:37:11] <megal0maniac> But still...
[12:37:39] <megal0maniac> OndraSter: You need to give it 5V. Otherwise it pretends that the flash has died and makes the programmer sad
[12:37:59] <OndraSter> but it does not use TPI
[12:38:00] <OndraSter> it uses normal SPI
[12:38:09] <megal0maniac> Oh. Well carry right on then
[12:38:16] <megal0maniac> I forgot t13 used SPI
[12:38:22] <bss36504> megal0maniac: Right, so any ideas? I can take it off no problem, but not having any pull up is bad since it could reset on it's own. General question, if i use the RSTDSBL fuse to disable reset, does ISP still work?
[12:38:38] <OndraSter> there is internal pullup
[12:38:39] <megal0maniac> No. RSTDSBL will break ISP
[12:38:40] <OndraSter> (check datasheet)
[12:38:42] <bss36504> cause I could do that first, then remove pull up, then try to do dW
[12:38:52] <bss36504> ok ok, just checking. I figured it would
[12:39:26] <megal0maniac> It wouldn't hurt to remove the resistor on the board. It's an easy test, but I vote that it won't help
[12:39:39] <bss36504> OndraSter: are you saying there is an internal pull up inside the chip? I didnt think that was the case
[12:39:45] <OndraSter> yes
[12:39:47] <bss36504> megal0maniac: I'll try it and be back in a minute
[12:39:47] <megal0maniac> bss36504: It's definitely the case
[12:39:49] <OndraSter> there is one, 30k or 20k I think
[12:39:51] <OndraSter> check the datasheet
[12:39:55] <bss36504> oh, the more you know.
[12:40:02] <bss36504> why do they make you put one external then>
[12:40:04] <OndraSter> under electrical part
[12:40:04] <bss36504> +?
[12:40:07] <megal0maniac> Stability
[12:40:08] <OndraSter> because it is very weak
[12:40:09] <OndraSter> the internal one
[12:40:13] <OndraSter> and easy to flow away
[12:40:18] <OndraSter> if you have a lot of interference
[12:40:30] <megal0maniac> Can be ~40K in some cases iirc
[12:40:38] <OndraSter> like I said, check electric specs
[12:40:43] <OndraSter> it has got quite a wide range I think
[12:40:58] <megal0maniac> Ah, 30-60K
[12:41:02] <bss36504> ok, that makes sense. I'll try it. The dW should realistically work with a bare chip if there is a pull up on reset...er, that seems like thats how it should have been designed.
[12:41:05] <bss36504> brb
[12:42:41] <megal0maniac> With an assumed 10K inside the programmer, plus the one on the board, plus internal, you have roughly 3K. It's quite strong, but it should still be able to drive the lines low
[12:48:01] <beaky> I love isrs
[12:48:13] <beaky> they make me feel like my avr is doing lots of stuff asynchronously
[12:50:47] <abcminiuser> Ahoyhoyohoy
[12:50:53] <OndraSter> ahoy cap'n abcminiuser
[12:51:02] <OndraSter> is the ship going through the wind?
[12:51:03] <OndraSter> harr
[12:51:14] <abcminiuser> Thar' be rum here
[12:51:14] <OndraSter> like a fox in the forest?
[12:51:18] <OndraSter> yey rum
[12:51:20] <OndraSter> YO HO HO
[12:51:23] <abcminiuser> And it's actually pretty good
[12:51:25] <abcminiuser> Wheee
[12:51:48] <OndraSter> hehe
[12:52:13] <OndraSter> beaky, what about women? Do you love them more or less than your tiny?
[12:52:29] <abcminiuser> My tiny what?
[12:52:33] * abcminiuser looks disapprovingly
[12:52:48] <OndraSter> abcminiuser, aww you haven't seen anything from beaky?
[12:52:56] <abcminiuser> You wha/
[12:52:57] <abcminiuser> ?
[12:53:24] <bss36504> megal0maniac_afk: Atmel Studio was unable to start your debug session.
[12:53:24] <bss36504> Please verify device selection, interface settings, target power and connections to the target device.
[12:53:34] <bss36504> no external pullup
[12:53:46] <abcminiuser> GDP starting to execute commands.
[12:53:46] <abcminiuser> - Erasing chip...
[12:53:46] <abcminiuser> - Programming memory type "flash" (4234 bytes, offset 0)...
[12:53:46] <abcminiuser> - Verifying memory type "flash" (4234 bytes, offset 0)...
[12:53:46] <abcminiuser> GDP finished executing commands.
[12:54:25] <bss36504> whatever, I dont need no stinkin' debug capability
[12:58:44] <beaky> if i am hooking buttons to my avr, should i hook them to GND and make them active low (with internal pullups enabled), or to VCC and active high with extenral resistors
[13:00:40] <N1njaneer> Pull to ground is easier
[13:01:06] <beaky> ah
[13:01:10] <beaky> why is it easier
[13:02:17] <ambro718> because you can use the built-in pullup feature in the avr
[13:02:29] <ambro718> no need to add resistors
[13:02:50] <sjokkis> what sort of real-time options do i have for linux on avr32? i looked into config_preempt_rt (https://rt.wiki.kernel.org/) but it doesn't seem to be supported. halp?
[13:11:32] <megal0maniac_afk> abcminiuser: Whooo!
[13:11:57] <megal0maniac_afk> Just realised that your messages weren't a continuation of bss36504's studio output
[13:12:17] <bss36504> lol
[13:12:21] <bss36504> any thoughts?
[13:12:36] <abcminiuser> :P
[13:13:06] <N1njaneer> megal0maniac_afk: Heh, I'll just pipe my stdout straight to #avr for fun and profit
[13:13:58] <megal0maniac_afk> * Open \______ \ ____ ____ | | _\_ |__ _______ ___
[13:13:58] <megal0maniac_afk> * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
[13:13:58] <megal0maniac_afk> * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
[13:13:58] <megal0maniac_afk> * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
[13:13:58] <megal0maniac_afk> * \/ \/ \/ \/ \/
[13:14:00] <megal0maniac_afk> * $Id:$
[13:14:19] <megal0maniac_afk> Aah! sorry. Not the expected result >.<
[13:15:52] <megal0maniac_afk> Irssi asks if you're sure when pasting many lines. It's smart that way. Luckily all 204 lines didn't make it through
[13:17:46] <abcminiuser> Damn, this is going to be one long-ass python file if I want to keep the one-protocol-one-file paradigm
[13:18:02] <megal0maniac_afk> abcminiuser: Which one are you busy with?
[13:18:16] <abcminiuser> Refactoring STKV2 protocol
[13:18:28] <abcminiuser> Since it needs to eventually cover ISP, HVPP, HVSP and XPROG
[13:18:33] <abcminiuser> Which means a crapload of code
[13:18:47] <abcminiuser> I think I should just break it up into a ton of files in a subfolder
[13:19:02] <megal0maniac_afk> I agree. Sub-protocols, so to speak
[13:19:34] <abcminiuser> I suppose people expect the protocols to be big
[13:19:44] <abcminiuser> The tool wrapper, transport and file readers are tiny
[13:19:46] <sjokkis> abcminiuser: are you familiar with real-time linux on avr32?
[13:20:27] <abcminiuser> I am not :P
[13:20:58] <sjokkis> abcminiuser: know anyone who might be?
[13:21:11] <N1njaneer> I heard Beaky is porting Linux to an ATTINY
[13:21:27] <megal0maniac_afk> sjokkis: Check out http://www.avr32linux.org/
[13:22:04] <megal0maniac_afk> Just kidding! What the hell is going on at that site?
[13:22:30] <sjokkis> no idea. it has absolutely nothing to do with linux
[13:22:36] <abcminiuser> HC, in #avr32 if he's ever around
[13:22:51] <sjokkis> abcminiuser: do you mean hce?
[13:23:16] <N1njaneer> Apparently Linux was not successful on AVR32 and the site took up other interests.
[13:23:37] <sjokkis> abcminiuser: didn't he work for atmel around the time rein did?
[13:23:38] <N1njaneer> Go Linux on SAM - widely supported, better performance, same price-point on devices :)
[13:23:43] <abcminiuser> Ja HCE
[13:23:48] <abcminiuser> And ja
[13:24:51] <beaky> sam stands for small arm microcontroller?
[13:25:52] <N1njaneer> Smashingly-Awesome Microcontroller, it's British
[13:30:13] <sjokkis> anyone know why rt-linux isn't established on avr32? i would have thought lots of people would find that useful
[13:35:21] <abcminiuser> Smart Atmel Microcontroller
[13:35:34] <beaky> ah right
[13:36:14] <abcminiuser> Man I'm terrible at structuring Pythong
[13:36:16] <abcminiuser> *Python
[13:37:43] <beaky> python structures itself :D its like executable pseudocode
[13:37:56] <beaky> i love python its the first programing language i laernd
[13:39:08] <abcminiuser> Fix mine then :P
[14:00:32] <megal0maniac_afk> *Pythong :D
[14:01:38] <megal0maniac_afk> sjokkis: Because SAM. It's more powerful, ARM core for which Linux is actively supported and developed and it's just generally better suited to it
[14:03:46] <sjokkis> oic
[14:20:32] <beaky> i thought atxmega is power enough for power linux kernel
[14:22:47] <OndraSter> xmega is still AVR
[14:22:51] <OndraSter> avr32 is avr32 core
[14:23:52] <beaky> ah
[14:41:17] <kdehl> Heh. Just found IntelĀ® 64 and IA-32 Architectures Software Developer Manual. 3289 pages.
[14:41:25] <kdehl> I thought a datasheet for an AVR of more than 400 pages was huge.
[14:41:45] <kdehl> Volume 2: Instruction Set Manual. 1455 pages.
[14:42:04] <kdehl> Maybe one should make an emulator...
[14:57:38] <beaky> hello
[14:57:46] <beaky> which internal RC oscillator should I choose?
[14:57:56] <beaky> the 8Mhz + 0ms startup time, or the one with higher startups?
[14:58:10] <MannImMond> If it's not time/power critical the longer startuptime
[14:58:26] <beaky> why?
[14:58:46] <MannImMond> sec, I think there was some appnote about it
[15:05:28] <N2TOH> beaky, check out this part. http://www.linear.com/product/LTC6903
[15:07:25] <beaky> wow that is overkill :D
[15:07:42] <N2TOH> :P
[15:08:17] <N2TOH> look at it this way, changing the clock frequency for any project is a snap
[15:08:37] <beaky> yeah it would be a lifesaver if i accidentaly fuse my clock to some crazy setting
[15:09:05] <N2TOH> linear does offer samples
[15:09:17] <beaky> even to noobs like me? :D
[15:09:31] <N2TOH> ask, worst they can say is no
[15:09:54] <beaky> theres no hope of ever getting a big order from me by offering me freebies :D
[15:10:07] <beaky> im no big company :(
[15:11:21] <N2TOH> word of mouth advertising is the best there is. so a few freebies here and there is a small proce to pay
[15:11:25] <N2TOH> price
[15:12:30] <beaky> but i dont use facebook
[15:12:39] <MannImMond> beaky: Hmm can't find the appnote I was looking for
[15:13:00] <beaky> ok maybe if i brag on irc about this awesome lt part then pros might get aroused to request them :D
[15:13:07] <beaky> aww :(
[15:17:35] * kdehl just ran CPUID.EXE in DOSBox and it identified his computer as a Genuine Intel486(TM) DX processor
[15:31:21] <beaky> i've disabled the reset on my attiny85
[15:31:24] <beaky> what do i do now
[15:31:33] <beaky> how do i program it again
[15:39:09] <Tom_itx> HVPP
[16:21:26] <beaky> how do i reduce the effect of noise?
[16:21:48] <beaky> when i am close to my avr the adc acts funny
[16:22:03] <jadew> shielding
[16:22:05] <beaky> or have i invented a person detector?
[16:22:26] <jadew> and maybe a stronger driver for the adc?
[16:22:32] <jadew> you could buffer the input
[16:24:13] <GuShH> beaky: something's floating...
[16:24:18] <GuShH> lower your impedance
[16:24:22] <beaky> ah
[16:24:40] <beaky> is avr cmos?
[16:24:43] <GuShH> if your inputs are untied and floating you'll pick up all kinds of noise, it's acting as an antenna
[16:24:44] <beaky> or is it ttl
[16:24:48] <beaky> ah cool
[16:25:00] <GuShH> (untuned, limited to whatever bandwidth is available, etc)
[16:25:14] <GuShH> well in reality it could be slightly tuned based on the parasitics available :p
[16:25:24] <beaky> why wont my mosfet turn on
[16:25:26] * GuShH goes back to the corner
[16:25:37] <GuShH> beaky: schematic?
[16:26:03] <GuShH> think of the fet gate as a capacitor, you need to charge it or discharge it, it's a capacitive load.
[16:26:12] <beaky> i am pwming it at 250khz
[16:26:22] <GuShH> alright you might not have the power to drive it properly
[16:26:30] <GuShH> ie to pull it up and down in time
[16:26:42] <GuShH> so you get a median sort of effect on the gate
[16:27:02] <GuShH> you have to figure out the inrush current required based on the gate capacitance and how fast you want to charge / discharge it
[16:27:10] <GuShH> then double that in your drive circuit, for good measure.
[16:27:19] <beaky> how do i make a mosfet direver
[16:27:21] <beaky> driver*
[16:27:26] <GuShH> a bare gpio won't do much
[16:27:40] <beaky> i want to switch an nmos high side
[16:27:43] <beaky> from avr
[16:27:44] <GuShH> you can buy mosfet driver ICs or make a fast buffer with an opamp for most low power applications
[16:27:46] <megal0maniac_afk> A bear gpio on the other hand...
[16:27:54] <GuShH> heh
[16:28:15] <GuShH> megal0maniac_afk: but those are rather gay I hear
[16:28:40] * megal0maniac_afk *rawr
[16:28:52] <GuShH> beaky: think, you might need let's say 100mA supplied very fast to charge the gate in time, likewise for the discharging portion...
[16:29:14] <beaky> so i can make a mosfet driver with a bjt?
[16:29:26] <beaky> wil that suply enough to power my high side nmos
[16:29:38] <GuShH> you could with a darlington or similar configuration
[16:29:39] <GuShH> not ideal
[16:29:57] <beaky> aw :(
[16:30:01] <GuShH> plus you might need to start working with higher voltages to meet your fet characteristics
[16:30:23] <megal0maniac_afk> P-channel, anyone?
[16:30:29] <GuShH> beaky: you can use discrete darlingtons (just two transistors one following the other) you don't have to use a monolithic one heh
[16:30:34] <beaky> how do i drive a pmos from an avr
[16:30:38] <GuShH> do your research
[16:30:48] <megal0maniac_afk> GuShH: He does it here
[16:30:51] <GuShH> ask once the smoke comes out, pics will make it better. I'll supply the popcorn
[16:30:55] <GuShH> megal0maniac_afk: damn it.
[16:31:45] <megal0maniac_afk> I used 2n7002. They work fine off gpio
[16:31:57] <beaky> i tried that but
[16:32:06] <beaky> for some reason nothing :(
[16:32:46] <megal0maniac_afk> Gate to Vcc
[16:33:02] <beaky> right; with a 1k pulup
[16:33:15] <megal0maniac_afk> Source to AVR, Drain to other device. Both pulled up
[16:33:23] <GuShH> beaky: schematics help determine where you went wrong :p
[16:33:27] <beaky> source to avr?
[16:33:43] <GuShH> o.O
[16:33:43] <megal0maniac_afk> Or the other way around, doesn't matter. Bidirectional
[16:33:54] <megal0maniac_afk> Like here: http://www.nxp.com/documents/application_note/AN10441.pdf
[16:33:59] * GuShH goes away for some target practice
[16:34:00] <megal0maniac_afk> Page 4
[16:34:50] <beaky> ah a level shitter
[16:34:54] <beaky> shfter*
[16:35:04] <beaky> i thought that needed a charge pump
[16:39:23] <megal0maniac_afk> Nope
[16:39:30] <megal0maniac_afk> Two resistors and an fet
[16:40:24] <beaky> i love fets they are nice and hunky
[16:40:50] <megal0maniac_afk> fets love you
[16:44:05] <abcminiuser> I should drink more
[16:44:20] <abcminiuser> Got the unaligned read/writes working :P
[16:49:05] <megal0maniac_afk> \o/
[16:49:53] <megal0maniac_afk> Haha! beaky.. just noticed "level shitter"
[16:57:20] <beaky> ah now i know why my pmos wont work
[16:57:37] <beaky> i had both source and drain at Vss
[17:01:25] <beaky> is it better to drive led active low?
[17:03:21] <Casper> beaky: depend on your drive ability
[17:03:36] <Casper> often a low side switch is more efficient and more powerfull
[19:47:55] <pingo> Are there chips with multiple adc? So that it can take more than 1 measurement at the same time?
[19:54:47] <Casper> afaik, not in avr
[19:54:53] <Casper> but you can get external ones that does
[19:55:13] <Casper> there is some sample and hold circuit/chip too that may work
[19:55:39] <pingo> Hmmm
[19:55:56] <pingo> I need to do relatively fast and concurrent measurements
[19:56:10] <pingo> to monitor mains power usage
[20:00:40] <Casper> you know, you probably do not need concurrent mesurement...
[20:00:58] <Tom_itx> agreed
[20:01:04] <Casper> the ADC is probably fast enought that you probably can consider the mesurement to be concurrent
[20:01:20] <Casper> it will probably fit within the error margin of the ADC anyway
[20:01:54] <pingo> Im getting 30 samples per one mains cycle
[20:04:27] <Tom_itx> how many do you really need to monitor power useage??
[20:04:57] <Tom_itx> 1800/sec
[20:05:08] <pingo> I've read that 50 per cycle is a good number
[20:05:10] <Tom_itx> asuming 60 hz
[20:05:44] <pingo> Its a 3 phase system
[20:05:49] <pingo> so I take 6 measurements
[20:05:52] <pingo> for 1 sample
[20:06:04] <pingo> 3 x current 3 x voltage
[20:08:27] <pingo> Well I was just wondering...
[20:08:44] <pingo> I will try to use 3 chips, one per phase
[20:08:49] <pingo> And compare results
[20:09:10] <Tom_itx> same clock source?
[20:09:42] <Tom_itx> you won't know if they sample the same time
[20:09:54] <pingo> not same clock source
[20:10:03] <pingo> they will calculate power each on their own
[20:16:20] <inflex> lo folks, hi Tom_itx
[20:16:22] <inflex> and Casper
[20:16:36] <Tom_itx> hey
[20:18:48] <inflex> Tom_itx: how's business?
[20:19:57] <Tom_itx> is there any?
[20:21:59] <inflex> I'm doing a lot better now - but I do miss designing electronics :(
[20:22:19] <inflex> instead the only time the iron warms up now is to replace broken connectors, or maybe fix a laptop mainboard, etc
[20:23:03] <Tom_itx> well i haven't quit my day job either
[20:58:33] <Casper> hi inflex