I'm working on a project to use an Arduino board as a significantly less expensive alternative to a PDI box for motor control. I'm relatively inexperienced when it comes to software/electronics, just a heads up. We've got an atmega2560 and we've got the pwm output to 16 bits which is fast enough but we need a higher resolution. The counter currently counts from 0 to 255 but how can I change that to a 16 bit counter if that's possible.
I'm using an mega 2560 by the way.
I spent some time sifting through the datasheet for the 2560 and it seems I need to change ICRn or OCRnA to max, whatever that value may be.
The more accuracy the better. How would I go about doing that. I've been pouring over the atmel datasheet for the last day or 2 and have gotten somewhere but haven't figured it out yet
Now I'm really lost haha. My problem is this. I have the arduino board controlling a motor using PWM. I'm using timer 2, pin 3; a 16 bit timer. I have the prescaler value for the timer set to 1 meaning a PWM frequency of 62500. (i used this Arduino Playground - TimerPWMCheatsheet). The frequency of the PWM signal is fast enough but, we need a higher counter resolution to better control the duty cycle. In this case, we don't want a duty cycle from 0 to 255, but something larger, hence I said 16 bit because I'm assuming that's the cap. On the atmega 2560 datasheet, the MAX value for the counter is 0xFFFF which is what I want to set it to. But I don't know how, which is what I'm inquiring about.