Serial communication problem between an arduino board and an ICOM M710 radio

I am building a remote control to communicate with an ICOM M710 marine radio, this uses the NMEA0183 protocol, prior to the project with Arduino (for which I use an Arduino nano v3) I made a small program with Visual Basic 6 with which I was able to communicate successfully to through physical port with the radio. The problem that I do with a very basic project with Arduino as a test to see the results it produces, but I cannot establish communication between the card and the radio in any way.

The COM port is set to 4800 baud, 8 bits, stop bits 1, no parity (Mandatory)

void setup() {
  Serial.begin(4800, SERIAL_8N1);
}

For example, to turn on the radio you have to send the following:

$ PICOA,90,01,REMOTE,ON*59
followed by a carriage return and line break

In visual basic 6 I did it like this:

MSComm1.Output = "$PICOA,90,01,REMOTE,ON*59" & vbCrLf

In the Arduino IDE:

Serial.write("$PICOA,90,01,REMOTE,ON*59\r\n");

Using a serial port monitor I observe that from the board and the software with VB6 they send the same string with its carriage return and line feed, however the application with VB6 and the physical port works correctly but the arduino does not, any ideas about?

What is "physical port"?

Hello, thanks for your attention. I mean the COM port of the main board of my PC, in my case COM1.

Do You have that kind of COM port on Your controller?

Yes, I use an old computer for these purposes and it has a COM port.

Old computer... But You try to transmit from a controller, an Arduino. How do make the nano have that kind of comport?

They are two different things, I will try to explain myself better, first I did a test with a program that I made in Visual Basic 6 connecting the radio to the computer through the COM port, in my case COM1, this test worked and I managed to send the commands to the radio and it responded appropriately; second, after passing the first test I "migrated" to Arduino and tried to send the same commands to the radio as explained in the initial post in this case using an arduino nano board and this is not connected through the COM port, the arduino is connected to a USB port. The connection between the arduino and the radio is through the Tx (1), Rx (0) and GND of the arduino nano and the RxD, Txd and GND of the radio.

I'm still not sure about Your setup. The Arduino is connected to USB, and Tx, Rx are connected to the radio. What type of radio connector? The RS232? Remember that Arduino Tx. Rx are TTL. 5 volt signals and RS232 are +- 12 volt.
What does the USB do? Supply controller power and debug only?

I use the USB cable to upload the program to the arduino and nothing else. The connection to the radio is as follows:

Arduino Board Radio

Tx-------------------> RxD
Rx-------------------> TxD
GND-----------------> GND

The radio can be connected directly to the computer, this may be the problem since the arduino, as you say, works with TTL levels, however by external references the connection can be made directly from the arduino but I'm not sure at this point.

NMEA0183.pdf (58.7 KB)

Okey. The radioTx, Rx You connect to the Arduino, are they the same as You connected to the Pc COM port?

If so you most likely fried the controller. You need a TTL- RS232 converter between the radio and the Arduino Tx/Rx.

Railroader:
Okey. The radioTx, Rx You connect to the Arduino, are they the same as You connected to the Pc COM port?

Yes its the same

Railroader:
If so you most likely fried the controller. You need a TTL- RS232 converter between the radio and the Arduino Tx/Rx.

The driver has no problem, I already tried it and it works fine. Reading more carefully the NMEA 0183 Protocol says that the radio can be connected directly to an RS232 input of a computer, however it is not clear to me if it can connect to lines with TTL or a signal level compatible with 5V CMOS. I think I should inquire more about the levels between the radio and the arduino board the problem may be there.

Yes. Get an RS232-TTL converter between the radio and the controller.
Would You try to use mains for feeding the controller? Of courde not. Connecting RS232 to 5 volt is he same wrong, only the poff and the smoke is less.

Very good Railroader, thanks for your patience; I'm going to try an RS232 to TTL converter, once I make the changes I'm back with the results.

You're welcome.

Hi Railroader, I'm back here again. I tell you that I followed your indications and confirmed that the problem is in the adaptation of voltage levels (as you say) since the I / O of the radio is RS232 (fortunately the arduino did not poff); I have not yet assembled the converter with the MAX232 but if I did the following test, according to the radio manual this has another connector to program or work remotely but it works with TTL levels, I tested it with the arduino and it worked correctly accepting all the commands sent, showing that the problem from the beginning was in the adaptation of levels and not in the programming of the arduino. With this my problem is solved. I thank you for the help you have given me, kind regards and good luck! 73 '

Wonderful! Thanks for being very responcive! Very nice to come to a solution.

Starting in the 1970:es RS232 was an issue. It needed -12 volt, an extra voltage to produce..... Also, if my memory is ok the levels were: -12, logic 1, high level and +12 was logic 0, low level. Never mind.
I still have an old logic tester for 25 pin D-sub.....

Reading Your last reply again it looks like the ICOM has 2 connectors, one RS232 and one at TTL level.

Railroader:
Reading Your last reply again it looks like the ICOM has 2 connectors, one RS232 and one at TTL level.

Hello Railroader, it is correct, one RS-232 connector and the other TTL, unfortunately that information was not given in the manuals of that radio, I had to search the web for information about it and later experiment as I mentioned in the previous post. After that I did another experiment and it was to intentionally lower the level of the Tx output of the arduino with respect to the TTL input of the ICOM, obviously it did not work, I reconnected as before and voila, working as before, with this I corroborated the importance of the adequacy levels, you can be sure it won't happen to me again. Now shaping the project, I'm already sending commands like putting the radio (REMOTE ON) and (REMOTE OFF) and frequency changes. Thanks for your attention and comments!

1 Like

Greate. Well done!