Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Debug Serial Port Connection (Read 3433 times)
harpster
Newbies
*
Offline


Posts: 5
Location: Charlotte NC USA
Joined: Jan 25th, 2014
Debug Serial Port Connection
Mar 19th, 2014 at 1:39pm
Print Post  
Hi - I just want to verify the serial port connection as I'm a little unclear on some things.

Because I'm using the Arduino serial port for communication to an external device I know that will interfere with the the debugger. I was using an Uno and then used soft serial (pins 7&8) connected to FTDI cable for the debugger and that worked. Now I'm using a Mega and hardware serial 3 but still didn't work on the main USB cable (using only one USB cable)... I had to connect the FTDI cable to the Mega pins 14 & 15 to get it to work. I thought I would only need one USB cable when switching to the Mega but it appears that if you are using the main serial port for external devices that this will not work and you must use 2 USB cables even with hardware serial (one for program upload and one for debug). Is this correct?

I know I have more serial ports available on the Mega but I need to keep this compatible with the Uno so I need to use serial port 0 for comm to the external device I'm controlling.

The other thing is regarding serial port speeds. Does the debugger need to be on the same speed as the Arduino if they are on different serial ports? Can I have 57.6K on serial 0 and 115K on serial 3 (debug). Also what is the best or recommended speed for the debugger? Thanks for your response - working pretty good but still learning!  -Alan



  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debug Serial Port Connection
Reply #1 - Mar 19th, 2014 at 1:47pm
Print Post  
Hi Alan,

Thanks for the good questions.
Quote:

Because I'm using the Arduino serial port for communication to an external device I know that will interfere with the the debugger. I was using an Uno and then used soft serial (pins 7&8) connected to FTDI cable for the debugger and that worked. Now I'm using a Mega and hardware serial 3 but still didn't work on the main USB cable (using only one USB cable)... I had to connect the FTDI cable to the Mega pins 14 & 15 to get it to work. I thought I would only need one USB cable when switching to the Mega but it appears that if you are using the main serial port for external devices that this will not work and you must use 2 USB cables even with hardware serial (one for program upload and one for debug). Is this correct?


Yes you need a 2nd usb/ftdi unless you use the main serial port (serial0)


Quote:
I know I have more serial ports available on the Mega but I need to keep this compatible with the Uno so I need to use serial port 0 for comm to the external device I'm controlling.


The Uno does not have the additional hardware serial ports that the mega has so either you need to hook up the ftdi to the serial1-2-3 etc of the mega or stick with software serial on a couple of digitalPins. The latter will also work on the Uno do you could use the same pin numbers and save yourself having to workout where to connect the debugger when switching between uno and mega. It's up to you.

Quote:
The other thing is regarding serial port speeds. Does the debugger need to be on the same speed as the Arduino if they are on different serial ports? Can I have 57.6K on serial 0 and 115K on serial 3 (debug). Also what is the best or recommended speed for the debugger?


If direct link from pc usb to the hardware then speeds will be the same. Both local and remote speeds must be the same unless you have a radio such as xbee or other hardware handling the communications.  57.6k or lower works best with SoftwareSerial. HardwareSerial (built-in) works fine at 115k
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint