Serial Port problems

Did uninstall and restart from fresh twice. When connecting the USB cable, the computer gives the ‘normal’ sound but nothing now appears now on the Device Manager. The very short time it did work, it was COM8 and then that unreal “LPT3” (which does not makes sense on W7) and now nothing, just the connecting and disconnecting sounds.
Giving up now until I find a ‘proper’ USB interface that works. Life is too short to waste time with devices that are not properly designed and don’t work
com64

Sorry this is being such a problem for you. I do believe that it is a Windows issue and I might have a solution to start with.

Go to your device manager.

Find "Ports" and expand if needed.

Right Click on the Communications Port (Or LPT) that is most likely your Arduino.

Click the Port Settings Tab and the top and click the "Advanced..." button.

In this Advanced Settings menu, there should be a "Com Port Number:" with the default.

Click the default Com# and note the Com Ports that are not in use and select one (Com15 should be out of the pack) of the 256 available.

*** Note, if the LPT Virtual Port is still there, you will have to uninstall the driver and possible reconnect the Arduino to initiate the driver install routine, then get back into the Port Settings window. My only LPT port is a real Parallel Port, so I can not test this.

You also have some Timeout Settings and Receive and Transmit bytes that can be dialed back to get that Arduino online. I suspect your PC might be not be patient enough for a response from the Arduino. The Vista and W7 (compared to XP) have a wide selection of "knobs" for serial tuning, so I suspect Microsoft is aware of this.

Dear spcomputing,

Thank you for your help. Following your instructions,I finally managed to get a port working (COM8). Also if the break in communication happens again (I am sure it will!), I know where to look. The problem very likely comes from my computer (W7) as when the connection is established, the Uno works well. I could also change the port at will, using one of the free ports not in use.
The whole thing has been a bit nightmarish, wasting a lot of time and sanity.

Once again many thanks. Cheers,

com64

Good to hear. Once you have gotten your Arduino out of the mess of COM1-4, Windows should reserve it for quite a while (Updates appear to screw with it).

Have fun!

Dear spcomputing,

Thank you. All problems are not totally resolved but I can use the Board. The whole system is very capricious. Sometimes I have an instant communication through COM8, sometimes I have to reboot the computer. Sometimes I lose the connection when uploading a new sketch. Also when uploading a new or a modified sketch, I sometimes have the message saying: “COM 8 busy with another program. Try to uninstall the other program”. Most of the times, holding the reset button while clicking on the ‘Upload’ icon and only then, releasing the reset button helps…but not every times.
Despite those minor nuisances, I like the board and can see its enormous potential for future uses when I shall finally correct those problems.
Next step is to build a Real Time Clock and use the ‘time’ functions.

Regards

c64

com64:
Dear spcomputing,

Thank you. All problems are not totally resolved but I can use the Board. The whole system is very capricious. Sometimes I have an instant communication through COM8, sometimes I have to reboot the computer. Sometimes I lose the connection when uploading a new sketch. Also when uploading a new or a modified sketch, I sometimes have the message saying: “COM 8 busy with another program. Try to uninstall the other program”. Most of the times, holding the reset button while clicking on the ‘Upload’ icon and only then, releasing the reset button helps…but not every times.
Despite those minor nuisances, I like the board and can see its enormous potential for future uses when I shall finally correct those problems.
Next step is to build a Real Time Clock and use the ‘time’ functions.

Regards

c64

Are you using 1.0.1 right?

I am experiencing troubles with the serial port also, never had issues with 0023 (besides some delays with bt devices) but now the menu is constantly grayed out... I tried updating the 8u2 to the rev0003, but after some uploads I got the same issue. Very annoying, the only workaround I found is to change the com port number every time this happens.

Another silly idea is to put a 2.0 USB Hub. Someone else had the same issue and moved from the front PC USB access ports to the back and fixed it. Something is fighting in the MS USB Driver based on the motherboard hardware. I had a machine that was fighting with the mouse on an old notebook and blam, all fighting gone.

I am having a similar problem with the serial port on my Arduino Uno, Rev 3, that is being discussed in this thread. When I try to run a program on the Arduino, I get the error the error message: "Serial port "COM3' not found. Did you select the right one from the Tools > Serial Port menu?"
When I go to the Tools > Serial port menu, it is greyed out. In reading the other posts to this thread, I noticed that, at one point, someone asked another member: "Do you hear the beep sound when you plug in the Uno to the computer?" My answer to that is: No, I do not get this sound. When I look at the device manager, it shows the Uno as being an "unknown device." Does this mean I should download the proper driver for the Uno? Will this solve the problem?

Did you try eried's modded IDE?

https://github.com/downloads/eried/Arduino/setup_Arduino_ERW_1.0.1i_20121020.exe

spcomputing:
I tried to download the link you provided, eried's modded IDE, but my computer blocked it...the computer didn't give me the option to override the block. Is there some other way to get this IDE?
Thanks, Dexter

Can you disable it thru the taskbar for 10 minutes? Usually it is the antiviral's company logo, right click and control option. It is just because of the .exe extension, so you are going to need to take the protection down for a few minutes.

spcomputing:
That worked! Thank you.

I am trying to run this sample program, http://www.robot-electronics.co.uk/files/arduino_md25_serial.ino , which I got from the Devantech website. My hardware is hooked up as in this diagram: Arduino Examples RD02 Motor Controller serial (Scroll down to the "MD25 RD02 Motor Controller Serial.") The program compiles correctly, but when I upload it, nothing happens to the motor or LCD screen...it all just sits there and does nothing. Is it waiting for a button-push or something? How do I get the motors running, using this code? I only have 1 of the 2 motors hooked up.

Have you tested with another sketch like blink (change the delay from 1000 to 500 to be sure)?

I tested it with Blink, and the Arduino worked. However, the Arduino Uno only worked when I had no other wires connected to it, besides the USB. Once I hooked it up as in the setup I gave in a previous post...Arduino Examples RD02 Motor Controller serial , then, the Uno would not respond to any changes I made in the blink program (i.e., changing from 3 seconds to 5 seconds). When I would upload another program, the Uno's various LED's would blink rapidly for 1 or 2 seconds, acknowledging that it was receiving new instructions, but then it would just blink the LED to the last uploaded interval that I had uploaded (when it was connected to nothing but the USB). It seems like it won't take any new instructions unless it is connected to only the USB cable. How do I get it to accept new programs?

The problem is you can't have Pin 0 Rx and 1 Tx hooked up to the motor controller board the same time you are trying to uploading the sketch. Those same pins are being used by the USB port communications.

hiduino,

Much thanks! That worked, and now the program is running.

--Dexter

The program worked a few times, but now it is not working again. My hardware is setup to use the RD02 MD25 serial circuit, as shown here:
Arduino Examples RD02 Motor Controller serial and I'm using the code shown below. I followed the suggestion given earlier, i.e., unhooking Rx and Tx when uploading the program through the USB (and then reconnecting Rx and Tx after the program is uploaded). Now the LCD03 does not show either. The LCD03 displays the message "LCD03 REVISION 9 SERIAL MODE", but then the screen goes blank when I run the code shown below. I used to get a readout on the LCD03 of motor statisitics, but now the LCD goes blank and the motors don't move when I upload the code. Is there some kind of memory buffer or limit I'm running into? Like I say, the motors ran for about 3-4 times, but then stopped -- that is I uploaded the code 3 or 4 times, and each time it ran, but then after the 3-4 uploads, the motors didn't run anymore. I must have changed something for this to happen, but I left everything the same. Here is the code I'm using:

/****************************************************************
*                    Arduino MD25 example code                  *
*                   MD25 running in serial mode                 *
*                                                               *
*                     by James Henderson 2012                   *
*****************************************************************/

#include <SoftwareSerial.h>

// Values of 0 being sent using serial.write() have to be cast as a byte to stop them being misinterpereted as NULL
// This is a bug with arduino 1
#define CMD                 (byte)0x00              //  MD25 command byte of 0

#define WRITESP1            0x31                    // Byte writes speed to motor 1
#define WRITEACCEL          0x33                    // Byte writes a value of acceleration
#define RESETREG            0x35                    // Byte resets encoders
#define SETMODE             0x34                    // Byte sets mode
#define READIVS             0x2C                    // Byte reads motor currents and battery voltage        
#define READENCS            0x25                    // Byte reads both encoders
#define GET_VER             0x29

#define LCD_RX              0x02                    // RX and TX pins used for LCD0303 serial port
#define LCD_TX              0x03
#define LCD03_HIDE_CUR      0x04
#define LCD03_CLEAR         0x0C
#define LCD03_SET_CUR       0x02

SoftwareSerial lcd03 = SoftwareSerial(LCD_RX, LCD_TX);          // Define the serial port for the LCD03

long encValue = 0;
byte softwareRev = 0;

void setup(){
  Serial.begin(38400);
  lcd03.begin(9600);
  
  Serial.write(CMD);                                            // Set MD25 accelleration value
  Serial.write(WRITEACCEL);
  Serial.write(10);
  delayMicroseconds(10);                                        // Wait for this to be processed
  Serial.write(CMD);                                            // Reset the encoder registers to 0
  Serial.write(RESETREG);         
  Serial.write(CMD);                                            // Set mode to 2, Both motors controlled by writing to speed 1
  Serial.write(SETMODE);
  Serial.write(2);    
  
  Serial.write(CMD);                                            // Get software version of MD25
  Serial.write(GET_VER);
  while(Serial.available() < 1){}                               // Wait for byte to become available         
  softwareRev = Serial.read();  
  
  lcd03.write(LCD03_CLEAR);                                     // Clear the LCD03 screen
  lcd03.write(LCD03_HIDE_CUR);                                  // Hide the LCD03 cursor
}

void loop(){ 
  while(encValue < 3000){               // While encoder 1 value less than 3000 move forward
    Serial.write(CMD);                  // Set motors to drive forward at full speed
    Serial.write(WRITESP1);
    Serial.write(150);
    encValue = readEncoder();
    readVolts();
  }
  delay(100);
  while(encValue > 100){
    Serial.write(CMD);                  // Drive motors reverse at full speed
    Serial.write(WRITESP1);
    Serial.write(100);
    encValue = readEncoder();
    readVolts();
  }
  delay(100);
}

long readEncoder(){                        // Function to read and display the value of both encoders, returns value of first encoder
  long result1 = 0; 
  long result2 = 0;
  Serial.write(CMD);
  Serial.write(READENCS);
  while(Serial.available() < 8){}          // Wait for 8 bytes, first 4 encoder 1 values second 4 encoder 2 values 
  result1 = Serial.read();                 // First byte for encoder 1, HH.
  result1 <<= 8;
  result1 += Serial.read();                // Second byte for encoder 1, HL
  result1 <<= 8;
  result1 += Serial.read();                // Third byte for encoder 1, LH
  result1 <<= 8;
  result1  += Serial.read();               // Fourth byte for encoder 1, LL
  result2 = Serial.read();
  result2 <<= 8;
  result2 += Serial.read();
  result2 <<= 8;
  result2 += Serial.read();
  result2 <<= 8;
  result2 += Serial.read();

  lcd03.write(LCD03_SET_CUR);              // Set the LCD03 cursor position
  lcd03.write(21);
  lcd03.print("Encoder 1:");               // Displays data to the LCD03 screen
  lcd03.print(result1,DEC);
  lcd03.print(" ");                        // Print a blank space to clear any unwanted characters that are leftover on the LCD03 display
  
  delay(5);                                // Delay for LCD03 to process data
  
  lcd03.write(LCD03_SET_CUR);
  lcd03.write(41); 
  lcd03.print("Encoder 2:");
  lcd03.print(result2,DEC);
  lcd03.print(" ");
  return result1;                                   
}
  
void readVolts(){                                                 // Function reads current for both motors and battery voltage
  byte batteryVolts, mot1_current, mot2_current = 0;
  Serial.write(CMD);
  Serial.write(READIVS);                                          // Send byte to readbattery voltage and motor currents
  while(Serial.available() < 3){}                                 // Wait for the 3 bytes to become available then get them
  batteryVolts = Serial.read();
  mot1_current = Serial.read();
  mot2_current = Serial.read();

  lcd03.write(LCD03_SET_CUR);
  lcd03.write(61);
  lcd03.print("Mot1 I:");
  lcd03.print(mot1_current,DEC);
  lcd03.print(" Mot2 I:");
  lcd03.print(mot2_current,DEC);
  lcd03.print(" "); 
  
  delay(5);
  
  lcd03.write(LCD03_SET_CUR);
  lcd03.write(1);
  lcd03.print("Rev:");
  lcd03.print(softwareRev, DEC);
  lcd03.print(" ");
  lcd03.print("Volts:");
  lcd03.print(batteryVolts/10,DEC);                               // Seperate whole number and descimal place of battery voltage and display
  lcd03.print(".");  
  lcd03.print(batteryVolts%10,DEC);
  lcd03.print(" ");   
}

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

Preogress report: I got both motors to run now. I replaced one of the motors that went bad. It may have gone bad because I spliced in an extra 10 inches of wire....or it could have gone bad because I set the acceleration value too high in the software. I'll have to check on this.