#avr | Logs for 2012-07-17

Back
[02:33:00] <cehteh> anyone of you knows an algorithm which detects if some (sensor) value is rising/falling over some time without using much memory for keeping the data history?
[02:34:23] <specing> Ok lets thing about it
[02:34:27] <specing> think*
[02:34:48] <specing> you have one var to store last readout
[02:35:22] <specing> and one var that stores the number of times it was rising without falling
[02:35:43] <specing> and you have a timer interrupt that reads a new value
[02:35:49] <specing> done?
[02:36:11] <cehteh> nope i need general trend there may be short spikes in either direction
[02:36:35] <cehteh> would be too easy i thought about that
[02:37:10] <cehteh> maybe summing up differences to the last reading .. and find some way to expire old data from that sum
[02:37:48] * cehteh thinks he has an idea, just asking if anyone knows some proven way to do this
[02:45:36] <specing> well
[02:45:44] <specing> you could have bit variables
[02:45:50] <specing> 0 = faling
[02:45:55] <specing> 1 = rising or equal
[02:46:02] <specing> and then test the bytes
[02:46:35] <specing> if (byte[blabla] > 0x80) // mostly rising
[05:42:17] <educr0w> Hello, I'm reading the newbie timers guide from tutorial forum, I don't speak/read english very well, I don't get the idea about in which scenario is better to use CTC or overflow CTC
[05:42:29] <educr0w> any advice?
[08:17:53] <k-man> i have an avr isp programmer i bought somewhere once, its marked usb-prog tom_l 2009 its usb - i can't find any doco on it and I can't remember where i got it. any idea how i would use it to program an avr?
[08:27:20] <gongoputch> k-man: 1st thing i'd do is plug it into your USB and read the vendor and product IDs
[08:33:31] <k-man> gongoputch, good idea
[08:33:39] <k-man> any idea how to do that on a mac?
[08:35:14] <w|zzy> Tom_itx: Another happy customer... Passed on your avrisp programmer to a mate and he was very pleased with it.
[08:36:27] <k-man> damn! maybe it was that tom who sold me the avr programmer
[08:37:02] <gongoputch> k-man: 'about this mac', 'more info'
[08:37:15] <cehteh> just boot linux :P
[08:37:56] <gongoputch> linux works too ... lsusb ?
[08:38:36] <gongoputch> I find FreeBSD 'cleaner' : usbconfig
[08:38:51] <k-man> usbtine, productid 0c9f vendor id 0x1781
[08:39:15] <k-man> s/usbtine/usbtiny
[09:36:05] <cehteh> do i miss something or is there no way to stop the watchdog counter while the cpu is sleeping?
[09:36:15] <cehteh> (automatically)
[09:37:36] <elektrinis> http://www.youtube.com/watch?v=kJZANaomnvE
[09:37:38] <elektrinis> my AVR project
[09:43:42] <CapnKernel> cehteh: Disable before sleeping?
[09:44:17] <cehteh> yes, i just wonder that the hardware cant do it
[15:23:40] <educr0w> Hello, I'm reading the newbie timers guide from tutorial forum, I don't speak/read english very well, I don't get the idea about in which scenario is better to use CTC or overflow CTC, any advice??
[15:35:15] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/abcminiuser/articles/avr_timers_index.php
[15:35:18] <Tom_itx> try reading that one
[15:35:46] <Tom_itx> CTC is part 4
[15:37:17] <educr0w> I read that, I want to know what should I evaluate to decide about using part 4 or part 8?
[15:38:45] <educr0w> I saw a lot of led display codes that uses overflow timer to refresh the display in the overflow interrupt, why overflow and not ctc?
[15:44:52] <OndraLappy> !seen abcminiuser
[15:44:52] <tobbor> abcminiuser was last seen in #avr on Jul 11 10:37 2012
[15:44:54] <OndraLappy> duh
[15:44:57] <OndraLappy> still no sign of him?
[16:09:06] <jdiez> hello
[16:09:23] <jdiez> I am a complete beginner to AVRs and electronics in general
[16:09:35] <jdiez> but I have some experience with arduinos
[16:10:02] <jdiez> I want to start using "bare" AVRs, and I think the ATtiny84 is a good place to start
[16:10:20] <jdiez> I figured I'll also need a programmer and I found a cheap one, the AVRUSB programmer
[16:10:42] <jdiez> it has a 10-pin connection, but I have no idea how to wire it to the ATtiny, and I can't find help either.
[16:14:17] <jdiez> help?
[16:15:42] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/how_to/atmega168/mega168_howto_main_index.php
[16:16:09] <Tom_itx> make sure your programmer is supported by avrdude
[16:16:13] <Tom_itx> i also make one
[16:16:34] <jdiez> that page says I need an atmega48 88 or 168
[16:16:39] <Tom_itx> most use a 6pin connector now
[16:17:00] <Tom_itx> the peripherals are all very similar
[16:17:31] <Tom_itx> arduino are typically the mega328
[16:17:44] <Tom_itx> which just has more memory than the 48 88 168
[16:19:38] <jdiez> how do we know to which pins should MOSI, MISO, etc be connected?
[16:19:56] <Tom_itx> the data sheet will tell you
[16:20:03] <jdiez> okay
[16:20:10] <Tom_itx> typically on P2 there is a diagram of the chip pinout
[16:20:12] <jdiez> also, the first part is just to supply voltage right?
[16:20:31] <Tom_itx> and you need to connect ALL the pins that say vcc or GND
[16:20:33] <Tom_itx> not just one
[16:21:00] <Tom_itx> on mine?
[16:21:05] <jdiez> on the 10 pin programmer, right?
[16:21:06] <jdiez> yes
[16:21:07] <Tom_itx> the stuff on the left is a voltage regulator
[16:21:10] <jdiez> the first part of the tutorial
[16:21:40] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/boards/USBTiny_Mkii/USBTiny_Mkii_index.php
[16:21:42] <Tom_itx> there is mine
[16:22:01] <Tom_itx> are you gonna breadboard it?
[16:22:01] <jdiez> okay, awesome
[16:22:04] <jdiez> yes
[16:22:06] <jdiez> also
[16:22:07] <jdiez> http://tom-itx.dyndns.org:81/~webpage/how_to/atmega168/mega168_led_sch.png
[16:22:12] <jdiez> here there is a second led shown
[16:22:21] <Tom_itx> one is just for power indication
[16:22:26] <Tom_itx> the other is to blink
[16:22:29] <jdiez> okay
[16:22:33] <jdiez> for the demo program, right?
[16:22:36] <Tom_itx> yes
[16:22:39] <Tom_itx> hold on..
[16:24:16] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/boards/USBTiny_Mkii/new_kits/USBTinyMkII_adapter_kit_desc.jpg
[16:24:23] <Tom_itx> i made some breadboard adapters for it too
[16:24:53] <Tom_itx> to make the programmer conneciton easier to the breadboard
[16:25:02] <jdiez> unfortunately I'm outside the US so buying one of those is probably unfeasible :P
[16:25:09] <Tom_itx> nope
[16:25:13] <Tom_itx> i send them all over
[16:25:20] <Tom_itx> where ?
[16:25:24] <jdiez> I'm looking at this programmer: http://www.bricogeek.com/shop/componentes/170-kit-programador-usb-avr.html
[16:25:27] <jdiez> (Spain)
[16:25:32] <Tom_itx> ick
[16:25:36] <Tom_itx> shipping there is bad
[16:25:39] <Tom_itx> but i have
[16:25:40] <jdiez> hehe
[16:25:41] <jdiez> yep
[16:25:48] <jdiez> so what do you think of thet programmer?
[16:26:19] <specing> looks like USBtinyISP
[16:26:31] <Tom_itx> if it works with avrdude it's probably fine
[16:26:31] <jdiez> is it any good?
[16:26:40] <specing> bitbanged usb
[16:26:42] <Tom_itx> i don't read the language personally
[16:26:44] <Tom_itx> oh
[16:26:45] <specing> mine did about 3kb/s
[16:26:49] <Tom_itx> those are slow
[16:26:54] <Tom_itx> i have a bunch of those too
[16:27:01] <Tom_itx> not selling em
[16:27:03] <jdiez> I don't care if they are slow :P
[16:27:03] <specing> well the hw usb is 6kb/s here
[16:27:10] <jdiez> I'm just starting
[16:27:40] <specing> jdiez: get 3 zener diodes and 3 resistors and you'll be able to program 10 bytes/s through the serial port
[16:27:42] <Tom_itx> you'd get little support with it if you had problems
[16:28:08] <jdiez> specing, my computer doesn't have a serial port xD
[16:28:18] <jdiez> there shouldn't be many problems though right?
[16:28:24] <jdiez> it seems quite straightforward
[16:28:56] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/usbtiny_programmer/usbtiny_top_txt.jpg
[16:29:00] <Tom_itx> that's my ver of that one
[16:29:10] <jdiez> it looks similar
[16:29:17] <jdiez> then again, I'm not at all familiar with electronics
[16:29:19] <Tom_itx> mine has a buffer chip
[16:29:53] <Tom_itx> doesn't look like the one in the link does
[16:30:10] <Tom_itx> the buffered ones were better i believe
[16:30:18] <jdiez> so basically I can buy the one I linked, with an ATtiny84 and it should do fine?
[16:30:28] <Tom_itx> yeah probably so
[16:30:57] <jdiez> the attiny84 has a 20mhz oscillator, right?
[16:30:59] <Tom_itx> and you can probably use my tutorial but you'll have to mod the code slightly
[16:31:13] <Tom_itx> i'm not sure
[16:31:23] <Tom_itx> it has an internal osc, they all do afik
[16:31:28] <jdiez> the code from this page, right? http://tom-itx.dyndns.org:81/~webpage/how_to/atmega168/mega168_led_blink_delay_index.php
[16:31:35] <Tom_itx> yeah
[16:31:47] <jdiez> okay
[16:31:54] <Tom_itx> you'll have to mod the makefile for your chip and maybe some of the register names
[16:31:58] <jdiez> also, could you explain how does the voltage regulator work?
[16:32:01] <Tom_itx> not much
[16:32:13] <specing> jdiez: google for 7805
[16:32:43] <jdiez> okay
[16:32:56] <drgreenthumb> it works by hoodoovoodoo magic =)
[16:33:14] <specing> nowadays I just hog an usb rail ;P easy 5V
[16:33:26] <Tom_itx> linear regulators waste alot of energy in heat
[16:33:46] <drgreenthumb> heh I've seen those USB chargers for as low as 0.3 in quantity though
[16:33:53] <drgreenthumb> cheap :P
[16:34:02] <drgreenthumb> heh well, in the short run :)
[16:34:03] <specing> 0.3 onions?
[16:34:14] <drgreenthumb> red or white?
[16:34:21] <Tom_itx> yellow
[16:34:34] <drgreenthumb> oh it takes a lot of those yellow ones nobody wants them.
[16:38:01] * drgreenthumb wonders if he could pay for stuff in Funyuns https://www.google.com/search?q=Funyuns&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&um=1&ie=UTF-8&hl=en&tbm=isch&source=og&sa=N&tab=wi&ei=h9gFULOTNMLi2AXMwdSxBQ&biw=1109&bih=593&sei=jdgFUIDAI6Te2QXupsWmBQ
[16:41:44] <educr0w> if I want to configure timer1 with overflow and I calculate the period using 1024 prescaler(smaller value) and 256 prescaler(bigger value), and both values could be used, which one should I pick?
[16:42:46] <Tom_itx> depends which prescaler you need
[16:43:17] <educr0w> ohh, I need to read more theory :$
[16:48:51] <educr0w> Tom_itx: do you know a tutorial which explain the use of prescaler beside the use for timers?
[16:49:46] <Tom_itx> it is a timer prescalar
[16:49:52] <Tom_itx> so not really
[16:51:14] <Tom_itx> it lets you divide the timer counts into chunks you can use for various things. some may require a different timer rate than others
[16:53:46] <educr0w> I am following the tutorial you sent me, in part 8 I want to turn on/off a led for 1 second, if I did math correctly, I can use 256 and one timer value or 1024 and other timer value
[16:54:33] <educr0w> in that scenario, how can I decide which one to use?
[16:55:16] <educr0w> is the same in this simple scenario?
[18:03:43] <k-man> Tom_itx, i think i bought a usb-prog board off you ages ago, i can't remember how to drive it
[18:11:51] <GuShH> k-man: check his site?
[18:12:09] <GuShH> I didn't know you got unlimited lifetime support for buying a single product off someone :p
[18:20:04] <Tom_itx> GuShH try selling something sometime and you will learn all about that
[18:20:07] <Tom_itx> ask inflex
[18:20:18] <theBear> heh
[18:29:57] <Tom_itx> k-man are you in Va?
[18:30:07] * Tom_itx has a hunch
[18:31:09] <drgreenthumb> Tom_itx, I accidentally dropped my programmer in a cup of coffee. fix it! ;p
[18:31:49] * Tom_itx pours drgreenthumb some more coffee
[18:32:59] <drgreenthumb> cool, I'll break some more stuff!
[18:33:23] <Tom_itx> i think he has one of the old bit banned ones
[18:33:29] <Tom_itx> banged*
[18:33:35] <Tom_itx> same diff :)
[18:34:02] <drgreenthumb> heh bit banning. I hereby ban all 1s!
[18:34:29] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/usbtiny_programmer/usbtiny_top_txt.jpg
[18:34:31] <Tom_itx> that one
[18:34:55] <drgreenthumb> heh yeah that's the one I ripped the USB header off of. it wasn't actually coffee, just me being a spaz :(
[18:35:10] <drgreenthumb> I still have the newer one though :)
[18:35:20] <Tom_itx> it works alot better
[18:36:02] <Tom_itx> now i gotta figure out an encoder for this spindle
[18:37:32] * Tom_itx starts loading studio 5.1 and goes off for supper
[18:40:00] <drgreenthumb> heh take a movie and nap too, might be launched when you get back ;)
[20:57:53] <k-man> Tom_itx, no, sydney australia
[20:58:21] <k-man> Tom_itx, its got 2009 on the board
[20:58:51] <k-man> and just an attiny 2313? and a buffer chip
[20:58:58] <k-man> i'll dig it out in a second
[21:35:43] <k-man> it's marked usb-prog rev 2.1 Tom_L 2009
[21:39:12] <CapnKernel> k-man: G'day
[21:39:33] <CapnKernel> If you're very lucky, Tom_itx will ask for it back for his museum.
[23:08:02] <Tom_itx> k-man`, http://tom-itx.dyndns.org:81/~webpage/usbtiny_programmer/testing_index.php