I´m on a litte robot project and I´m running out of pins so I purchased this Mega-Board here.
I couldn´t find a category for MEGA Boards, so I´m hoping the Due is the closest match...
To run the motors without the humming noise, I found this tutorial here were a code was used written by macegr. On my old Elegoo Uno R3 this code worked fine and the Motors were running perfectly without the humming noise. (You need to scroll down a lot for the modified code.)
Unfortunately this code does not work on my new board so I´m thinking of getting an original MEGA Board. Can anybody tell me if this code would work on the original MEGA board as well? Unfortunately this code is way too advanced for me to understand and modify it by my own. The beauty of this code is, that it covers all pins if called in the ().
I need to change the PWM frequency for Pins 5,6 and 9,10
Thanks a lot for your support
Ben
PS: I also found this post here to change the frequency’s on a Due. so this would be an alternative as well.
The reason why the code will not work on your new board is because it has a different microprocessor chip on it than the Uno and so does the original Mega
The code addresses some registers of the chip, so as written will only work with an ATMega328. I have no doubt that it is possible to change the PWM frequency of the Mega and you may well find some help using Google
Thanks for your post and explaining the background why the Uno-code is not working on my MEGA. That makes absolutely sense…
So the easiest solution for me would be to get the Arduino Due and use the code which was posted in the other thread.
All my controllers and sensors are fine with 3.3V, the only downside for me is the relatively high power consumption of the Due compared to the Mega. Its higher speed is not really relevant for me.
Are there any more points to take into account?
Or is there a board using the ATmega328(P) which has 7 analog, 4 PWM pins, 8 digital and a pair of DCL/SDA pins?