user56511: I have connected DRV8835 with 2 DC motors with 11 power supply. Arduino nano.
When I for loop like i from 0 to 1024 for analogWrite(i,Motor1) for the DC Motor1 it's accelerating from 0 to 200 and it's stopping. When I becomes 250 it's starting at higher speed. When it becomes 500 it's stopping again. And 550 we have our power again.
Now I tried to run analogWrite(1000, ***) but it's not working. When I change the value from 1000 to 1005 it's not working again. But at 1024 we have the maximum speed and it is working? 

 #define LEFT_PWM 9
 #define RIGHT_PWM 10
 #define LEFT_DIR 5
 #define RIGHT_DIR 6

void setup() {
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
}

void loop() {
  digitalWrite(LEFT_DIR, HIGH);
  analogWrite(LEFT_PWM, 1000);
}


user55899: analogWrite has the following prototype
void analogWrite(uint8_t, int);

which means that its first parameter has [0, 256) range and follows the rules of modulo arithmetic, with 256 as the modulo. If you supply arguments outside of [0, 256) range, they will be interpreted % 256. 1000 is the same as 232 (1000 % 256 == 232), 500 is the same as 244, 550 is the same as 38 and so on.
This is not fully consistent with the symptoms you describe (if your description is accurate), which might imply that something else is a factor here. Are sure you are using your DRV8835 in PHASE/ENABLE mode (pin 11 pulled high)?

56511: <p>I have connected DRV8835 with 2 DC motors with 11 power supply. Arduino nano.</p>

<p>When I for loop like i from 0 to 1024 for analogWrite(i,Motor1) for the DC Motor1 it's accelerating from 0 to 200 and it's stopping. When I becomes 250 it's starting at higher speed. When it becomes 500 it's stopping again. And 550 we have our power again.</p>

<p>Now I tried to run analogWrite(1000, ***) but it's not working. When I change the value from 1000 to 1005 it's not working again. But at 1024 we have the maximum speed and it is working? 
</p>

<pre class="lang-cpp prettyprint-override"><code> #define LEFT_PWM 9
 #define RIGHT_PWM 10
 #define LEFT_DIR 5
 #define RIGHT_DIR 6

void setup() {
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
}

void loop() {
  digitalWrite(LEFT_DIR, HIGH);
  analogWrite(LEFT_PWM, 1000);
}
</code></pre>
 55899: <p><code>analogWrite</code> has the following prototype</p>

<pre><code>void analogWrite(uint8_t, int);
</code></pre>

<p>which means that its first parameter has <code>[0, 256)</code> range and follows the rules of modulo arithmetic, with <code>256</code> as the modulo. If you supply arguments outside of <code>[0, 256)</code> range, they will be interpreted <code>% 256</code>. <code>1000</code> is the same as <code>232</code> (<code>1000 % 256 == 232</code>), <code>500</code> is the same as <code>244</code>, <code>550</code> is the same as <code>38</code> and so on.</p>

<p>This is not fully consistent with the symptoms you describe (if your description is accurate), which might imply that something else is a factor here. Are sure you are using your DRV8835 in <code>PHASE/ENABLE</code> mode (pin 11 pulled high)?</p>
