Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 14 of 14

Thread: help on all these different types of processors

  1. #1

    help on all these different types of processors

    I'm new to hardware and also semi new to programming, so bare with me. I'm confused by all the different processors chosen by all these micro controllers.

    arduino uses atmega
    teensy uses atmega and now arm cortex (which from what I know is an actual cpu?)
    pi uses arm 11 (<-- but I assume the cpu is so beefy that it can also do video as well? I guess it has a large enough ramdac for frame buffer where as all these others don't?)
    then there is fpga's... I honestly have no clue what these are, but so far anytime major video is required they point you to a fpga.. why? what is special about a fpga?

    What makes pi different than the teensy 3? I know the teensy uses a boot loader off chip, but how does the pi work? Boot loader on chip, then checks sd card for os? I assume if the teensy 3 had enough ram, that it could be possible to build a bootloader to check sd for a os? Also, I know the pi uses gpio, and from what it looks like so does the teensy, but the argument I've always heard is gpio is slower than arduino's io compared to the pi? is this because access to the gpio ports are going through a nasty software layer? and how does the teensy deal with this? or is this just a false argument?

    most of this is confusing cause then you look at cell phones.. what do they use? currently I think most androids use arm cortex's but how do those cpu's differ from teensy's or pi's? are they really just the same with beefed up specs and setup like the pi?

  2. #2
    Senior Member MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    1,800

    Cool

    This is only going to be a high level summary.

    First of all, Arduino now has an Arm product as well (the Due).

    At the basic level is which chip is in the product. Most of the Arduinos (except Due) use ATmega chips from AVR. These are all 8 bit processors. To deal with larger data, like int or long, multiple instructions will be needed to be done. So for example, to add two 16-bit numbers, might involve two instructions, ADD and ADD-carrying. On a 32-bit chip like the ARM, this would be a single ADD instruction. Now, in general most of the chips used in embedded spaces are not performance critical, as they are using waiting for a device to come back. Sometimes things are performance critical (video and audio for instance), and the 8-bit chips may not be up to the task. One consequence is the int data type is 16-bits. In general, most of the 8-bit chips have small amounts of read/write memory, and moderate amounts of read-only memory for program space. One of the reasons to go with Arm is to get to higher amounts of memory (but it depends on what the actual chip has).

    The ARM based chips uses a different instruction set at its core. Think of it as the AVRs internally speak Italian and the ARMs speak German, within each system, assuming you are fluent in the language you can do anything, but speaking German in an area populated only with Italian speakers won't get you very far. The Arm is a scale-able architecture, and it has multiple different levels. Most of the chips for embedded programming tend to be fairly basic Arms, and run at slow clock speeds. The primary reason is power and cost -- running at higher clock speeds consumes more power. Also, adding extra things to the base architecture can also increase the cost, using a newly designed chip vs. an older design that is simpler.

    In general, until you get to things like hardware interrupts, writing to machine specific registers, or writing assembly language, most people don't have to worry about the details, and the compiler will compile the code for the appropriate machine (i.e. writing out instructions in Italian or German to use my example). Now, the closer you get to the hardware, the more you have to know what goes on at the hardware level.

    My day job is working on the GCC compiler for a completely different chip, and there I have to have extensive knowledge of the machine. However, dealing with Arduinos and Teensy is an after the hours hobby, and so I so far have avoided poking under the covers too much. I know from past jobs, that I generally can only keep a few architectures current in my brain, and I need to swap them out when I'm not dealing with them on a current basis. I've lost track of the number of chips I've looked at over the last 30+ years, but I believe it is now over 20.

    Now, the Raspberry Pi is also an Arm chip, but it is a much beefier chip than the Teensy 3.0 chip. instead of having 16 kilobytes of read/write memory and 128 kilobytes of read-only program memory, the R-PI has 256 megabytes or 512 megabytes of read/write memory. It also has full support for running a full operating system (typically Linux, but you could run your own). It also runs at 700 Khz, while the Teensy 3.0 runs at 48 Khz or 96 Khz, and has instructions for doing floating point calculations. Thus if you need to do lots of calculation or process lots of data, you go for the R-PI. However, the R-PI is less friendly for embedding programming, since you typically need to go through the OS which can introduce delays. Also, the Arduinos/Teensys have a lot of pins for controlling devices, while the R-PI only has a few.

    Another difference is the R-PI has a separate chip to do video processing. So for things like drawing on a screen, the Arm processor tells the video processor to do stuff at a higher level, and it does it in parallel with the main processor. Unfortunately, the video processor on the R-PI is not open, and so you have less flexibility to run stuff in the video processor, than you might if the design were completely open.

    Cell phones are similar, except the newer cell phones now have multiple processors, and maybe can run at even faster rates. But that's the reason most of the smart phones need either big batteries or need to be recharged more often than older phones in the past.
    Last edited by MichaelMeissner; 03-01-2013 at 05:00 PM.

  3. #3
    Was reading the wiki page on the r-pi and it's a broadcom chip with arm 11 and their vcore 3 gpu. Seems to be a all in one chip compared to the micro controllers. So then you would agree that with the R-PI having to go through a software layer (aka the linux kernal) it causes the gpio to be slow? And thus why teensy doesn't experience this is because Paul (who is awesome) is accessing it directly from within the chips flash vs sd which has a much lower level control point and faster speed.

    Since Paul made the teensy 3 to be a off the chip bootloader, does that mean the R-PI just used it's flash on chip to build a boot loader to pull from SD since user control to that flash is denied? I mean why build a off chip boot loader when they know the chip's internal flash will never be used, best to make use of it as a boot loader for and OS on a SD card right?

    Making a bit more sense now how all this works really. And Thank you very much Michael! You've been a awesome help!

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    11,716
    Generally, microcontroller-based boards, like Teensy and Arduino, are best for interfacing sensors, controlling hardware like motors and lights, and similar tasks. Some microcontrollers offers better CPU performance, but even those are relatively limited. Generally you use boards like Teensy for tasks that involve input/output and modest manipulation of data. Microcontrollers use relatively little power, so they're typically the best choice if your project will run on a battery or need to fit into a very small space.

    Small-scale computers, like Raspberry Pi, internet routers and even small PCs are best for complex data manipulation tasks. If you need special networking, like running a web server with scripting in Python, Perl, etc, that's where those platforms really shine. These systems run Linux, which gives you a lot of great multitasking capability and access to lots of software (though much of it is designed to run on more powerful PCs). Raspberry Pi has I/O pins which can interface some things, but generally the I/O capability is less than using a microcontroller. Typically power consumption is a few watts, so usually they aren't run from batteries. These boards can work in moderately sized sealed boxes (little or no airflow), but not the tiny spaces where microcontrollers can fit.

    There are a lot of projects where either a microcontroller or small scale computer can do the job. Each has its own strengths. Many people have used them together, where the microcontroller handles I/O tasks and rapid response to special signals, and the small scale computer does data manipulation and networking. Together they can do a tremendous amount.

    FPGAs are very specialized hardware, normally used for only very advanced applications. They are much harder to use than microcontrollers or small scale computers. Typically they're needed for very special applications that manipulate tremendous amounts of data at very high speeds. If you're just getting started with electronics, FPGAs are not a good place to start.

  5. #5
    Makes sense why fpga's are mostly used in driving larger lcds and such. Heck I'm just glad my teensy 3 can handle the 3.2in I'm using now.

  6. #6
    Senior Member
    Join Date
    Jan 2013
    Location
    San Francisco Bay Area
    Posts
    433
    Quote Originally Posted by MichaelMeissner View Post
    Now, the Raspberry Pi is also an Arm chip, but it is a much beefier chip than the Teensy 3.0 chip. instead of having 16 kilobytes of read/write memory and 128 kilobytes of read-only program memory, the R-PI has 256 megabytes or 512 megabytes of read/write memory. It also has full support for running a full operating system (typically Linux, but you could run your own). It also runs at 700 Khz, while the Teensy 3.0 runs at 48 Khz or 96 Khz, and has instructions for doing floating point calculations.
    The Raspberry Pi is at 700 Mhz.

  7. #7
    Thanks Paul for the clear presentation!

  8. #8
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a Space Turkey, Dinosaur, and a Vampire Pig
    Posts
    1,320

    Just as the Teensy is 24/48/96MHz...

    Quote Originally Posted by linuxgeek View Post
    The Raspberry Pi is at 700 Mhz.
    ...the OP had the multiplier right even if the frequencies were off by three orders of magnitude.

  9. #9
    Senior Member MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    1,800
    Quote Originally Posted by Constantin View Post
    ...the OP had the multiplier right even if the frequencies were off by three orders of magnitude.
    Yes, I obviously was shooting off the cuff in terms of the speeds.

  10. #10
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a Space Turkey, Dinosaur, and a Vampire Pig
    Posts
    1,320
    Quote Originally Posted by MichaelMeissner View Post
    Yes, I obviously was shooting off the cuff in terms of the speeds.
    Mr. Meissner,

    You'll likely forget in a given day more about programming, CPUs, etc. than I will ever know. Thank you in particular for the many useful posts here and elsewhere re: programming, the GCC compiler, and the many idiosyncrasies of the underlying hardwares you have supported over the years. Perhaps one day I can repay my debt of gratitude with something useful in return, perhaps how to manufacture a part for your steampunk camera - but that is assuming you'd need that help...
    Last edited by Constantin; 03-06-2013 at 09:11 PM.

  11. #11
    Junior Member
    Join Date
    Jun 2016
    Location
    Anantapur
    Posts
    13
    Dear paul
    Please guide me, how to use teensy and rasperry pi together.
    The serial data from Teensy 3.2 needs to connect to pi,perhaps problem in serial connection.
    I succesfully interfaced UNO and pi but not teensy 3.2 and pi,. I am getting the serial data from UNO to Pi.

  12. #12
    Junior Member
    Join Date
    Apr 2015
    Posts
    9
    First let's just say you have a lot of questions here that bridge the programming and electrical engineering worlds. I'm not sure if you will get an optimal answer here, you really need o find a book on MicroControllers.


    Quote Originally Posted by nekidfrog View Post
    I'm new to hardware and also semi new to programming, so bare with me. I'm confused by all the different processors chosen by all these micro controllers.

    arduino uses atmega
    teensy uses atmega and now arm cortex (which from what I know is an actual cpu?)
    ARM M4 series of MicroControllers would be more accurate for the new Teensy.
    pi uses arm 11 (<-- but I assume the cpu is so beefy that it can also do video as well? I guess it has a large enough ramdac for frame buffer where as all these others don't?)
    They do video due to having hardware to support video. The video portion of the chip is separate from the CPU section. Depending upon the chip the video section can be a pretty advanced computational unit all on its own. Currently the fastest GPUs show up in Apples A series chips and a couple of others.
    then there is fpga's... I honestly have no clue what these are, but so far anytime major video is required they point you to a fpga.. why? what is special about a fpga?
    Your best bet is simply to put FPGA out of your mind for now. Why? Well to put it simply you really need an electrical engineering background to leverage such a chip. FPGA (field programmable gate arrays) ar a class of chip known as programmable hardware. There is really now reason for a beginner to concern your self with them.
    What makes pi different than the teensy 3?
    Faster hardware. Support for memory management. A video section far more addressable RAM.
    I know the teensy uses a boot loader off chip, but how does the pi work? Boot loader on chip, then checks sd card for os?
    Asking this question may be confusing but I believe this one is booted up via the GPU section. Well one of these little boards is and I think it it Raspberry PI.
    I assume if the teensy 3 had enough ram, that it could be possible to build a bootloader to check sd for a os?
    An Operating System means different things to different people but it is possible to run an OS on these sort of MicroControllers. It won't be Linux though, likely an embedded realtime kernel. Linux for the most part requires a chip with a memory management unit.
    Also, I know the pi uses gpio, and from what it looks like so does the teensy, but the argument I've always heard is gpio is slower than arduino's io compared to the pi? is this because access to the gpio ports are going through a nasty software layer?
    Possibly! I haven't looked into this so I can't assume this is correct.

    The thing is this, software written for Teensy can be fast due to directly manipulating the hardware. However the processors in the Teensy's are relatively slow compared to a cell phone chip running at 1 GHZ or whatever a specific board runs at. So the potential here is that Raspberry PI can process data much faster feeding I/O quicker. You also get into issues of architecture and where the ports are located in that hierarchy. In the end it depends.

    Also realize that most Raspberry PIs are running Linux. There are different ways to get to hardware in Linux so how a solution is structured impacts how fast something can happen.

    and how does the teensy deal with this? or is this just a false argument?
    It isn't so ,icy a false argument as it is a silly argument. For example Raspberry PIs can do Ethernet with fairly good performance. Teensy on the other hand might struggle to keep a port feed.

    This highlights a problem with these discussions because you really aren't comparing Apples to Oranges.
    most of this is confusing cause then you look at cell phones.. what do they use?
    Depends upon the cell phone, nut most smart phones use high end ARM processors. Sometimes these are called Applications processors as opposed to embedded processors. Applications processors are processors capable of running full blown operating systems.
    currently I think most androids use arm cortex's but how do those cpu's differ from teensy's or pi's? are they really just the same with beefed up specs and setup like the pi?
    They vary from the Teensy's by having a memory management unit to support the operating system, they have a GPU, lots of RAM and high performance.

  13. #13
    Senior Member Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    464
    Mr vishnuchittan.m, if really think that you should really be more specific about what you want to do. Before talking about interfacing hardware, the first step is to define exactly what the result should be: What data is to be captured and from where, how it has to be processed, and finally how and where it has to be outputted. The second step is to define the HMI (Human-Machine-Interface) : Is one needed? If yes, how has it to look and which interactions are wanted?
    All that has to be done on a hardware independent and abstract level.

    Then, and only then, you might start thinking about hardware: First, you'll have to define the required I/O types and modules, then you'll have to estimate the needed computing power, memory size and bandwidth. With these details, you'll have to gather information about different processor types (or embedded systems) and to study their reference manuals until you find the one(s) which meet your specific requirements. You'll have to buy a few different systems and write a few example programs to see if they really suit your specific needs. When you'll have found these, you can start asking questions about programming and interfacing. That's how engineers work.

    Your questions up to now appear very silly, like "How do I attach a trailer to a car?" without having said what you want exactly to transport. In this example, you'd have first to precise the nature, the volume/size and the weight of your freight, then, depending on that, to select a suitable trailer and finally a car which will be powerful enough to pull the thing. Only if all that is done, the questions on how to attach that specific trailer to that specific car might arise, and like there are different standardized attachment systems for different car/trailer combinations, there are different interfacing systems between hardware, like SPI, I2C, Serial, USBHID, and so on.

    But before all, for heavens sake, be precise about your intentions! Although many forum members here are ready and willing to sacrifice time to help beginners realizing specific complex tasks (for example: I want to collect data from up to ten temperature sensors in my house, compare these to the presets for each room, and finally control the heater valves to keep the temperatures within the individual presets +/- 0.5C. I want to control everything from a 7" touch display in my living room, which should also allow me to set up different preset sets for different times of the day and different season. I'll need a real time clock and calendar in that system which switches automatically between the different presets.), we can for sure not replace a technical university and transform everybody into experienced engineers.

  14. #14
    Senior Member Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    2,506
    Quote Originally Posted by wizard69 View Post
    ...
    Ok, this thread is from 2013..
    But wizard you simplified some things - the next-gen Teensy will have a MPU, so it might be possible to run a simplified linux on it (but that's nothing I'd do..)


    Most of the time, for the things we are doing here with Teensy (or Arduino) ...it is better NOT to have an OS.
    Last edited by Frank B; 06-11-2016 at 10:40 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •