EEVblog Electronics Community Forum

General => General Technical Chat => Topic started by: chamod on November 23, 2015, 04:16:40 pm

Title: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: chamod on November 23, 2015, 04:16:40 pm
I like Arduino, but I'm not much happy with the way it's overused.  :D
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: Artlav on November 23, 2015, 04:59:21 pm
How a bout an Arduino controlled spaceship?
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: Gustav on November 23, 2015, 06:34:58 pm
How a bout an Arduino controlled spaceship?

Her you go

http://copenhagensuborbitals.com/technology-2/communication/ (http://copenhagensuborbitals.com/technology-2/communication/)
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: Stonent on November 24, 2015, 12:57:12 am
I love the completely inappropriate use of Arduino like "How do I do (something that would require a really beefy cpu) with my Arduino?"
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: iampoor on November 24, 2015, 01:07:10 am
<iframe width="560" height="315" src="https://www.youtube.com/embed/Xr9s6-tuppI" frameborder="0" allowfullscreen></iframe>

"Arduinos making Arduinos, how perverse"  :-DD
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: Stonent on November 24, 2015, 01:16:28 am
<iframe width="560" height="315" src="https://www.youtube.com/embed/Xr9s6-tuppI" frameborder="0" allowfullscreen></iframe>

"Arduinos making Arduinos, how perverse"  :-DD

Julian Ilet did a video once called "How slow is an Arduino" where he simply wrote a sketch that toggled a pin high and low in a loop. It wouldn't even make 32Khz.  Once he changed it to using PortB he was able to toggle the pin at roughly 1Mhz (still using the arduino IDE so the wave form was not very even because of all the overhead).

I think he worked it out that using digitalwrite vs portb had an overhead increase by about a factor of 7.  Apparently each time a digitalwrite is used, the AVR has to run commands to determine what port and bit that pin alias is.
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: Rerouter on November 24, 2015, 01:30:45 am
The arduino platform is just like any other tool, you use it to make something that works in less time based on what you have on hand, if you need more power, well there are a few other models with increasing power levels that work using the same code if you don't attack the registers, and if you do attack the registers, then you should be able to read through the new devices data sheet to adapt accordingly,

To make clear there is no line in the sand between what is using the arduino macros and writing avr code, as people learn more in the platform and do things that are not in a library or marco, they will learn more of the AVR side, and use a combination of the 2 to get something that works in an hour or 2, vs the full AVR from scratch which might mean half a day of data sheet digging to figure out why the ADC isn't initializing correctly, or how to properly implement the serial peripheral, rather than spending that time on what you where hoping to accomplish with the micro,


Also the ATmega328 can change a pin state in 1 clock cycle when writing to registers, you end up close to a 4Mhz square wave with a shifted duty cycle by using a while loop,
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: sleemanj on November 24, 2015, 02:18:03 am
I think he worked it out that using digitalwrite vs portb had an overhead increase by about a factor of 7.  Apparently each time a digitalwrite is used, the AVR has to run commands to determine what port and bit that pin alias is.

Yes that's correct, more or less (there is generally a lookup table arduino pin > port, and arduino pin > port pin), it also somewhat mankily checks to see if a pin has a PWM output running on it every time you call digitalWrite so it can turn it off. 

But as you point out, if you need more speed and less overhead than "digitalWrite()" can give you there is nothing stopping you from manipulating the port's registers directly, you can use the arduino way, port manipulation in C, assembly statements, or all of the above at the same time if it floats your boat.

A convenient abstraction provided by the Arduino "core" introduces overhead, just as practically any abstraction does, just because it is available doesn't mean you have to use the abstraction, and if you don't, the compiler/linker will probably optimise away most the code anyway.


Edit to add:
With that said, I don't much like how Arduino *implements* that particular pin numbering abstraction, the abstraction itself is fine, but the implementation should have been better.
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: Stonent on November 24, 2015, 02:28:19 am
I think he worked it out that using digitalwrite vs portb had an overhead increase by about a factor of 7.  Apparently each time a digitalwrite is used, the AVR has to run commands to determine what port and bit that pin alias is.

Yes that's correct, more or less (there is generally a lookup table arduino pin > port, and arduino pin > port pin), it also somewhat mankily checks to see if a pin has a PWM output running on it every time you call digitalWrite so it can turn it off. 

But as you point out, if you need more speed and less overhead than "digitalWrite()" can give you there is nothing stopping you from manipulating the port's registers directly, you can use the arduino way, port manipulation in C, assembly statements, or all of the above at the same time if it floats your boat.

A convenient abstraction provided by the Arduino "core" introduces overhead, just as practically any abstraction does, just because it is available doesn't mean you have to use the abstraction, and if you don't, the compiler/linker will probably optimise away most the code anyway.


Edit to add:
With that said, I don't much like how Arduino *implements* that particular pin numbering abstraction, the abstraction itself is fine, but the implementation should have been better.

I think the trade-off was because Arduino can't use the oscillator pins, so they skipped the numbering.
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: JoeN on November 24, 2015, 06:45:26 am
I love the completely inappropriate use of Arduino like "How do I do (something that would require a really beefy cpu) with my Arduino?"

How do I do face recognition on 16 simultaneous channels of 1080p video against a 20 terabyte database of facial images with an Arduino?   :-//
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: BradC on November 24, 2015, 07:01:31 am
I love the completely inappropriate use of Arduino like "How do I do (something that would require a really beefy cpu) with my Arduino?"

How do I do face recognition on 16 simultaneous channels of 1080p video against a 20 terabyte database of facial images with an Arduino?   :-//
Slowly.
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: iampoor on November 24, 2015, 07:18:05 am
I love the completely inappropriate use of Arduino like "How do I do (something that would require a really beefy cpu) with my Arduino?"

How do I do face recognition on 16 simultaneous channels of 1080p video against a 20 terabyte database of facial images with an Arduino?   :-//
Here (https://www.arduino.cc/en/Tutorial/Blink) is a good starting point. :)
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: Galenbo on November 24, 2015, 07:38:19 am
I like Arduino, but I'm not much happy with the way it's overused.  :D

I like Porsche and Ferrari, but not the people who talk about them.
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: RickBrant on November 24, 2015, 09:00:17 am
I love the completely inappropriate use of Arduino like "How do I do (something that would require a really beefy cpu) with my Arduino?"
A really beefy CPU, and a true real-time OS.
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: RickBrant on November 24, 2015, 09:02:07 am
I like Arduino, but I'm not much happy with the way it's overused.  :D

Much like BASIC used to be. Or using a spreadsheet instead of a real database.
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: tszaboo on November 24, 2015, 09:28:18 am
I love the completely inappropriate use of Arduino like "How do I do (something that would require a really beefy cpu) with my Arduino?"

How do I do face recognition on 16 simultaneous channels of 1080p video against a 20 terabyte database of facial images with an Arduino?   :-//
I would use the Teensy because that has more processing power.
(https://i.kinja-img.com/gawker-media/image/upload/s--qFwSqT_6--/c_fill,fl_progressive,g_north,h_358,q_80,w_636/18n2u2jtl147mjpg.jpg)
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: free_electron on November 24, 2015, 03:18:34 pm
i know something that is missing: an arduino sketch that makes the CPU commit suicide out of the box ( no extra hardware needed. ). run it and the cpu is hosed beyond repair. can't reprogram it anymore.

now if we could find a way to make this the default main ... would be fun.

arseduino. what a farce ...


Note : i got nothing against people wanting to build something or learn electronics , it's the arduino makers and their endless infighting that rile me up. Now they have two brands. Genuino and Arduino. All because they are pissed off at each other and dude a has the trademark here and due b claims he owns it somewhere else so they need to sell arduino as genuino over there... and they are pissed off at the rest of the world because 'everyone is copying it and we don't make money'. Well you shouldn't have released it as open source. That's what happens in a world economy. It started as a university professors thingie to aid his students in learning embedded programming. it snowballed and now they cry over 'lost income'. Besides, it was slapped together from free stuff. They didn't invent wiring. As for slapped together : off grid pitched connectors and crazy shaped boards..  ah well.
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: chamod on November 24, 2015, 04:06:24 pm
I like Arduino, but I'm not much happy with the way it's overused.  :D

I like Porsche and Ferrari, but not the people who talk about them.

I actually use arduino everyday, unlike Porsche and Ferrari.  >:D
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: Moondeck on November 24, 2015, 04:42:48 pm
I like Arduino, but I'm not much happy with the way it's overused.  :D
Same here. And the people who want to use it for everything, thinking its the best thing. FFS i am so sick of it.
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: os40la on November 24, 2015, 07:43:38 pm
Can I replace the powertrain control module in my car with an arduino and get more horse power?   :-DD
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: Refrigerator on November 24, 2015, 08:55:36 pm
I remember when i was just starting to learn electronics and tried to look up some projects on YouTube and all of the used arduino!! And that pissed me off cause arduino at the time was expensive as hell. and literally all of them were like " buy arduino, copy paste some code and presto! that's your project."
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: alexanderbrevig on November 24, 2015, 09:10:12 pm
It started with a student and his thesis. Not the professor and his startup based on said thesis.  :)
Though... I guess it really started with the big bang.  :-//
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: JoeN on November 25, 2015, 12:07:15 am
I remember when i was just starting to learn electronics and tried to look up some projects on YouTube and all of the used arduino!! And that pissed me off cause arduino at the time was expensive as hell. and literally all of them were like " buy arduino, copy paste some code and presto! that's your project."

But is should give you enough information to then go and dream up your own projects.  If you fail to dream up your own projects, that's on you.
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: Dinsdale on November 25, 2015, 01:12:30 am
iampoor sez:
Quote
Here is a good starting point. :)

I feel like I've been Rick Rolled!
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: T3sl4co1l on November 25, 2015, 02:23:44 am
FYI...

Rule 34... isn't this.

Although given the popularity of Arduino, I'm surprised I don't see (obvious?) r34 of it actually out there.

Tim
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: Stonent on November 25, 2015, 05:26:43 am
I like Arduino, but I'm not much happy with the way it's overused.  :D

I like Porsche and Ferrari, but not the people who talk about them.

BMW is a good car, but not the drivers. :)
Title: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: timb on November 25, 2015, 09:27:48 am
FYI...

Rule 34... isn't this.

Although given the popularity of Arduino, I'm surprised I don't see (obvious?) r34 of it actually out there.

Tim

We should make one! Any ladies *up* for it? *Smirk*

It would literally be a guy in an Arduino costume railing a chick dressed as an LED. Every time he thrusts the LED costume lights up. Just like a blinking LED sketch. It would be like that surreal 80's porn, Nightdreams; specifically the scene where the guy dressed as a box of Cream of Wheat has sex with the girl on her kitchen floor, while the guy dressed as a beatnik-esque slice of white bread plays the saxophone behind them.

We could call it...Ardudreamos! We should crowdfund this!


Sent from my Tablet
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: sleemanj on November 25, 2015, 11:12:13 am
https://www.youtube.com/watch?v=2a4gyJsY0mc (https://www.youtube.com/watch?v=2a4gyJsY0mc)
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: LordNobady on November 26, 2015, 10:09:00 am
FYI...

Rule 34... isn't this.

Although given the popularity of Arduino, I'm surprised I don't see (obvious?) r34 of it actually out there.

Tim

We should make one! Any ladies *up* for it? *Smirk*

It would literally be a guy in an Arduino costume railing a chick dressed as an LED. Every time he thrusts the LED costume lights up. Just like a blinking LED sketch. It would be like that surreal 80's porn, Nightdreams; specifically the scene where the guy dressed as a box of Cream of Wheat has sex with the girl on her kitchen floor, while the guy dressed as a beatnik-esque slice of white bread plays the saxophone behind them.

We could call it...Ardudreamos! We should crowdfund this!


Sent from my Tablet

go for it, but record it with an arduino ;)
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: Moondeck on November 26, 2015, 08:09:05 pm
FYI...

Rule 34... isn't this.

Although given the popularity of Arduino, I'm surprised I don't see (obvious?) r34 of it actually out there.

Tim

We should make one! Any ladies *up* for it? *Smirk*

It would literally be a guy in an Arduino costume railing a chick dressed as an LED. Every time he thrusts the LED costume lights up. Just like a blinking LED sketch. It would be like that surreal 80's porn, Nightdreams; specifically the scene where the guy dressed as a box of Cream of Wheat has sex with the girl on her kitchen floor, while the guy dressed as a beatnik-esque slice of white bread plays the saxophone behind them.

We could call it...Ardudreamos! We should crowdfund this!


Sent from my Tablet

go for it, but record it with an arduino ;)
Or a raspberry pi. or banana pi.
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: NiHaoMike on November 27, 2015, 03:07:44 am
i know something that is missing: an arduino sketch that makes the CPU commit suicide out of the box ( no extra hardware needed. ). run it and the cpu is hosed beyond repair. can't reprogram it anymore.
You have to run it for a long time for it to do that, but it already exists.
http://tronixstuff.com/2011/05/11/discovering-arduinos-internal-eeprom-lifespan/ (http://tronixstuff.com/2011/05/11/discovering-arduinos-internal-eeprom-lifespan/)
Of course, something that would appear the same to a beginner and much quicker to do is to trash the bootloader.
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: Tim F on November 27, 2015, 03:14:22 am
I love the completely inappropriate use of Arduino like "How do I do (something that would require a really beefy cpu) with my Arduino?"
That's 80% of the attraction for me, practicing efficient coding O0
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: Rerouter on November 29, 2015, 11:05:58 am
I agree, working within limitations is good for practice, and getting more creative with how you solve a problem, The main reason i learn to pay attention to how i use variables, and to make functions self contained was after repeatably bumping shoulders with the 2KB memory space early on, (big arrays for fixed values that the compiler didnt know where fixed)

Oh you want to interpret a C code script via a file on an SD card, and the file is X times bigger than the memory space you have, you also want to run syntax and error checking over the entire file before running, guess what, it bloody runs on a 328, :)

Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: Moondeck on November 30, 2015, 08:40:09 am
I love the completely inappropriate use of Arduino like "How do I do (something that would require a really beefy cpu) with my Arduino?"
That's 80% of the attraction for me, practicing efficient coding O0
efficient coding? Then make a 1920x1080@60 fps game with PhysX emulation with a fn arduino if its all about efficient coding.
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: miguelvp on November 30, 2015, 10:56:43 am
I love the completely inappropriate use of Arduino like "How do I do (something that would require a really beefy cpu) with my Arduino?"
That's 80% of the attraction for me, practicing efficient coding O0
efficient coding? Then make a 1920x1080@60 fps game with PhysX emulation with a fn arduino if its all about efficient coding.

Easy, make a shield with a Tegra X1 (or even a Tegra K1) with plenty of memory and leave the arduino to handle just the game script, the rest is offloaded to the Tegra :)

Of course I kid, and I know I'm reaching, because you wouldn't need the Arduino since you have 8 cores on the X1 (6 on the K1) but yeah it could be done.

Actually Nvidia had PhysX back on the Tegra 3

Would be silly to do it that way? I dunno, I think a beefy GPU/Physx shield might sell quite well.

Edit: just did a quick search and found this, not quite the same but same principle:

http://playground.arduino.cc/SmartGPU2/SmartGPU2 (http://playground.arduino.cc/SmartGPU2/SmartGPU2)
Title: Re: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.
Post by: Moondeck on November 30, 2015, 03:15:28 pm
I love the completely inappropriate use of Arduino like "How do I do (something that would require a really beefy cpu) with my Arduino?"
That's 80% of the attraction for me, practicing efficient coding O0
efficient coding? Then make a 1920x1080@60 fps game with PhysX emulation with a fn arduino if its all about efficient coding.

Easy, make a shield with a Tegra X1 (or even a Tegra K1) with plenty of memory and leave the arduino to handle just the game script, the rest is offloaded to the Tegra :)

Of course I kid, and I know I'm reaching, because you wouldn't need the Arduino since you have 8 cores on the X1 (6 on the K1) but yeah it could be done.

Actually Nvidia had PhysX back on the Tegra 3

Would be silly to do it that way? I dunno, I think a beefy GPU/Physx shield might sell quite well.

Edit: just did a quick search and found this, not quite the same but same principle:

http://playground.arduino.cc/SmartGPU2/SmartGPU2 (http://playground.arduino.cc/SmartGPU2/SmartGPU2)
Yeah, i have seen it too, but if you have that shitload of power, WTF is the point? What, because awwdooeeenoo is easier?