Author Topic: Can you make the arduino do non miro controler things?  (Read 9338 times)

0 Members and 1 Guest are viewing this topic.

Offline raspberrypiTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 358
  • Country: us
Can you make the arduino do non miro controler things?
« on: March 09, 2017, 08:33:38 pm »
Since it reads C could you make it do something like process an image (compress a .jpg to lower quality or anything that a computer would do when you program it in C)? Not necessarily to output the image in any usable way but just make it perform calculations or do something other then look at inputs and turn on outputs.

How complex is that chip; millions of transistors or is it pretty simple?
I'm legally blind so sometimes I ask obvious questions, but its because I can't see well.
 

Offline alsetalokin4017

  • Super Contributor
  • ***
  • Posts: 2055
  • Country: us
Re: Can you make the arduino do non miro controler things?
« Reply #1 on: March 09, 2017, 08:48:08 pm »
Well, the answer is basically "Yes".  You can perform calculations, you can store/read digital data, you can synthesize music, you can do all kinds of things in c++ but these ARE "microcontroller things" after all.  You can even have it store and serve an interactive web page wirelessly with the right "shield" plugin. A small webpage due to memory size limitations, of course.

There is nothing magic about Arduino. It is basically just the microcontroller chip itself, a regulated power supply, and a convenient set of connectors for the power and the mcu inputs and outputs. The software IDE (integrated development environment) is just an easy way to get your c++ program into the chip, and other programs like "processing" make it easy to get whatever kind of input/output you need to display on your computer.

Actually the chip itself doesn't "read c", the software IDE reads c and translates it into instructions that the chip can operate on. If you had the right IDE/compiler you could work in other high-level languages that would be translated into assembly language and fed to the chip.

How many transistors in an ATmel mcu? I don't know but it's more than I can count on my fingers and toes, for sure. "Pretty simple" it's not, from my perspective. But from the perspective of a CPU designer it probably is "pretty simple".
« Last Edit: March 09, 2017, 08:51:22 pm by alsetalokin4017 »
The easiest person to fool is yourself. -- Richard Feynman
 

Offline Nusa

  • Super Contributor
  • ***
  • Posts: 2418
  • Country: us
Re: Can you make the arduino do non miro controler things?
« Reply #2 on: March 09, 2017, 09:15:20 pm »
As for video processing, here's an old project that actually produces VGA output with nothing more than a handful of resistors besides the Arduino itself.
Quote
http://www.gammon.com.au/forum/?id=11608
 

The name Arduino refers to a family of devices, not a particular chip. Historically it uses one of the 8-bit Atmel AVR microcontrollers, but isn't restricted to those. If I had to guess what you bought to play with, you probably have http://www.microchip.com/wwwproducts/en/ATmega328p.
 

Offline raspberrypiTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 358
  • Country: us
Re: Can you make the arduino do non miro controler things?
« Reply #3 on: March 09, 2017, 09:20:09 pm »
As for video processing, here's an old project that actually produces VGA output with nothing more than a handful of resistors besides the Arduino itself.
Quote
http://www.gammon.com.au/forum/?id=11608
 

The name Arduino refers to a family of devices, not a particular chip. Historically it uses one of the 8-bit Atmel AVR microcontrollers, but isn't restricted to those. If I had to guess what you bought to play with, you probably have http://www.microchip.com/wwwproducts/en/ATmega328p.

I had the atmega but took it back as I was told for simplicity stick with the original arduino.
I'm legally blind so sometimes I ask obvious questions, but its because I can't see well.
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: Can you make the arduino do non miro controler things?
« Reply #4 on: March 09, 2017, 09:20:43 pm »
Since it reads C could you make it do something like process an image (compress a .jpg to lower quality or anything that a computer would do when you program it in C)? Not necessarily to output the image in any usable way but just make it perform calculations or do something other then look at inputs and turn on outputs.
Yes of course, same with any other MCU.  Your limitations are code size and RAM size, as long as you fit within those requirements it'll run almost anything, it just might be slow, especially if floating point calculations are involved.
 

Offline Nusa

  • Super Contributor
  • ***
  • Posts: 2418
  • Country: us
Re: Can you make the arduino do non miro controler things?
« Reply #5 on: March 09, 2017, 09:33:06 pm »
As for video processing, here's an old project that actually produces VGA output with nothing more than a handful of resistors besides the Arduino itself.
Quote
http://www.gammon.com.au/forum/?id=11608
 

The name Arduino refers to a family of devices, not a particular chip. Historically it uses one of the 8-bit Atmel AVR microcontrollers, but isn't restricted to those. If I had to guess what you bought to play with, you probably have http://www.microchip.com/wwwproducts/en/ATmega328p.

I had the atmega but took it back as I was told for simplicity stick with the original arduino.

You're confusing the chip designation and the product name. Look at the labeling on the CPU chip on your Aruduion. Odds are it says ATmega328. The Arduino Mega uses http://www.microchip.com/wwwproducts/en/atmega2560, which has more i/o ports, timers and memory, but otherwise performs about the same.
 

Offline pitagoras

  • Regular Contributor
  • *
  • Posts: 116
  • Country: fr
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13382
Re: Can you make the arduino do non miro controler things?
« Reply #7 on: March 10, 2017, 12:01:16 am »
An Arduino is Turing Complete, subject to the limitations of available memory, so given enough external storage, it can do *anything* that isn't time critical, as long as there's enough time to complete the task before the Arduino dies of old age. (e.g. from charge leaking away in FLASH memory cells, electromigration in the metallisation layer of the various chips, or the electrolytic caps drying up and failing)

Here's an 8 bit ATmega emulating a PXA255 SoC (ARMv5TE. core) running Ubuntu Linux.

http://dmitry.gr/index.php?r=05.Projects&proj=07.%20Linux%20on%208bit

Its not actually an Arduino as such, but the Atmega1284P it uses in the same family of chips as the Atmel based Ardunos, and there are third party board packages for using a '1284P from the Arduino IDE.

The emulator could be ported to run on an Arduino Mega 2560 + a protoshield for the SIMM and the SD card with a moderate amount of effort, but as its overclocking the '1284P at 24MHz and the Mega 2560 is only clocked at 16MHz with half the RAM of the '1284P, it would be a lot slower - approximately half the speed or maybe worse.  Also it uses the 'raw' AVR GCC toolchain, not the novice-friendly Arduino IDE, (although the Arduino installation does install the AVR GCC toolchain) so it would be a steep learning curve if you only had previous 'Arduino-land' experience.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 12012
  • Country: us
    • Personal site
Re: Can you make the arduino do non miro controler things?
« Reply #8 on: March 10, 2017, 03:40:33 am »
millions of transistors or is it pretty simple?
Number of transistors means absolutely nothing as far as performed tasks go.
Alex
 

Offline raspberrypiTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 358
  • Country: us
Re: Can you make the arduino do non miro controler things?
« Reply #9 on: March 10, 2017, 03:54:44 am »
So is this where most ICs are headed? I have a really cool clock that uses needle dial "VU" meters to show the hours, minutes, and seconds. The instructions say you can program it to do anything you want like changing out different dials or use different displays entirely. You can tell its "smart" by the way you set the time with a rotary encoder. So in the future or right now maybe, you get a micro controller whos only limits are speed and memory and you just program it to do what ever you want instead of purpose built ICs that only do one thing and only have one type of output that works? I'm noticing it in products that have USB connections...
I'm legally blind so sometimes I ask obvious questions, but its because I can't see well.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 12012
  • Country: us
    • Personal site
Re: Can you make the arduino do non miro controler things?
« Reply #10 on: March 10, 2017, 03:58:11 am »
So in the future or right now maybe, you get a micro controller whos only limits are speed and memory and you just program it to do what ever you want
You can do that right now. High end microcontrollers run at 300+ MHz and have 512 KB of RAM (and can use external SDRAM, if needed). This is plenty of computing power.

And then your nickname is pretty powerful for its price.

instead of purpose built ICs
Depends on the "purpose". Some things are just impractical to do in software. Sometimes you care about the price and purpose-build ICs are cheaper.
Alex
 

Offline raspberrypiTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 358
  • Country: us
Re: Can you make the arduino do non miro controler things?
« Reply #11 on: March 10, 2017, 04:00:48 am »
millions of transistors or is it pretty simple?
Number of transistors means absolutely nothing as far as performed tasks go.

I often speak in generalizations. Such as I thought this power supply I was building (when I started it I had no idea what I was doing, or rather some knowledge but no working use of it) had some fancy MOSFET in it because it looked like one. It was an LM317 that doesn't have one transistor in it but probably 50. I had no idea that integrated circuits came in this package with only three pins. So when I say "number or transistors" I'm asking about general complexity of the device. Like a core I7 has ~10 billion transistors.
I'm legally blind so sometimes I ask obvious questions, but its because I can't see well.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13382
Re: Can you make the arduino do non miro controler things?
« Reply #12 on: March 10, 2017, 04:05:14 am »
If its digital, or mostly digital, is more than can be done with one off-the-shelf logic chip, and it doesn't need to be screamingly fast, the tendency is to use a MCU.  If its pure digital and it does need to be screamingly fast, there's a tendency to use a FPGA. 

Many special purpose chips for more complex tasks are actually custom programmed MCUs - sometimes the only difference is the pre-loaded program and the part number, or it may be more 'hidden' e.g a MCU core on a multipurpose custom chip with extra peripherals and/or interfaces that can be factory programmed as a range of different chips for similar applications.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 12012
  • Country: us
    • Personal site
Re: Can you make the arduino do non miro controler things?
« Reply #13 on: March 10, 2017, 04:09:06 am »
I'm asking about general complexity of the device. Like a core I7 has ~10 billion transistors.
The reason such numbers are not readily publicized, is that they are pretty much useless for anything. Intel likes to brag about this stuff because there is not much else to say.

I'd estimate that mega328 has 500K-1M transistors (excluding on-chip memories). But this says absolutely nothing about actual chip performance.
Alex
 

Offline jonovid

  • Super Contributor
  • ***
  • Posts: 1589
  • Country: au
    • JONOVID
Re: Can you make the arduino do non miro controler things?
« Reply #14 on: March 10, 2017, 04:10:38 am »
be interested to know if this is possible  :o
do like the old Arduino Atmel  its the  Z80 of our time.
if someone can squeeze more out of it , then Good, let us know .  :-+
Hobbyist with a basic knowledge of electronics
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13382
Re: Can you make the arduino do non miro controler things?
« Reply #15 on: March 10, 2017, 04:28:09 am »
From comp.arch.embedded: Transistor count of common uCs? (11 May 2004)
Quote
IIRC, The AVR core is 12,000 gates, and the megaAVR core is 20,000 gates
Each gate is 4 transistors. The chip is considerably larger since the memory
uses quite a lot.
The ATmega128 is probably somewhere between 600k-1M transistors.

For comparision:
The AT91R40008 ARM7 micro is probably 2 M transistors.
The ultimate CISC microprocessor, the NS32016 was but 60,000 transistors.



--
Best Regards,
Ulf Samuelsson   ulf@********.com
This is a personal view which may or may not be
share by my Employer Atmel Nordic AB
 

Offline TNorthover

  • Contributor
  • Posts: 42
  • Country: us
Re: Can you make the arduino do non miro controler things?
« Reply #16 on: March 10, 2017, 04:43:08 am »
Quote from: Ian.M
The AT91R40008 ARM7 micro is probably 2 M transistors.

This looks incongruous, I think he's mixing counts of different things (including the RAM for the ARM?). The Cortex-M0 apparently has about 12000 gates and while it's optimised for transistor count, I don't believe it's 50 times better than the earlier equivalents.
« Last Edit: March 10, 2017, 04:46:51 am by TNorthover »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13382
Re: Can you make the arduino do non micro controller things?
« Reply #17 on: March 10, 2017, 04:52:12 am »
Yes, it does look like Ulf mixed up the comparisons.  However his numbers for the AVRs are probably good. - For those who don't know of him, he was well respected Atmel 'insider' who helped a lot of people with AVR queries on comp.arch.embedded and related technical USENET groups.
« Last Edit: March 10, 2017, 04:54:20 am by Ian.M »
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 12012
  • Country: us
    • Personal site
Re: Can you make the arduino do non miro controler things?
« Reply #18 on: March 10, 2017, 04:52:23 am »
The Cortex-M0 apparently has about 12000 gates and while it's optimised for transistor count, I don't believe it's 50 times better than the earlier equivalents.
Cortex-M0 from Design Start package in Cyclone V takes exactly 841 registers and ~4000 LUTs. This is just the core, no memories, no peripherals.
Alex
 

Offline TNorthover

  • Contributor
  • Posts: 42
  • Country: us
Re: Can you make the arduino do non miro controler things?
« Reply #19 on: March 10, 2017, 05:09:39 am »
Cortex-M0 from Design Start package in Cyclone V takes exactly 841 registers and ~4000 LUTs. This is just the core, no memories, no peripherals.

You don't happen to have the Cortex-M1 numbers handy too, do you? I'd heard that one was optimized for FPGAs but never actually saw the numbers and would be interested in what the difference is when tuning for different targets like that.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 12012
  • Country: us
    • Personal site
Re: Can you make the arduino do non miro controler things?
« Reply #20 on: March 10, 2017, 05:14:06 am »
You don't happen to have the Cortex-M1 numbers handy too, do you?
Nope. But M1 numbers should be available from ARM. I think I saw some numbers on their site or in some promotional PDF.

I'd expect them to be a bit more heavy on the register side. As far as number of registers goes, DS M0 is definitely optimized for that, at expense of a lot of logic. And that's no the best for FPGA.
Alex
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4319
  • Country: us
  • KJ7YLK
Re: Can you make the arduino do non miro controler things?
« Reply #21 on: March 10, 2017, 05:16:43 am »
Since it reads C
There is a C compiler for the machine code.  That is no indicator of capability.

Quote
could you make it do something like process an image (compress a .jpg to lower quality or anything that a computer would do when you program it in C)?

Could a lower-end Atmel microcontroller do the computations necessary to transform an image into a compressed codec?  Yes, but for a couple of limitations which are likely show-stoppers:
1) Speed.  The amount of time it would take to process a large array of pixel data may be much longer than you expect.
2) Memory. Unless you are talking about really tiny images, it seems quite possible that the Atmel microcontroller can't access enough memory to perform such a task.

Quote
Not necessarily to output the image in any usable way but just make it perform calculations or do something other then look at inputs and turn on outputs.
You are vastly under-estimating the amount of "horsepower" it takes to do sophisticated image manipulation and/or analysis.

Quote
How complex is that chip; millions of transistors or is it pretty simple?
Complexity of the CPU has no correlation with its ability to process a large amount of data quickly.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Can you make the arduino do non miro controler things?
« Reply #22 on: March 10, 2017, 06:09:15 am »
The only thing that "reads" C code is the compiler. C was developed in the early 70s and you can code in C for just about anything, even 8 bit microcomputers from the 80s. Technically there's no reason you couldn't do image processing or even transcode video with an AVR or even a 6502 if you were extremely patient. To put that into perspective, I remember when .jpg compression was first showing up I had a 40MHz 386 with a 640x480 VGA screen. It could open a jpg file for viewing but it took about 30 seconds to paint it on the screen. That had a lot more processing power and memory than an Arduino.
 

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 3510
  • Country: us
Re: Can you make the arduino do non miro controler things?
« Reply #23 on: March 10, 2017, 07:06:19 am »
be interested to know if this is possible  :o
do like the old Arduino Atmel  its the  Z80 of our time.
if someone can squeeze more out of it , then Good, let us know .  :-+

Wikipedia has "As of 2016, 10 nm devices are still under commercial development. Commercial release is confirmed for 2017 by Samsung." and on the side bar, 5nm in 2020.
https://en.wikipedia.org/wiki/10_nanometer

5nm is the width of about 50 atoms abreast.  They are nearing/entering a domain where quantum mechanics starts to dominate.  I am eager to see in 2020, if and how they begin to deal with that.

I actually would not think 5nm is possible, but perhaps it is.  Question remains is can it be commercially produced and with operational reliability.  There is a floor >0.1nm.  You can't have a node smaller than an atom.

So, no matter what, the end of Moore's Law is in the near future.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4401
  • Country: us
Re: Can you make the arduino do non miro controler things?
« Reply #24 on: March 10, 2017, 09:35:48 am »
See also https://en.wikipedia.org/wiki/Transistor_count  (alas, it does not include many microcontrollers.)
 

Offline donotdespisethesnake

  • Super Contributor
  • ***
  • Posts: 1093
  • Country: gb
  • Embedded stuff
Re: Can you make the arduino do non miro controler things?
« Reply #25 on: March 10, 2017, 04:21:03 pm »
5nm is the width of about 50 atoms abreast.  They are nearing/entering a domain where quantum mechanics starts to dominate.  I am eager to see in 2020, if and how they begin to deal with that.

I know what you are getting at, but transistors fundamentally depend on quantum effects to operate, so the domination has already occurred :)

Quantum tunneling effects place a limit on the lowest practical feature size, I guess that is what you are thinking of.
Bob
"All you said is just a bunch of opinions."
 

Offline donotdespisethesnake

  • Super Contributor
  • ***
  • Posts: 1093
  • Country: gb
  • Embedded stuff
Re: Can you make the arduino do non miro controler things?
« Reply #26 on: March 10, 2017, 04:22:46 pm »
Since it reads C could you make it do something like process an image (compress a .jpg to lower quality or anything that a computer would do when you program it in C)? Not necessarily to output the image in any usable way but just make it perform calculations or do something other then look at inputs and turn on outputs.

Of course, you could even run a power station* with an Arduino.

*conditions apply
Bob
"All you said is just a bunch of opinions."
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13382
Re: Can you make the arduino do non miro controler things?
« Reply #27 on: March 10, 2017, 05:14:48 pm »
You could even compile Arduino sketches on an Arduino - though it might take the rest of your lifetime just to open the IDE!
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Can you make the arduino do non miro controler things?
« Reply #28 on: March 10, 2017, 07:03:23 pm »
I suppose you could get around the memory limitations by using a serial interface to external RAM and mass storage. It might be kind of fun to see how far the concept could be pushed, maybe boot MS DOS in an x86 emulator? You might not live long enough to see it come up, then again the original PCs were not all that much more powerful than the AVR on an Arduino.
 

Offline retrolefty

  • Super Contributor
  • ***
  • Posts: 1648
  • Country: us
  • measurement changes behavior
Re: Can you make the arduino do non miro controler things?
« Reply #29 on: March 10, 2017, 08:01:04 pm »
A main point is that the 8-bit AVR used in arduino does not 'read' C code. Your PC does all the compiling (search cross compiler). If not for your PC working with an Arduino would not really be practical in anyway.

 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9987
  • Country: us
Re: Can you make the arduino do non miro controler things?
« Reply #30 on: March 10, 2017, 08:31:43 pm »
I suppose you could get around the memory limitations by using a serial interface to external RAM and mass storage. It might be kind of fun to see how far the concept could be pushed, maybe boot MS DOS in an x86 emulator? You might not live long enough to see it come up, then again the original PCs were not all that much more powerful than the AVR on an Arduino.

The original 8080 ran at 2 MHz clock and about 4 clocks per instructions (IIRC) so about 500k instructions per second.  Compare this to nearly 20M instructions per second on the AVR.  I suppose it would be possible to get some kind of AVR to run CP/M and do it a LOT faster than my Altair 8800.  I would probably have to forego the 8" floppies and go straight to SD cards. 

Even the Z80 only ran at 6 MHz or about 1.5M instructions per second and it was considered smokin' at the time.  Arcade games used lots of Z80 chips!

So, wimpy as they are, AVRs are pretty impressive!
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Can you make the arduino do non miro controler things?
« Reply #31 on: March 10, 2017, 10:26:16 pm »
It's hard to compare clock cycles and instructions per second between different architectures. Especially when you're dealing with a microcontroller that has no exposed data and address buses. Yeah the Z80 and the 6502 were both very common in arcade games, Atari used a lot of 6502's. The games typically had custom graphics and sound hardware though, hardwired predecessors to the graphics accelerator.
 

Offline timb

  • Super Contributor
  • ***
  • Posts: 2536
  • Country: us
  • Pretentiously Posting Polysyllabic Prose
    • timb.us
Re: Can you make the arduino do non miro controler things?
« Reply #32 on: March 11, 2017, 12:24:28 am »
It's hard to compare clock cycles and instructions per second between different architectures. Especially when you're dealing with a microcontroller that has no exposed data and address buses. Yeah the Z80 and the 6502 were both very common in arcade games, Atari used a lot of 6502's. The games typically had custom graphics and sound hardware though, hardwired predecessors to the graphics accelerator.

It's also important to keep in mind that the same code can take different amounts of instructions, depending on the CPU architecture you're compiling for. Let's take this simple piece of code:

Code: [Select]
int square(int num) {
    return num * num;
}

Now, let's look at the ASM that outputs for different architectures (using the same version of GCC):

AVR GCC 4.5.3
Code: [Select]
__SREG__ = 0x3f
__SP_H__ = 0x3e
__SP_L__ = 0x3d
__CCP__ = 0x34
__tmp_reg__ = 0
__zero_reg__ = 1
square(int):
        push r29
        push r28
        rcall .
        in r28,__SP_L__
        in r29,__SP_H__
        std Y+2,r25
        std Y+1,r24
        ldd r24,Y+1
        ldd r25,Y+2
        ldd r18,Y+1
        ldd r19,Y+2
        mov r22,r18
        mov r23,r19
        rcall __mulhi3
        pop __tmp_reg__
        pop __tmp_reg__
        pop r28
        pop r29
        ret

MSP430 GCC 4.5.3
Code: [Select]
square(int):
        push    r10
        push    r4
        mov     r1, r4
        add     #4, r4
        sub     #2, r1
        mov     r15, -6(r4)
        mov     -6(r4), r10
        mov     -6(r4), r12
        call    #__mulhi3
        mov     r14, r15
        add     #2, r1
        pop     r4
        pop     r10
        ret

ARM GCC 4.5.3
Code: [Select]
square(int):
        push    {r7}
        sub     sp, sp, #12
        add     r7, sp, #0
        str     r0, [r7, #4]
        ldr     r3, [r7, #4]
        ldr     r2, [r7, #4]
        mul     r3, r2, r3
        mov     r0, r3
        add     r7, r7, #12
        mov     sp, r7
        pop     {r7}
        bx      lr

x86-64 GCC 4.5.3
Code: [Select]
square(int):
        push    rbp
        mov     rbp, rsp
        mov     DWORD PTR [rbp-4], edi
        mov     eax, DWORD PTR [rbp-4]
        imul    eax, DWORD PTR [rbp-4]
        leave
        ret

Also keep in mind that each instructions could take anywhere from one to hundreds of clock cycles to execute, it all depends on the instruction in question, the architecture, your code, the compiler used, the current day of the week, humidity and alignment of the planets! Comparing one architecture to another is difficult; it's apples to weird space apples, really.

That said, it *is* useful to checkout the sort of assembly your code is producing and compare it among compiler versions and architectures. I use Compiler Explorer to do that and it's awesome.
Any sufficiently advanced technology is indistinguishable from magic; e.g., Cheez Whiz, Hot Dogs and RF.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4401
  • Country: us
Re: Can you make the arduino do non miro controler things?
« Reply #33 on: March 11, 2017, 02:53:54 am »
You also have to be careful about the Optimization settings of your compiler; sometimes they make a bigger difference than other times.  For example, if I run "square" through avr-gcc with the -O3 setting, I get:
Code: [Select]
00000000 <square>:
   0:    88 9f           mul    r24, r24
   2:    90 01           movw    r18, r0
   4:    89 9f           mul    r24, r25
   6:    30 0d           add    r19, r0
   8:    98 9f           mul    r25, r24
   a:    30 0d           add    r19, r0
   c:    11 24           eor    r1, r1
   e:    c9 01           movw    r24, r18
  10:    08 95           ret
(That's 4.3.3, rather than 4.5.3, but I get approximately the same improvement with 4.9.x.)
(Also note that "int" on an AVR is 16bits, while "int" on the ARM and x86 is 32bits...)
 

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 3510
  • Country: us
Re: Can you make the arduino do non miro controler things?
« Reply #34 on: March 11, 2017, 05:08:40 am »
On second thought, I removed the reply I just made to avoid hi-jacking the thread and tangent into other areas.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf