#avr | Logs for 2016-01-09

Back
[04:11:36] <julius> morning
[04:12:22] <Xark> julius: No, but hello anyways. :)
[04:16:36] <julius> wouldnt it be possible to use some arduino libs, compile the code with the ide for my atmega and then upload it to a atmega? isnt a arduino basically a atmega128 or something?
[04:19:41] <WormFood> yes julius, that should work just fine.
[04:20:16] <WormFood> The biggest thing the Arduino has going for it, is that it can be programmed via the USB, instead of needing a special programmer. Other than that, there is really nothing special about it.
[04:22:03] <julius> hi WormFood
[04:22:09] <julius> whats your local time in china?
[04:22:50] <WormFood> 5:58 pm
[04:22:56] <twnqx> WormFood: but the 16/32u* have an usb boot loader on them, as soon as you add a crystal
[04:23:19] <twnqx> so they don't need external programmers either, or am i wrong?
[04:23:44] <twnqx> (iirc i bought some arduinos from taobao that did not have any arduino soft flashed)
[04:23:47] <WormFood> I *think* you're wrong, but I don't know for sure.
[04:24:11] <WormFood> the bootloader is the only thing that needs to be flashed on them
[04:24:23] <WormFood> I buy mine in person. If they're a problem, I just take it back ;)
[04:24:28] <twnqx> i need to go back to shenzhen
[04:24:33] <twnqx> so many things i want to buy :3
[04:25:07] <julius> i wait for 15-30 days for packets
[04:25:21] <julius> and no, im not gonna pay the return fee ;)
[04:25:21] <twnqx> see!
[04:25:26] <twnqx> flying to shenzhen is faster!
[04:25:31] <julius> sure
[04:25:34] <julius> if you can poop money
[04:25:39] <twnqx> (and also more fun)
[04:25:49] <twnqx> or have work there every now and then :P
[04:26:00] <julius> http://de.aliexpress.com/item/Free-Shipping-1pcs-lot-ATMEGA328P-Pro-Mini-328-Mini-ATMEGA328-5V-16MHz-for-Arduino/32291252874.html?spm=2114.020208.3.1.kWNoYX&ws_ab_test=searchweb201556_3,searchweb201644_4_10001_10002_10005_10006_10003_10004_62,searchweb201560_8,searchweb1451318400_6150 does this look like a "real" atmega328?
[04:26:50] <WormFood> http://de.aliexpress.com/item/Free-Shipping-1pcs-lot-ATMEGA328P-Pro-Mini-328-Mini-ATMEGA328-5V-16MHz-for-Arduino/32291252874.html dude, truncate your long URLs...please :P
[04:35:10] <Xark> But then how will the advertising companies track us? :)
[04:35:40] <julius> ah yes, will do
[04:35:47] <WormFood> you think that long url helps with that?
[04:35:58] <julius> could be
[04:36:12] <julius> hes right, i HAVE to use that google accepted url...its necessary ;)
[04:36:45] <julius> so does that look like a atmega328p thats useable?
[04:45:56] <WormFood> sure, why not?
[05:30:07] <Mikael> Hello! Anyone here?
[05:37:25] <cehteh> o/
[05:38:39] <rue_bed> hmm
[05:38:53] <rue_bed> how do I know if I'm really here or just think I am
[05:53:10] <Snert> pinch your computer
[07:46:11] <julius> WormFood, thanks
[07:46:27] <julius> rue_bed, ping -c 1 127.0.0.1
[08:22:09] <julius> is it possible todo this: const uint8_t gammaTable18[200] = {.... with 200 values?
[08:28:29] <julius> ah now the code is working
[08:29:00] <julius> uint_8t goes from 0 to 255 inclusive, right?
[09:14:29] <nuxil__> julius, nop. but uint8_t does :p .. 8 for 8 bit. which is one byte. if im correct, then you also have example uint16_t for 16 bit that can max be in 0- 65535/0-ffff , signed i belive its half. like -128/+128 for 1byte, or something like that.
[09:43:01] <WormFood> +127/-128
[09:43:04] <WormFood> IIRC
[09:45:04] <cehteh> yes
[09:46:04] <nuxil> hey cehteh
[09:46:57] <nuxil> i lost your paste on how to use the reset button to alter some init state on the ATtiny85 chip.. could you show it to me again ?
[09:47:30] <nuxil> it was some days ago
[09:47:33] <nuxil> :\
[09:47:43] <cehteh> heh
[09:47:55] <cehteh> that was just my code from the battery watchdog
[09:48:05] <nuxil> yea.
[09:48:21] <cehteh> http://git.pipapo.org/?p=battswitch.git;a=blob;f=src/battswitch.c
[09:48:56] <nuxil> thanks
[09:53:09] <nuxil> cehteh, what does int __attribute__((OS_main)) do ?
[09:53:40] <cehteh> tells the compiler about some optimizations
[09:54:10] <nuxil> so its not needed ?
[09:54:41] <cehteh> no
[09:55:10] <cehteh> saves a few bytes code and ram
[09:55:35] <cehteh> since you dont have much ram on the tiny you may want to use it though
[09:58:03] <cehteh> saves 4 bytes code here
[09:58:12] <cehteh> well ram might be more important
[11:26:31] <LeoNerd> Most notably, it tells the compiler that this function isn't really ever expected to exit; it starts, runs exactly once, etc...
[11:26:49] <LeoNerd> And its caller isn't expecting anything to be preserved, register-wise
[12:42:03] <lorenzo> hello
[12:42:09] <lorenzo> can you help me understand this notation?
[12:42:10] <lorenzo> TCCR0A = 2<<COM0A0 || 2<<COM0B0 || 3<<WGM00;
[12:42:17] <lorenzo> TCCR0A is 8 bits: [COM0A1:COM0A0:COM0B1:COM0B0:unused:unused:WGM01:WGM00]
[12:58:58] <apo_> COM0A1:COM0A0 = 2, COM0B1:COM0B0 = 2, WGM01:WGM00 = 3
[13:11:08] <lorenzo> apo_: thanks
[13:11:25] <lorenzo> I've noticed in the header files that the various options are just numbers
[13:11:34] <lorenzo> to make bits shift to the correct position in the register :)
[14:34:59] <julius> nuxil, thank you, found the error. was in another place
[14:35:08] <julius> any idea why this wont light any leds? http://paste.pound-python.org/show/pUWX6gs8BhdxJNnVhPg3/
[14:36:03] <julius> i was expecting it to light led 1....60 and then start at the beginning
[14:37:42] <tpw_rules> julius: when position is 0, leds[position-1].r is undefined
[14:37:50] <tpw_rules> it probably corrupts the state and crashes the processor
[14:38:05] <julius> true, i was hoping that the light_ws2812 catches that and ignores it
[14:39:40] <nuxil> why are you doing position-1 anyway?
[14:39:58] <julius> i want to have one led wander from first to last, -1 turns the old one off
[14:40:16] <tpw_rules> put an if so you don't do that if position is 0
[14:40:26] <julius> but that wasnt it, commenting out the part where r/g/b is set ot 0 does not help
[14:40:28] <nuxil> ^ he said
[14:40:48] <tpw_rules> is that your entire code?
[14:41:00] <julius> let me check
[14:41:12] <julius> yes, basically light_ws2812 does all the work
[14:41:25] <tpw_rules> i'm sure the ws2812 driver must be initialized. right now you're just poking values into memory
[14:41:32] <julius> did some experiments with it today, fading all leds in, larson scanner....they worked
[14:41:39] <tpw_rules> oh
[14:41:43] <julius> oh, yeah
[14:43:48] <julius> ws2812_setleds(leds, NUM_LEDS); was missing
[14:44:30] <tpw_rules> :P
[14:44:39] <nuxil> :)
[15:18:45] <julius> jesus christ, all those ; ( }
[15:19:06] <julius> i just did something in python some days ago, ; ( } are really useless constructs
[15:24:39] <Lambda_Aurigae> yeah...just remember your order of operations.
[16:49:13] <phinxy> does anyone know where i could find a magnet-thing that makes a pulse each revolution on a bicycle wheel? maybe a complete kit so it works with atmega8 ?
[16:49:46] <cehteh> hub dynamo?
[16:50:05] <cehteh> gives more than one impulse .. but you know how to count? :)
[16:50:17] <LeoNerd> Magnet + hall sensor
[16:50:40] <LeoNerd> Any cheap simple magnet will do... poundshop/dollarshop/{local equivalent here} will likely sell those
[16:50:51] <inkjetunito> phinxy: do you want a magnet switch?
[16:51:50] <phinxy> i might use a ir sensor and reflective tape instead
[16:51:51] <Lambda_Aurigae> reed switch works well.
[16:52:14] <inkjetunito> hmm. looks like it's called 'magnetic switch' or 'reed switch'
[16:52:31] <cehteh> phinxy: for a tachometer?
[16:54:26] <inkjetunito> phinxy: if it's actually for a bicycle, just grab a cheap meter for like 3 euros and you'll get perfect fitting switch + magnet :)
[16:55:18] <cehteh> any why full rotation when you can get much better precision, like counting the sprokes with a photo sensor, or sensing a dynamo hub when you already have one
[16:56:01] <cehteh> either way would be easier AND more precise
[16:56:06] <phinxy> didnt know Hall sensors where non mechanical
[16:56:21] <aandrew> yep
[16:56:49] <phinxy> cehteh or just add more hall sensors :D
[16:57:06] <phinxy> the dynamo would need a voltage divider
[16:57:14] <cehteh> more magents .. one hall sensor would be enough
[16:57:19] <phinxy> and counting sprokes with a photo sensor would not work at night?
[16:57:28] <phinxy> right..
[16:57:30] <aandrew> julius: heh, the only thing I dislike about python is the forced structure. I like structure, my C is clean, but the forced use of *spaces* is tedious
[16:57:54] <cehteh> with a IR led on the other side of course ,, modulated at high frequency
[16:58:04] <Lambda_Aurigae> optical beam break might work for spoke counting.
[16:58:33] <inkjetunito> just slam a gps module on it
[16:58:42] <aandrew> yeah a little hall sensor and magnet would work great on a bike, what's wrong with that?
[16:58:50] <cehteh> you can sense the dynamo with the analog comparator, resistors and zener diodes
[16:59:32] <aandrew> I mean when it comes to precision does it really matter if it detects 3/8 of a turn or 1 whole turn?
[16:59:39] <cehteh> aandrew: a full rotation on a 28" wheel are already a few meters
[17:00:13] <inkjetunito> not to mention the time needed for one cycle when walking the bicycle
[17:01:22] <phinxy> "400ns transition period for rise and fall." for a hall sensor
[17:01:25] <phinxy> thats pretty good
[17:01:44] <aandrew> cehteh: sure but what kind of real accuracy do you think you're going to have on an average ride?
[17:02:08] <aandrew> optics means you gotta keep your wheels clean
[17:02:28] <cehteh> i'd go for sensing the hub dynamo anyway
[17:02:57] <cehteh> you can already power the thing from that too
[17:03:03] <aandrew> throw 4 magnets on the spokes and hall effect if you really need <1 rotation
[17:03:35] <cehteh> no extra sensors and stuff at all ..
[17:03:39] <aandrew> impervious to dirt, super low power, doesn't require any special alignment or calibration
[17:03:40] <cehteh> 1 wire
[17:04:07] <aandrew> what're you sensing on the hub?
[17:04:41] <cehteh> hub puts out A/C
[17:04:50] <aandrew> is this an electric bike?
[17:04:56] <cehteh> dynamo i saied
[17:05:08] <cehteh> *if* that bike has such
[17:05:09] <aandrew> yes, most bikes I know have no motor/dynamo
[17:05:22] <cehteh> here they do
[17:05:42] <aandrew> also the motor back-emf would vary with speed and if unpowered (walking the bike) then no output
[17:05:51] <cehteh> dynamo not motor
[17:05:54] <phinxy> aww seeedstudio is out of hall sensors. anyone know another place to buy stuff?
[17:06:12] <aandrew> phinxy: digikey, mouser, element14, aliexpress...
[17:06:29] <cehteh> and walking the bike would already generate plenty of signals
[17:06:48] <aandrew> the only dynamos I know are the ones that ride on the outer tread, not in the hub
[17:07:01] <cehteh> where do you live?
[17:07:20] <aandrew> and those are not great, particuarly if you're telling me that 1 pulse per rev is not accurate enough
[17:07:23] <aandrew> cehteh: canada
[17:07:32] <cehteh> i mean yes we used them too .. still many bikes have those, but new bikes usually have hub dynamos
[17:07:58] <cehteh> much more efficient and no maintenance, and no problems with dirst
[17:08:26] <aandrew> but yeah if you've got that in the hub that'd be a decent signal to use, particuarly if you clamp it and use a comparator, it'd work at pretty much any speed
[17:08:34] <cehteh> http://www.thinkbiologic.com/products/joule-3-dynamo-hub
[17:09:03] <aandrew> TIL about hub dynamo
[17:09:06] <aandrew> er dynamos
[17:44:07] <phinxy> i have this hall effect sensor documentation but i cant figure out whats the difference between types
[17:44:19] <phinxy> TLE4935L or TLE945L
[17:44:19] <phinxy> http://www.produktinfo.conrad.com/datenblaetter/150000-174999/153775-da-01-en-HALL_SENSOR_TLE_4935L.pdf
[17:44:46] <phinxy> they all have the same package, does this mean they are the same dimensions
[18:30:00] <aandrew> phinxy: yes, package determines dimensions
[18:30:14] <aandrew> same package does not imply same pinout although this *can* be true
[20:48:34] * LeoNerd reads about the ATtiny43U
[20:48:55] <LeoNerd> A weird chip. A fairly simple non-descript ATtiny, ... with an integrated boost-mode switching power converter
[20:58:21] <Chillum> interesting
[20:59:05] <Chillum> neat how low voltage it goes
[21:04:04] <aandrew> 0.7V... never worked down there before
[21:09:46] <LeoNerd> Yeah
[21:37:17] <Chillum> good for those transistor/solar panel based systems, assuming it has a good sleep mode
[21:43:06] <tpw_rules> that's around the voltage of a dead alkaline battery
[21:43:32] <tpw_rules> LeoNerd: did you ever get your thing working
[21:45:45] <LeoNerd> My thing? I've got many
[21:45:55] <tpw_rules> the sd card dingler
[21:46:47] <LeoNerd> Oh, yeah bits of, Still adding more, but what's there is working nicely
[21:49:03] <Chillum> ohh and it has a VBAT and a VCC pin
[21:49:44] <tpw_rules> yeah it's undoubtedly designed for battery powered trinkets
[21:50:33] <tpw_rules> coin batteries are 3.0V from start to end but alkalines can vary from 1.5 to 0.8 or so
[21:51:55] <tpw_rules> which you'll notice happens to be almost exactly the working range of the converter
[21:52:17] <Chillum> yup, with proper use of sleep mode it would be very practical
[21:52:50] <Chillum> not that cheap though
[22:28:07] <Casper> and another plexi that went from scratchy transparent to... perfect for a bathroom door full size glass! (aka: 100% foggy/white)