Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

SB with NGO much slower then Arduino


  • Please log in to reply
4 replies to this topic

#1 eplaksienko

eplaksienko

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts

Posted 17 March 2013 - 03:25 AM

Hi!

 

may be I misunderstand something, but it seems me processing NGO with SB much slower then with Arduino, I am playing with step motor and I can see difference, I made everything easy, but still I can not get rotate it quicker, and signal lamps are just visible much slower then with arduino, may be there is any hack or anything I am doing wrong, the same code with arduino just fly. Any advise really appreciated

 

PS: I use Stepper Motor+ Driver Board ULN2003 5V 4-phase 5 line

 

 public class Program
    {
     
     
     
        public static void Main()
        {
            // write your code here
            NetduinoGo.ShieldBase sb = new NetduinoGo.ShieldBase((GoBus.GoSocket)4);
            OutputPort op1 = new OutputPort(sb.Pins.GPIO_PIN_D8, false);
            OutputPort op2 = new OutputPort(sb.Pins.GPIO_PIN_D9, false);
            OutputPort op3 = new OutputPort(sb.Pins.GPIO_PIN_D10, false);
            OutputPort op4 = new OutputPort(sb.Pins.GPIO_PIN_D11, false);
 
            bool[][] positions = { new bool[] { false, false, false, true }, new bool[] { false, false, true, true }, new bool[] { false, false, true, false }, new bool[] { false, true, true, false }, new bool[] { false, true, false, false }, new bool[] { true, true, false, false }, new bool[] { true, false, false, false }, new bool[] { false, false, false, false } };
 
            Debug.Print("started");
         
            while (true)
            {
                 
                    op1.Write(positions[0][0]);
                    op2.Write(positions[0][1]);
                    op3.Write(positions[0][2]);
                    op4.Write(positions[0][3]);
                    op1.Write(positions[1][0]);
                    op2.Write(positions[1][1]);
                    op3.Write(positions[1][2]);
                    op4.Write(positions[1][3]);
                    op1.Write(positions[2][0]);
                    op2.Write(positions[2][1]);
                    op3.Write(positions[2][2]);
                    op4.Write(positions[2][3]);
                    op1.Write(positions[3][0]);
                    op2.Write(positions[3][1]);
                    op3.Write(positions[3][2]);
                    op4.Write(positions[3][3]);
                    op1.Write(positions[4][0]);
                    op2.Write(positions[4][1]);
                    op3.Write(positions[4][2]);
                    op4.Write(positions[4][3]);
                    op1.Write(positions[5][0]);
                    op2.Write(positions[5][1]);
                    op3.Write(positions[5][2]);
                    op4.Write(positions[5][3]);
                    op1.Write(positions[6][0]);
                    op2.Write(positions[6][1]);
                    op3.Write(positions[6][2]);
                    op4.Write(positions[6][3]);
                    op1.Write(positions[7][0]);
                    op2.Write(positions[7][1]);
                    op3.Write(positions[7][2]);
                    op4.Write(positions[7][3]);
                    Thread.Sleep(1);
             
            }
 
 
        }
 
    }


#2 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 17 March 2013 - 05:22 PM

yeah i can imagine that beein very slow.

from what i know shieldbase uses uart (serial) to send the commands, and you send a lot of it, theres also error checking ans stuff i dont even know of i guess :P

 

next: netmf is interpreted, and its way slower than arduino, way way way.

 

 

the benefit  for sure it the nice ide and a managed and beautiful language, more ram and flash



#3 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 17 March 2013 - 06:32 PM

Hi eplaksienko, This particular type of application is going to be slower on Netduino than on Arduino. Bitbanging motor control commands may work...but it's generally best to use PWM. Is this something that would benefit from PWM enhancements which synchronized multiple channels (perhaps with some inverted from the others)? Chris

#4 eplaksienko

eplaksienko

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts

Posted 17 March 2013 - 09:31 PM

Chris, do you mean to send all 4 channels the same time, use 255 bit pwm to split, then I win x4?



#5 eplaksienko

eplaksienko

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts

Posted 17 March 2013 - 09:32 PM

Chris, in additional is there any hacks to send some more native way?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.