In the binary world, multiplying by 2 is the same as shift left 1 (<< 1).
This will always leave a 0 it the bit0 location. So if you had a dutycycle of say 257 (100000001), * 2 would be 514 (1000000010).
The easiest way to fix it is to just use bigger numbers. 10-bit numbers range from 0 to 1023. <br>
Bookmarks