Working on enhancing my Christmas light controller. I am using vixen to program the lights and create the DMX stream. Last year i used a Duemilanove, and this year I upgraded to a Mega 2560 to get additional control channels. The downside is that vixen is trying to leverage a FTDI connection which I am discovering the 2560 no longer uses. Is there a way to add TFDI to the 2560? I have a FTDI cable like this one : https://www.sparkfun.com/products/9718 to program the pro boards I have used in other projects. Is there a way to leverage this with the 2560?
Thanks in advance for any guidance you can offer.
Is there a way to leverage this with the 2560?
What do you mean by leverage? Can you use a FTDI cable with your mega, yes you can. But it would be better to understand what you wish to do with it, to replace the Mega's on-board USB serial converter used to upload sketches? Or just as another USB serial channel working from one of the additional serial ports available on the mega board?
Thanks for your reply retrolefty. To clarify based on the good questions you asked, this is what I am after.
I have no need to remove the current USB interface from the Mega. I am fine using that to update my sketch etc. I did not know there were other serial connections/options available but that sounds promising. I would like to use a FTDI connection between the pc and the arduino, potentially using this alternate connection.
The program I am running to control lights sends a DMX string over USB/Serial to the arduino. On the arduino is a sketch that basically processes the streams and makes digital ports go high/low. The current software plugin only recognizes FTDI connections, but no the new style of the MEGA. So if I can provide an alternate connection into the mega that would be ideal.
How would that be wired? Also, when I have the FTDI connected (now I have 2 serial connections right?) how do I manage the serial(read) on the arduino to choose the correct one?
Well it sounds like just wiring the FTDI's send and rec signals (and ground) to one of the alternate serial hardware channel would serve your purposes, the Mega has four built in serial hardware ports and the standard on-board USB serial converter uses the first port. Here is link to the serial library document that explains what pins the mega has those additional serial ports on and how you access them with the serial commands.
The part that should answer your questions is the following:
The Arduino Mega has three additional serial ports: Serial1 on pins 19 (RX) and 18 (TX), Serial2 on pins 17 (RX) and 16 (TX), Serial3 on pins 15 (RX) and 14 (TX). To use these pins to communicate with your personal computer, you will need an additional USB-to-serial adaptor, as they are not connected to the Mega's USB-to-serial adaptor. To use them to communicate with an external TTL serial device, connect the TX pin to your device's RX pin, the RX to your device's TX pin, and the ground of your Mega to your device's ground. (Don't connect these pins directly to an RS232 serial port; they operate at +/- 12V and can damage your Arduino board.)
In you sketch you just change the default serial.whatever command to say serial1.whatever to use the second mega serial channel. Example:
Serial.begin(speed) // first (if mega) or only (if Uno) serial channel
Arduino Mega only:
That was exactly the breadcrumb trail I was looking for. I will give it a run tonight, and let you know how it turns out. Thanks so much for your helpful insight.
I did not have much luck with serial.1 or serial.2. The DMX connection between the software I am using (vixen) and the arduino required modifying the hardware.cpp file which may have hard coded the serial connection? The code was beyond my capabilities. What did work is just injecting the tx/rx from my usb-FTDI right into pins 1/2 and 'bypassing' the MEGA onboard serial circuitry. Working well.
Thanks again for your assistance and education.