Dual Serial Motor Controller Questions

First off, let me describe my setup with as much detail as possible.

The 4byte command packet origin is my laptop and a homegrown Visual Basic program. I’m transmitting 4 bytes (each of the datatype “byte”) connected with the concantenation character (simply the ampersand & for VB). Looks somethign like this: USB_Write(byte1 & byte2 & byte3 & byte4). There is also a carriage return added as well. On the bus, the packet looks like this “12800127.” Have i made an error yet? Anyhow, From there it goes thru a USB/serial Adapter which essentially gives my a Tx and Rx pin on my breadboard.

From there the signal travels thru a 3.3v Xbee tranciever to a separate board.
On the separate board, i have a small PIC with which i can successfully communicate, even thought the PIC uses 5V logic levels. It seems as though the 3.3V xbee output is sufficient enough to drive the PIC which is expecting a 5V logic high. Thinking that if 3.3V is enough to drive the PIC, it ought to work for the DSMC also. Apparently not, or i’ve got some bugs to chase down elsewhere.

So, i’ve got a few questions to help me get to the bottom of this.

  1. Will the DSMC work with 3.3V logic level inputs? Or better yet, can i hook up the DSMC VCC to 3.3V supply (force 3.3V to be logic high).

  2. Must the 4 byte user command be followed by a carriage return?

  3. Is it a bad idea to use the same 5V supply for my motors and logic?

  4. Is there any sort of feedback from the DSMC other than moving a motor?

A few other comments. I’ve tried transmitting the 4-byte command packet directly from my USB adapter both inverted and non-inverted and no luck. Also, sometimes when the DSMC is powered on it spins a motor until RESET is pulled low, or it will intermittently but regularly pulse a motor until i reset it. I’m using the default DSMC, straight out of the box in the 2 motor configuration. Here’s to hoping there’s an easy answer: Please advise.

EDIT: I’ve been reading thru the other posts, and it seems as though i may have a power supply issue. I’m using a 5v, 1A wall wart to power the remotely located board. This supply power both my 2 small motors and the DSMC. Surely i would get SOME response from this setup eventhough it’s not recommended. Also, it doesn’t explain why running directly from my 5V UART doesn’t work.

Hello,

You are almost certainly sending the wrong data. I’m not sure what you are doing with the ‘&’ character, and there definitely should not be any carriage return: you should send a total of four bytes per command, and nothing more. In general, I recommend that you try things with as little complexity as possible. In this case, that would mean connecting the motor controller directly to just the microcontroller or PC serial port and getting some communication going with as little intermediate modules (e.g. wireless transceivers) as possible.

Also, can you confirm whether you are talking about our micro dual serial motor controller (9-pin blue module) or the one with through-hole parts? Some posters have been unaware of the distinction, and the answers could be different for the two units.

Unfortunately, the unit does not have any other means of user feedback.

- Jan

I’m using the second Serial Controller you described, with thru hole parts - i bought it preassembled. I’ll try using a separate power supply for the motors because it looks like that could have been an issue w/ other folks.

Hello.

I’m not sure how to interpret this statement. Are you saying that you are transmitting the command bytes as ascii character representations of their numbers? The DSMC is expecting to receive, for example, the following four serial bytes:

128
0
0
127

In your representation it looks like it will be receiving 8 bytes:

‘1’ (49)
‘2’ (50)
‘8’ (56)
‘0’ (48)
‘0’ (48)
‘1’ (49)
‘2’ (50)
‘7’ (55)

Is this the case or am I misunderstanding your description of what you are sending?

- Ben

To the best of my knowledge i’m transmitting ONLY 4 bytes, like in your first case. Although i’m less sure now - and we all know VB likes to “help” you by changing things around. I’m going to try encoding my input data in UTF8 and put in a byte array with maximum size of 4 so there’s no way it can accidentally convert it to something else.

I’m less of a hardware guys so i thought there was certainly something wrong with my circuit. From reading the forums, however, it looks like a signal from a 3V UART should be enough to drive the serial control input of motor controller. Is that correct?

Also, i’m not certain about my power supply. Currently i have a 5V wall-wart powering both motors, the positive supply (+) pin on the board and the reset pin (thru a 4.7k). Is that going to get me in trouble?

Also, thanks so much for all your help!