Pages: [1]   Go Down
Author Topic: Romeo board and LCD pin assignmet conflict?  (Read 721 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

New to Arduino but not to MCUs or programming I assume the answer I am looking for is obvious but I could not find it online.

Here it is:
The pin used for motor control on the Romeo board (SKU:DFR0004) are assigned to the same pins used but the LCD+Key shield (SKU: DFR0009).

I want to assign the motor control:
Code:
#define motorDir             4                 // INA motor pin
#define motorSpeed         5                 // PWM motor pin


The LCD declaration is:
Code:
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

I am obviously missing something.
help appreciated.
Bob
Logged

France
Offline Offline
Edison Member
*
Karma: 37
Posts: 1008
Scientia potentia est.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello and welcome,

If your 2 shields are using the same pins, I think there is no other solutions than:

a) Using this thing: https://www.sparkfun.com/products/11002

b)
    1) Or manually re-routing the conflicting pins, by bending the pins on the above shield (LCD) so they don't plug on the shield below (the motor shield), and connect to other Arduino pins, using wires...And then change the line accordingly:
Code:
LiquidCrystal lcd(8, 9, newpin1, newpin2, 6, 7);

    2) Or if you don't want to bend pins, use lot of wires to connect the LCD like a breakout board rather than a shield.

Maybe I'm wrong and there may be other methods, I'm beginner too. Hope it helps smiley

PS: And don't forget that the motor 2 is using pin 6 and 7 too!
« Last Edit: October 15, 2012, 07:40:33 pm by guix » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's why I was hoping that i was missing something. I hoped not to get the tools out.
 only use/need one motor so I have a 2 pin problem.
I will see if anyone has a better idea before I break out the wire cutters and I appreciate you help.
cheers
Bob
Logged

California
Offline Offline
God Member
*****
Karma: 14
Posts: 629
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
#define motorDir             4                 // INA motor pin
#define motorSpeed         5                 // PWM motor pin

Any reason the motors can not go to pins 2&3?

Quote
Quote
#define motorDir             2                 // INA motor pin
#define motorSpeed         3                 // PWM motor pin

Just wondering.  Is there a specific frequency you trying to get out of the pin 5 PWM?
Logged


Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 613
Posts: 49270
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The pin used for motor control on the Romeo board (SKU:DFR0004) are assigned to the same pins used but the LCD+Key shield (SKU: DFR0009).
Links are far more useful than text.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not sure what the "links" comment meant.

Anyway, on further investigation it looks like the romeo has 4 jumpers which assign 4,5,6,7 tp the motor control so if I disconnect the offending pins and jump spare PWM pins as mentioned above I should be in business. I'll try and see.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 613
Posts: 49270
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I'm not sure what the "links" comment meant.
A URL. A hypertext device to allow clicking on some text, to be directed to the manufacturers web site, so we can see what you bought.
Logged

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you can take out two jumpers (D4 and D5) and hardwire them to other digital pins. D4 is for direction control, so any digital pin will do, but for speed you need to pick any other free PWM capable pin.

And you should also consider swapping D6 with some other PWM signal that is free and uses the same frequency divider as the other one, and change it to at least ...was 32kHz? You get quieter motor control under full speed, and more torque as well...?

This seems to be newer version of Romeo than ours, older can't take shields.

Links would be nice, but somehow I managed to find these parts... PaulS... smiley-wink


Cheers,
Kari
 
Logged


The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

PaulS, I appreciate the definitions and I apologize for not adding them to the post. I made an erroneous assumption that the boards I was using were well known and unique and that this board would be full of people using them and I expected a reply from someone who had the same setup, problem and solution.
This too I will learn.
Nothing like a little sarcasm to start the day.  smiley
Thanks for taking the time.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 613
Posts: 49270
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Thanks for taking the time.
No problem.

Except that there are still no links.  smiley-cool
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Let there be links!
Romeo: http://www.dfrobot.com/index.php?route=product/product&filter_name=romeo&product_id=656#.UH1Wx66nJ8E
LCD Keypad shield: http://www.dfrobot.com/index.php?route=product/product&path=123_124&product_id=51#.UH1YB66nJ8E
Logged

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

bobsmithimages,

Did you read my post, and did you find the point I was trying to show?
It is possible that I explained it a bit messy way, but it should work. All you need to do is to change pin assignments on your code.
Works for me, should works for you as well.

I like Romeo, it includes many nice features for a start, as the first board, it just takes time to get use to its hardwired parts.

Cheers,
Kari
Logged


The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Kari,
        I did read it and I understood your point. It led me to conclude that you are right. All I have to do is remove the jumper that routs the pins 4,5 to the motor and jump 2,3 to replace them and assign these in the code. There are a set of header pins on the LCD board conveniently placed to make this easy.
All working fine as "spcomputin" suggested with a slight jumper fix.
Thanks y'all for the help.
Logged

Pages: [1]   Go Up
Jump to: