#avr | Logs for 2015-09-05

Back
[04:16:13] <_abc_> Hello. Am reading on FMUL and FDIV asm instructions. I can't believe there is no direct library (avr-libc) interface. Surely someone has done something like that already, but I can't find it?!
[04:27:40] <_abc_> Also, NO thanks to atmel.com for using the unserachable reserved fmul and fdiv mnemonics for those assembly instructions, when they are not at all floating point related
[04:28:19] <LeoNerd> _abc_: What is the thing that you are wanting?
[04:29:22] <_abc_> http://www.atmel.com/webdoc/avrassembler/avrassembler.wb_FMUL.html and FDIV more or less indirect support in avr-libc and or pointers to someone who already did it? Inline asm or otherwise? I am a little ticked off, yes, but not serious. It will pass. Thanks for answering LeoNerd
[04:29:49] <LeoNerd> AVR has some amusing instruction names though. I'm sure ORI is of great amusement to Stargate fans
[04:30:12] <_abc_> LeoNerd: Nothing beats SEX (65xx) and HCF (pdp
[04:30:13] <_abc_> )
[04:30:19] <LeoNerd> I'm not understamding. yoy aren't explaining, you are referencing
[04:30:27] <LeoNerd> Explain in words what yu want
[04:30:39] <LeoNerd> Don;t name a thing you think provides it
[04:30:40] <_abc_> LeoNerd: I am trying to optimize multiply and add pipes in a digital filter context
[04:30:53] <LeoNerd> Right. FMUL is indeed a multiply
[04:30:54] <_abc_> LeoNerd: Y=A+X*B
[04:31:11] <_abc_> And some coefficients are fractional binary, or, it is better if they are
[04:31:14] <LeoNerd> Right. that's often called MAC; multiply-and-accumulate
[04:31:18] <_abc_> Exactly
[04:31:34] <LeoNerd> AVR does not have one, but it does have 32 registers
[04:31:35] <_abc_> So are there any examples, avr-gcc related inline asm perhaps, using these?
[04:31:48] <LeoNerd> So you can do it in 2 instructions using MUL then ADD
[04:31:50] <_abc_> atmega168 has fmul fdiv
[04:31:54] <_abc_> iirc
[04:31:59] <_abc_> Others have it too
[04:32:07] <LeoNerd> Those are not multiply-and-accumilate
[04:32:09] <_abc_> Even atmega8 I think, not sure
[04:32:32] <_abc_> LeoNerd: they are the multiply with binary fixed point number part of mac
[04:32:37] <LeoNerd> FMUL and FDIV on AVR are instructions to perform fixedpoint multiply or divide
[04:32:50] <_abc_> yes the X*B part on mac
[04:32:53] <LeoNerd> It could be part of mac, if you wanted
[04:33:01] <LeoNerd> Sure; but that's just a multiply
[04:33:10] <_abc_> So, any nice examples in avr-gcc on how to use these?
[04:33:40] <LeoNerd> None I am aware of. You might have to do some asm("...") trickery
[04:33:58] <LeoNerd> C doesn't usually represemt fixedpoint types
[04:34:39] <_abc_> Yeah so you know no examples. Will wait some more, perhaps someone else...
[04:34:43] <_abc_> Thanks.
[04:46:25] <_abc_> Is anyone using sdcc with avr here?
[05:12:37] <Xark> _abc_: GCC seems much more reasonable to use with AVR vs SDCC. SDCC is good for 8051. and PIC. :)
[05:13:34] <_abc_> I know.
[05:13:44] <_abc_> See backlog about FMUL FDIV...
[05:44:35] <abcminiuser> I see an in-dev clang/llvm port for AVR, super excited if that ever gets finished
[09:27:48] <_abc_> imho FMUL and FDIV should be FIMUL FIDIV (Integer)
[10:35:57] <Jartza> not using sdcc nor clang
[10:36:03] <Jartza> I only use gcc and avra with avr
[11:55:36] <Jartza> I once thought to learn LLVM and start coding everything with it :)
[12:02:45] <Lambda_Aurigae> Jartza, I thought much the same with Ada years back.
[12:03:01] <Lambda_Aurigae> once I learned it I changed my mind.
[12:08:43] <_abc_> Lambda_Aurigae: hehe. Too complex?
[12:09:16] <_abc_> Programming by contract was supposed to solve everything. Then they had to update firmware in flight for space probes several times...
[12:09:36] <_abc_> At least it IS updateable, unlike core rope memory @moon landing.
[12:10:20] <_abc_> That was a feature! Only one bug and a non critical one @moon.
[12:11:44] <_abc_> http://thedailywtf.com/ the place where the results of "using X will solve all our problems" are documented
[12:33:02] <Lambda_Aurigae> _abc_, no, too useless.
[12:33:24] <_abc_> Well, there were several trials at embedded Pascal. Same outcome.
[12:33:40] <Lambda_Aurigae> military/DoD decided everything needed to be converted to Ada
[12:33:51] <Lambda_Aurigae> so we converted all our C, PASCAL, and FORTRAN stuff to Ada...
[12:34:06] <Lambda_Aurigae> buggy as hell due to the conversion process.
[12:34:11] <Lambda_Aurigae> and much of it ran much slower.
[12:34:35] <Lambda_Aurigae> finally the military relented and told us to use whatever language was best for the situation
[12:34:41] <Lambda_Aurigae> which is what we had been doing in the first place.
[12:35:19] <_abc_> The latest I know of was for pic target, called http://jal.sourceforge.net/ ; which actually works and I met the author online too. But it ended up being a niche.
[12:35:36] <Lambda_Aurigae> jal was interesting.
[12:35:41] <_abc_> Lambda_Aurigae: The best thing that happened due to your DoD was VHDL being mandated in hw/sw designs
[12:35:45] <Lambda_Aurigae> I played with that like, 10 years ago or so.
[12:36:00] <_abc_> Now THAT has a future, once compilers get more accessible (<$10k/yr seat)
[12:36:06] <Lambda_Aurigae> I chatted with Wouter years ago.
[12:36:16] <_abc_> You were on the piclist?
[12:36:22] * _abc_ still is
[12:36:28] <Lambda_Aurigae> I was, years ago.
[12:36:36] <Lambda_Aurigae> I started in microcontrollers with pic.
[12:36:50] <Lambda_Aurigae> then switched to avr when I couldn't program the new pic chips with my pic programmer hardware.
[12:36:53] <_abc_> Ah. 16c54 otp?
[12:37:01] <Lambda_Aurigae> not that far back.
[12:37:07] <Lambda_Aurigae> like 2002 or so.
[12:37:16] * _abc_ started before that but that was the 1st self contained one with no external rom
[12:37:31] <_abc_> I still have the self designed programmer, parallel port.
[12:37:36] <Lambda_Aurigae> I was programming long before that, just not self-contained microcontrollers.
[12:37:39] <_abc_> The design, not the actual build.
[12:37:49] <Lambda_Aurigae> I have a k149 pic programmer that was very limited..my first one.
[12:38:11] <Lambda_Aurigae> then a few years back I got a pickit3 which does pretty much everything in the pic world.
[12:38:22] <Lambda_Aurigae> in between I did avr for years and barely touched pic.
[12:38:32] <Lambda_Aurigae> I also do 8051/8052 stuff here and there.
[12:38:47] <_abc_> Yeah so everyone did a little this and that.
[12:38:54] <_abc_> 8085 even
[12:38:57] * _abc_ blinks
[12:38:57] <Lambda_Aurigae> and, in between, I make grape jelly! which I'm doing right now.
[12:39:04] <_abc_> Hehe
[12:39:18] <_abc_> http://www.neowin.net/news/asuss-rt-ac5300u-is-a-new-ac-router-that-is-as-wicked-as-it-looks posted in some other channel I'm on
[12:39:32] <_abc_> All you need is 8 rotors and fly that over crowds to control their minds
[12:40:48] <Lambda_Aurigae> my current wifi router here is a tiny linux box with a gigabit connection and a pair of usb wifi adapters in it.
[12:41:24] <_abc_> Heh. You couldn't get a proper openwrt hacked box like everyone else, right? ;)
[12:41:27] <Lambda_Aurigae> it boots off an 8GB usb stick and has 2GB of ram and runs debian.
[12:41:32] <Lambda_Aurigae> of course not.
[12:42:02] <_abc_> brb
[12:42:15] <Lambda_Aurigae> runs a 1GHz atom processor and does everything I need on a router
[12:43:44] <_abc_> http://thedailywtf.com/articles/The-Key-Lock-Box ...
[12:59:43] <milk_base> https://www.youtube.com/watch?v=rLNYhWpdSOo <--- #chan
[13:02:06] <Lambda_Aurigae> now now..
[13:02:11] <Lambda_Aurigae> we can't use the N word here.
[13:02:16] <Lambda_Aurigae> they are Basketball-Americans
[13:02:45] <_abc_> Well the A word is worse. Arduino...
[13:02:52] * _abc_ looks around the channel fearfully
[13:03:04] <Lambda_Aurigae> now you are on thin ice there dude.
[13:03:09] <Lambda_Aurigae> Ardweeny.
[13:03:21] <_abc_> Lambda_Aurigae: How much did you invest in your fancy little router, and why 2 usb wifi sticks in it?
[13:03:39] <Lambda_Aurigae> I invested all of nothing.
[13:03:54] <Lambda_Aurigae> it's an acer aspire one netbook with a pair of wifi sticks.
[13:04:06] <Lambda_Aurigae> was given to me.
[13:04:15] <_abc_> I mean, how much is it worth. Just asking. Given that an openwrt capable router can be had new and boxed for $20 and some change where I am.
[13:04:22] <Lambda_Aurigae> one is for me to access and one is for everybody else in the house.
[13:04:30] <Lambda_Aurigae> dunno.
[13:04:35] <_abc_> Okay.
[13:04:46] <Lambda_Aurigae> but I bet your openwrt capable router doesn't have a 10 inch display on it!
[13:05:03] <_abc_> Nor does it need one...
[13:05:05] <Lambda_Aurigae> all of it is scrounged or free.
[13:05:14] <_abc_> So it runs for ~5 hours on a 12V sla backup battery...
[13:05:42] <Lambda_Aurigae> with the monitor off I get about that on the built in battery.
[13:05:50] <_abc_> Interesting.
[13:06:09] <Lambda_Aurigae> when it was new I got close to 8 hours of useful working life from a similar netbook.
[13:06:25] <_abc_> Not under Windows probably
[13:06:28] <Lambda_Aurigae> that one I still use on a daily basis but the battery is down to about 2 hours useful life nowadays.
[13:06:31] <Lambda_Aurigae> oh hell no.
[13:06:39] <Lambda_Aurigae> I haven't run windows on anything of my own since 1999.
[13:06:50] <Lambda_Aurigae> other than the occasional virtual machine to check something out.
[13:07:07] <_abc_> I was kidding on another channel that m$ will soon come out with quick tea boiler phones. Turn on indexing feature, use to stir water in cup.
[13:07:41] <Lambda_Aurigae> unfortunately, mickysoft has gotten better at power management over the last 10 years.
[13:08:04] <Lambda_Aurigae> microsoft=truth in advertising?
[13:08:10] <Lambda_Aurigae> small and squish.
[13:08:12] <Lambda_Aurigae> squishy.
[13:08:42] <Lambda_Aurigae> I just hate them as a company from back about 18 years or so ago when I applied for a job there.
[13:09:51] <Lambda_Aurigae> they would have hired me for the job except for the fact that the job "required" that I have a 4 year degree,,,not in programming which is what the job was but in SOMETHING...
[13:12:13] <_abc_> microshit and truth in one sentence? Remove the mistake.
[13:12:37] <_abc_> That being said, I found one of their original famous 8 bit basic interpreters online somewhere on an antique embedded site.
[13:12:47] <Lambda_Aurigae> hehe.
[13:12:48] <_abc_> That was likely the 1st and last good product they made.
[13:13:07] <Lambda_Aurigae> I have some old technet CDs with the entire pile of everything 16Bit from way back when on them.
[13:13:52] <_abc_> Didn't m$ require the 4 year degree up front? Before you went to interview?
[13:13:56] <Lambda_Aurigae> a big binder with a couple dozen CDs with every product microsoft had at the time.
[13:14:15] <Lambda_Aurigae> there was nothing in the job requirements.
[13:14:20] <_abc_> Cute
[13:14:34] <_abc_> Did they call you at your current work to tell you they don't want you too...
[13:22:50] <Lambda_Aurigae> no...I went out for the interview..when it was all said and done, almost, I went to HR because the manager wanted me hired immediately.
[13:22:59] <Lambda_Aurigae> the HR droid looked at the paperwork and asked me where I went to school.
[13:23:16] <Lambda_Aurigae> when I told them I didn't have a degree they said I couldn't do the job without a four year degree.
[13:23:33] <Lambda_Aurigae> the manager ranted and raved,,,they wouldn't budge,,,so I told them where to put the job.
[13:23:52] <Lambda_Aurigae> in 1998, this job started at 75K USD a year.
[13:24:26] <Lambda_Aurigae> it would have required I move to washington
[13:24:34] <Lambda_Aurigae> but, hell, I had nothing better to do with my life at the time.
[13:33:37] <_abc_> Neat.
[13:33:58] <l_oliveira> sorry about breaking into your conversation, but I have a (unrelated) question
[13:34:29] <l_oliveira> is there a project about using those "1chip cameras" taken from scrap cell phones with AVR MCUs ?
[13:34:47] <l_oliveira> has anyone tried that yet?
[13:35:26] <_abc_> l_oliveira: no, but there is with ARMs and with larger embedded boards, like rpi etc
[13:35:51] <_abc_> www.amazon.com/Raspberry-5MP-Camera-Board-Module/dp/B00E1GGE40 etc etc
[13:35:53] <l_oliveira> I see... What I am looking for is information about these cameras
[13:36:06] <l_oliveira> how they work, for example.
[13:36:08] <_abc_> That is available, especially see above (track it down)
[13:36:24] <_abc_> The code requires typically huge pieces of ram, which the atmegas do not have
[13:36:39] <l_oliveira> I saw some modules at sparkfun which had LCDs from nokia phones being used with Arduinos
[13:36:46] <l_oliveira> which is how I thought of asking that
[13:37:10] <_abc_> arduino has at most about 4k ram on chip
[13:37:17] <_abc_> of 2560iirc
[13:37:25] <l_oliveira> well, the phones became obsolete but the LCDs are pretty much still usable
[13:37:34] <l_oliveira> so are the cameras
[13:37:55] <_abc_> yes but a lcd does not need a backing buffer or a frame buffer. The lcds which DO need that, again, work with rpi and ARM based boards.
[13:38:03] <_abc_> Atmel makes ARMs among others.
[13:38:06] <l_oliveira> I took a small color LCD from a Nokia 3205 and I would like to make use of it
[13:38:35] <_abc_> https://www.raspberrypi.org/documentation/hardware/camera.md find the ds for OmniVision OV5647
[13:38:39] <l_oliveira> well I understand what you mean, and thanks for the pointers
[13:39:02] <_abc_> l_oliveira: that IS possible, 3205 and other lcds which do not need a backing store and live refresh can be used with duino and avr
[13:39:35] <l_oliveira> yeah, those are not "raster" LCDs like panels used on VGA monitors
[13:39:51] <_abc_> They are raster but they have internal ram frame buffers
[13:40:26] <_abc_> Just for laughs, compute the data rate for QVGA b/w at 15fps and see how an avr could work with that.
[13:40:30] <l_oliveira> non raster ones are strictly character based, right?
[13:40:38] <_abc_> No! They are graphical
[13:40:55] <_abc_> l_oliveira: Since this is arduino related, why not ask in #arduino?
[13:41:14] <l_oliveira> I am looking for information on the devices
[13:41:28] <l_oliveira> you already gave me the pointers :)
[13:41:36] <_abc_> I think there is a 'camera shield'... it probably has an ARM cpu in it too >;)
[13:41:59] <l_oliveira> I just thought of asking for "arduino people" as they would likely have a idea about it
[13:42:19] <_abc_> Anyway QVGA has 77kpix/frame, easily 10 times the ram in a normal large avr.
[13:42:32] <_abc_> l_oliveira: type 'camera shield' into google
[13:43:13] <_abc_> http://www.arducam.com/tag/arduino-camera-shield/ l_oliveira there are several
[13:43:18] <l_oliveira> anyway, those cell phone cameras all use a standard protocol, right?
[13:43:22] <_abc_> no
[13:44:04] <_abc_> l_oliveira: note the device ids in the left hand bar 'tag soup'
[13:44:15] <_abc_> l_oliveira: follow up on those to find datasheets libs etc
[13:45:09] <l_oliveira> this camera has "560A" written on it's back
[13:45:50] <l_oliveira> such a puny tiny component doesn't even have space in it for the manufacturer to put a proper logo into haha
[13:48:52] <_abc_> Find out what phone it came from
[13:48:59] <l_oliveira> oh, it's a "vga camera"
[13:49:06] <l_oliveira> it's a nokia 3205
[13:49:17] <Lambda_Aurigae> the LCD displays have their own controller and video ram...you just send drawing commands.
[13:49:36] <Lambda_Aurigae> you don't have to constantly refresh them, just send the data.
[13:50:06] <Lambda_Aurigae> the cameras, however, do one shot and have to upload the data to the computer/microcontroller.
[13:50:23] <Lambda_Aurigae> some might have a small framebuffer of up to 16 frames but those get rather pricy.
[13:51:18] <l_oliveira> well considering the phone was already on the cheap side when it was new lol
[13:51:26] <l_oliveira> I bet it only does stills
[13:51:40] <l_oliveira> or has a catch like
[13:51:47] <l_oliveira> only do motion at 320x240
[13:52:21] <l_oliveira> going to try ID it
[13:52:23] <l_oliveira> thanks
[14:07:53] <l_oliveira> wow there's so many different interface types for phone cameras
[14:55:25] <Lambda_Aurigae> l_oliveira, yup....
[14:55:36] <Lambda_Aurigae> about as many as there are manufacturers...maybe twice that many even.
[15:28:06] <Jartza> evening
[15:29:04] <Lambda_Aurigae> morning Jartza
[15:29:13] <Jartza> hi
[15:30:33] <Lambda_Aurigae> anything new and/or interesting today?
[15:31:01] <Lambda_Aurigae> we just made a gallon of grape jelly here.
[15:37:14] <Jartza> nothing, 8th day ill :(
[15:37:32] <Jartza> very persistent flu of some kind
[15:37:34] <Jartza> and bronchitis
[15:37:35] <Lambda_Aurigae> drink plenty of fluids
[15:37:42] <Lambda_Aurigae> take tylenol or ibuprofen
[15:37:44] <Jartza> been doing that and taking my antibiotics
[15:37:48] <Jartza> and ibuprofen
[15:37:51] <Lambda_Aurigae> and your antibiotics.
[15:37:52] <Jartza> and zinc and vitamins
[15:37:59] <Lambda_Aurigae> keep fed too.
[15:38:06] <Lambda_Aurigae> that's something most people miss.
[15:38:18] <Lambda_Aurigae> don't feel like eating.
[15:39:43] <Jartza> yeah, don't feel like eating but I've been forcing myself
[19:38:15] <milk_base> does anyone know if it's safe/okay to have multiple PDO connections at the same time to the same database?
[23:07:31] <aandrew> abcminiuser: ping