Page 1 of 2

running a DC motor using the arduino motor shield

Posted: Thu Mar 31, 2022 7:28 pm
by peterhalloway
Hi I am having issues setting up an arduino motor shield in conjunction with an arduino uno R3. I suspect I have some wrong pin assignments, but havent worked it out and couldn't find any help for it. I have attached my very simple program can someone please point me in the right direction.

Pete

Re: running a DC motor using the arduino motor shield

Posted: Thu Mar 31, 2022 8:59 pm
by medelec35
Hello.
The pins look wrong as they should not be mapping on the Arduino.
I have created a temporary fix.
Browse to this location using file explorer, it's hidden by default so just paste the link into your address bar.

C:\ProgramData\MatrixTSL\FlowcodeV9\Components
Replace the existing file with the attached file.
The flowchart will need to be refreshed if Flowcode was open when you replaced the file.

It looks like the connections are:

Code: Select all

Function	   Channel A	Channel B
Direction	   Digital 12	Digital 13
Speed (PWM)	   Digital 3	Digital 11
Sorry I only have a motor shield to test with.

Re: running a DC motor using the arduino motor shield

Posted: Thu Mar 31, 2022 9:09 pm
by peterhalloway
Thanks for the quick response Martin. I assume once I install the file, as I have I just need to program the arduino with the file I put on the posting. If so its still not working.

Re: running a DC motor using the arduino motor shield

Posted: Thu Mar 31, 2022 9:46 pm
by medelec35
Did you reload the flowchart after?
If you are using channel A have you got Channel 6 selected?
If so, what does it show for port?
Is the Remap Pin greyed out?
Have you got Direction Pin set to either $D12 with Use Chip References unticked, or B4 with it ticked?
If still not working, I will look into it more tomorrow.

Re: running a DC motor using the arduino motor shield

Posted: Fri Apr 01, 2022 5:52 pm
by peterhalloway
Hi Martin
I have A connected, channel6 selected, Port shows as $PORTD.3 but is greyed out and the direction pin is $PORTB.4

I have 250 for speed 300 for acceleration and 50 for deceleration

unfortunately it is still not working

Pete

Re: running a DC motor using the arduino motor shield

Posted: Sun Apr 03, 2022 12:30 pm
by chipfryer27
Hi

I've only recently started playing with an Uno, mainly to explore Flowcode Developer, so I'm no expert with it.

Keen to play I downloaded your chart (and Martin's component). Whilst I don't have the motor shield I can monitor the pins with a logic analyser. No matter what I tried I couldn't get a PWM output on any channel (1-6). I could see enable and direction pins change state where applicable as I tried various scenarios, but no actual PWM.

Regards

Re: running a DC motor using the arduino motor shield

Posted: Mon Apr 04, 2022 3:17 pm
by medelec35
We have not forgotten.
This is currently being looked into.
Thank you for your patients.

Re: running a DC motor using the arduino motor shield

Posted: Wed Apr 06, 2022 12:16 pm
by medelec35
Hello.
The motor component has now been updated and should be available via Library updates.
Thank you for your patience.

Re: running a DC motor using the arduino motor shield

Posted: Thu Apr 07, 2022 7:31 am
by chipfryer27
Thanks Martin

I'll try it out later today.

Regards

Re: running a DC motor using the arduino motor shield

Posted: Thu Apr 07, 2022 10:28 pm
by chipfryer27
Hi

Working now sort of....

With Duty set to 128 I get the expected 50% Duty Cycle on the analyser. However irrespective of the frequency set under properties, I always get half of expected. If set at 7.8KHz I get 3.9KHz etc.

Freely admit to only starting to play with the Uno so maybe I'm doing something stupid.

Regards