#avr | Logs for 2014-07-06

Back
[15:30:46] <PureSine> hello, I have a weird problem, I have a program that has worked for many years, I added a timer ISR that calls a function that writes into some ports,read and write functions inside main are protected by cli()/sei(), now when I comment out read/write functions in main, newly added ISR works fine but when I enable them memory corruption in RAM occurs, many variables in RAM get random values!
[15:34:11] <PureSine> First I thought maybe it is stack error but even when I free lots of RAM problem persists, problem seems only depends on read/write functions being enable in the same time as ISR write function is enabled
[15:35:22] <twnqx> if there really is an interaction then your ISR changes mainloop vars
[15:35:35] <twnqx> or is not declared as an ISR so registers change
[15:36:45] <PureSine> ISR do not change variables and also ISR routine is defined with ISR() macro
[15:42:24] <malinus> PureSine, double check the macro
[15:45:50] <PureSine> If it was an error in the ISR, program wouldn't work when I comment out read/write calls from main
[16:22:11] <wondiws> I'm reading someone elses code and it has a line "asm volatile ("" ::: "memory"); in it
[16:22:18] <wondiws> what does that memory bit mean?
[18:03:54] <Tom_itx> pur
[18:04:06] <Tom_itx> mmm he left already
[18:04:19] <Tom_itx> wondiws that is inline assembler
[18:05:11] <wondiws> yeah, I know, but the "memory" keyword, or instruction, or whatever
[18:06:19] <Tom_itx> being in quotes makes me think it may be a var
[18:06:36] <Tom_itx> i'm not great at asm
[18:07:51] <Tom_itx> consult: http://www.nongnu.org/avr-libc/user-manual/inline_asm.html
[18:09:26] <Tom_itx> GuShH, it's just that cold
[18:09:55] <GuShH> Tom_itx: really?
[18:10:07] <GuShH> anyway blackout... running off SLAs 'til they die out :(
[18:10:13] <Tom_itx> the sensor board isn't plugged in
[18:10:20] <GuShH> :p
[18:10:39] <Tom_itx> why the blackout?
[18:10:47] <Tom_itx> didn't pay the bill?
[18:10:48] <GuShH> blackout priority list: light, internet
[18:10:50] <GuShH> I did
[18:10:57] <GuShH> it's out on all the block
[18:11:03] <GuShH> well 4 block radius or so
[18:11:04] <Tom_itx> fire up the gen
[18:11:17] <GuShH> no need at the moment, sadly I probably only have a gallon of fuel...
[18:11:39] <GuShH> should keep the other SLA charged... doh. it just rarely happens so I don't bother
[18:11:59] <GuShH> hope it comes back soon, got work to do
[18:12:06] <malinus> hey guys, does this look safe to you: http://i.imgur.com/Fx8AJF9.jpg
[18:12:53] <GuShH> malinus: no
[18:13:07] <GuShH> hope you are just the local troll here and not serious
[18:13:38] <GuShH> your breadboard is not rated for higher voltages
[18:13:53] <GuShH> whatever it is you are trying to do try inductive coupling instead or at least get an isolation transformer going
[18:14:49] <malinus> I'm just joking around. But it's a funny story. A guy came into #arduino and said that his 220V won't work with his arduino. A few seconds after posting the picture, he disconnected. I expect him dead.
[18:15:11] <malinus> *his 220V electrical motor
[18:15:41] <GuShH> lmfao
[18:15:51] <GuShH> one can only hope Darwin was awake at the moment.
[18:17:02] <Tom_itx> what's wrong with that??
[18:17:47] <twnqx> hm
[18:17:54] <twnqx> doesn't look wrong at all to me
[18:18:14] <twnqx> relais, freewheeling diode, transistor to drive it from the arduino
[18:19:24] <Tom_itx> not much worse than this: http://tom-itx.no-ip.biz:81/~webpage/toaster_oven/blinktest2.jpg
[18:19:42] <twnqx> except
[18:19:44] <twnqx> did he...
[18:21:09] <twnqx> link up the 220V on the long lines, and do i see cables going from there to the electronics
[18:22:16] <Tom_itx> he's probably using the relay to switch the 220v
[18:22:57] <Tom_itx> i probably wouldn't have done it that way
[18:23:11] <twnqx> but clearly the 220V go in the long lines of the second board...
[18:23:28] <twnqx> then there's the yellow and white, but look at the orange on the top
[18:24:27] <GuShH> I got 6VAC on mains
[18:24:29] <GuShH> all phases
[18:24:33] <GuShH> lol...
[18:24:41] <GuShH> 240? 230? 220? no... 6.
[18:25:07] <GuShH> fridge lightly hummin', let's trip the breakers for good measure.
[18:25:30] <twnqx> Oo
[18:27:02] <GuShH> ok the plugs phase is out, just left the lights in case the service comes back...
[18:27:06] <GuShH> assholes. something blew.
[18:27:28] <GuShH> not fun.
[20:24:16] <vsync> malinus: that's completely safe
[20:31:47] <Tom_itx> i wouldn't say 'completely'
[20:42:04] <Lambda_Aurigae> running 220VAC through an arduino is completely safe and good and something that should be done multiple times a day.
[21:48:21] <vsync> Lambda_Aurigae: you can program it with python if you run it off mains
[21:48:34] <vsync> did you not know this?
[21:49:00] <vsync> also with nodejs and ruby on rails
[21:49:05] <vsync> it's so good.