2
\$\begingroup\$

I'm having trouble talking to an Arduino Mega using serial port commands on Windows. Identical code works fine to connect to an Arduino Duemilanove but doesn't allow connection to the serial port with the Mega. Also, I can access both cards from the Arduino IDE software, on both Linux and Windows.

I have serial port code that works fine on Linux for both Duemilanove and Mega. But I can't write code that works for the Mega on Windows, even though it works fine with the Duemilanove at this stage.

My only thought is that perhaps something is different in the way that the Mega's USB-to-serial hardware is set up, and perhaps, at least on Windows, I need to add some additional command (maybe on the Arduino, or maybe in my C code) to enable the interface to be correctly visible/accessible.

Any thoughts anyone? Anyone else had this problem?

\$\endgroup\$
  • 1
    \$\begingroup\$ please post a sample of your code \$\endgroup\$ – jyz Oct 7 '10 at 12:51
  • \$\begingroup\$ Is this one of the new megas with the atmega-u8? \$\endgroup\$ – Toby Jaffey Oct 18 '10 at 14:59
  • 2
    \$\begingroup\$ The mega has 4 serial connections, the one that goes through USB is the one that is on digital pins 0 and 1, I believe. Make sure those pins are clear, and that your C program has selected the right baudrate. \$\endgroup\$ – Jack Schmidt Oct 18 '10 at 17:23
1
\$\begingroup\$

This sounds like you might be having a baud rate mismatch. I have seen many cases where a device or library will default to a particular baud rate and wont be an issue until switching devices or platforms.

The other possibility is using a serial class that only works on linux.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.