For Timer 3, Do I keep the OCR statements as they are or do they need changing if using pins 3 and 5 for 20 kHz PWM on the Mega? I'm getting quite confused with setting up the correct frequency on the appropriate pins.
As I understand it, OCR3C is for the register for pin 3, and OCR3A is for pin 5. Since I'm using these pins instead of 11 and 12, do I just change the OCRxx in the .cpp file for the parts that deal with motor 1 and 2?
Also, Are the following TCCRxx correct for the lines below defines statement for the Mega 1280/2560 :
TCCR3A = 0b1010100;
RCCR3B = 0b0001001;
Ive attached the modifications to the library. The .h file has the remappings and the .cpp file has modifications to remap the EN2DIAG2 from pin 5 to pin 9 because I want the two PWM pins to be 3 and 5. The TCCxx lines are set to the above two assignments. I changed SetM1Speed OCRxx to OCR3C for Timer 3 on pin 3. I wont change anything else until I get motor 1 work correctly.
DualVNH5019MotorShieldMegaMYMODS.zip (3.24 KB)