Page 2 of 2

Re: running a DC motor using the arduino motor shield

Posted: Thu Apr 07, 2022 11:33 pm
by medelec35
The period register is misleading on the AVR range as it's always fixed at 256, there no period control register.
Therefore, as the period on PWM and the motor shield only shows 0 to 255 and not 256, the frequency displayed will not be correct.
It's not anything you are doing wrong.
You should see a warning about the period control register when compiling.

Re: running a DC motor using the arduino motor shield

Posted: Fri Apr 08, 2022 9:56 am
by chipfryer27
Hi Martin

Thanks for the clarification. I'll check the compiler messages later too.

Regards

Re: running a DC motor using the arduino motor shield

Posted: Sun Apr 10, 2022 8:33 pm
by peterhalloway
Hi Martin
I have updated flowcode reprogrammed the arduino but still the motor does not turn. I also did not get a compiler warning. I am sure there is something simple I am doing wrong?

Pete

Re: running a DC motor using the arduino motor shield

Posted: Sun Apr 10, 2022 9:41 pm
by chipfryer27
Hi

Try the attached.

Do you have a logic analyser or scope? If so look at the output pin on the Uno, it should show a 50/50 square wave. If not perhaps try an led with a resistor in series. It won't flash but if you change duty to 255 it should then be brighter than 128. This will at least prove your Uno is functioning.

Regards

Re: running a DC motor using the arduino motor shield

Posted: Mon May 23, 2022 7:56 pm
by peterhalloway
correction the motor is now running thank you can you please explain what I did wrong