# RS232 Communication Nightmare



## Jeff77789 (Nov 26, 2014)

For my car we are using a BAMOCAR D3 motor controller for an Emrax 228 motor.

According to the manual, rs232 is used to connect the motor controller to the PC and then using the nDrive software, the motor parameters can then be uploaded to the motor controller.

http://www.unitek-online.de/pdf/download/Antriebe-Drive/BAMOCAR/E-BAMOCAR-D3.pdf
(motor controller manual, see pdf pages 20 and 31)

http://www.unitek-online.de/pdf/download/Antriebe-Drive/Servo-Digital/E-DS-NDrive.pdf
(pc software manual, see pdf pages 5, 8, 11)

Problem is, when using an rs232 to USB adapter cable, we can't seem to get the motor controller talking to the PC.

We connected the white cable to pin 2, the grey cable to pin 3, and the pink cable to pin 5; the COM port cannot be opened by the PC and the nDrive program says "Drive is offline" for all COM ports; we did set the baud rate correctly.

The motor controller is being supplied 12v and a green light is on inside the case.

Any suggestions?


----------



## Nathan219 (May 18, 2010)

Eliminate variables, known good unit you have communicated with before.
then move back to the controller use putty terminal to confirm you have something before using different software. One step at time assume the hardware is good and the monkey is doing something wrong.


----------



## piotrsko (Dec 9, 2007)

Suspect the pc. Rs232 to usb is notorious for not working on anything relatively newer than 10 years because of how the hardware/software is implemented.


----------



## PhantomPholly (Aug 20, 2008)

Had the same kind of issue with an experimental autopilot. All USB to Serial adapters are not equal. Finally found one that worked, but that was years ago so can't tell you which one.

If you have a desktop / tower PC, you may have a simpler option. Many motherboards still have pinouts for Serial port; they just don't bother to actually have a plug on the back. For about $2 you can get the port for the back of the PC. Or, for a bit more you can get a card to add Serial Ports.


----------



## PStechPaul (May 1, 2012)

I recently purchased a used laptop computer with XP and a serial port for about $40, and used it to test some software/hardware I designed which normally uses its own internal USB-serial converter implemented with a Microchip PIC18F2550 processor and their CDC library. This was for an application where the USB (even using an isolator) would shut down in the presence of a 13.2 kV AC contactor and coil in a recloser. The customer had a desktop PC and a direct serial port and it worked well for him. 

I agree that many of the USB-Serial converters do not work well in some cases. If you can find one with a well-documented device like the FTDI chip or the Silicon Labs CP2103, you may be able to tweak the timeouts and other parameters to get it working.


----------



## Jeff77789 (Nov 26, 2014)

So it was in fact the rs232 to USB converter...

we tested it on an older computer with a built in serial port and it worked on the first try

I had a hunch it was the rs232 adapter when we first connected it...funny story after we figured it out we found in a box somewhere filled with wires the _correct connector to the motor controller with the usb adapter still attached_... i plugged that into my laptop and it also worked the first time.

*sigh* looking around for a cable would have saved a lot of headaches while trying to re-solder all the permutations of 6 different wires onto a db9 connector...


----------



## PThompson509 (Jul 9, 2009)

Could be worse - you could have tried the adapter on your laptop and downloaded the wrong driver. Hmmm, how would I know that? 

Glad you are finally able to communicate with the system.


----------



## Sunking (Aug 10, 2009)

Jeff77789 said:


> We connected the white cable to pin 2, the grey cable to pin 3, and the pink cable to pin 5; the *COM port cannot be opened by the PC* and the nDrive program says "Drive is offline" for all COM ports; we did set the baud rate correctly.


Well if you cannot go into Device Manager on your PC and see COM PORT assignments, the problem is with your PC


----------

