#avr | Logs for 2012-10-28

Back
[00:00:05] <jadew> I think about how to clean a square signal, by passing it trough a fast op amp, but the opamp is powered from -6 to +6 and I need the resulting signal to be above 0
[00:00:29] <theBear> jadew, no, and also, err, just no, it compares the inputs, one higher or other higher, and o utputs rail or rail
[00:00:44] <jadew> got it, so no way eh?
[00:00:46] <jadew> hmm
[00:00:55] <jadew> I guess I could use a diode on the output then
[00:01:02] <theBear> where is the square biased ?
[00:01:08] <jadew> but I need to look into how fast diodes are
[00:01:25] <theBear> different diodes are different fastnesses, but i suspect that isn't what you want
[00:01:25] <jadew> what does that mean? "biased"?
[00:01:38] <jadew> lik top and bottom?
[00:01:39] <theBear> you know, like centered around X volts (in this case)
[00:01:51] <jadew> 0v-5v on the input
[00:02:05] <theBear> can you not just use a 74 schmitt buffer or something ?
[00:02:19] <theBear> they are traditional for cleaning tthis kinda thing up
[00:02:39] <jadew> don't know, but I already have a 300Mhz opamp in there, with a free slot
[00:02:56] <jadew> so I figured I could use that to clean that square
[00:04:15] <theBear> mmm, maybe.... i suppose something like a series resistor on the output and a clamp diode to gnd could do it, but that will undo some of your cleaning up, depending on exactly what you are going for
[00:04:21] <jadew> why did you say that you suspect I that's not what I want (about the diodes)?
[00:04:51] <jadew> ah, so the diode might mess stuff up, eh?
[00:05:22] <theBear> oh, or were you thinking series diode for pullup ? not as much the diode (tho it will introduce SOME knee onto its transition/corner/edges) as the resistor and inherant capacitances
[00:05:49] <theBear> and if you use the series diode as pullup, you still got a resistor on the pulldown, but that's possibly nicer than the first way i said
[00:05:50] <jadew> I was thinking a diode to cut off whatever is under 0
[00:06:32] <theBear> that's a clamp diode if it goes to gnd to achieve that, but it'll really cut off everything under -0.6v or so, and you need the series resistor, you can't just short the output of a comparator and expect it to behave normally
[00:06:54] <jadew> I see
[00:07:54] <theBear> but series diode pointing away from the opamp with a pulldown, that might be 'o.k' ... how clean do you need this square, and why ? that might suggest what is/isn't acceptable
[00:08:16] <jadew> I'm building a function generator
[00:08:26] <jadew> the chip is a dds AD9834
[00:08:37] <jadew> 75Mhz clock, it probably does about 30Mhz sqaures
[00:08:44] <jadew> but I suspect they will be really dirty
[00:08:58] <theBear> hmmm, if it's a function generator, why do you want the signal above 0v
[00:09:30] <jadew> so I can feed it back into the opamp and work the same as the sines and the other one
[00:09:43] <jadew> I'm generating a different ground reference on the output of the generator
[00:09:48] <jadew> to controll the offset
[00:09:56] <theBear> hmmmmm k
[00:10:33] <theBear> you mean before the final buffer stage right ? 'cos you don't want a weird voltage on the output gnd as exposed to the user
[00:10:58] <jadew> it's an isolate supply, so there shouldn't be any issue
[00:11:13] <theBear> mmk
[00:11:18] <jadew> or that's not ok?
[00:11:44] <theBear> if it's isolated, just means you ALWAYS need to connect the output gnd, but you probably have a reason for wanting it floatey, i can even think of several handy uses already
[00:12:06] <theBear> still, that doesn't control the offset
[00:12:13] <theBear> oh, i suppose, yeah i see
[00:12:39] <theBear> oh, if yer happy with a discrete buffer, a fet or bjt or two can do a very nice job :)
[00:13:01] <JViz> !seen abcminiuser
[00:13:02] <jadew> as long as they have the bandwidth
[00:13:24] <theBear> a lot of small silicon discretes are a lot faster than most people think
[00:13:30] <jadew> I noticed the stuff I have around is pretty slow
[00:14:24] <jadew> some dude in #electronics suggested pretty much the same thing
[00:14:39] <jadew> so you can't be both wrong, eh?
[00:15:07] <jadew> I'm gonna try it, but again, most of my transistors seem to be junk at higher frequencies (I tried them)
[00:15:56] <jadew> thanks theBear
[00:47:41] <theBear> i was watching :)
[00:49:07] <jadew> you were right about the diode, it introduced some noise in there
[00:49:19] <jadew> and that was at a really low freq
[00:50:11] <theBear> ahh of course, a diode takes 'a moment' to work too
[00:51:47] <jadew> yeah, I saw that on the scope
[00:52:03] <jadew> it leaves the signal to go under 0 for a bit
[00:52:29] <jadew> don't know why that's happening tho
[00:52:43] <jadew> I mean.. what could go on in there
[00:53:57] <theBear> diodes can only 'switch' so fast
[00:54:05] <theBear> and they have a knee when they do
[00:54:07] <jadew> this is weird, I'm trying to fix it now with a mosfet and for some reason it wouldn't go above 600mV on the output, altho I'm using a pull up as you suggested
[00:55:31] <jadew> I have the source connected to the ground, gate connected to the opamp output (-6 +6), and drain is the output, connected trough a pullup to +6
[00:55:44] <jadew> I do get the correct wave, but freaking small
[00:55:45] <theBear> what how ? i said pulldown if using a series diode i think
[00:56:01] <jadew> I don't have any diodes now
[00:56:15] <theBear> have you got a big load on the output ? what kinda fet ?
[00:56:28] <jadew> n
[00:56:32] <jadew> BS108
[00:56:44] <jadew> oh, I need a load?
[00:56:59] <theBear> no, but a big load would work 'against' the pullup.. what value you got ?
[00:57:41] <jadew> 10k pullup
[00:57:48] <jadew> and no load
[00:58:46] <theBear> 10k is pretty big, no load and still .6v sounds err, odd, i'd be tempted to try 4k7 or 1k... apart from anything else, when the fet goes off you want the resistor to work fast
[00:59:13] <jadew> got it, let me try it out
[00:59:56] <theBear> hang about, source, drain, i think it's upside down
[01:00:34] <jadew> done, weird
[01:00:44] <jadew> so I have the source connected to the ground
[01:00:48] <jadew> drain to the pullup
[01:01:03] <theBear> mmm, i'm bad at remembering, but i'm PRETTY sure you want source above drain
[01:01:25] <jadew> you're right
[01:01:26] <jadew> hehe
[01:01:42] <jadew> works awesomely now
[01:01:52] <theBear> hehe awesome
[01:02:10] <jadew> now I have to find one that with enough bandwidth
[01:02:34] <jadew> thanks
[01:03:58] <theBear> :) and remember the fet is 'doing' the downs and the transition to up, resistor is doing high and the up side of the waves
[02:12:52] <RLa> then why most tutorials carefully write high and low bytes separatedly?
[02:13:11] <RLa> that looks completely stupid and makes code more confusing, doesn't it?
[03:51:26] <hackvana> This netsplit thing is very tiresome
[03:51:34] <OndraSter> yep
[03:55:13] <Theta9> reminds me of the early days of the interwebs
[03:55:41] <OndraSter> when there were only 4 people in total online?
[04:54:52] <OndraSter> DAT REFERANCE! http://clip2net.com/s/2rq5c
[05:30:01] <Lundis> I've got an attiny2313, is there a "hardware" way to stop a timer/counter temporarily while handling the interrupts it causes? like setting a bit in some register?
[05:31:16] <specing> yes, the enable bit in the control register
[05:31:26] <specing> How did you turn it on in the first place?
[05:34:14] <Lundis> ah, the clock source bits... I see, thanks for pointing me in the right direction :)
[05:34:25] <Lundis> clock select*
[05:35:28] <specing> no/
[05:35:34] <specing> Oh
[05:35:35] <specing> yes
[06:22:35] <Richard_Cavell> Is there any difference between Flash and EEPROM within the AVR from an electronics point of view, or is it just that one is meant for the program and the other is meant for data?
[06:24:20] <specing> Stellaris has EEPROM wear-leveling :)
[06:26:40] <Richard_Cavell> I'm not asking about Stellaris
[06:26:50] <Richard_Cavell> I'm asking whether Flash and EEPROM are electrically the same
[06:26:55] <specing> no
[06:27:10] <Richard_Cavell> what's different?
[06:27:35] <specing> Im not an EE, I have no idea
[06:49:49] <OndraSter_> flash and eeprom are different technology
[06:50:00] <OndraSter_> well
[06:50:03] <OndraSter_> not on electronics level
[06:50:05] <OndraSter_> they should be the same
[06:50:14] <OndraSter_> tunnel effect diode or transistor or w/e
[06:50:18] <OndraSter_> but flash = erased by blocks
[06:50:24] <OndraSter_> (and written by blocks)
[06:50:27] <specing> It works (tm), lets leave it there ;)
[06:50:29] <OndraSter_> eeprom = erased/written by single bytes
[06:50:47] <RikusW> OndraSter_: flash can be written in bytes too
[06:50:51] <specing> yup
[06:51:11] <specing> and eeprom also has erase blocks
[06:51:12] <RikusW> having all bytes 0xFF and only changing the ones you want to modify
[06:51:14] <specing> 4 bytes?
[06:51:18] <RikusW> yes
[06:51:26] <OndraSter_> RikusW, but you can not set 0s to 1s!
[06:51:29] <OndraSter_> you would have to erase it
[06:51:34] <RikusW> but flash blocks are bigger
[06:51:36] <specing> neither can you on flash
[06:51:38] <RikusW> OndraSter_: correct
[06:51:41] <specing> or on eeprom
[06:51:56] <RikusW> but you can change 1 to 0
[06:52:09] <OndraSter_> basically, flash = bigger storages with less overwrites in large blocks = application
[06:52:18] <OndraSter_> eeprom = smaller storages with more overwrites in smalelr blocks = settings
[06:52:26] <OndraSter_> smaller*
[06:53:07] <RikusW> eeprom does have a higher rewrite rating
[06:53:19] <OndraSter_> yep
[06:53:24] <OndraSter_> by 10 times on megas
[06:53:27] <OndraSter_> MTBF
[06:53:31] <OndraSter_> 100k for eeprom, 10k for flash
[06:53:34] <OndraSter_> IIRC
[06:53:39] <RikusW> so I guess there is some difference on die level
[06:53:43] <RikusW> yes
[06:53:45] <OndraSter_> just better quality control
[06:53:47] <OndraSter_> IMHO
[06:53:51] <RikusW> maybe
[06:54:14] <RikusW> ask abc to ask around ?
[06:54:15] <OndraSter_> eeproms might have bigger gate a bit
[06:54:17] <OndraSter_> hehe
[06:54:23] <OndraSter_> I don't think he goes into such low levels :P
[06:54:25] <OndraSter_> but why not ask!
[06:54:43] <RikusW> maybe hes NDAed to silence...
[06:54:48] <OndraSter_> heh
[06:55:21] <OndraSter_> gee
[06:55:22] <OndraSter_> http://clip2net.com/s/2rrkf
[06:55:24] <OndraSter_> those 2 megabytes
[06:55:25] <OndraSter_> thanks yo!
[06:55:35] <RikusW> deANed silence :-P
[06:56:05] <specing> OndraSter_: lol
[06:56:25] <OndraSter_> maybe if it gave me an option to NOT install examples
[06:56:30] <OndraSter_> which seem to take much more space
[08:38:54] <RLa> trying to get pulse width measurement working but no luck
[08:40:19] <Horologium> try harder?
[08:40:26] <Horologium> how are you measuring?
[08:42:34] <RLa> a second, pasting code
[08:43:43] <RLa> https://gist.github.com/3968606
[08:44:10] <RLa> fan rpm output is connected to pin c7
[08:44:28] <RLa> when fan is turned off, i get consistent output 1
[08:44:40] <RLa> which is completely logical
[08:44:54] <RLa> when it's turned on, i get consistent 2
[08:45:25] <RLa> which means the rpm signal never goes high
[08:45:45] <RLa> i do not have scope to see what is actually going on there :(
[08:46:09] <RLa> internal pull-up is enabled on pin c7
[08:46:20] <Horologium> what about the timer1_read() code?
[08:46:45] <RLa> and fan rpm output is either open collector or open drain according to spec
[08:46:59] <RLa> it's just returning TCNT1
[08:47:15] <Horologium> and when you read TCNT1, does that stop the timer?
[08:47:47] <RLa> no
[08:47:57] <RLa> that's why i have reset_timer
[08:48:24] <RLa> that writes 0 to TCNT1
[08:49:11] <RLa> this is my timer setup code: TCCR1B = (1 << CS12) | (1 << CS10);
[08:49:20] <RLa> clock is 16Mhz
[08:49:43] <RLa> that should give 64us per timer tick
[08:49:58] <Horologium> just not quite getting your logic.
[08:50:40] <Horologium> just a backup here,,,when I do pulse width reading, I use an interrupt routine tied to an external pin interrupt.
[08:50:40] <RLa> i'm counting clock ticks between two raising edges
[08:50:54] <RLa> yes, that can be used too
[08:51:17] <RLa> i'm just polling the pin value
[08:51:37] <RLa> in those loops i use the timer value to implement timeout
[08:51:47] <RLa> in case the raising edge never arrives
[08:52:05] <Horologium> then shouldn't you do an OR rather than AND?
[08:52:14] <Horologium> wait, nevermind.
[08:52:17] <Horologium> brain not working.
[08:52:20] <Horologium> just got up.
[08:52:46] <RLa> while ((PINC & (1 << PINC7)) && timer1_read() < 10000); <- yes, loop while less that 0.64s expired
[08:57:38] <RLa> hm, maybe the internal pullup too weak?
[09:00:11] <RLa> some guys using external 1k pull ups
[09:04:43] <OndraSter_> http://clip2net.com/s/2rsHi
[09:04:48] <OndraSter_> dat 100Mbit xboard shield!
[09:08:28] <OndraSter_> I could get away with single layer!
[09:08:41] <OndraSter_> I can home test it :P
[09:09:08] <OndraSter_> nope I could not
[09:09:13] <OndraSter_> I am not doing 0.1mm stuff
[09:10:25] <megal0maniac> BGA?
[09:10:53] <OndraSter_> no
[09:10:58] <OndraSter_> tracks between pads
[09:10:59] <OndraSter_> :P
[09:11:07] <OndraSter_> 6 mil track, 6 mil between pads
[09:11:10] <OndraSter_> that is about 0.15mm
[09:11:55] <OndraSter_> I dare anybody to plug it into his old arduino
[09:12:00] <OndraSter_> which does not have 3v3 output!
[09:12:44] <megal0maniac> Eek...
[09:12:48] <megal0maniac> No thanks
[09:13:03] <OndraSter_> I think that the newer arduinos have 3v3 out
[09:13:05] <OndraSter_> or don't?
[09:13:16] <megal0maniac> They do\
[09:13:31] <megal0maniac> Used to use FTDI chip's output, so only about 40mA
[09:13:36] <OndraSter_> yep they do!
[09:13:41] <Horologium> RLa, my internal logic analyzer is just not working but something is flashing amber when I look at your code..just can't figure out what it is.
[09:13:42] <OndraSter_> nice
[09:13:42] <megal0maniac> Now there's a dedicated vreg, albeit 150ma
[09:14:48] <OndraSter_> now, it fits arduino mega 2560 and other 3v3 ones
[09:14:59] <OndraSter_> no POE on this board
[09:15:04] <OndraSter_> POE is expensive
[09:16:00] <RLa> i increased timeouts so i can manually toggle it
[09:16:27] <RLa> but seems like it can't detect high signal after low
[09:16:57] <megal0maniac> Isn't POE glorified smps?
[09:17:01] <OndraSter_> ugh?
[09:17:04] <OndraSter_> megal0maniac, yes
[09:17:16] <OndraSter_> RLa, what is the issue?
[09:17:18] <OndraSter_> show us the code!
[09:17:23] <specing> POE = 48V
[09:17:36] <RLa> https://gist.github.com/3968606
[09:18:18] <RLa> while (~(PINC & (1 << PINC7)) && timer1_read() < 10000); <- while pin c7 is low and no timeout?
[09:18:26] <RLa> does it read like that
[09:18:31] <megal0maniac> specing: And smps takes it back down to 12v or whatever
[09:18:42] <OndraSter_> RLa, remember that the timer will keep running 0 - max
[09:18:44] <OndraSter_> then 0 - max again
[09:18:57] <OndraSter_> what do you want?
[09:18:59] <RLa> it's 16 bit times
[09:19:05] <RLa> timer
[09:19:09] <OndraSter_> read pin7 for at least timer 10000 value
[09:19:21] <OndraSter_> and if nothing happens in that timeout then go ahead?
[09:19:50] <RLa> ah well, i disable timeout competely
[09:22:01] <RLa> when internal pull-up is enabled, shouldn't pin measure 5V?
[09:22:25] <OndraSter_> not nescesarily
[09:22:28] <OndraSter_> what is the load on the pin?
[09:23:18] <RLa> nothing
[09:25:01] <RLa> DDRC &= ~(1 << DDC7); PORTC |= (1 << PORTC7) <- this is my code to enable input and pull-up
[09:32:35] <RLa> https://gist.github.com/3968727
[09:32:48] <RLa> this is my code with debug statements
[09:33:08] <RLa> when i run it, it prints L when i short pin to gnd
[09:33:25] <RLa> but it won't print H when i remove the short
[09:33:54] <RLa> so i suspect this code: while (~(PINC & (1 << PINC7)))
[09:34:30] <megal0maniac> This Android thing is scary. I had to intentionally flash the WRONG kernel in order to root it :/
[09:36:59] <RLa> my low/high checks are flawed?
[09:37:22] <RLa> guys, care to share some working macros
[09:41:30] <OndraSter> aren't you setting DDR to 1?
[09:42:09] <RLa> never mind, i think i figured it out
[09:42:28] <RLa> and yes, my checks were flawed
[09:42:44] <RLa> !(PINC & (1 << PINC7)) instead of ~(PINC & (1 << PINC7))
[10:16:00] <specing> megal0maniac: don't buy unrooted androids, then
[10:16:55] <OndraSter> megal0maniac, don't buy unroted androids, then
[10:17:26] <Tom_itx> megal0maniac! don't buy unroted androids, then¿
[10:20:42] <OndraSter> what is the weird z?
[10:21:46] <Tom_itx> whichone?
[10:21:53] <Tom_itx> the upsidedown ?
[10:22:04] <OndraSter> I have received something like ź
[10:22:06] <Tom_itx> ¿
[10:22:09] <Tom_itx> alt 168
[10:22:20] <OndraSter> huh
[10:22:27] <OndraSter> different character in here :)
[10:22:58] <RLa> got the rpm counter working
[10:23:06] <Tom_itx> wrong keymap set
[10:23:20] <Tom_itx> RLa, i got mine working a month ago
[10:24:11] <RLa> this is my code without timeout protections: https://gist.github.com/3968606
[10:24:31] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/cnc/cnc_files/Sherline_Mill.png
[10:24:35] <Tom_itx> upper right
[10:24:45] <Tom_itx> :)
[10:25:34] <RLa> oh
[10:25:46] <RLa> are you counting pulses or time between pulses?
[10:27:36] <RLa> and this is how i calculate rpm from the count of 64us ticks between two consequential rpm pulse rising edges: https://gist.github.com/3968862
[10:27:55] <RLa> the fan gives 2 rpm pulses per revolution
[10:28:32] <RLa> it gives about 2600 for a 12V 12cm fan here
[10:29:17] <Tom_itx> it's not avr
[10:30:10] <RLa> avr is sending the count on 64us ticks over serial
[10:30:16] <RLa> of*
[10:30:43] <RLa> i try to keep most code on pc for now, makes debugging way easier
[10:31:03] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/cnc/psu/encoder_disk1.jpg
[10:31:34] <RLa> oh, that's for generic rotating device?
[10:31:44] <RLa> the disk with holes
[10:31:57] <Tom_itx> it's from an old printer
[10:32:13] <RLa> are you building a cnc machine?
[10:32:18] <Tom_itx> using an ir detector
[10:32:22] <Tom_itx> i have a cnc machine
[10:33:38] <RLa> what is that big psu with 3 transformers used for?
[10:33:54] <Tom_itx> it's my new psu for the cnc
[10:34:01] <Tom_itx> and new drivers etc
[10:34:19] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/boards/USBTiny_Mkii/Boxes/milling1.jpg
[10:34:46] <Tom_itx> 50v 18A supply
[10:35:23] <OndraSter> linear?
[10:38:23] <RLa> it looks for making quite precise details
[10:39:02] <RLa> are those linear motor for the base?
[10:39:07] <RLa> motors*
[10:40:09] <Tom_itx> steppers
[10:44:05] <Tom_itx> brb
[10:51:02] <RLa> i'm now rewriting it to use interrupts
[10:51:21] <Tom_itx> pin or pinchange?
[10:51:32] <Tom_itx> pinchange triggers on both edges
[10:51:43] <OndraSter> bloody arduino, being 0.1cm above the 5cm limit!
[10:51:51] <Tom_itx> hahaha
[10:51:56] <OndraSter> the board is 2.08" * 2.1" or so
[10:52:26] <Tom_itx> they knew it too
[10:53:31] <RLa> Tom_itx, can't it be configured to fire only on rising edge?
[10:54:20] <RLa> can't you mill part of case off?
[10:54:36] <RLa> or the board
[10:55:00] <OndraSter> this is arduino compatible shield
[10:55:07] <OndraSter> so no, I can not ask everybody to move the holes
[10:55:13] <OndraSter> and the connectors
[10:55:18] <OndraSter> because the original creators were stupid
[10:55:20] <OndraSter> STUPID STUPID STUPID
[10:56:29] <OndraSter> $10 for 5x5cm, $23 for 5x10, $25 for 10x10 (discount), on iTead
[10:56:30] <OndraSter> GREEN ones
[10:56:40] <OndraSter> in colour it is $17/$25/$35
[10:56:42] <OndraSter> I think
[10:56:47] <OndraSter> maybe a bit more
[10:56:56] <OndraSter> for the colour 10x10 CapnKernel is cheaper :)
[10:58:55] <OndraSter> I am thinking "ignore the screw holes on the sides"
[10:59:00] <OndraSter> and make it smaller by far :P
[10:59:04] <OndraSter> to fit it the 5x10
[10:59:19] <OndraSter> too bad I can't put any other board next to it
[10:59:27] <OndraSter> I can, but I don't have any usable way to separate them
[11:00:18] <hackvana> OndraSter: s/CapnKernel/hackvana/ :-)
[11:00:24] <OndraSter> yes
[11:00:25] <OndraSter> that guy
[11:00:27] <OndraSter> this*
[11:00:35] <CapnKernel> He always does that. What a bore!
[11:00:55] <hackvana> That's enough from you.
[11:01:19] <OndraSter> omg not this again
[11:01:21] <OndraVPS> WHAT NOT AGAIN
[11:01:25] <OndraSter> SHUT UP, MEG!
[11:01:27] <OndraVPS> ...
[11:02:05] <Horologium> huh?
[11:02:16] <Tom_itx> RLa, not on pinchange
[11:02:19] <Tom_itx> it fires on both edges
[11:02:27] <OndraSter> Horologium, CapnKernel and hackvana = same person. Me and OndraVPS = same person.
[11:02:32] <OndraSter> I don't like explaining jokes
[11:02:56] <Tom_itx> OndraSter, become the new standard of excellence
[11:03:09] <Tom_itx> hmm
[11:03:12] <Tom_itx> didn't know that
[11:03:23] <hackvana> Tom's also had his non-de-plumes, as does rue.
[11:03:50] <Tom_itx> tryin to hide are ya?
[11:04:25] <Tom_itx> ok i'm gonna get these steppers workin off the 2560 today
[11:05:31] <RLa> Tom_itx, what if i read the port state in the handler
[11:05:44] <RLa> that would give which type of edge it was
[11:05:48] <Tom_itx> i suppose
[11:05:56] <Tom_itx> but it will slow the interrupt down too
[11:06:03] <Tom_itx> use external interrupt
[11:06:09] <Tom_itx> it will go either or or both
[11:06:15] <Tom_itx> int0
[11:06:33] <RLa> but is it fired before or after the pin state change?
[11:06:54] <Tom_itx> as it happens
[11:07:04] <RLa> int0 and int1, i have bit trouble with them :(
[11:07:15] <Tom_itx> what do you mean?
[11:07:31] <RLa> i have the serial connection on the same pins
[11:07:39] <Tom_itx> so sad
[11:08:03] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/avr/atmega328/PCINT0/quadrature/
[11:08:09] <Tom_itx> quad code for pinchange
[11:08:12] <RLa> they were closer on pcb than the other usart unit pins
[11:08:25] <RLa> tho i could rewire them
[11:08:31] <Tom_itx> so not thinking ahead, you used them
[11:10:09] <Tom_itx> you could put a bitmask in the interrupt to ignore whichever state you wanted to on whichever pin you wanted
[11:10:25] <RLa> its protoboard so i can rewire them
[11:10:42] <Tom_itx> then pinchange would work
[11:10:46] <RLa> anyway, how much interrups/s is too much to start worry?
[11:10:56] <Tom_itx> just depends how fast you need it to work
[11:11:01] <RLa> fan generates rpm/60 * 2
[11:11:17] <Tom_itx> what else is it doing?
[11:11:39] <RLa> i think need less than 10 instructions in interrupt handler
[11:11:52] <RLa> nothing else at the moment
[11:12:23] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/avr/atmega328/INT0/
[11:12:26] <Tom_itx> int0 example
[11:12:31] <Tom_itx> so now you have both
[11:12:58] <RLa> that's very easy to use
[11:13:11] <RLa> if i had int* pins free :)
[11:13:38] <Tom_itx> so add a mask to the other one
[11:13:46] <Tom_itx> ignore whatever state you don't want
[11:15:09] <RLa> hm, i have another problem
[11:15:53] <RLa> sending the unsigned int that is also updated by interrupt handler
[11:16:17] <RLa> what if it's modified while sending one half of it?
[11:16:24] <Horologium> define variable as volatile.
[11:16:36] <RLa> will that make it atomic?
[11:16:59] <Horologium> that I don't know, but that is how you handle variables that are changed both inside and outside interrupt routines.
[11:17:23] <RLa> yes, i have read that
[11:17:33] <RLa> but nothing about it vs atomicity
[11:18:19] <RLa> i think 16bit registers use some tricks like temp high byte
[11:18:32] <RLa> it's mentioned in the datasheet
[11:18:41] <RLa> but nothing about general variables
[11:25:09] <RLa> hm, found util/atomic.h: http://www.nongnu.org/avr-libc/user-manual/group__util__atomic.html
[11:27:41] <RLa> i will copy my variable in the atomic block
[11:31:01] <RLa> static variable in the interrupt handler must be volatile too?
[11:32:04] <hackvana> Yes if it might be accessed from another interrupt handler of higher priority
[11:44:59] <e2580> Anyone interested in a sneak peek at a hardware based security device we are about ready to release?
[11:46:43] <Tom_itx> i think i saw that button thing the other day
[11:46:50] <Tom_itx> usb device
[11:48:27] <e2580> we have the video up now
[11:48:30] <OndraSter> hackvana, only xmegas have priority in interrupts :)
[11:48:38] <OndraSter> also
[11:48:38] <e2580> www.CryptX2.com/demo
[11:48:39] <OndraSter> http://www.indiegogo.com/XBoard?a=1654315
[11:48:56] <OndraSter> writing right now
[11:49:24] <OndraSter> e2580, Demo Video Coming Soon !
[11:49:24] <specing> Please contact the campaign owner if you feel this is in error!
[11:49:26] <OndraSter> oh
[11:49:27] <hackvana> OndraSter: Thanks
[11:49:31] <specing> OndraSter: Its in error!!
[11:49:35] <OndraSter> specing, lol
[11:49:38] <OndraSter> it works for me
[11:49:38] <OndraSter> weird
[11:49:41] <OndraSter> it is not open yet
[11:49:42] <specing> FIX THE ERRORS
[11:49:53] <specing> The page you are looking for is currently in "DRAFT" mode and hidden from the public.
[11:49:58] <OndraSter> oh
[11:50:04] <OndraSter> so why does it work for me even when not logged in? :(
[11:50:24] <Steffann> magic cookie
[11:50:29] <specing> Maybe it is a hint from the deities that ARM is the way
[11:50:34] <OndraSter> even across browsers, Steffann ?
[11:50:45] <Steffann> Yeah, it's magic
[11:50:46] <specing> magic IP
[11:51:49] <OndraSter> e2580, lol "atmel.com/avrdragon"
[11:52:12] <e2580> hehe, its works very well
[11:52:46] <specing> http://www.indiegogo.com/icancervirus
[11:52:48] <specing> Hahahahaha
[11:55:41] <OndraSter> lol
[11:55:45] <OndraSter> "the virus named after you"
[11:55:50] <OndraSter> I'd rather have a treatment named after m
[11:55:50] <OndraSter> e
[11:56:00] <OndraSter> oh
[11:56:04] <OndraSter> it is the virus
[11:56:06] <OndraSter> that treats it
[11:57:56] <specing> Not sure what the point in raising $100000 is if his $50000000000 didn't fix it
[12:03:40] <OndraSter> but
[12:03:44] <OndraSter> they are scientists!
[12:06:47] <specing> More like scammers
[12:06:55] <OndraSter> :P
[12:06:59] <OndraSter> but they have Apple PCs!
[12:07:31] <hackvana> Well that's alright then.
[12:48:34] <jadew> hey, any idea if someone sending me something from the US, would have to pay an export fee or any kind of duties?
[12:49:19] <jadew> I'm trying to order something from digikey and have it sent to my mom so she can mail it to me from the US and they're asking me for some weird info
[12:49:27] <jadew> with the text: The following information is required by Digi-Key so that we may comply with US Export Law. All information provided is confidential and requested of all International and Domestic customers prior to export. Providing complete and accurate information will help your order ship promptly.
[12:50:13] <jadew> then there's a checkbox at the bottom: I understand I am responsible for paying all duties and taxes associated with this order.
[12:50:31] <jadew> are they talking about the taxes I have to pay, or the taxes my mom has to pay?
[12:50:46] <OndraSter> huh
[13:40:28] <inkjetunito> i don't get what i'm doing wrong. i've an atmega328p with a 16 MHz external crystal. i'd like to get interrupts at ~4 us rate. this should be possible by configuring the timer/counter0 clock source prescaler to 64 and making it interrupt and clear the counter when it matches 0, right?
[13:41:15] <inkjetunito> instead, i'm getting something that can be counted in milliseconds
[13:42:35] <Tom_itx> did you account for the ckdiv8 fuse?
[13:42:39] <Horologium> did you set the system clock to external crystal?
[13:44:02] <inkjetunito> Horologium: that's a good question. i thought the only clock selection i have are the prescaler settings
[13:44:23] <Horologium> factory default is 1mhz internal oscillator.
[13:44:35] <Horologium> that is the 8mhz internal oscillator divided by 8.
[13:44:49] <Horologium> so the thing is probably running at 1MHz.
[13:44:55] <Tom_itx> as well as ckdiv8 being set
[13:45:19] <OndraSter> no
[13:45:19] <OndraSter> he forgot one thing
[13:45:22] <OndraSter> it counts to 256
[13:45:22] <Horologium> http://www.ladyada.net/learn/avr/fuses.html
[13:45:24] <OndraSter> :)
[13:45:39] <inkjetunito> OndraSter: i did set the CTC flag (clear counter on match)
[13:45:47] <OndraSter> and what is the match value?
[13:45:59] <inkjetunito> OndraSter: 0. i tried using 1 aswell
[13:46:06] <OndraSter> if it is 0
[13:46:11] <OndraSter> and it starts at 0
[13:46:14] <OndraSter> ..?!)
[13:46:26] <OndraSter> afk
[13:46:27] <Horologium> http://www.engbedded.com/fusecalc/
[13:47:19] <inkjetunito> i'm quite new to these things. it's an arduino uno, but i've used the hw "directly" since.. yesterday i think
[13:47:59] <Horologium> need to know what the fuses are set at in order to know what it is doing for clock source.
[13:49:13] <inkjetunito> one moment. i need to figure out how to read them first :)
[13:49:31] <Horologium> and I have to go build a chicken coop door controller.
[13:49:45] <inkjetunito> Horologium: ok. thanks anyway :)
[13:49:55] <Tom_itx> inkjetunito, http://tom-itx.dyndns.org:81/~webpage/how_to/atmega168/using_avrdude_index.php
[13:52:44] <inkjetunito> Tom_itx: thanks
[14:05:10] <inkjetunito> both lfuse and hfuse contain only zeros, it seems
[14:07:29] <Tom_itx> not true
[14:07:35] <Tom_itx> it read it wrong then
[14:09:49] <inkjetunito> "avrdude -c arduino -p m328p -P /dev/ttyACM0 -b 115200 -U lfuse:r:lfuse.txt:b -U hfuse:r:hfuse.txt:b"
[14:09:49] <inkjetunito> both files contain '0b0'
[14:11:26] <Tom_itx> -U lfuse:r:con:r -U hfuse:r:con:r
[14:11:29] <Tom_itx> just display it
[14:13:19] <inkjetunito> Tom_itx: it will use 'con' as the filename then :( strange. i have avrdude 5.11
[14:18:36] <inkjetunito> avrdude: safemode: lfuse reads as 0
[14:18:39] <inkjetunito> avrdude: safemode: hfuse reads as 0
[14:18:39] <inkjetunito> avrdude: safemode: efuse reads as 0
[14:20:57] <Tom_itx> odd
[14:31:13] <inkjetunito> oh well. it's probably a good time to get an icsp programmer
[14:32:53] <specing> What do you have now?
[14:33:08] <specing> I haven't yet had problems with programmers ...
[14:49:06] <Tom_itx> he's got an arduino uno
[14:49:46] <Tom_itx> inkjetunito, you need a good programmer, i have one
[14:49:49] <r00t|home> <inkjetunito> Tom_itx: it will use 'con' as the filename then :( strange. i have avrdude 5.11
[14:49:54] <r00t|home> con is a windows thing :P
[14:50:20] <OndraSter> conM
[14:50:21] <OndraSter> con?
[14:50:30] <r00t|home> on linux you use /dev/stdout
[14:50:40] <r00t|home> <Tom_itx> -U lfuse:r:con:r -U hfuse:r:con:r
[14:51:21] <r00t|home> (actually /dev/console, but stdout makes more sense anyway)
[14:51:35] <Tom_L> friggin irc
[14:53:28] <r00t|home> Tom_itx: in case you missed it... "con" as a filename only works on windows
[14:53:45] <Tom_itx> i saw the log
[14:53:59] <Tom_itx> not sure he said windows or linux really
[14:54:22] <r00t|home> he uses /dev/ttyACM0, clearly *nix
[14:54:27] <Tom_itx> k
[14:55:21] <r00t|home> avrdude should have a builtin filename to use standard output... usually it's "-". no idea if that's supported, con and /dev/stdout are windows/linux-only respectively
[14:55:29] <r00t|home> but then, who would use cli tools on windows anyway
[15:00:31] <Horologium> inkjetunito, what programmer are you using? or are you using the built in ardweeny bootloader?
[15:00:53] <Horologium> because the ardweeny bootloader can't read or write fuses.
[15:03:23] <r00t|home> <inkjetunito> "avrdude -c arduino -p m328p -P /dev/ttyACM0 ..." <---
[15:03:37] <Horologium> ayup...ardweeny bootloader.
[15:03:52] <r00t|home> is ardweeny like fruitcake?
[15:03:59] <Horologium> something like that.
[15:07:01] <Tom_itx> that sucks uno
[15:07:44] <Tom_itx> so how are they supposed to change them?
[15:07:53] <Horologium> they don't.
[15:07:53] <Tom_itx> if they're arduinofied?
[15:08:12] <Horologium> if you start screwing with things on ardweeny then the code doesn't run right.
[15:08:22] <Tom_itx> oh of course :)
[15:08:28] <Horologium> the libs are tied to the predefined arduino config.
[15:09:12] <Horologium> you need either another arduino or an AVR programmer of some kind.
[15:12:32] <Tom_itx> good thing i got a few
[15:12:59] <Horologium> I just avoid the arduino entirely and don't have to worry about it.
[15:13:29] <Tom_itx> i got a 2560 to play with recently but generally feel the same way
[15:13:56] <Tom_itx> it was cheaper to get one than build a board for one
[15:14:06] <Horologium> hehe.
[15:15:24] <Tom_itx> so far i kinda like it
[15:15:52] <Horologium> the boards are a good idea.
[15:16:01] <Tom_itx> if i did much beside reprap with it i'd just use it as an avr
[15:16:23] <Horologium> never been impressed with the arduino libs.
[15:16:51] <Tom_itx> i never looked
[15:16:59] <Tom_itx> don't really plan to
[15:17:12] <Horologium> I like procyon avrlib better.
[15:17:21] <Horologium> but mostly just spin my own libs for my own purpose.
[15:17:44] <Tom_itx> it had it's share of problems too
[15:18:07] <Horologium> yeah...and procyon isn't actively developed anymore I don't think.
[15:18:09] <Horologium> he moved on to arm.
[15:18:25] <Tom_itx> i used it early on
[15:18:52] <Horologium> it was always beta but it gave a good starting point.
[15:34:44] <OndraSter> hmm I thought about getting some roller blade paper cutter
[15:34:46] <OndraSter> and modify it a bit
[15:34:51] <OndraSter> so it works like a v-scoring tool
[15:34:53] <OndraSter> any ideas? :)
[15:35:06] <Tom_itx> don't think that would work
[15:35:13] <Tom_itx> i have a roller cutter
[15:35:31] <Tom_itx> spose you could try it
[15:36:02] <OndraSter> :/
[15:36:30] <OndraSter> OR
[15:36:35] <OndraSter> I could get one of these
[15:36:35] <OndraSter> http://www.seetrax.com/scorers.htm
[15:36:35] <OndraSter> :D
[15:37:32] <OndraSter> damn even old used ones are like 7000 GBP
[15:44:32] <inkjetunito> specing: i was using the builtin programmer on arduino uno. it's time for me to buy an actual icsp programmer, it seems
[15:45:01] <Tom_itx> inkjetunito, i've got a decent one if you need one
[15:45:16] <inkjetunito> Tom_itx: i see. where are you? i'm in germany
[15:45:30] <Tom_itx> US but i've sent several to germany
[15:45:57] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/boards/USBTiny_Mkii/USBTiny_Mkii_index.php
[15:47:02] <inkjetunito> Tom_itx: i will have a look at available programmers tomorrow. anyway, i suppose it's safe to assume that the clock source fuse is set to external osc on an arduino
[15:47:42] <OndraSter> yep
[15:51:46] <inkjetunito> Tom_itx: $5 for international shipping you say?
[15:52:46] <Tom_itx> yes
[15:56:05] <Tom_itx> looks like about 14-16 days average
[16:15:55] <Horologium> could just get another AVR, use the arduino as an AVR programmer, and build an AVR programmer from the other AVR.
[16:16:21] <Horologium> or if you have a,,,,(shudder),,,,parallel port then you have an ISP programmer already.
[17:22:15] <JViz> anyone ever have this problem? undefined reference to `Print::write(unsigned char)'
[17:23:24] <JViz> i'm trying to use some arduino code in my project, and i get that error
[17:23:55] <JViz> i think there is supposed to be an implmentation of Print that i'm supposed to use, but i don't know which file it's in
[17:30:52] <Horologium> JViz, guessing you are not using the full arduino libs?
[17:31:29] <Horologium> that looks like a C++ class so you need to have that class file for starters.
[17:32:53] <JViz> I tried using all the file, just now, and it still gives me the error
[17:33:24] <JViz> *all of the files
[17:33:40] <Horologium> you have the libs included as well?
[17:34:09] <JViz> i have the core.a
[17:34:11] <Horologium> or rather, linked, not included.
[17:34:22] <JViz> -Llibs/core.a
[17:34:31] <Horologium> sorry but I don't know much about the arduino libs.
[17:34:48] <Horologium> but from your error there is a lib and/or header file missing.
[17:35:14] <JViz> yeah, it seems that way
[17:35:41] <Horologium> you might check with #arduino as it is their libs.
[17:36:16] <JViz> i asked there too, i usually come here for C/C++ questions though
[17:36:32] <Horologium> but this is an ardweeny lib problem, not just C/C++
[17:36:43] <JViz> indeed
[18:11:29] <hyoomin> Hello.
[18:11:41] <Horologium> hello hyoomin
[18:14:03] <hyoomin> O.K., so I’ve got an Atmega 328, and I’ve got Timer 0 outputting a carrier pulse to a pin; what are my options for modulating the carrier pulse by switching the pin from carrier signal to ground and back again, without disrupting the timer?
[18:14:33] <Horologium> use an external AND gate maybe?
[18:15:12] <hyoomin> I’m looking for something more in-micro, Horologium.
[18:15:37] <Horologium> well, it all depends on how you want to "modulate" it.
[18:17:25] <hyoomin> Well, I have another timer that is going to manage the protocol via compare match interrupts... one interrupt turns the carrier off, the other turns it back on again. Now, I just need options for what those interrupts do to turn the pins on and off.
[18:17:49] <karlp> force output compare bit?
[18:18:11] <karlp> or, turn the pin back into an input?
[18:18:27] <hyoomin> No no, the comparing is already done by another timer; I just need different ways of toggling the pin from the carrier signal to ground.
[18:19:06] <hyoomin> Correct me if I’m wrong, but setting the pin to an input would leave it floating, wouldn’t it?
[18:19:24] <karlp> internal pull ups.
[18:19:33] <karlp> you're making like ir remote pulse modulated stuff?
[18:19:41] <hyoomin> Yup.
[18:19:58] <karlp> have a look at the dangerous prototypes ir toy code.
[18:20:38] <hyoomin> I’m just looking for how to switch the pins; I have my own plans on how to modulate and do protocols and such.
[19:40:08] <forrestv> anyone know if can you brick a PIC by programming the wrong clock config bits like you can an AVR?
[19:42:24] <Tom_itx> i can't remember
[19:47:15] <Eartaker> Tom_itx: I have a quesion unrelated to avr
[19:47:22] <Eartaker> to machining
[19:47:51] <Eartaker> what do you think about using a 1/16" endmill on a mill that cant run over 6.5krpm?
[19:48:58] <Tom_itx> as long as the feedrate matches what you're cutting and the rpm to end up with the proper chip load it's fine
[19:49:18] <Eartaker> in other words.... will take a long time to machine
[19:49:19] <Eartaker> lol
[19:49:21] <Tom_itx> the problem comes when you try to cut too fast
[19:49:30] <Eartaker> i was looking at a shipload of .0005
[19:49:35] <Eartaker> chipload
[19:49:41] <Eartaker> 2 flute
[19:49:51] * Eartaker goes to calculator
[19:49:52] <Tom_itx> what are you machining?
[19:50:00] <Eartaker> 7075 AL
[19:50:02] <Tom_itx> just a sec, i'll link you to a site
[19:50:13] <Tom_itx> it's on the other pc
[19:50:24] * Tom_itx winds the mainspring
[19:51:08] <Eartaker> soo with a 2 flute 1/16" i would run 6.5ipm
[19:51:09] <Tom_itx> you're not gonna be able to remove alot of material
[19:51:22] <Tom_itx> i wouldn't even go that fast
[19:51:28] <Eartaker> really?
[19:51:28] <Tom_itx> at least to start
[19:51:31] <Eartaker> hmm
[19:51:35] <Tom_itx> try it and see
[19:51:40] <Eartaker> what chipload would you run?
[19:51:44] <Tom_itx> if it breaks it was too fast
[19:51:52] <Tom_itx> i'm booting to show you
[19:51:57] <Eartaker> lol yeah but i dont want to break it
[19:51:59] <Eartaker> ok
[19:52:10] <Tom_itx> that's why i say start slower
[19:52:33] <Eartaker> I have a buddy who wants some stuff made but he wants some very tight curves... I never never used anyhting under 1/8"
[19:53:03] <Eartaker> brb
[19:54:36] <Tom_itx> http://zero-divide.net/index.php?page=fswizard
[19:54:43] <Tom_itx> there's a page to download it
[20:17:20] <Tom_itx> btw Eartaker i use a .0312 cutter on my programmer boxes and haven't broken one yet
[20:17:30] <Tom_itx> i use carbide
[20:18:13] <Tom_itx> i'd rough cut what you can with a larger cutter then clean out the radius's with the smaller cutter
[20:18:42] <Tom_itx> keep in mind your depth of cut will be quite limited on that small cutter
[20:22:49] <Tom_itx> that one shows 106 in/min at 6500 rpm with a chip load of .0009 and a feedrate of 11.7
[20:23:15] <Tom_itx> for a 2 flute carbide em
[20:23:41] <Tom_itx> that may be pretty close. i was thinking of the one i've been using which is half that size
[20:33:42] <Eartaker> Tom_itx: thanks, sorry for the delay, im grilling chicken
[20:38:15] <Tom_itx> np
[20:38:32] <Tom_itx> i looked and i got my .031 feedrate at 6.7
[20:38:46] <Eartaker> hmm
[20:38:47] <Tom_itx> and my spindle tops out around 5k or so
[20:39:02] <Tom_itx> so the calcs from that page are real close
[20:39:13] <Tom_itx> i'd still start slow and work up to it
[20:39:30] <Tom_itx> i like that app. i downloaded the standalone
[20:40:42] <Eartaker> i will, ill order a few of the endmills
[20:41:15] <Tom_itx> got a place for that as well?
[20:41:39] <Tom_itx> http://www.lakeshorecarbide.com/
[20:41:55] <Tom_itx> i haven't ordered from them but i'm told they are high quality
[20:51:27] <Eartaker> nice I have been using http://www.victornet.com/
[20:53:01] <Tom_itx> i get all mine locally usually
[20:55:35] <Eartaker> I would but here they want $$$$
[20:56:00] <Eartaker> grainger is cheaper than some of my local shops
[21:29:44] <hyoomin> Anyone know what the options are for disabling and reenabling the output of a timer to its pin?
[21:50:44] <JViz> i switched from a C to a C++ target, and now my project won't compile
[21:51:54] <JViz> No rule to make target `project.elf`, needed by `elf`. Stop.
[21:53:51] <JViz> all i basically did was replace project.c with project.cpp and move it from the SRC to the CPPSRC section
[21:54:03] <timemage> section of what?
[21:54:13] <hyoomin> What sort of target are you trying to compile for?
[21:55:27] <JViz> hex? i think it converts the elf to hex
[21:59:19] <Tom_itx> JViz, have a look at the makefile and see if it helps: http://tom-itx.dyndns.org:81/~webpage/avr/atmega328/PCINT0/makefile
[22:01:25] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/avr/adc_test/makefile
[22:01:29] <Tom_itx> or that one
[22:01:36] <Tom_itx> look very similar to me
[22:04:49] <JViz> looking
[22:05:58] <X-warrior> I'm trying to understand the sleep modes, I'm using a atmega328 with internal clock (8mhz) power-save mode with timer2 (overflow) to wake, and a overflow count of 100 and a prescalar of 1024, so it is one count every 0.000128, counting up to 256, it is 32756 microseconds to wake up, multiplying this with my overflow counter it is 3275600 micro that is 3.27 seconds, I'm using a blinking led to see how long it takes, and it seems somethin
[22:05:59] <X-warrior> g around 10 seconds to change the led state. So, can I assume that all this difference is to wakeup the controller?
[22:06:05] <JViz> weird, if i compile /any/ C files it breaks, but if i comment out all the C files, it just errors out later down
[22:09:56] <JViz> Tom_itx: i think my makefile is breaking in a place that isn't duplicated in your makefiles
[22:42:26] <JViz> ok
[22:42:39] <JViz> so i put my makefile on pastbin http://pastebin.com/2tS3TwzF
[22:43:05] <JViz> when I comment out all of the SRC files, it will build, but error because it needs those files
[22:43:20] <JViz> if i leave the SRC files, it breaks without doing anything
[22:44:31] <JViz> brb, gonna go get dinner
[23:17:07] <JViz> back