GPIO VS Arduino direct control

Discussion in 'General Discussion' started by Luce, Dec 10, 2013.

  1. Luce

    Luce New Member

    Joined:
    Dec 10, 2013
    Messages:
    3
    Likes Received:
    0
    Hi All! I am new to UDOO and I am waiting to open UDOO box and turn on my own board!

    I have a couple of questions about GPIO and his performances/limits.
    • Can i do the same things that i do with Arduino with GPIO? Or there are something that i can't do and i must use arduino instead of GPIO?
      what about performances of GPIO controls, reads and writes? Are there faster than arduino's?
      Reading from Arduino, passing it from serial to i.MX6 and output is slower than reading direcly from GPIO? And what about writing?

    Thanks to anyone who will help me :)
     
  2. Lifeboat_Jim

    Lifeboat_Jim New Member

    Joined:
    Sep 16, 2013
    Messages:
    399
    Likes Received:
    1
    Welcome.



    • I think you're confused. The UDOO is a dual/quad ARM9 and a SAM3X8E which is an Arduino Due compatible clone.

      GPIO is General Purpose Input/Output.

      So I have no idea what you believe you can and cannot do. Perhaps it's best if you explain what your planning to do.

      As above, the SAM3X8E is and Ardiono Due. The fastest Arduino available (many times faster).

    Again, I don't know to what information you refer. Perhaps you could link the article you quote from and explain your concern.
     
  3. EBrown

    EBrown New Member

    Joined:
    Dec 9, 2013
    Messages:
    48
    Likes Received:
    0
    You can do the same things with the digital GPIO's in both the i.MX6 and the SAM3X. (Arduino and CPU) However, you can not measure or signal analogue signals with the i.MX6 (computer). This being said, there are ways to work around it, which I will be working on when I get time on Thursday and Friday.

    Thanks,
    EBrown
     
  4. Luce

    Luce New Member

    Joined:
    Dec 10, 2013
    Messages:
    3
    Likes Received:
    0
    @EBrown thanks! Good work, then! I hope you will share your job :D
    @Lifeboat_Jim 2 examples.


    Example 1 (looping):

    Scenario A) Arduino sketch;

    • SAM3X reads value from PIN X
      SAM3X turns on/off a led on PIN Y corresponding to red value from PIN X

    Scenario B) C, C++, script shell, script in other language on ARM9:

    • ARM9 reads value from PIN X (GPIO)
      ARM9 turns on/off a led on PIN Y corresponding to red value from PIN X (GPIO)

    Which is faster?
    Which is ""better"" if the only propose is to control the led?


    Example 2 (looping):

    Scenario A) Arduino sketch;

    • SAM3X read value from PIN X
      SAM3X turns on/off a led on PIN Y corresponding to red value from PIN X
      SAM3X make some statistics about PIN X status over time
      SAM3X send statistics results through serial to ARM9 (suppose a fast implementation)
      ARM9 read serial stream
      Display on monitor statistics value

    Scenario B) C, C++, script shell, script in other language on ARM9:

    • ARM9 reads value from PIN X (GPIO)
      ARM9 turns on/off a led on PIN Y corresponding to red value from PIN X (GPIO)
      ARM9 makes statistics
      Display on monitor some statistics about PIN X status over time

    Again, which is faster?
    Which is ""better""?

    Thanks :)
     
  5. Lifeboat_Jim

    Lifeboat_Jim New Member

    Joined:
    Sep 16, 2013
    Messages:
    399
    Likes Received:
    1
    You don't mention whether it's Digital or Analog. So worst case then Analog:

    Both can do the job, potential speeds of 1,000,000 reads (ADC) is possible (with some tuning, out of the box ADC speeds are 'just' hundreds of thousands reads per second). Given the SAM3X8E has a clock of 84MHz there is plenty of headroom for the rest of the code.

    I haven't looked into how fast the i.MX6 can do ADC, I'd expect several hundred thousand per second at least.

    Buttons and LEDs clearly aren't an issue even if you fade them and are mashing buttons like a mad person.

    The take away is that the UDOO would be spinning 99.x% of its potential on such a task so don't worry about which is faster.

    Better? Well the SAM3X8E would be simpler and quicker to have up and running.

    Same comments as above of course +

    You won't get more than 4mbps out of the UART, but that is pretty fast for sending 'stats' or messages back and forth (say a summary of activity every 250ms).

    If this project of yours really was LEDs & Buttons then either would do the job.

    For a real project you would have the SAM3X8E handle all the hardware, an Asynchronous Message Queue over UART, the i.mx6 doing stats/logging & GUI.
    Bear in mind the SAM3X8E would be 'Real Time' whereas the i.MX6 normally isn't (although can be if you use a RTOS).

    Hope this helps
     
  6. Luce

    Luce New Member

    Joined:
    Dec 10, 2013
    Messages:
    3
    Likes Received:
    0
    Cool, thanks :)
     

Share This Page