#avr | Logs for 2016-12-06

Back
[01:47:56] <_ami_> Is late binding (c++) supported in avr-g++? does it work well?
[05:08:00] <skz81> _ami_, what do you mean "late binding" ?
[05:08:23] <_ami_> skz81: virtual stuffs in cpp.
[05:08:28] <_ami_> fancy stuffs :P
[05:09:17] <skz81> hum on wikipedia i find "late binding" to be a synonym of "dynamic" binding.
[05:09:38] <skz81> then "shared objects" AKA DLLs in M$ world
[05:09:52] <skz81> unsure what you want to do with that
[05:10:05] <skz81> 'virtual' thing is not related
[05:10:22] <skz81> (if talking of methods vs class inheritance)
[05:10:57] <_ami_> umm.. well, the book i referred to read on Cpp talks abt late binding which is virtual thing in cpp.
[05:11:11] <_ami_> its long time back ago though.
[05:11:26] <_ami_> i think it was "Thinking in C++, vol 1"
[05:12:25] <_ami_> skz81: http://www.learncpp.com/cpp-tutorial/124-early-binding-and-late-binding/
[05:13:31] <_ami_> skz81: https://en.wikipedia.org/wiki/Late_binding#Late_binding_in_C.2B.2B
[05:13:40] <_ami_> i was right!
[05:14:29] <skz81> _ami_, ok my bad, read too quickly
[05:14:31] <_ami_> :D
[05:14:51] <skz81> From what I know : virtual method is OK on AVR
[05:15:02] <_ami_> aha, nice.
[05:15:19] <skz81> Indeed it's only a bunch of pointers at the end of your object
[05:15:29] <_ami_> please i plan to write a set of widget toolkit for avr which can be used for TFTs
[05:15:40] <skz81> BUT exceptions are NOT supported
[05:16:01] <_ami_> don't need exceptions. hated it :)
[05:16:16] <_ami_> cool fact to know that virtual works!
[05:16:59] <skz81> Did you ever wonder what happends when you declare a method both "virtual" and "inline" ?? ;°)
[05:25:47] <sabor> _ami_: function pointers work fine on avr so i guess the C++ stuff works too
[05:29:18] <specing> ya'll need more Ada :)
[05:29:57] * specing still doesen't have a working avr ada toolchain though....this thing is extremely hard to get going
[05:30:31] <GeneralStupid> but c++ has a different compiler -.- i would not agree with "c++ is just function pointers in C"
[05:31:39] <GeneralStupid> and i wouldnt use inline too much. I like it, but it does not mean that the compiler inlines that function
[05:32:04] <GeneralStupid> its only a suggestion to the compiler that he might inline that function
[05:32:11] <specing> why not?
[05:32:30] <specing> suggesting inlining means there is no harm done
[05:32:54] <GeneralStupid> yes thats right.
[05:32:55] <specing> the compiler is still free to choose (unless you specifically tell it to respect that)
[05:33:09] <GeneralStupid> but the compiler is already able to inline functions without inline keyword
[05:33:39] <GeneralStupid> specing: i like the 'inline' keyword. But if i want to force inlining i still use preprocessor macros
[05:33:50] <specing> lol
[05:34:03] <specing> > macros > 2016
[05:34:05] <GeneralStupid> specing: they work and iam old
[05:34:30] <specing> they "work"
[05:34:45] <specing> you don't get type protection though
[05:34:55] <specing> which is fairly weak in C to begin with
[05:35:14] <_ami_> GeneralStupid: there is some fancy/alien looking gcc prefix you can use to force compiler to make function inline.
[05:35:27] <GeneralStupid> yes. And it's a conflict with myself. abstraction which nobody really understand vs. non readable macro fancyness
[05:35:58] <GeneralStupid> _ami_: yes :) but thats another thing... forcing a specific compiler
[05:36:02] <specing> just use Ada
[05:36:12] <specing> then everyone will understand your code
[05:36:59] <GeneralStupid> iam happy that most of the processors i use in this project has a c compiler -.-
[05:38:08] <specing> GeneralStupid: the de-facto Ada compiler is GCC
[05:38:24] <specing> it is the only compiler that fully supports the latest Ada standard
[05:38:54] <specing> you can also get commercial support for it
[05:39:26] <GeneralStupid> i had a discussion this morning: x / 256 or x >> 8 . It's equal and the compiler should optimize / 256 to >> 8. So i think / is easier to understand (because i can use a macro there)
[05:39:51] <GeneralStupid> specing: HM :) so throw every code away and start again in ada? i dont think that this will happen :D
[05:39:53] <specing> Shift_Right (x, 8);
[05:40:09] <specing> GeneralStupid: Ada has great bindings
[05:40:18] <specing> you can easily call into C code from it
[05:40:26] <GeneralStupid> specing: shift_right looks like vhdl :D
[05:40:38] <specing> GeneralStupid: guess what language VHDL is based on...
[05:41:23] <deepbluv_> howcould I install ATmel studioin jessie amd64?
[05:42:00] <specing> deepbluv_: you can't
[05:44:04] <deepbluv_> but thewe isa linux version
[05:44:13] <GeneralStupid> specing: Ah
[05:44:25] <deepbluv_> specing: but there is a linux version
[05:44:26] <GeneralStupid> deepbluv_: hmm where?
[05:44:41] <GeneralStupid> i would say there is no linux version of the visual studio based Atmel Studio
[05:44:51] <deepbluv_> inATmel's site
[05:45:45] <GeneralStupid> link please
[05:46:24] <deepbluv_> http://www.atmel.com/tools/atmelavrtoolchainforlinux.aspx
[05:46:54] <GeneralStupid> please read the page
[05:47:34] <GeneralStupid> yes, there is an avr toolchain for linux. But no IDE
[05:48:11] <specing> so
[05:48:25] <deepbluv_> GeneralStupid: mmmh.ok,thanx a lot
[05:48:26] <GeneralStupid> and if you dont want to use ASF, then use the toolchain and a makefile. Atmel studio is 'not that great'
[05:48:38] <specing> illiterate_people.append("deepbluv");
[05:50:49] <deepbluv_> GeneralStupid: excuse my ignorance,but what is ASF?
[05:51:11] <GeneralStupid> deepbluv_: atmel software framework. its hard to use without atmel studio
[05:51:19] <GeneralStupid> but atmel studio just make problems imho
[05:52:34] <deepbluv_> GeneralStupid: right,thanx
[05:53:32] <GeneralStupid> deepbluv_: i use it since february this year and i really wish i would have just used makefiles instead
[05:53:58] <_ami_> GeneralStupid: makefile for what?
[05:54:02] <_ami_> for compile avr code?
[05:54:07] <_ami_> i use cmake
[05:54:10] <_ami_> it rocks
[05:54:21] <_ami_> much simpler than automake/make
[05:54:42] <specing> GPRBuild
[05:55:38] <specing> http://docs.adacore.com/gprbuild-docs/html/gprbuild_ug.html
[05:55:47] <GeneralStupid> _ami_: cmake rocks, yes thats right.
[05:56:00] <specing> finaly a project building with a readable syntax^
[05:56:04] <specing> builder*
[05:56:50] <GeneralStupid> i didnt know that there is already a cmake binding for avr ?! i just write the makefiles by hand. For my c++ projects i use qmake or cmake :D
[06:00:39] <_ami_> GeneralStupid: https://github.com/amitesh-singh/amiduino/tree/master/avr/ami-atmega16-cmake
[06:00:47] <_ami_> i use this one for both arduino and avr.
[06:01:38] <GeneralStupid> _ami_: i use handmade Makefile for the Analog Devices Blackfin...
[06:01:46] <GeneralStupid> _ami_: but i guess there is no cmake :D
[06:02:03] <GeneralStupid> _ami_: http://www.vtk.org/Wiki/CmakeAdsp
[06:06:51] <_ami_> GeneralStupid: nice.
[06:08:14] <_ami_> i was doing a motor controller project, and i needed to write code in modular fashion (like motorcontroller.h/.cpp, button.h/cpp, menu.h/.cpp, timer.cpp/.h etcs)
[06:08:33] <_ami_> also i am glad that i used cmake.
[06:08:55] <_ami_> also my code compiles and link with arduino core and other libraries automatically.
[06:09:35] <_ami_> i had this nice upload.sh which loads the code to mega2560 via its bootloader.
[06:09:57] <GeneralStupid> _ami_: i will see. I have to use a Bluetooth library. iam happy if it compiles and links :D
[06:09:58] <_ami_> all i want to say that it felt like professional build environment.
[06:10:27] <_ami_> GeneralStupid: i have a closed version of this, which does more nice things :)
[06:10:30] <GeneralStupid> i wrote the programmer by myself. The AVR programs my blackfin adsp
[06:10:46] <_ami_> DM me i will send u via email.
[06:18:39] <deepbluv_> GeneralStupid: there is debian packages
[06:20:09] <GeneralStupid> _ami_: i always write in that fashion. just with makefile
[06:20:31] <_ami_> cool!
[06:34:11] <sabor> specing: ada may be nice, but i prefer cobol ;)
[06:35:17] <specing> 0.o ok
[06:36:22] <Lambda_Aurigae> COBOL ROCKS!
[06:36:27] <Lambda_Aurigae> on IBM mainframes.
[06:42:32] <Lambda_Aurigae> hmm.
[06:43:06] <Lambda_Aurigae> a current avr is actually about the same power overall(ram/flash, processing speed, etc) as an IBM 360 mainframe
[06:48:49] <sabor> hehe
[06:51:06] <GeneralStupid> Lambda_Aurigae: nice fact. I recently calculated a bit with BOINC (paid to many for power) with my 2006 Intel Core Duo. It consumed 50 to 60 Watts and was slower then the 9Watts Intel Atom -.-
[06:51:22] <GeneralStupid> It's amazing how efficient processors get :D
[06:51:30] <Lambda_Aurigae> and how bloated software gets.
[06:51:53] <specing> BOINC?
[06:52:30] <GeneralStupid> Lambda_Aurigae: yes -.- And programming language output
[06:53:01] <Lambda_Aurigae> berkeley open infrastructure for network computing
[06:53:11] <GeneralStupid> specing: i calculate for worldcommunitygrid but maybe you know "SETI"
[06:53:32] <Lambda_Aurigae> looks like a distributed computing platform.
[06:53:40] <GeneralStupid> Lambda_Aurigae: http://xkcd.com/676/
[06:53:56] <specing> GeneralStupid: I know SETI, but not idk what BOINC is
[06:54:29] <specing> I applaud the SETI project, but they are handling the wrong data
[06:54:43] <Lambda_Aurigae> BOINC is the distributed computing platform written to run SETI.
[06:54:45] <GeneralStupid> i was server administrator before i start studying computer science... Sometimes we had old servers and i installed boinc on them
[06:55:01] <specing> the sensors used to record it are inadequate for finding extraterrestrial civilisations
[06:55:19] <GeneralStupid> at the beginning SETI had its own client? afaik IBM supported to wrote a Client for many projects and that is what boinc is
[06:56:09] <sabor> seti alias nsa-at-home
[06:56:56] <sabor> i doubt they search aliens, they probably search private keys or something...
[06:57:03] <Lambda_Aurigae> nsa has its fingers in just about everything.
[06:57:12] <Emil> sabor, hmm, excellent point
[06:57:32] <Lambda_Aurigae> if you run software you haven't compiled yourself after auditing the source code, you are probably running something that is spying on you.
[06:57:43] <Emil> How can we validate that what we are calculating is actually scientific data instead of key cracking
[06:57:45] <sabor> yeah
[06:57:57] <Lambda_Aurigae> Emil, collect the data yourself.
[06:58:11] <Emil> Lambda_Aurigae: hmm?
[06:58:26] <Lambda_Aurigae> only way to be sure what the data is....collect it yourself..
[06:58:39] <Emil> If even 1% of it is key cracking
[06:58:39] <specing> mining bitcoins is a more efficient use of resources than running seti
[06:58:43] <sabor> with seti you can be sure it is not the data you expect since the signal arriving here is much too small if it exists at all
[06:58:48] <specing> because you might even find some
[06:58:55] <Emil> specing: >bitcoins
[06:59:48] <specing> we need alien tech to find aliens
[06:59:55] <specing> what we have is not going to work
[07:00:00] <Lambda_Aurigae> ok...off to W*rk.
[07:01:47] <GeneralStupid> specing: but mining bitcoins is so inefficient
[07:02:19] <specing> GeneralStupid: finding aliens is even more
[07:02:35] <Snert_> Let them aliens find us.
[07:02:43] <Snert_> if the haven't already.
[07:02:53] <specing> efficiency = benefits/losses
[07:02:59] <specing> with SETI, benefits is 0
[07:03:34] <GeneralStupid> i dont do SETI
[07:04:25] <specing> Snert_: no smart alien civilisation would ever want contact with a warrior tribe
[07:04:41] <specing> the later is a fitting description of our civilisation
[07:05:14] <Snert_> they might need our gold, though.
[07:05:17] <specing> and any alien civilisation that would not self-annihilate before/when reaching tech levels required to reach/detect us
[07:05:21] <Snert_> or something sililiar.
[07:05:27] <specing> would be smart enough to avoid contact
[07:06:01] <specing> all resources we have are much easier to extract from asteroids
[07:06:11] <specing> and asteroids are abundant
[07:06:19] <GeneralStupid> not all
[07:06:38] <GeneralStupid> every oxygen connected material
[07:06:57] <Snert_> gold in asteroids?
[07:07:04] <specing> ? oxygen is abundant in asteroids
[07:08:06] <specing> and I'm sure that whatever civilisation is capable of bending space-time is also advanced enough to sinthesize the elements they can't easily obtain
[07:08:24] <GeneralStupid> ok
[07:08:47] <GeneralStupid> should be easy to synthesize an element IF you are capable of bending space time
[07:09:17] <specing> well according to our current understanding of physics, you need to bend space-time to travel faster than light
[07:10:56] <GeneralStupid> i guess this is basic knowledge -.-
[07:11:37] <Snert_> sure. every alien knows this.
[07:12:17] <Lambda_Aurigae> by the time you can travel faster than light you don't need to.
[07:22:27] <sabor> by the time you travel faster than light you start worrying about how to stop ;)
[07:22:58] <specing> you are not actually travelling faster than light
[07:23:04] <LeoNerd> A friend of mine wrote the "Driving Theory Test for Owners of Faster-Than-Light Vehicles"
[07:23:08] <specing> you are reducing the distance to your destination
[07:23:38] <specing> which is what the warp bubble in star trek is
[07:23:40] <sabor> might be a good read before starting to travel that fast
[07:23:42] <LeoNerd> It had such wonderful questions as: "You are travelling at 2.0c and intend to turn right. Do you a) signal right then turn, b) signal left then turn, c) turn then signal left, d) turn then signal right"
[07:23:44] <specing> you are bending space
[07:24:49] <specing> LeoNerd: e) turn and hope you don't crash into anything you can't detect
[07:25:32] <sabor> i guess you have to signal long before you start travelling that fast
[07:28:11] <Lambda_Aurigae> sabor, nope....you are traveling faster than time too, in one theory, so you signal AFTER turning.
[07:28:14] <specing> depends on how old your blinker fluid is
[07:28:18] <Lambda_Aurigae> kinda like living in florida
[07:28:29] <specing> Lambda_Aurigae: everywhere
[07:28:39] <specing> you're lucky if they even signal after turning
[07:29:14] <Lambda_Aurigae> when I lived there,,,,20 years ago,,,the old farts would signal the fact that they just made a turn...not necessarily the correct direction of the signal either.
[07:29:52] <Lambda_Aurigae> ok...all ready to go w*rk....except I have to leave the house...
[07:29:53] <Lambda_Aurigae> so,
[07:29:55] <Lambda_Aurigae> laters.
[07:53:06] <skz81> <GeneralStupid> but c++ has a different compiler -.- i would not agree with "c++ is just function pointers in C" >> who said that ? I just told about actual virtual table/methods implementation
[07:54:21] <LeoNerd> Hah
[10:06:00] <_ami_> GeneralStupid: sent the email.
[10:11:57] <skz81> <Snert_> they might need our gold, though. >> Once someone stated that if alien would invade earth for its ressources, the ressources they're seeking would be related to life / DNA.
[10:11:57] <skz81> Indeed : why mining on a "living" planet when there are so many empty rocks in space ?
[10:13:05] <brabo> i guess depends what resource they'd want, considering the nice amount of water on earth, that might be interesting
[10:13:23] <brabo> i doubt gold would be their goal :)
[10:16:17] <skz81> brabo, ALL other/mineral ressources are very aboundant in outter space space. Also as specing said, advanced alien civilisation is likely to know how to synthethise rare elements
[10:16:32] <skz81> And water is only H20, furthermore an exothermic sy
[10:16:37] <skz81> synthesis !
[10:17:04] <skz81> (no need to provide energy to synthetize water from its components)
[10:20:27] <skz81> << proportions of the total mass consistent with the mass and radius are ~25% rock and ~75% water, covered by a thick envelope of gases such as hydrogen and helium (~0.05%). >>
[10:21:19] <skz81> given the planet is about 7 times heavier than earth. You want water, alien ? Warm up yoour fucking frameshift drive and jump there !
[10:36:47] <bss36504> lol what has this channel become :P
[10:59:08] <skz81> bss36504, probably an effect of atmel/microchip merge. They want to kill the AVR line, remember ? x)
[11:06:39] <bss36504> skz81: Do they? I hadnt heard that
[11:08:23] <skz81> bss36504, not really, but it was a common fear expressed by many people here by the time
[11:08:50] <bss36504> Ohhh gotcha. Yes i did remember that fear.
[11:09:16] <bss36504> It seems unlikely that they would buy a company known primarily for it's mcu products just to kill it
[11:09:53] <bss36504> MCP is at least more diversified with an analog and other digital IC portfolio. Atmel, not so much, except for the odd memory or Qtouch chip, both of which were aquired.
[11:13:25] <skz81> I like rather to beleive they sent << undercover chineese FBI agents >> to the chan to distract us, by making us talk about aliens and space-time travel !
[11:28:41] <Chillum> Aliens are just there to distract us from the fact that we are the aliens and the "visitors" are the displaced population of this world
[11:28:59] <Chillum> we are NOT giving it back, they just need to accept that
[14:49:13] <limpkin> damn it, it seems my sections are not taken into account by atmel studio
[14:49:20] <limpkin> can't seem to set a given var at a givven address
[15:02:55] <Jartza> evening
[15:26:55] <sebus> I'm writing sequence of 0x00/0x55/0xAA/0xFF to dram memory, before each new value is written I'm checking previous one... But it sometimes fail and I'm for 100% sure that dram chips are okay - tested them with memtest86 on very old 386 board. Can somebody look at this code? http://pastebin.com/Wmp8qQga http://pastebin.com/DwGkKixb
[15:27:45] <sebus> also.. schematics might be helpful http://wstaw.org/m/2016/12/06/aaaaa.png
[15:27:58] <sebus> and yes, i'm driving this thing with 3rd overtone crystal
[15:31:19] <Thrashbarg> sebus: mm! I think you may have solved a problem I have with a TRS-80 clone... It needs a 10.6445MHz crystal which is unobtanium, 10.6666MHz will probably do... :P
[15:31:31] * Thrashbarg didn't consider this
[15:32:24] <sebus> Oh, trs-80! I have one too :D
[15:32:29] <Thrashbarg> nice
[15:32:36] <Thrashbarg> this is a Dick Smith System-80 TRS clone
[15:32:39] <Thrashbarg> Australian
[15:32:56] <Thrashbarg> but the glue they used to hold the crystal in place ate through the crystal pins...
[15:34:06] <Thrashbarg> I have a sneaking suspicion the crystals they used were surplus 32MHz ones that hadn't been cut properly, which would explain why the frequency isn't found anywhere else
[15:34:45] <sebus> yep, it happens. Even nowdays white glue is destructive. I measured once... It behave like a 560k resistor :<
[15:34:51] <Thrashbarg> yup
[15:35:07] <Richard_Cavell> Thrashbarg: If you were a real hacker you'd cut the crystal yourself
[15:35:14] <Thrashbarg> well then! :D
[15:35:21] <sebus> you can use this generator and de-tune it a bit with proper rc value
[15:35:25] <Thrashbarg> yep
[15:38:29] <sebus> also... it looks a bit odd
[15:38:44] <sebus> 10,6445 / 3 is near PAL clock
[15:39:37] <Thrashbarg> how near :P
[15:40:00] <sebus> 3,5468MHz * 3 = 10,6404
[15:40:06] <Thrashbarg> that's the NTSC clock lol
[15:40:14] <sebus> meh, fail
[15:40:16] <sebus> :F
[15:40:16] <Thrashbarg> hehe
[15:40:39] <Thrashbarg> PAL is 4.43361875MHz (I know that off by heart from college *_*)
[15:41:39] <sebus> ah, now I remember.. TA7698AP sh*t which I replaced many times in C= 1802-like crt monitors
[15:41:54] <Thrashbarg> sebus: however! This opens up another possibility of running an NTSC crystal on the third harmonic
[15:41:58] <sebus> it fails when no clock was applied
[15:42:53] <Thrashbarg> sorry for hijacking the question btw... I have no idea what's wrong with it FWIW
[15:43:02] <sebus> Haven't tried it yet?
[15:45:11] <sebus> I'm scratching my head and thinking what's wrong with that code.. I think... I've tested this atmega32 with even higher clock.. eg 66,3552MHz and 5,3V and ... works fine, except adc :P
[15:45:43] <sebus> (22,1184MHz uart crystal pushed at 3rd overtone)
[15:59:46] <sebus> okay
[15:59:49] <sebus> i failed :<
[16:00:14] <sebus> if ((addr > 8) & 0x01) {SET_A8;} - > if ((addr >> 8) & 0x01) {SET_A8;}
[16:00:16] <sebus> :/
[16:21:32] <specing> hahaha
[16:21:49] <specing> daily example of Ada's superiority
[16:23:21] <specing> (the first one wouldn't even compile)
[17:22:42] <Thrashbarg> sebus: well that works haha
[17:25:02] <sebus> yep and now I have 256kB of DRAM on my m32 \o/
[17:25:08] <Thrashbarg> awesome
[17:25:20] <sebus> now, time to implement z80 emulation ]:->
[17:25:28] <Thrashbarg> :D
[17:26:10] <specing> whoa
[17:26:20] <specing> thats not enough
[17:26:24] <specing> you need at least 640 K
[17:26:39] <sebus> meh... dos
[17:26:46] <sebus> CP/M dude
[17:27:39] <Thrashbarg> nice
[17:27:53] <Thrashbarg> I just got CP/M going again on an old homebrew machine I made in 2005
[17:27:56] <Thrashbarg> Intel 8080 however
[17:31:00] <sebus> Thrashbarg http://dubel.org/computer/
[17:31:15] <sebus> seen this?
[17:31:19] <Thrashbarg> I have!
[17:33:57] <sebus> great thing in z80 is that it just run all 8080 code, all 78 opcodes compatible
[17:35:04] <sebus> cool stuff in z80 is that out (C), A will push BC registers on address bus, so... 2^16 output ports instead of 2^8 alike datasheet says
[17:35:08] <sebus> still.. 6502 wins
[17:35:12] <Thrashbarg> hehe
[17:44:07] <crazy_pete> now thats kinda cool Thrashbarg
[17:44:37] <Thrashbarg> lol thank
[17:44:38] <Thrashbarg> s