#avr | Logs for 2013-07-15

Back
[04:11:23] <Duality> sometimes need more info next to each other then the datasheet dislays
[04:22:26] <twnqx> solution: open the datasheet twice
[04:45:39] <Duality> understanding timers is killing me -.-
[04:50:15] <twnqx> ... they count clocks
[04:50:22] <twnqx> not that hard to understand :P
[04:52:19] <braincracker> they count clock cycles in a 8 or 16 bit counter
[04:52:22] <Duality> well setting them up
[04:52:29] <braincracker> and i explained everything
[04:52:39] <braincracker> h
[04:53:25] <Duality> i can get a let to blink by checking a value in TCNT0 in the main loop, but can't do the same with a ISR
[04:53:57] <braincracker> you want a static variable then
[04:54:33] <Duality> what variable ?
[04:54:37] <Duality> :)
[04:54:50] <Duality> it does TIMER0_OVF_vect
[04:55:11] <Duality> oh i see need to do sei();
[04:55:32] <braincracker> hm, yes, timer won't trigger until
[04:56:24] <Duality> yay got blinking led with interupt :)
[04:56:45] <braincracker> oh cool, next project, create a stopwatch with an lcd
[04:57:01] <braincracker> bicycle odometer ?
[04:57:30] <twnqx> i was pretty proud when i managed to myke my fpga blink a LED too :P
[04:57:34] <twnqx> make*
[04:57:38] <braincracker> hehehe
[04:57:46] <Duality> never used interupts before :)
[04:58:11] <braincracker> i made my first night rider running lights with 89c2051 without timers ;/
[04:58:13] <Duality> Always used arduino but it has sooo much overhead :)
[04:58:22] <braincracker> so you pressed a button and the mainloop hung
[04:58:49] <Duality> your mainloop ?
[04:59:04] <braincracker> yes, because it was waiting for key release
[04:59:15] <braincracker> blocking mode
[04:59:31] <Duality> would interupts also work without a infinite loop in the main function ?
[04:59:47] <braincracker> not sure it is a good thing to do
[04:59:53] <braincracker> IP would overflow i think
[04:59:59] <braincracker> and maybe reset
[05:00:03] <Duality> IP ?
[05:00:11] <braincracker> instruction pointer
[05:00:21] <Duality> ah
[05:00:30] <Duality> doesn't work without a infinite loop
[05:00:33] <Duality> :)
[05:01:35] <braincracker> does it reset periodically? never tried
[05:06:07] <braincracker> netherlands ?
[05:10:38] <Frigolit> Duality: normally i guess one would enter a light sleep state in the main loop which doesn't prevent interrupts from the interrupt-sources you need to function
[05:10:47] <braincracker> mm http://euro2008girls.com/pics/dutch-girl-03.jpg
[05:10:56] <Frigolit> lowers power consumption as well :)
[05:24:00] <Duality_> braincracker: yea NL ftw :)
[05:24:15] <Duality_> Frigolit: nice one might be a nice option for a remote aswell :)
[05:25:02] <Duality_> braincracker: without a infinite loop it does exactly nothing.
[07:26:02] <braincracker> http://scourmanop.wordpress.com/2008/02/07/hungarian-inventions/
[07:26:26] <braincracker> "GM offered him a half a percent of each unit sold and a monthly USD 200 advance for five years. The license fee was eventually never paid " oh how nice of GM
[08:17:01] <tzanger> braincracker: that's a cool page
[08:19:17] <tekzilla_> hi, i'm on a mega8 (16 bit timer1, 2 compares), have only OCR1A set and interrupts enabled for both A and B
[08:19:44] <tekzilla_> now the compare B interrupt is fired together with the compare A interrupt
[08:21:55] <tekzilla_> same behaviour when i actually set OCR1B, so thats why i tried to leave it unset..
[08:34:47] <tekzilla> ok nevermind i gotta rethink this :)
[09:43:35] <megal0maniac_afk> right you are
[09:44:53] <megal0maniac_afk> Whoops. Replying to the scrollback :)
[09:48:02] <RikusW> heh
[09:48:18] <RikusW> Telkom finially fixed the line properly today :)
[09:48:26] <RikusW> now its underground again
[09:48:34] <megal0maniac_afk> Whoohoo!
[09:48:54] <RikusW> I laid a temp line yesterday :-P
[09:49:00] <RikusW> I knew where to connect it
[09:49:14] <RikusW> the tech didn't complain..
[09:49:16] <megal0maniac_afk> With surfex? :P
[09:49:23] <RikusW> surfex ?
[09:49:38] <megal0maniac_afk> I wasn't being serious
[09:50:46] <RikusW> I had a peek inside the big blue and green telkom box...
[09:50:56] <RikusW> bunches and bunches of patch wiring...
[09:51:08] <RikusW> I've no clue whats what in there
[09:52:22] <RikusW> there are phone sockets in there too, so you could make a free call :-P
[10:25:47] <cart_man> RikusW: Hey Rikus have you ever used the L297 Motor driver? I heard its quite common
[10:52:17] <ambro718> crap, I'm hitting another avr-gcc bug... http://ideone.com/9SAdvE without the second printf, the m_command.x[2] is computed wrong....
[10:52:38] <ambro718> FixedResMultiply is just a multiplication and right shift
[10:58:50] <bsdfox> ambro718: paste the functions or it's unlikely people can help
[10:59:40] <ambro718> the problem with these compiler bugs is that it's practically impossible to reduce them to a usable test case
[10:59:57] <ambro718> I'm almost sure trying to isolate it will quickly remove the bug
[11:02:19] <ambro718> it seems like computing the product a single time then assigning it worked it around, luckily
[11:06:27] <ambro718> I'll try anyway though...
[11:06:57] <RikusW> cart_man: not yet
[11:19:23] <braincracker> ;> new monitor
[11:19:48] <braincracker> 19" dell tft
[12:02:46] <kdehl_> Um. Does anyone of you guys know of any Linux software that is compatible with the old DOS laplink?
[12:06:39] <tzanger> oh man laplink I remember them
[12:06:51] <tzanger> wondering if you can use laplink in a dosbox/dosemu vm
[12:15:51] <kdehl> Hm.
[12:15:57] <kdehl> That might be something.
[12:19:43] <theBear> do you gotta connect to a laplink or just its cable on 2 linux machines ? and is it serial or parallel laplink cable ?
[12:19:44] <braincracker> who knows how an lcd display becomes damaged if you press the display ?
[12:19:44] <braincracker> will the tft burn out?
[12:20:07] <braincracker> or just gets squished and gets darker because of this?
[12:20:16] <BJfreeman> now aday VNC is used
[12:20:23] <theBear> depends how much you squash and what size/kind/material it is
[12:20:32] <braincracker> TN
[12:20:36] <kdehl> I'm having an old 486 with DOS 6.22, and a broken floppy. But it had laplink installed.
[12:20:57] <tzanger> braincracker: you are squishing a very fragile stackup of glass, circuitry and chemicals.
[12:21:01] <tzanger> there are a few failure modes
[12:21:06] <kdehl> And interlnk and intersvr of course. Heh, I had forgotten about those.
[12:21:08] <braincracker> those used to have a soft shaded area if you press with your finger
[12:21:09] <theBear> in bigger ones it doesn't take much to crack the glass with the crystals sandwich, and even if you don't a bit stretch could disconnect pixels or move spacers so an area collapses
[12:21:47] <tzanger> in short, don't do it.
[12:22:00] <braincracker> can a small mild darkened area be fixed like massaging around it?
[12:22:10] <tzanger> I have my children trained with intense physical harm if they do anything but look at the TVs. :-)
[12:22:17] <tzanger> braincracker: highly unlikely
[12:22:52] <tzanger> if it's already damaged the worst you can do is damage it more
[12:23:04] <braincracker> pushing a calculator lcd display causes similar effects, but it resores mostly
[12:23:15] <BJfreeman> LCD is small cells that are connected by tiny wires once the cell is ruptured or the wires broken it is damages
[12:23:33] <braincracker> i was not talking about dark areas, only slightly darkened ares
[12:23:56] <braincracker> if a wire breaks then it will be black no?
[12:24:25] <tzanger> braincracker: there's a world of difference between a reflective simple monochrome calculator display and a high resolution TFT display
[12:24:36] <tzanger> you can't compare then
[12:24:37] <bsdfox> braincracker: you'll just make it worse if you mess with it
[12:24:39] <tzanger> them
[12:24:58] <tzanger> no you can short the wires too
[12:25:11] <tzanger> static discharge can also short or blow open the transistors on the glass
[12:25:41] <braincracker> so keep away the lighter's high voltage sparks
[12:31:34] <BJfreeman> LCD works by twisting the crystal cells, electrically. if the crystal lattice os stressed to much it will stay twisted or not at all
[12:31:54] <BJfreeman> is stressed
[12:32:06] <tzanger> kind of like people in that regard. :-)
[12:32:14] <tzanger> you push someone too far they can end up permanently stressed
[12:32:28] <BJfreeman> :P
[12:33:06] <BJfreeman> have to teach them Tai Chi
[12:36:22] <kdehl> Shit, I'm stuck.
[12:37:03] <kdehl> The computer has DOS 6.22 (which includes interlnk and intersvr), and laplink installed. Which since the floppy drive is broken, are the only ways for it to communicate with the rest of the world.
[12:37:19] <kdehl> But there seems to be no Linux software compatible with those protocols.
[12:38:21] <tzanger> there are IDE-to-compact flash inerfaces
[12:38:24] <tzanger> that would work
[12:38:28] <Xark> kdehl: copy /b COM1: somefile.com perhaps? :)
[12:38:44] <tzanger> edlin C:\myapp.exe
[12:38:46] <tzanger> be a real man :-)
[12:40:41] <kdehl> tzanger: It has a SCSI drive.
[12:41:03] <kdehl> Xark: Yeah, true... Do I dd /dev/TTYS0 or something on the Linux side?
[12:41:51] <kdehl> TTYUSB0 even
[12:42:01] <BJfreeman> do a search on SCSI to USB
[12:42:03] <Xark> kdehl: Something like that. Not sure if the protocol is transparent (may need to turn off XON/XOFF or something with MODE COM1: ...).
[12:42:16] <kdehl> Hm. Okay.
[12:43:01] <Xark> kdehl: I would try to xfer a small .COM communications program (and then use ZMODEM or something reasonable for the real xfers).
[12:43:25] <kdehl> Hm.
[12:43:58] <Xark> kdehl: Also, IIRC, DOS was flakey at over like 4800 baud. :)
[12:44:13] <kdehl> Gah.
[12:44:21] <kdehl> I need to transfer about 500 MB...
[12:44:35] <kdehl> I just want to boot another OS and then use PLIP.
[12:44:57] <Xark> Yes, this is why I suggest sending a real com program (which should go like 19.2Kbaud).
[12:45:03] <Xark> Maybe 38.4Kbps even...
[12:45:06] <kdehl> Ah.
[12:45:18] <kdehl> I thought you could go as high as 115,200.
[12:45:51] <Xark> kdehl: Only if it has modern UARTs (rare on older DOS machine - depending on vintage).
[12:46:04] <kdehl> It's a PS/2 model P75
[12:46:14] <kdehl> But it's probably crappy.
[12:46:35] <kdehl> Okay, I'm doing sudo 'cat /dev/ttyUSB0' on the Linux machine.
[12:47:00] <kdehl> Shouldn't I be able to just do 'echo whatever > com1' on DOS now, and recieve it on the Linux end?
[12:47:08] <Xark> kdehl: With slow baud rate it could work AFAIK. Double check the received file has the right size...
[12:47:50] <Xark> kdehl: Perhaps (although I would think copy /b would be better... I am worried you will have issues with ^Z = EOF etc. with a com program).
[12:47:59] <Xark> er, without
[12:49:49] <Xark> kdehl: If you get really stuck, you can use an AVR to emulate PS/2 keyboard and have it "type" a com program into the DOS debugger. :-D
[12:50:21] <kdehl> Haha
[12:50:39] <kdehl> Yeah... or buy another DOS machine. With a working floppy drive!
[12:51:11] <Xark> ...that may be easier (and points off if you can't find a giveaway machine free). :)
[12:52:00] <braincracker> somebody knows the usual limit of voltage for tft monitor power ?
[12:53:44] <kdehl> Hum hum hum... Nothing happens on the linux side...
[12:54:12] <kdehl> I do 'copy /b config.sys com1:', it says 1 cfile copied, but nothing is shown on the other end.
[12:54:16] <kdehl> Maybe the baud rate.
[13:39:34] <kdehl> Nope, I can't get this to work.
[13:39:47] <kdehl> 'sudo stty -F /dev/ttyUSB0 2400 -parenb cs8 -cstopb'
[13:40:01] <kdehl> That should be 2400 baud rate, no parity, 8 data bits, and one stop bit.
[13:40:44] <jobgg> hey, does anyone know a tutorial on avr makefiles?
[13:40:49] <kdehl> And on the DOS machine: 'mode com1:2400,N,8,1,N'
[13:41:09] <R0b0t1> jobgg, last time I asked that in here I stole somebodies make file
[13:41:19] <R0b0t1> barring someone else answering your question, one sec
[13:41:44] <BJfreeman> kdehl you need to specify the file source on the DOS and Destinatioh on linux
[13:43:17] <BJfreeman> http://www.nongnu.org/avr-libc/user-manual/group__demo__project.html
[13:43:44] <kdehl> BJfreeman: I copy a file to the COM1 port on DOS, as 'cp /b config.sys com1:', and on Linux I just 'cat /dev/ttyUSB0'.
[13:45:18] <BJfreeman> kdehl OK
[13:45:55] <R0b0t1> jobgg: http://pastebin.com/raw.php?i=XbHpjpgQ
[13:46:02] <R0b0t1> jobgg: Change names, should work.
[13:46:50] <R0b0t1> jobgg: Modify CFLAGS to point to proper include dir, and remove the -mmcu flag (oops)
[13:47:06] <R0b0t1> It should be -mmcu=$(MCU_TARGET)
[13:53:28] <jobgg> now I've been given a deadly makefile. I'm just afraid that I'll look into it's business end by accident, and blow my fuses off.
[14:27:15] <kdehl> Nope. It doesn't seem to be possible to load interlnk.exe as a driver in dosemu.
[15:01:01] <braincracker> http://www.desktopwallpaperhd.com/wallpapers/16/5532.jpg are you hungry yet? ;>
[15:07:52] <tzanger> lol
[15:11:29] <GuShH> braincracker: that bread looks very dry
[15:11:38] <GuShH> the whole thing looks dry as hell.
[15:12:02] <GuShH> what's that, a salad sammich with a lost and found slice of ham in the middle, rolled up for no good reason
[15:12:07] <GuShH> that's not how you make a sammich
[15:13:03] <GuShH> and you don't ever place the corners of a tomato where they can be seen, in fact you try not to use them at all. Jeez, amateurs.
[15:13:36] <GuShH> There's a reason why each ingredient is placed in a specific order!
[15:20:14] <Duality_> don't timers run at cpu speed?
[15:23:38] <Duality_> I though i could use timers to generate 38khz but seems it only goes to 31khz :)
[15:37:08] <specing> Hahahah Linux for Workgroups: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Makefile
[15:37:11] <specing> get it while its hot!
[15:37:35] <tzanger> haha
[15:37:36] <tzanger> linux 3.11
[15:40:31] <braincracker> Duality_ <= timers run at selected clock rate divided by prescaler
[15:43:52] <Duality_> is delay blocking for interupts ?
[15:44:16] <Duality_> braincracker: i know but when i don't select a prescaler, it outputs 31khz which is just short of 38khz :(
[15:45:11] <braincracker> don't prescale the cpu clock then, only the timer
[15:50:38] <Duality_> braincracker: i think i didn't with what do you prescale cpu ?
[15:53:43] <Duality_> hmm i think i need to redo the timer tutorial then :)
[15:54:16] <Tom_itx> a noob writing a tutorial?
[15:56:32] <Casper> Tom_itx: typical arduino tutorial
[15:57:13] <Duality_> Tom_itx: i meant redo as in the tutorial i found online i have to follow again :)
[15:57:28] <Duality_> not making a tutorial
[15:58:00] <inkjetunito> Duality_: is it an arduino tutorial or avr-libc?
[16:03:02] <Duality_> http://tom-itx.dyndns.org:81/~webpage/abcminiuser/articles/avr_timers_index.php
[16:03:50] <inkjetunito> Duality_: aah. good.
[16:03:53] <Duality_> but it's for a 16 bit, i think i can make it work for 8 bit too :)
[16:04:32] <Duality_> not new to arduino just new to avr :P (love the amount of controle i got now, and that the code size is really smaller then arduino's size)
[16:05:09] <Tom_itx> duh
[16:09:27] <Duality_> just a bit overwhelming though
[16:16:23] <Duality_> think it should be possible for me to generate 38khz though :) http://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=76870&start=0
[17:07:15] <braincracker> i have found the beckground of rpi http://www.desktopwallpaperhd.com/wallpapers/Perfect-Strawberry-117186.html
[17:09:11] <Flecks> strawberry != raspberry! :D
[17:25:06] <braincracker> hehe, more correct term ? http://www.desktopwallpaperhd.com/wallpapers/wallpapers-wallpaper-raspberry-raspberries-sweet-files-63260.html
[17:33:58] <Roklobsta> what gcc warning option will ensure things I declare using typedefs will be properly adhered to? If i have an enum type want warnings if the variable is set with a integer rather than the legal enumeration.
[17:35:28] <braincracker> not sure, i always do -Wall
[17:36:09] <Roklobsta> that';s one thing i like about Ada, super strict type usage.
[17:37:17] <braincracker> so far i have warnings for mostly everything
[17:37:47] <braincracker> i like to turn on all warnings, and make he code correct
[17:42:56] <Roklobsta> -Wshadow looked promising but it's not warning where i set Signal=0 instead of Signal=VALID_SIGNAL_ENUMERATION.
[17:45:06] <Xark> Roklobsta: Hmm, why would you expect a shadow warning on that? I believe shadow is (e.g.) where you have a global with the same name as a local (and local shadows global).
[17:45:56] <Roklobsta> -Wshadow Warn whenever a local variable or type declaration shadows another variable, parameter, type, or class member (in C++), or whenever a built-in function is shadowed. Note that in C++, the compiler warns if a local variable shadows an explicit typedef, but not if it shadows a struct/class/enum.
[17:46:21] <Roklobsta> hrm PEBKAC parse error.
[17:46:44] <Xark> Roklobsta: No worries.
[17:47:22] <Xark> braincracker: You can try -Wextra too (may be C++ only though and not sure wise on MCU). :)
[17:53:27] <Roklobsta> hmm,m it seems the handful of enumeration warnings are turned on by wall
[17:53:48] <Roklobsta> and at least it also lets you know if you missed an enumeration case in a switch staement.
[17:54:38] <Roklobsta> it'd be cool if GCC had a -WMISRA
[17:54:43] <Xark> Roklobsta: Yeah, that is a handy one IMO.
[17:54:50] <Roklobsta> http://en.wikipedia.org/wiki/MISRA_C
[17:54:56] <Roklobsta> for those uninitiated
[17:55:13] <Roklobsta> perfect sort of thing for avr
[18:06:31] <Roklobsta> http://splint.org/ might help
[18:07:23] <timemage> Roklobsta, doe split handle c99 code now?
[18:07:51] <Roklobsta> gunna find out. installing the windows split package now to play
[18:08:07] <timemage> Roklobsta, ok. it's been a very long time since i tried to use it.
[18:11:15] <Roklobsta> it's probably worth using.
[18:20:14] <Roklobsta> hmmm, lots of noise generated by split.
[18:20:18] <Roklobsta> need to RTFM
[18:26:33] <Roklobsta> interesting, splint was included in winavr http://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=88305&start=20
[18:28:02] <Roklobsta> it's not in the newer AVR toolchain from atmel
[18:29:25] <Roklobsta> i wonder how many head banging hours are wasted because splint isn't often used by AVRers.
[23:27:56] <Roklobsta> as per http://false.ekta.is/2012/05/static-analysis-for-avr-code-with-splint/ cppcheck seems good. splint was very noisy
[23:48:54] <Roklobsta> but split was very picky about scanf and printf arguments and use
[23:54:16] <Xark> I really like how gcc can error check format specifiers (making them semi-type safe). I have found lots of lurking issues using that on codebases without it.