The ICOM CI-V bus is a single wire interface
#Icom ci v commands serial#
However, I don't understand why the serial monitor never shows the The FB is the positive acknowledgement of the vfo or frequency command The 04 is the device sending the packet which is the address assigned The "computer" end is usually set to 0x01. The 01 is the address the packet is being sent to which in this case the set vfo or set frequency command which will be: If you start up the serial monitor you should see the response to either depending upon whether VFO is defined here or sets the frequency to 28000 kHz and increments it by 100Hz every second from A to B and back again once every second The sketch is for V1.0 and uses the SoftwareSerial library so that the rig is on pins 2 and 3 which the USB to be connected as well so that you can monitor what’s going on. It can also read what the radio sends when you spin the dial or change the mode etc. I wrote a program to test the interface and it can set the VFO or the frequency and also read the radio’s response. I’ve attached a hand-drawn diagram of the circuit - use at your own risk. But two transistors in each direction are required for TTL-TTL. The one I had been using was for connection to RS-232 which only requires one transistor in each direction. I tried connecting my IC735 using just the diode but I couldn’t get the Arduino to receive anything even though I could send stuff.īut I did get a TTL-TTL interface working with the Arduino.
#Icom ci v commands code#
This code blithely assumes that the first 17 things in the buffer are what it wants. This program flushes the serial buffer, sends a command, reads the first 17 numbers in the serial buffer corresponding to the Arduino’s command and the radio’s response, decodes the BCD data and puts it in a four-element array (GHz, MHz, kHz, and Hz). Serial.print(0x58,BYTE) // 706MKIIG's address Using Arduino 0023’s Serial.flush() and the interface described above, I can read the radio’s frequency with this code: int incoming ÞþXàý //Arduino’s request, looks weird because it’s raw dataįE FE 58 E0 3 FD FE FE E0 58 3 0 76 46 1 0 FD // Arduino’s request (red) Radio’s response (blue) as read from serial buffer. Serial.print(response,HEX) Serial.print(' ') //get response Radio data – 1N914 – Arduino TX (cathode on Arduino TX side) Here is the wiring a kind man told me to try: If the line is high, why am I seeing all that junk? Why do I get a perfect call and response only after the Arduino resets? Why doesn’t Serial.flush seem to do anything? I measure the voltage of the data bus and it is always 5v, except for a dip when a command is sent/recieved.
I try flushing the serial buffer before each request but Serial.flush() doesn’t seem to do anything. Occasionally I can make out the Arduino’s command, and then see part of the radio’s response. But from now on, the serial buffer spews junk (numbers around 0x30).
In the serial monitor I see the command sent by the Arduino (because it’s an open collector bus) and the radio’s response. After 1 sec, the Arduino spits out the contents of the serial buffer. The Arduino commands the radio to spit back its frequency. The problem comes when I try to read data from the radio. The only difference is that instead of using TX, RX and ground pins, the radio uses data and ground. The interface is exactly compatible with the Arduino serial output, as far as I can tell, since I have no problem sending commands to the radio at high data rates. I’m trying to talk to an Icom amateur radio (model 706MKIIG) using the radio’s 5v TTL open collector bus serial interface ( DF4OR: ICOM CI-V Information - Table of Contents).