Author Topic: Rule 34 of arduino: If you can imagine it, there’s an arduino project with it.  (Read 14626 times)

0 Members and 1 Guest are viewing this topic.

Offline chamodTopic starter

  • Contributor
  • Posts: 20
  • Country: nz
I like Arduino, but I'm not much happy with the way it's overused.  :D
 

Offline Artlav

  • Frequent Contributor
  • **
  • Posts: 750
  • Country: mon
    • Orbital Designs
How a bout an Arduino controlled spaceship?
 

Offline Gustav

  • Newbie
  • Posts: 6
  • Country: dk
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
I love the completely inappropriate use of Arduino like "How do I do (something that would require a really beefy cpu) with my Arduino?"
The larger the government, the smaller the citizen.
 

Offline iampoor

  • Frequent Contributor
  • **
  • Posts: 500
  • Country: us
<iframe width="560" height="315" src="https://www.youtube.com/embed/Xr9s6-tuppI" frameborder="0" allowfullscreen></iframe>

"Arduinos making Arduinos, how perverse"  :-DD
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
<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.
The larger the government, the smaller the citizen.
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
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,
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3024
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
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.
« Last Edit: November 24, 2015, 02:23:13 am by sleemanj »
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
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.
The larger the government, the smaller the citizen.
 

Offline JoeN

  • Frequent Contributor
  • **
  • Posts: 991
  • Country: us
  • We Buy Trannies By The Truckload
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?   :-//
Have You Been Triggered Today?
 

Offline BradC

  • Super Contributor
  • ***
  • Posts: 2106
  • Country: au
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.
 

Offline iampoor

  • Frequent Contributor
  • **
  • Posts: 500
  • Country: us
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 is a good starting point. :)
 

Offline Galenbo

  • Super Contributor
  • ***
  • Posts: 1469
  • Country: be
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.
If you try and take a cat apart to see how it works, the first thing you have on your hands is a nonworking cat.
 

Offline RickBrant

  • Supporter
  • ****
  • Posts: 105
  • Country: us
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.
"banging meter needles into stop pins since 1965"
 

Offline RickBrant

  • Supporter
  • ****
  • Posts: 105
  • Country: us
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.
"banging meter needles into stop pins since 1965"
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7390
  • Country: nl
  • Current job: ATEX product design
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.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
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.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline chamodTopic starter

  • Contributor
  • Posts: 20
  • Country: nz
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
 

Offline Moondeck

  • Regular Contributor
  • *
  • Posts: 142
  • Country: dk
  • i really like compilers
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.
I'm selling 100ml bottles of free energy, PM me for pricing.
 

Offline os40la

  • Regular Contributor
  • *
  • Posts: 122
  • Country: us
Can I replace the powertrain control module in my car with an arduino and get more horse power?   :-DD
"No, but I did stay at a Holiday Inn Express"
 

Offline Refrigerator

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: lt
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."
« Last Edit: November 24, 2015, 08:57:42 pm by Refrigerator »
I have a blog at http://brimmingideas.blogspot.com/ . Now less empty than ever before !
An expert of making MOSFETs explode.
 

Offline alexanderbrevig

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: no
  • Musician, developer and EE hobbyist
    • alexanderbrevig.com
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.  :-//
 

Offline JoeN

  • Frequent Contributor
  • **
  • Posts: 991
  • Country: us
  • We Buy Trannies By The Truckload
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.
Have You Been Triggered Today?
 

Offline Dinsdale

  • Regular Contributor
  • *
  • Posts: 77
  • Country: us
    • pretzelogic
iampoor sez:
Quote
Here is a good starting point. :)

I feel like I've been Rick Rolled!
This can't be happening.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21687
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
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
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf