I have a piece of hardware which is a RS232 DCE (MegaSquirt ECU), which I wish to interface to my Arduino. I have a FTDI based 9pin RS232 to USB convertor cable which works with the computer as the DTE device. As I'm a total Noob WRT to hardware at this level, I'm trying to see if anyone has created a shield, or even a schematic which I can use to make the Arduino act as the USB master. I have to think that this is something that others have come across etc.. but I've been unable to find anything. As I understand, again very little in terms of knowledge here, I need to convert the signal to TTL. I intend to use NewSoftSerial for the serial function on the Arduino (so that I can use the primary usb port for debug and testing of the code). Does the Serial2USB device convert this for me?, can I just pull TX and RX out of the USB end and use those as inputs to the pins on the arduino? Do I need some kind of coversion circuit?
Does the Serial2USB device convert this for me?
No you don't need this.
Do I need some kind of coversion circuit?
Yes all you need to do is ti take the TTL out of the arduino and convert it into RS232 voltage level signals. Some thing like the MAX202 will do this for you. No need for USB to get involved at all.
The only difference between DTE and CTE is the way the leas is wired up. See wikipedia for how.
Grumpy_Mike..
Thanks for the pointer.is the MAX202 anything like a TIMC1489 (a buddy sent me a bunch of these for another purpose which if i can figure out how to use them it will be good).
I did find online for 9.99 a board that takes a 9 pin input and breaks out the signals to TTL, so that may be what I need for my prototype..
Assuming they are MC1489s these are only line receivers so while they might be fine for converting incoming RS232 into TTL they can't convert TTL into RS232. This requires the generation of +12 and -12 volts which the MAX chips generate from a capacitor ladder.
The Max chips are easy to use so you don't need a board:-
http://www.google.co.uk/images?q=max202&oe=utf-8&rls=org.mozilla:en-US:official&client=firefox-a&um=1&ie=UTF-8&source=univ&ei=NlG8TJ-tJti4jAe4y9zIDg&sa=X&oi=image_result_group&ct=title&resnum=3&ved=0CC4QsAQwAg&biw=1090&bih=650
If you're not going to be driving a long cable, you can probably get away with one of these: it's not real RS-232, but the vast majority of devices will accept its inverted TTL.
You can also get Arduinos without the FTDI chip, and use the hardware UART for communicating with the Megasquirt. I like the RBBB from the same company for projects that don't use a shield.
You might also want to check out the MPGuino project: it's designed to provide a compact module that displays what a factory ECU is doing. Perhaps you could adapt it to be a Megasquirt controller that displays what it's telling the ECU.
Actually this is a sub project of a larger project whichnis a full race dash and data acquisition system. While working in this I realized that I could build a logger for the ecru and stop having to fight with a laptop to log data for tuning purposes, loose things in a race car are bad things.
I have the main project to the point where I will start trials I my street car, since race season is over and my motor is out for rebuild. I've got the basic sensors and sendig to a separate pro mini driving the LCD working, I hope to get time this week to do the data logging to a microsd card this week.
Once things are in better shape I will make the code available.
I've looked at mpguino and some other projects for inspiration and ideas.
I hope to be able to use xbee modules for a poor mans telemetry, some of them look like they can handle pretty long distances line of sight, so I will have to implement a bursting protocol. But thats for later this winter during down time