#avr | Logs for 2013-12-11

Back
[02:08:41] <megal0maniac_afk> kdehl: The only reason I'm bothering with PIC is because we use them next year at uni and I want to get comfortable with it in my own time. So far it's only making me yearn for AVR. Although the programmer does have some novel features like programmer to go and powering the target with a specific voltage
[02:09:28] <megal0maniac_afk> But I still can't blink an LED
[02:13:00] <jerkey> damn
[02:52:55] <OndraSter> euw PIC
[02:52:59] <OndraSter> (we had PIC24f at uni as well :D
[02:56:57] <megal0maniac_afk> The LED is finally blinking!
[02:57:34] <megal0maniac_afk> "Configuration bits" were wrong. It's kinda cool that the fuses are set in code
[02:58:23] <jacekowski> megal0maniac_afk: avr programmers have that as well
[02:59:29] <megal0maniac_afk> Oh yeah.. I guess they do. I just never use them like that :)
[03:55:25] <jerkey> congratulations!
[03:58:38] <megal0maniac_afk> It needs the programmer to be connected, otherwise it seems to reset after every blink. Pull-up on the reset pin isn't solving the problem. So I'm only half way there :/
[04:00:33] <jerkey> wtf!?!? how did people survive back then!?
[04:01:25] <megal0maniac_afk> Why can't everything just be AVR?
[04:03:49] <OndraSter> because Microchip
[04:05:16] <megal0maniac_afk> wtf. Pulling the programming pins low fixes it :/
[04:05:48] <megal0maniac_afk> gtfo microchip
[04:16:33] <OndraSter> lol
[09:59:15] <dask_> can AVR Dragon program surface mount MCUs? or is it just for through hole MCUs?
[10:05:44] <Essobi> Sup...
[10:06:46] <malinus> dask_, the package has nothing to do with how the chip works. The question is how easy it would be to connect it.
[10:08:55] <dask_> malinus, sorry I wanted to mean what you say. I have an AVR Dragon that I only see space to place a through hole item. is there a place on the Dragon that I can place a surface mount MCU or any standard way to do it?
[10:11:14] <LoRez> dask_: surface mount it on your target board and then use ICSP or JTAG to program it.
[10:12:08] <RLa> while (!timeout && !(PINC & (1 << PC0))); <- why this wait loop is "not working"?
[10:12:13] <dask_> LoRez, thank you.
[10:12:30] <RLa> i want to wait till timeout occurs or pin goes high
[10:13:14] <twnqx> is timeout set from an interrupt handler?
[10:13:34] <RLa> yes
[10:13:34] <twnqx> if so, is it declared volatile?
[10:13:40] <RLa> and it's volatile global
[10:13:45] <dask_> is there any atmel chip that can run linux?
[10:13:57] <twnqx> sure, the avr32 can
[10:15:05] <LoRez> volatile global? or volatile static?
[10:15:18] <dask_> twnqx, do you know if this one can http://uk.farnell.com/atmel/at32uc3l016-d3ht/ic-mcu-avr32-16k-flash-48ttlga/dp/2097754 ?
[10:15:31] <RLa> LoRez, global
[10:16:06] <twnqx> dask_: unlikely. far, far, far too little flash and ram
[10:16:20] <twnqx> needs some orders of magnitude more
[10:16:21] <RLa> LoRez, volatile uint8_t timeout = 0;
[10:17:15] <dask_> twnqx, thanks
[10:17:28] <twnqx> RLa: try while ((!timeout) && (!(PINC & (1 << PC0)))) {}; - i always forget about operator precedence
[10:18:10] <RLa> twnqx, a sec
[10:19:02] <RLa> oh, you think && binds stronger than !?
[10:19:16] <twnqx> i keep forgetting. it shouldn't, i think..
[10:19:42] <RLa> there must be something else wrong
[10:20:30] <RLa> nvm, the condition is just wrong :)
[10:20:50] <twnqx> lol
[10:21:20] <RLa> i need pin to go low
[10:21:23] <RLa> not high
[10:24:06] <RLa> now everything works
[10:24:23] <RLa> i need logic analyzer, better than two slow leds :)
[11:23:30] <beaky> hell
[11:23:32] <beaky> hello*
[11:30:41] <twnqx> hello beaky
[11:30:48] <twnqx> what do you love today?
[14:23:41] <beaky> if i run avr at 128kHz, do i need to preslace my adc
[14:28:50] <devilsadvocate> beaky: probably not. check the ADC specs for your chip for maximum clock speed
[14:39:47] <rlc> I'm looking for a way to use a random port as function argument in C. Has anyone tried it?
[14:42:30] <Amnesia> hi question, what could be the reason for avr-ld to throw an exception that /usr/lib/gcc/avr/4.8.2/avr5/libgcc.a is incompatible
[14:42:33] <Amnesia> ?
[14:43:21] <beaky> ports are just volatile uint8_t *
[14:45:54] <rlc> beaky: what's the syntax to call a port? For example, PORTC?
[14:46:37] <beaky> volatile uint8_t *myport = PORTC;
[14:46:51] <rlc> ok, thanks
[14:46:54] <beaky> oops, &PORTC;
[14:47:19] <rlc> Ok, I'm going to try it
[14:49:23] <bss36504> Anybody have experience with shared libraries in linux written in C?
[15:03:06] <bsdfox> bss36504, ask a question and someone might be able to help
[15:05:19] <bss36504> I'm trying to create a shared lib that uses the NI-VISA library. The visa library has a whole bunch of derived types that wont map to the JNA properly, and since the lib is shared, to my knowledge I cant rely on the lib itself to store the derived-type variables. My question is: Is there a way to store data in a shared lib that is somewhat instance based? That way when I instantiate two objects in my java code, they will each have
[15:05:19] <bss36504> own variables stored in the lib.
[17:12:30] <ambro718> anyone knows if it's legal to redistribute ASF?
[17:13:20] <ambro718> provide a download that is
[17:13:34] <Casper> asf?
[17:14:32] <ambro718> http://www.atmel.com/tools/avrsoftwareframework.aspx
[17:43:19] <ThiefMaster> why not provide a deep link (skipping the login/email bs) to the official download site?
[17:45:13] <ambro718> oh good idea, I didn't think it would actually work :) http://www.atmel.com/images/asf-standalone-archive-3.13.1.85.zip
[17:45:50] <ambro718> usually when they do this registration thing they make temporary links
[17:49:39] <tzanger> I wish they'd just publish the git repo and be done with it
[22:22:54] <RLa> anyone else built fan pwm controller with avr?
[22:24:42] <Casper> I did not, but I considered it
[22:24:48] <Casper> shouln't be hard at all
[22:25:07] <Casper> will you use a 4 pins fan or a 2-3 pins one?
[22:25:19] <Casper> and do you need rpm feedback?
[22:25:29] <RLa> yeah, for 3 wire fans you need pwm stretching to get usable tacho reading
[22:25:39] <RLa> i haven't gotten to feedback yet
[22:25:51] <Casper> 4 pins is actually the easiest to work with
[22:26:02] <RLa> but do you imagine what sound pwm stretching is making?
[22:26:05] <Casper> like, dead easy
[22:26:32] <RLa> i wonder if anyone has built it at all
[22:26:46] <RLa> it does not sound so good at all
[22:27:00] <Casper> well implemented, it shouln't be too bad
[22:27:00] <RLa> and makes fan jump during pulse stretch
[22:27:13] <Casper> in fact, you don't notice it on computer
[22:27:18] <RLa> you do
[22:27:33] <Casper> if you do, they fucked up
[22:27:47] <RLa> maybe just because of fans i use
[22:28:12] <Casper> or maybe the board you use too
[22:28:30] <RLa> board?
[22:29:08] <Casper> or have you tried to do the pulse stretching thing?
[22:29:14] <RLa> just imagine fan coils suddenly get full current, that causes magnetic effects strong enough to make it jump on table
[22:29:17] <RLa> yes, i did
[22:29:34] <Casper> then possibly misimplemented
[22:29:38] <RLa> it takes about 30ms pulse
[22:30:10] <Casper> but maybe it's your fan
[22:30:18] <Casper> because I never saw that kind of issue
[22:30:19] <Casper> or
[22:30:35] <Casper> maybe that manufacturers cheat and use 5V instead of 12 for the stretch?
[22:30:46] <Casper> hmmm
[22:31:00] <RLa> https://gist.github.com/rla/7923099
[22:31:07] <RLa> this is enough to make it jump
[22:31:11] <Casper> or maybe they diode or the pulsed 12V and the 5V...
[22:31:13] <RLa> full current for 30ms
[22:32:07] <RLa> also, maybe it's just the fan
[22:32:13] <Casper> possible too
[22:32:23] <Casper> but what about just diode OR with 5V? :D
[22:32:33] <Casper> so no need to pulse stretch
[22:32:50] <RLa> of course it does not do weird things when feed with constant power
[22:43:46] <RLa> Casper, one cpu fan behaves much better
[22:44:00] <RLa> but it's way lower power too
[22:44:18] <RLa> i can only hear stretched pulses when i put my ear against it
[22:44:36] <Casper> so it was the fan
[22:44:55] <RLa> now i'm going to try how it behaves with water pump
[22:46:01] <Casper> I guess you could also make it work better by cheating even more
[22:46:25] <RLa> that my only 3-wire device, others are all 4-wire and need no pulse stretching
[22:46:27] <Casper> PWM 100%, wait 1 pulse, count time until 2 count, PWM back to what it was
[22:46:47] <RLa> Casper, that's what i do
[22:46:51] <Casper> so you have variable pulse stretching, of just over 1 rotation
[22:47:04] <Casper> you show 30ms
[22:47:12] <Casper> I say count the time for 1 rotation
[22:47:22] <Casper> so no fixed time
[22:48:21] <RLa> 30ms is 1000 rpm with 2 pulses per revolution
[22:48:47] <RLa> i used fixed time and commented out measuring logic to make test simpler
[22:49:08] <Casper> ok
[22:49:59] <RLa> https://gist.github.com/rla/7923228
[22:50:53] <RLa> this code behaves same as simple loop as measurement takes about that time
[22:52:26] <RLa> hm, as a solution i could also make it into buck "converter"
[22:53:10] <RLa> only takes p-channel mosfet, fast diode, inductor, a cap and inverted signal
[22:54:26] <RLa> anyway, i will now try to make feedback loop that maintains rpm