#avr | Logs for 2016-10-30

Back
[03:09:44] <NicoHood> If i want to read the state of an output pin, do i need to read the PORT or the PIN? Or doesnt it matter?
[03:19:11] <Thrashbarg> PORT
[03:20:40] <Thrashbarg> if you want to read what it currently is (e.g. if it's shorted to ground) use PIN
[03:41:13] <_ami_> NicoHood: PIN
[03:42:09] <NicoHood> thx
[04:58:29] <Levitator> Ugh. Anyone understand the inline assembler syntax?
[04:59:39] <Levitator> input constraint [addr] "x" (addr) should bind %[addr] to X, Y, or Z, shouldn't it? So then I should be able to do "st %[addr], ...", but I can't. It says it's not X, Y, or Z. But I just specified that it is, so why is it bitching?
[05:00:00] <Levitator> Actually "e" binds to X, Y, or Z. "x" binds to X, specifically.
[05:00:20] <Levitator> Either way, it should work. But it works neither way. I have to say "st x,..." explicitly.
[07:56:37] <Lambda_Aurigae> posting to the avr-gcc list now eh LeoNerd ?
[08:14:10] <LeoNerd> Lambda_Aurigae: Have been for a while
[08:14:14] <LeoNerd> Occasionally
[08:15:23] <Lambda_Aurigae> hehe
[08:15:37] <Lambda_Aurigae> I just noticed it because it looked familiar to what you were talking about in here.
[08:59:47] <LeoNerd> If I want to use the MOSI pin as a GPIO pin to output a signal, can I do that while the SPI unit is enabled but not actually operating at this moment? I.e. can I override the pin? Or do I have to disable it, fiddle with the pin, then enable it again?
[09:00:08] <LeoNerd> I have a chip that needs a custom sortof-SPI-like protocol to talk to it, so electrically I can share the MOSI pin for its data input
[09:03:24] <twnqx> no
[09:03:41] <twnqx> you'd need to disable the unit
[09:03:46] <LeoNerd> Ah, boo
[09:03:53] <twnqx> iirc it's written in the datasheet
[09:05:45] <LeoNerd> I can just unset MSTR for a moment?
[09:12:06] <LeoNerd> Ah, SPE
[10:33:17] <LeoNerd> Woo. I do appear to have a nicely working little 4x4 crossbar matrix switch
[10:33:34] <LeoNerd> I'm able to arbitrarily remap GPIO pins out of the FTDI chip onto the pin connector
[10:33:50] <LeoNerd> (because FTDI can't seem to make up their minds what is in and what is out)
[13:03:47] <GeneralStupid> LeoNerd: have you thought about i²c its very easy, it just need two pins…
[13:40:53] <LeoNerd> GeneralStupid: ?
[14:42:32] <carabia> rue_house: you crazy redneck where are the prizes for the grand makefile competition?
[14:43:13] <carabia> cause i'm not gonna reveal my greatest make secrets for nothing y'all
[14:57:09] <twnqx> carabia: one day i should post my most convoluted abuse of make and see if people can figure out what it does :P
[14:59:18] <specing> best makefile would be the shortest one possible that invokes some other build system
[15:23:45] <carabia> specing: not to mention it should probably be written in ada...
[15:23:49] <carabia> ...right?
[15:24:23] <specing> carabia: yes
[15:24:47] <specing> my Ada programs use GPRBuild, which is configured in something resembling Ada
[15:33:52] <carabia> Thank you for the very useless tip
[15:34:45] <carabia> I can't remember did you ever answer my question as to have you actually ever used ada in any avrs or "embedded" applications apart from led-blinking?
[15:35:32] <carabia> or is this ada-interest academic in nature and therefore its usability questionable at best?
[15:35:54] <carabia> well usability... practicality rather
[15:39:42] <carabia> okay i had a backlog long enough, so it turns out you haven't...
[15:39:49] <carabia> nevermind, carry on
[15:40:59] <specing> useless how?
[15:41:13] <specing> carabia: I have used, but not embedded
[15:41:26] <specing> the hardest part of using Ada is getting a working toolchain
[15:41:36] <carabia> specing: yes. nodejs is *used*, but not with avrs either.
[15:41:37] <specing> I have a working one for x86 that I use
[15:41:41] <specing> none yet for avr
[15:41:55] <specing> well I have one, but it is missing basic stuff for blinking
[15:43:32] <carabia> i have hard time believing advocacies for practically anything unless the advocater (word, yes?) himself at least have proved the method true and tested
[15:44:14] <specing> considering that Ada has been developed for use in embedded?
[15:44:31] <carabia> that doesn't mean never to try anything new, just that for all purposes of advertisement one should probably have some experience with the thing in question
[17:36:22] <LeoNerd> PORTB |= _BV(PD2); <== I wonder what it would take to have gcc warn me of such mistakes
[17:53:44] <carabia> really not gcc's job to warn of a mistake like so
[17:53:50] <carabia> s/so/that
[17:54:18] <specing> LeoNerd: using Ada.
[17:54:33] <specing> specifically, gcc's Ada port.
[17:54:36] <carabia> I was waiting for him to chime in
[17:55:36] <LeoNerd> Another mistake (which gcc definitely isn't responsible for) is the fact that TI make a copy of NXP's PCF8574 chip, with -slight- differences. I was reading the wrong datasheet for it. The sheet says you don't need pullup resistors on the A0/1/2 lines. My chip does. :/
[18:00:19] <carabia> PORTB |= (1 << PD2) is syntactically correct, does not violate anything regarding C. It's your job to make sure your program is logically correct.
[18:00:26] <carabia> not gcc's
[18:01:32] <carabia> this is where specing will start his ada sermon, i'll ignore it as per usual
[18:03:15] <Lambda_Aurigae> I never found Ada useful on a full computer when I was forced to use it in the military in the 80s.
[18:04:19] <carabia> I think i'll write an ada interpreter in C for specing
[18:04:40] <Lambda_Aurigae> I prefer my C interpreter written in C
[18:04:51] <carabia> no, just so he can have a platform!
[18:06:19] <Lambda_Aurigae> we were forced to rewrite all our C and FORTRAN code into Ada in the late 80s/early 90s.
[18:06:42] <Lambda_Aurigae> two years of it then they dropped the requirement.
[18:07:31] <carabia> how long were you in the military then?
[18:07:37] <Lambda_Aurigae> 5 years
[18:08:11] <Lambda_Aurigae> the requirement came down in 1988...they dropped it in early 1990.
[18:08:56] <Lambda_Aurigae> the code compiled in Ada was not easier to read, it was no more efficient, and it was more prone to mistakes because we weren't used to using Ada at the time.
[18:10:34] <carabia> well the last argument is a matter of time but still to switch over it should have major advantages (and support) in my opinion.
[18:11:04] <Lambda_Aurigae> it should have, according to the powers that be who told us to do it.
[18:11:30] <carabia> which are? "we designed it, ergo you must use it"?
[18:11:35] <Lambda_Aurigae> but they tried to implement something on the sayso of a few geeky nerds without full knowledge of what that switchover entailed.
[18:11:40] <Lambda_Aurigae> pretty much.
[18:15:11] <carabia> i wonder if it can be done so that any jpeg saved in chrome would be autoconverted to baseline instead of that stupid bullshit webdev progressive jpeg
[18:15:33] <specing> 1988 Ada was very different to today's Ada
[18:16:00] <Lambda_Aurigae> C was different then too.
[18:16:53] <specing> not much
[18:17:17] <Lambda_Aurigae> what I use as C these days is pretty much what I used as C back then.
[18:18:13] <Lambda_Aurigae> but it has changed.
[18:18:28] <Lambda_Aurigae> specially with the advent of C++ and all the other derivatives.
[18:19:04] <carabia> fundamentally, no. But that also entails that there's been a lot of research gone into the development of C and its shortcomings and they're fairly well known.
[18:19:31] <carabia> C++ is a clusterfuck from hell
[18:19:54] <Lambda_Aurigae> agreed
[18:19:57] <specing> :D
[18:20:17] <Lambda_Aurigae> I pretty much find I don't need any high level language other than C.
[18:20:18] <carabia> i'm not sure if great bjarne stringsoup himself knows even the baseline functionalities completely
[18:20:57] <Lambda_Aurigae> augmented with processor specific assembly here and there.
[18:22:53] <carabia> hi Tom_shop so what's at stake in the makefile comp
[18:23:08] <Lambda_Aurigae> carabia, probably bragging rights.
[18:23:34] <carabia> 72 virgins cause i've got my avrs ticking, literally?
[18:23:34] <specing> you get publically shamed
[18:23:49] <specing> like "XYZ still uses Makefiles, ha ha ha ha"
[18:23:56] <Lambda_Aurigae> heck with the virgins
[18:24:00] <Lambda_Aurigae> it's 45 sluts.
[18:24:31] <carabia> i guess that's the american version
[18:24:47] <Lambda_Aurigae> trailer trash sluts to be exact.
[18:24:52] <carabia> 45 human rights activist -feminists
[18:25:07] <carabia> oh yes, well maybe that's the eu-version then