Problem with arduino Mega2560 PWM programming


hello,

i'm working on robotics project @ engineering school , i'm stuck problem.
i've made mistake electronic card made, i'm using pins 3 , 14 (timer 0) , 9 , 10 (timer 2) drive 2 motors. setup need 2 in sync opposite pwm signals each motor.

i foolishly based off site saw 31khz max value both when in actual fact 62khz or timer 0.
i need frequency between 20 , 40khz drive motors, , i'm stuck 62khz or 7.8khz on pins 3 , 14 depending on if use prescaler of 0x01 or 0x02.
i either need figure out way working correctly or need totally messy scrape part of card off , solder wires link pwm outputs timer.

i've been struggling details of datasheet atmel processor on arduino mega2560.
i've seen few options might work far having no luck, i'm wondering if has tried these before?
- using pwm configuration on 9 or 10 bits instead of 8 may force lower frequency
- using other base pwm mode instead 1 of "compare" things manually make switch high or low value @ given time might let me influence frequency
- configure pwm run based off external clock , somehow use timer timer 1 or 2 either via physical hookup or coding

really stuck, use help! lot



Arduino Forum > Using Arduino > Microcontrollers > Problem with arduino Mega2560 PWM programming


arduino

Comments

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support