#avr | Logs for 2016-08-01

Back
[01:21:09] <_abc_> Hello. Can someone please tell what the intended use of the T bit in SREG in avrs is? I can't really tell if it is "important" in any way or just something they could do and did.
[01:33:46] <Jartza> _abc_: it's user-defineable flag which can be used as... well, flag
[01:33:53] <Jartza> good for moving single bit around
[01:35:04] <Casper> they probably had some space left, and decided to put it there with the intent of saving memory... I doubt it is used much, if at all
[01:35:35] <Jartza> I use it quite a lot
[01:35:47] <Jartza> and floating point routines use it too
[01:45:18] <Jartza> but yeah, probably they put it there because they could :)
[01:56:56] <_abc_> Ok. Was just trying to understand if it's hardware special in some way.
[01:57:41] <_abc_> The V 2's cpl overflow bit is hard to understand. Any good explanations you know of please? Besides the sparse use of the bit in the AVR Addressing Modes/Instruction Set doc
[02:02:45] <_abc_> So 2's cpl overflow bit V actually is a 2's cpl ofl for *signed* integers on 7 bit + sign, right? Sigh.
[02:03:47] <_abc_> It's like they hurt to say "signed int 8 bit". Only clue is " Two?s complement overflow occurs if and only if Rd was $7F before the operation." . Seriously, is the word "signed" verboten?
[02:04:13] <_abc_> This is from INC instruction description.
[02:09:23] <_abc_> I think I still don't understand V vs N. Used only C on avr so far, time to move to asm.
[02:11:42] <_abc_> So V records any overflow while doing signed int arith in an 8 bit register, where the overflow can "disappear" before the operation is finished, for signed numbers as 7 bit + 1 sign ? More or less?
[02:12:39] <_abc_> Yes this seems to be it. Sigh.
[02:13:56] <_abc_> Okay, time to move on in 10 minutes. Thanks for listening to my ramblings ;)
[12:03:43] <_abc_> .
[12:05:03] <_abc_> Erm in the context of stk200 programmers and pci io cards on linux, they work but setup is far from automatic. One needs to pass parameters to modprobe parport_pc, reading them manually from dmesg. Surprizingly I found no trace of related messages on searches on duckduck or google. Surely I am not the 1st one to notice this little problem? Anyway I solved it.
[12:05:48] <LeoNerd> Mmm.. parallel ports
[12:05:50] <_abc_> So, do you people have a link to a tutorial explaining how to install / support detected multi io PCI cards on linux, related to using parallel and serial port programmers for avr and not only?
[12:05:58] <LeoNerd> I stopped caring about those around the time I got a computer with a USB port
[12:06:04] <LeoNerd> Which is to say... 12 years ago. :)
[12:06:40] <_abc_> Yeah LeoNerd in despite of all the crap being foisted upon us, parallel ports are very useful. Think of them as a direct pipe to a quad core 2.5GHz 4GB ram >500GB disk "microcontroller" running a Unix variant not called Unix.
[12:06:49] <LeoNerd> Sure
[12:06:56] <LeoNerd> I just don't hang those on the PCI bus directly
[12:07:03] <LeoNerd> If I wanted a 1284 port I'd use a USB-1284 bridge
[12:07:04] <_abc_> Iow whatever shitty little c**p comes on expensive usb boards this thing can fly hoops around it.
[12:07:36] <_abc_> Also am going to insulate the spi bus to the target using a Si8842.
[12:08:45] <_abc_> Now, the surprizing part is, I could not find relevant info on searches even 10 years ago!
[12:10:04] <_abc_> Now if I could only find out where I put my new photosesitized well packaged pcb I wanted to use today instead of the 4 year old one which I ended up using. And if I'd be able to break both hands of whoever unscrews my gas soldering iron's head now and then, perhaps looking for drugs or whatever.
[12:11:10] <_abc_> My soldering iron is not a crack pipe heater damnit. The fun of living "downtown" with interesting neighbors I am not interested in.
[12:11:37] * _abc_ is really pissed since everthing that could break, did today.
[12:12:51] <_abc_> Even the aircon remote insists in setting 26C when I set it to 24 yesterday. Advice: do NOT buy "intelligent / 6th sense / ambient enabled" anything. It will try to outthink you and is probably designed by idiots or by ones made to toe the line by their boss.
[12:13:10] <_abc_> Abient "fucktards". brbr
[12:19:43] <_abc_> Board gone without a trace. Am going to set up a camera for auto recording in my work area. Should have done it a long time ago.
[12:20:40] <_abc_> Back to avr & co. Are there any "structured assembly" approaches to avr programming? Or were there? (10 years ago etc?)
[12:21:36] <aczid> structured?
[12:21:50] <aczid> you're just limited by the machine...
[12:21:57] <aczid> nothing else except your imagination :P
[12:23:10] <_abc_> There used to be macro systems which "eased" programming control flows and the like. I am asking if anyone saw such a thing. Now or 10 years ago or... . I learned programming using both theory and practice and I remember https://en.wikipedia.org/wiki/Ratfor and other things which shaped the way I think. Been doing asm for 8080/85 Z80 and pic for >>20 years
[12:23:50] <aczid> can you still think after 20 years of 8080/Z80/PIC ? :P
[12:23:51] <_abc_> I am new to avr asm, I did it only in C until now, with tiny inline asm snippets, but now I need to get a very cost sensitive project going on a tiny and I probably need asm because C does not fit, I tried.
[12:24:05] <_abc_> aczid: yes because I did than in parallel with C...
[12:24:11] <aczid> ah okay :)
[12:24:21] <_abc_> But the thing that kept me current was tcl and wish ;)
[12:24:21] <aczid> well in my experience GCC has gotten a lot better too
[12:24:37] <_abc_> Yes compilers are much much better than say 10 years ago.
[12:24:44] <aczid> check out -flto for example, it makes a huuuuge difference
[12:24:49] <aczid> (link time optimizer)
[12:24:57] <aczid> it can basically inline your code between .o files
[12:24:59] <_abc_> They still spew crap in some instances, see sdcc pic14 port which I have dealt with recently, I made a patch for it.
[12:25:11] <_abc_> aczid: avr-gcc -flto?
[12:25:14] <aczid> yes
[12:25:17] <aczid> I only have little experience with sdcc, it's a bit spartan
[12:25:20] <_abc_> Interesting. I will try it.
[12:25:27] <_abc_> spartan is a polite euphemism.
[12:25:32] <aczid> hehe
[12:25:37] <aczid> as long as it works :)
[12:26:25] <_abc_> What version of avr-gcc does that require please?
[12:26:36] <aczid> I'm not sure
[12:26:38] <aczid> I use 5
[12:26:40] <aczid> .something
[12:26:45] <_abc_> I think I have 3 or 4
[12:26:54] <aczid> oh no, 4.9.2 here
[12:26:56] <aczid> as 'stable'
[12:27:14] <_abc_> 4 is gpl v3? Then I have 3.x
[12:27:16] <_abc_> I think.
[12:27:32] <aczid> err, I didn't keep up with license wars. sounds possible
[12:28:32] <aczid> anyway I don't know what would be a good way to structure a huge ASM project
[12:28:40] <aczid> I think most people's advice would be: don't :P
[12:28:50] <_abc_> Lately I found that a lot of pdf datasheets from microchip and others have some pdf errors inserted by the adobe distiller. gs/kpdf etc older versions choke on the error, and I have to run ps2pdf manually to rewrite the pdf so it can be viewed. My old version of gs + ps2pdf shows the error, but the new versions do not. I asked in #gs-devel here on freenode and I was snubbed!
[12:29:04] <aczid> ratfor looks interesting and historically relevant hehe
[12:29:17] <aczid> but I don't think these glued on layers will really make your code better
[12:29:20] <_abc_> ratfor was used to teach control flow and structuring in cs courses
[12:29:24] <aczid> just easier to write
[12:29:29] <_abc_> Without the fortran part.
[12:29:37] <aczid> aha
[12:29:48] <_abc_> And one way to use it is to define some macros which implement control flow statements.
[12:31:11] <_abc_> I think I have some crack addict in the house, several people live here. I have no other explanation for the interest in well wrapped packages (the photosensitive board) and gas powered soldering irons.
[12:31:16] <_abc_> F* hell.
[12:32:36] <_abc_> Now I notice that what I learned as ratfor does not resemble much what the article on wikipedia shows.
[12:33:44] <_abc_> http://sepwww.stanford.edu/doku.php?id=sep:software:ratfor here's a more terse and to the point description
[12:38:22] <_abc_> iirc in reality there was at least one variant which used indented curly brace less code, reminiscent of python today.
[12:38:44] <_abc_> http://www.avrfreaks.net/forum/how-add-structured-control-flow-any-assembler aha getting something
[12:39:14] <aczid> my prediction: this will generate way way worse code than modern gcc will from actual C, say C99
[12:39:34] <aczid> Let's face it C is just a grown up macro language on top of assembler really isn't it?
[12:39:37] <aczid> from this thread
[12:39:49] <_abc_> Sure but in some tiny things when you don't have a choice you can and I will use some sort of simplifed macro flow control.
[12:39:49] <aczid> I agree completely. C is portable assembly
[12:40:04] <aczid> voltaile asm("hacks");
[12:40:20] <_abc_> Yes but C got lost in the woods with types and worse. B would be nicer here...
[12:40:27] <aczid> idk, it sounds like trying to hammer a square peg into a round hole
[12:40:36] <_abc_> I wonder if B can still be used and if a gcc frontend for B ever existed.
[12:40:50] <_abc_> aczid: it's more like hammering a large peg into a tiny hole
[12:40:52] <aczid> man, you are showing your age :P
[12:40:59] <aczid> B is well before my time
[12:41:05] <_abc_> Hush now. I felt younger for a moment there.
[12:41:10] <aczid> sorry :)
[12:41:25] <aczid> once again I am very impresed with GCC's ability to squash down code
[12:42:07] <_abc_> Yes I have to remember to re-read and activate all the pragmas when I need the damn vars I put in a subr there for inline asm, not optimized out damnit.
[12:42:18] <_abc_> Otherwise gcc makes my code disappear.
[12:42:21] <_abc_> sdcc too btw
[12:42:50] <aczid> _abc_: __attribute__((used))
[12:43:00] <_abc_> Yeah that does not work in sdcc (yet)
[12:43:02] <aczid> but gcc is also cleverer in seeing what gets used these days
[12:43:04] <aczid> i know
[12:43:33] <_abc_> Sometimes I add params to a function because that's a way to reserve local vars in the subr for inline asm use.
[12:43:51] <_abc_> sdcc makes them vanish if I leave it on automatic.
[12:44:04] <_abc_> Anyway sdcc does not target avr yet.
[12:44:45] <aczid> I think the only C compiler worth anything for AVR is gcc
[12:44:52] <aczid> it's also what Atmel built their tools on
[12:45:02] <aczid> there is lvvm-avr in progress
[12:45:19] <_abc_> Yes gcc had a lot of input and polish over the years so it is now the best tool for avr I think.
[12:47:59] <_abc_> https://www.routledge.com/Some-Assembly-Required-Assembly-Language-Programming-with-the-AVR-Microcontroller/Margush/p/book/9781439820643 anybody knows this book?
[13:07:18] <_abc_> wow I found the lost board
[13:29:25] <_abc_> Still don't know how the gas soldering iron head came off and went back on loosels and at wrong angle.
[13:29:41] <_abc_> *loosely. Will make that auto camera work soon. I have to, I'm going insane.
[13:31:33] <_ami_> _abc_: yes, i read few chapters of this book.
[13:31:39] <_ami_> Its a very good book.
[13:31:50] <_abc_> _ami_: thanks. The price is a little insane but okay.
[13:32:04] <_ami_> yes, pretty costly :/
[13:32:19] <_ami_> the author is no more in this world..
[13:32:25] <_abc_> Oh.
[13:32:30] <_ami_> :(
[13:32:31] <_abc_> 2011 book though.
[13:32:34] <_abc_> Not too old.
[13:32:55] <_ami_> yeah, but sadly he died little bit early. :(
[13:34:49] <inkjetunito> who :o
[13:35:15] <_ami_> _abc_: https://books.google.co.in/books?id=tbfMBQAAQBAJ&pg=PR5&lpg=PR5&dq=Timothy+S+Margush+died?&source=bl&ots=7fqaOq7IO5&sig=pbCUDQzLo6ZsorDev76c2QWE2Rs&hl=en&sa=X&ved=0ahUKEwj7qbG256DOAhWEvY8KHfu1D8wQ6AEIJzAC#v=onepage&q=Timothy%20S%20Margush%20died%3F&f=false
[13:35:32] <_abc_> oh $deity the link
[13:36:04] <_ami_> inkjetunito: the author of AVR ASM book "Some assembly required"
[13:36:19] <_abc_> Okay nice. I assume it was an accident?
[13:36:49] <_ami_> https://www.uakron.edu/bcas/about-us/news-detail.dot?newsId=2194485&pageTitle=UA%20News&crumbTitle=Margush+book+published+posthumously
[13:36:51] <_ami_> not sure,
[13:37:08] <_abc_> Thanks for the info.
[13:47:35] <_abc_> Does cflow work on avr-gcc? I once patched lclint so it would work on embedded code. The patch is at peter5.50webs.com/free
[13:47:56] <_abc_> I am interested in every little bit of help I can lay hands on with embedded C eh
[13:48:17] <_abc_> Err splint not lclint.
[13:48:31] <_abc_> 2012
[13:59:20] <_abc_> Basically splint and cflow can use some minor parser extensions to accommodate avr-gcc and sdcc extensions, they tend to be very useful to make sense of existing code.
[14:06:04] <_abc_> So, has anyone else got links to standard static C analysis tools to be used with avr-gcc or sdcc please?
[14:14:31] <_abc_> ...
[14:14:47] <_abc_> Ok, I get the point. Silence is golden ;)
[14:16:52] <inkjetunito> just don't tell anyone when it sucks
[14:17:15] <inkjetunito> oh. he went
[20:10:10] <carabia> I really am not sure what the hell's that style used in fatfs source
[20:10:24] <carabia> imho that's seriously hard to read
[20:15:47] <Casper> fatfs is a microsoft thing, maybe they wrote their code in the microsoft style?
[20:16:37] <Lambda_Aurigae> microsoft...truth in advertising?
[20:23:54] <carabia> Oh, well, yeeea that's misleading... I meant elm chan's fatfs
[20:24:42] <Casper> someone that added the -chan to his own nick? considered rude by japanese standard :D
[20:28:23] <carabia> it says elm by chan or whatever. I'm not an expert on chinks, gooks, zipperheads or the likes.
[20:30:10] <timemage> Casper, i've heard of that being done before. like they want to make it part of their persona.
[20:30:18] <Casper> ah elm by chan and not elm-chan
[20:36:42] <cehteh> why is -chan rude?
[20:37:02] <cehteh> -dono maybe :)
[21:05:52] <Casper> cehteh: -chan -san -kun -sama basically tell the "rank" between the people
[21:06:01] <Casper> sama is kinda like master
[21:06:09] <cehteh> i know
[21:06:16] <cehteh> but -chan is rather harmless
[21:06:35] <cehteh> you should not call your boss "boss-chan" of course :)
[21:06:36] <Casper> -chan denote a kid or someone you cherish
[21:07:10] <cehteh> if someone denotes himself -chan .. its a bit silly, but ok