Members | Sign In
Legacy MOVI User Community Forum (readonly) > MOVI Question & Answers

Re-assigning Rx and Tx

posted May 29, 2016 03:44:49 by BillSherman
Rx and Tx use D10 and D11. Is it possible to change to other pins on the Arduino, such as D2 and D3? I have designed a shield for controlling relays and would rather not hack my board to allow D10 and D11 to pass through.
page   1
7 replies
BillSherman said May 29, 2016 05:20:39
I think i found my own answer by going over the manual. I can pull jumpers 2 and 3 and rewire Rx and Tx to what digital pin I want. It seems I also will need to reassign Rx and Tx by changing the statements in MOVIshield.h. Correct? Or should I use the LowLevelinterface? I think in my case, I will leave things the way they are and make changes to my relay shield.
Dylan said May 29, 2016 18:36:29
While changing MOVIShield.h would work, the cleaner way is to use the constructor that is provided that allows you to override the default Rx and Tx pins:

// Construct a MOVI object with different communication pins and optional serial monitor interaction. This constructor only works on AVR architecture CPU (e.g Arduino Uno, Mega, Leonardo. NOT Due, Zero, Edison)
MOVI(bool debugonoff, int rx, int tx);

So in your code, instead of something like

MOVI movi;

You'd change that to

MOVI movi(false, 2, 3);

Hope that helps.
BillSherman said May 31, 2016 02:46:05
Yes, very helpful. Thanks.
avatar said May 17, 2017 15:25:00
I've read through the user manual, the support forum and the library code. Could someone please confirm which MOVI shield jumpers go with RX vs TX?

The User Manual states:
"To rewire MOVI’s communication to different pins, open Jumper 2 and Jumper 3 and
connect the left side of MOVI's TX jumper (Jumper 2) and the left side of MOVI's RX
jumper (Jumper 3) to two other connectors on the Arduino headers using jumper wires.
The left side is the pin that is further away from the Arduino headers and the microphone
(MIC1) and closer to the button."

Is J2=TX and J3=RX?

I want to reassign TX to mega R3 pin 30, and reassign RX to mega R3 pin 31 using the constructor: MOVI(bool debugonoff, int rx, int tx);

If I jump J2->30 and J3->31, is the correct constructor call: MOVI movi(false, 31, 30)

Please advise.
[Last edited May 17, 2017 15:30:48]
GeraldFriedland said May 18, 2017 02:14:27
J2->30 and J3->31 corresponds to
MOVI TX (J2) -> Arduino 30 (Arduino's RX)
MOVI RX (J3) -> Arduino 31 (Arduino's TX)

This makes the call MOVI movi(true, 30, 31) as this call needs Arduino's RX, TX.

(I'd for sure enable debug to try this one out).

[Last edited May 18, 2017 02:16:21]
avatar said May 18, 2017 21:42:18
Thank you. I got it to work using A13 and A12. I'll give 30 and 31 a try again.

//MOVI TX (J2)->Arduino A13
//MOVI RX (J3)->Arduino A12
MOVI recognizer(true, A13, A12);

I'm using the MOVI shield with an Adafruit Music Maker Shield and an Adafruit PN532 shield.

[Last edited May 19, 2017 02:21:09]
GeraldFriedland said May 19, 2017 02:37:13
The Arduino MEGA is restricted regarding the ports. See:

"Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69)."
Login below to reply: