Topics

separate CAT jack, without using the USB cable #ubitx #arduino #cat #raduino

Sascha Bohnet | DL5SMB
 

Hello everybody,

can anybody tell me, if it is possible to realize / install a separate cat jack without using the present USB port,
by going straight to Pin 1, Pin 2 and Ground on the Arduino Nano?

If I have understood correctly the built in cat interface  in KD8CECs firmware uses the USB connector

just as an RS232/TTL converter

Am i right, if I assume, that it should be possible to solder some wires to D0 and D1 (RX + TX) and ground and then install

a MINI-DIN 8 socket to the uBITX like in an FT817?

I am asking because I am building TF3LJs Magnetic Loop Controller https://sites.google.com/site/lofturj/to-automatically-tune-a-magnetic-loop-antenna at

the moment, which communicates with the tranceiver via cat for tuning the antenna. This interface uses just these three lines. So I need to make them talk :-)

I would just try it, but am a little bit unsure if i might damage something, if I am wrong. I am not really fond of grilling the Raduino.

Sascha

Scott Norby
 

I do not think that would work.  The TX and RX pins on the Nano are RS232, not USB.

Jerry Gaffke
 

That can work, if you include an external USB to 5v tolerant UART converter such as this:
     http://www.oddwires.com/cp2102-serial-adapter-module-usb-to-rs232-with-jumper-wires/

How to do it is documented at the bottom of this post:
    https://groups.io/g/BITX20/message/50027
In that write-up, I mention tying the 5v pin from the CP2102 to the 5v pin of the Raduino,
only do that if you want to power the Raduino from the host's USB port.
In your case where you have the Raduino installed in the uBitx, do not connect
up that 5v wire, as it is better to let the LM7805 on the Raduino supply the 5v.

The CP2102 is primarily 3.3v, but the pins are 5v tolerant.
The Nano has 5v TXD/RXD pins.
It works.

There are plenty of other USB-to-UART adapters that could work for you, 
but that happens to be the one I used.
Some may give you more trouble with installing the needed software driver,
my CP2102 worked out of the box on an Ubuntu host without needing a driver installed.
And some USB-to-UART adapters may not be 5v tolerant.

Toward the top of that post there's a link to the schematic for the Nano clones we use:
       http://actrl.cz/blog/wp-content/uploads/nano_ch340_schematics-rev1.pdf
in case you wanted to figure things out more thoroughly.
Datasheets for all the IC's involved are easily found on the web.

Jerry, KE7ER



On Sun, Feb 10, 2019 at 01:00 PM, Sascha Bohnet | DL5SMB wrote:

Hello everybody,

can anybody tell me, if it is possible to realize / install a separate cat jack without using the present USB port,
by going straight to Pin 1, Pin 2 and Ground on the Arduino Nano?

If I have understood correctly the built in cat interface  in KD8CECs firmware uses the USB connector

just as an RS232/TTL converter

Am i right, if I assume, that it should be possible to solder some wires to D0 and D1 (RX + TX) and ground and then install

a MINI-DIN 8 socket to the uBITX like in an FT817?

I am asking because I am building TF3LJs Magnetic Loop Controller https://sites.google.com/site/lofturj/to-automatically-tune-a-magnetic-loop-antenna at

the moment, which communicates with the tranceiver via cat for tuning the antenna. This interface uses just these three lines. So I need to make them talk :-)

I would just try it, but am a little bit unsure if i might damage something, if I am wrong. I am not really fond of grilling the Raduino.

Sascha

Jerry Gaffke
 

I'll now drive this thread off into the weeds regarding an obscure issue
with some older CP2102 USB-to-UART modules.
Most people won't care.


While verifying how the CP2102  USB-to-UART converters work, I ran into this post
    https://www.silabs.com/community/interface/forum.topic.html/cp2102_3_3v_outputi-EaVr
where the second to the last post says:

PBudmark    Replied Jul 08 2017, 12:37 PM
There is a major design flaw in the board, RST-pin (9) is connected to 5.0V (VBUS).
This is reported deep into a forum on Banggood but not properly informed to buyers.
Quote: The problem with the 3.3V line at 4.2 is due to the RST input being tied not to 3.3 V out but to the Vbus in (5V) this back feeds into the 3.3V line pulling it up above spec, cut the trace you see coming from pin 9 before it reaches the capacitor, then optionally pull it to 3.3 via a 4k7 resistor to pin 6. This also seems to solve the variability with Win10     Posted 2017-02-22 09:12:56 by instoned @t aol dot com
 
The post includes a photo, showing that pins 8 and 9 of his CP2102 chip got shorted together.
From the diagram at the bottom of the first page of the CP2102 datasheet
    https://www.silabs.com/documents/public/data-sheets/CP2102-9.pdf
you can see that pin8 is 5v coming in from the USB host computer.
Pin 9 is the RST (reset) pin of the CP2102 chip, and should be pulled high to 3.3v through a pullup resistor.

The CP2102 modules I got from oddwires.com  a few years ago do not have this flaw.
My modules do not have a ceramic cap placed near pins 8,9 of the CP2102 as in the above post,
the appearance of my module is significantly different.
The current CP2102 modules available from Banggood are different than the post above or mine:
    https://www.banggood.com/Wholesale-USB-To-TTL-COM-Converter-Module-buildin-In-CP2102-New-p-27989.html?akmClientCountry=America&cur_warehouse=CN
Oddwires now pictures yet a fourth build, with the CP2012 chip placed at a diagonal:
    https://www.oddwires.com/cp2102-serial-adapter-module-usb-to-rs232-with-jumper-wires/

So hopefully, the incorrect CP2102 modules are now long gone from the supply chain.
I'd go with the Oddwires product, as it has access to some additional signals (CTS, RTS, DSR, ...)
along the sides of the board.

It seems the incorrectly built CP2102 modules worked, though having Vdd up at 4.3v
is stressing the CP2102.chip.  And if driving a 3.3v processor with a 4.3v TXD,
you might be slightly stressing that processor as well.
Since our Nano has 5v IO, I doubt anything catastrophic would occur other than having 
the CP2102 module possibly fail.

Jerry

On Mon, Feb 11, 2019 at 11:42 AM, Jerry Gaffke wrote:
How to do it is documented at the bottom of this post:
    https://groups.io/g/BITX20/message/50027
In that write-up, I mention tying the 5v pin from the CP2102 to the 5v pin of the Raduino,
only do that if you want to power the Raduino from the host's USB port.
In your case where you have the Raduino installed in the uBitx, do not connect
up that 5v wire, as it is better to let the LM7805 on the Raduino supply the 5v.

The CP2102 is primarily 3.3v, but the pins are 5v tolerant.
The Nano has 5v TXD/RXD pins.
It works.

AndyH
 

On Sun, Feb 10, 2019 at 03:00 PM, Sascha Bohnet | DL5SMB wrote:

Hello everybody,

can anybody tell me, if it is possible to realize / install a separate cat jack without using the present USB port,
by going straight to Pin 1, Pin 2 and Ground on the Arduino Nano?

If I have understood correctly the built in cat interface  in KD8CECs firmware uses the USB connector

just as an RS232/TTL converter

Am i right, if I assume, that it should be possible to solder some wires to D0 and D1 (RX + TX) and ground and then install

a MINI-DIN 8 socket to the uBITX like in an FT817?

I am asking because I am building TF3LJs Magnetic Loop Controller https://sites.google.com/site/lofturj/to-automatically-tune-a-magnetic-loop-antenna at

the moment, which communicates with the tranceiver via cat for tuning the antenna. This interface uses just these three lines. So I need to make them talk :-)

I would just try it, but am a little bit unsure if i might damage something, if I am wrong. I am not really fond of grilling the Raduino.

Sascha

 
Sascha,

  THANK YOU for linking to this project - I've been trying to figure out how to put a loop in my attic for close to three years - this is PERFECT!  

   I noticed that Loftur has a 'pass-through' mode.  I wonder if that will do the job? 
The USB port can also be configured for Serial port <==>USB port passthrough mode, enabling computer control of the transceiver.
   I'm interested in exploring this as well, as I'm hoping to use cat to let my µBITX talk to this box an an off-board PA.

  73, Andy, KG5RKP

John (vk2eta)
 

Hello Sascha,

The RX and TX lines of the Arduino are TTL levels like the CAT port in the FT-817 and therefore can be used in place PROVIDED the Arduino's USB port is not connected.

I looked at the project you linked to and it indeed uses the TTL serial communication between the tuner and the rig so what you are proposing should work.

I would nevertheless be mindful of the capability of serial communications to become corrupted especially at TTL levels (0-5V) by the RF of the antenna while transmitting. It may be that during transmission no exchange is done with the rig in which case it would be Ok (I didn't read the project data in more details).

Otherwise shielded cables and ferrites may be in order, just mentioning in case issues do appear.

Interesting project. I have a copper loop "sleeping" at the moment and that could be a good project for it. Thanks for sharing.

Good luck and 73, John (VK2ETA)

John (vk2eta)
 

Some reference if interested:  https://forum.arduino.cc/index.php?PHPSESSID=v7m2jee5bohuk54l5lva6fiip5&topic=285660.15

AndyH
 

Sascha,

   I'll add this to the pile just in case it might be valuable.  I'm guessing you won't have to use Google translate for OM Kurt's pages.  hi

https://www.helitron.de/dj0abr/index.html

  Tschüß, Andy

Sascha Bohnet | DL5SMB
 

Thanks a lot everybody for your input.

So I will try to procede with the separate jack, connected directly to D0 and D1,  I just need to remember to plug-in either  USB or the Cat control into the uBITX.
So no connection betwwen uBITX and my PC while use the Magnetic Loop.

However - if I understood correctly, I might be able to connect the magnetic Loop Controller with the UBitx via Serial BUS while I connect via USB from my PC

to the Teensy 3.2 in the Magnetic Loop Controller using the Pass-htough method. This way it might be possible to use the PC to control the Tranceiver and the antenna.

Thanks also for the link to DJ0ABR Andy. His CIV Router Box sounds useful, though it might be no option here as KD8CEC decided to use Yaesus Protocol ant not Icoms.
So no BUS-System with unlimited paralled devices.

John (vk2eta)
 

Yes I believe the passthrough method is designed for that purpose. 

I downloaded the code and had just a casual look at it but I suspect the ATU software queues the PC request and sends them between frequency requests it makes itself to the rig every second.

This means you may have to increase the timeout delay slightly in the PC software to cater for some delayed responses.

Keep us informed please.

73, John

Sascha Bohnet | DL5SMB
 

So, to give some feedback.

I do not have any positive results yet. The controller is built and finished, but I am not able to control neither my IC-725 nor the uBitx with it.

Nevertheless I am not sure if the problem is the loop controller. I wanted to use the Icom first to check if the tuner is okay,
but there seems to be a problem with the C-IV of my 725. There is only signal of 0.8V at the radio, while the controller shows about 2,5V at the DVM and my normal CIV cable does not work with the rig  anymore. Maybe there was a problem with the last thunderstorm, who also killed my power supply. I have to investigate.

But back to the uBitx:

The direct connection to controller did not work either, so I tried hooking up the PC with a TTL adapter to DO and D1.
I first used an older Prolific USB-TTL converter which turned out was good for nothing. I could not connect the the uBitx at all.

But then i remembered that I had another adapter at home which I had used to program some Arduino Pro Minis ealier . And it turned out, this was even a CP2102. And: It works, just as Jerry wrote earlier.
I can connect to the Ubitx with this adapter via the MM Manager and Ham Radio Deluxe.

I just do not know why it will not work with the loop controller,if connected directly. I chcked all the connections, pins, played along with the serial data speed, 8N1 and 8N2, inverted the signal and so on. Its crazy. No function. I need to find another rig first to make sure the controller works as it should.

John (vk2eta)
 

Hello Sascha,

One good news is that you have a USB-TTL converter that works and that it talks to the Arduino.

Based on the above my first thoughts about the issue are either the option selection in the loop controller (compile time or run-time) or the serial communication parameters and maybe (but I don't think so) voltage level incompatibilities between the two micro-controllers (the Raduino runs at 5V, not sure about the loop controller).

I would do the following tests:

1. Connect the RX and Ground of the TTL converter to the TX and ground of the loop controller and use a terminal emulator which can display hex values. E.g. Realterm (see https://learn.sparkfun.com/tutorials/terminal-basics/real-term-windows).

Check that you see characters sent by the loop controller. That will tell you if the controller is sending the proper sequences, at the proper speed, parity, stop bits and so on.

2. Connect the loop controller to the Raduino and keep the USB/TTL Rx/Ground connections as above. That way you can "spy" on the Loop-to-Radio data transmission. Check that you can still see expected characters sent from the loop controller (eliminates issues of overload).

3. Move the Rx pin of the USB/TTL converter to the Rx pin of the loop controller and check that the Raduino responds to the frames sent by the loop controller. This would tell you if the first part is working, but not the processing of the responses.

That would give you a first pass at pinpointing the issue.

73, John

Sascha Bohnet | DL5SMB
 

So, after googling a bit I think I have a suspicion.

While the Nano in the Raduino is a 5V System, the Teensy 3.2 runs internally on 3.3 Volt.

Then with the additional 1k resistors in the Teensy RX and TX lines I think the signal might be too low to be processed correctly. I guess I will try an 5V to 3.3V converter and look what will happen.

John (vk2eta)
 

Hello Sascha,

It should work "in theory" without a level converter (but it does not hurt to verify).

Reason being is that "A TTL input signal is defined as "low" when between 0 V and 0.8 V with respect to the ground terminal, and "high" when between 2 V and VCC (5 V)". Source PJRC forum.

So even if the output is 3.3V it should be sufficient for the Tx side (resistors excepted as you mentioned).

73, John 

Gary Anderson
 

There's a 1k series resistor in the RX and TX lines? Is this what you mean by "in"?  That would slow the slew rate of the signal.
A 1K pull-up to 5V, shouldn't be a problem.

The K20 on Teensy 3.2 is 5V tolerant on digital I/Os. You can drive the inputs to the Teensy 3.2 to 5V without an issue.
The Teensy runs 3.3V Externally. (internally it's nominally 1.0V, but that's not the issue) 
At 3.3V the K20 VOH min is  3.3V -0.5V = 2.8V @ -9mA of drive.
This should work fine with standard 5V TTL levels, (VIH 2V), BUT the Nano/ATmega is not TTL.  VIH is speced at 0.6Vcc  for Vcc 2.4-5.5V.

Gary Anderson
 

Sorry all, I hit send when I meant to delete what I had partially written yesterday evening.
Not a completed thought, and I didn't think my comments would really be of much help.

But since I did send:
With the specified switch point of Nano's input buffer at 60% of Vcc,and assuming Nano running at 5V,  the Teensy and Nano aren't compatible by min spec.
With a capacitive load, the Teensy should drive to 3.3V rail.

Sascha, I think you are on the right path. Also consider switching speed / baud rate.

Again my apologies, 
Gary

Sascha Bohnet | DL5SMB
 

I am still fighting to get this working.

While installing the first level converter I somehow managed to burn the Teensy controller- so I had to wait for the new one.
In fact this project uses the third Teeny controller by now and is slowly bankrupting me :-O Though i have to admit the first kill was really stupidity by me
(wrong polarisation - no diode can help you if you wire up the power connection the wrong way).

First of all, thank you John. The advice with the serial monitoring via Realterm might have been the push into the right direction.
I have built a spy cable where i can connect my USB-TTL-Adapter to with RX,TX and GND to try to monitor whats happening.
And i also installed a new level converter - the level is higher now.

I tried reducing the speed to 4800 by changing  the following in ubitx_20.h in KD8CECs firmware as Gary suggested.

  Init_Cat(4800, SERIAL_8N2);
  initSettings();
  initPorts();   

I can connect with the slower rate now, but all in all it did not help me with the problem. The loop controller and the uBitx are still not able to understand each other

Furthermore  I noticed that, I can read out the frequency manually using the Serial Port Monitor (send in "0000000003" and the uBitx answers the frequency).
So to find out what the loop Controller is sending, i  switched the RX-TX lines on the tapping, where i am taking of the signal with my adapter.

And now the strange thing  is: There is no readable signal, as long as the uBitx is powered on. If i turn off the uBitx , I can nearly see immediatelly the "0000000003" which the loop controller is sending on the serial monitoring software to poll the frequency. But as soon as the loop controller is switched on again the signal is lost. Does anyone have any idea, why this is the case? I have added some screen shots.

Is this a mistake in my built, is it a measuring error or do I just understand something wrong? It seems as if the uBitx is sucking in the signal or distorting it so much that it is not readable anymore.
I could imagine that the signal gets pulled in because there are no additional resistors in line to the serial pins of the raduino, but I am not sure. But if this should be the reason, the problem is most probably somewhere else, right? As mentioned earlier if use a serial adapter to connect the PC directly it works.

Sascha

John (vk2eta)
 

Hi Sascha,

Sorry to hear about the dead Teensies...ouch.

Fascinating problem. After reading you email a few times and to make sure I didn't jump to conclusions:

1. your "spy" connection towards the usb/TTL converter should not have the TX connected at all, only RX and Ground.

2. Could there be a possible ground issue via the power supplies of the PC and the uBitx. Try with the laptop on batteries if that is what you use as a computer.

3. When you say that "And i also installed a new level converter - the level is higher now." can you check with an oscilloscope? That should show you what happens when the power is applied to the uBitx.

4. The schematic of the Arduino Nano shows a 1K resistor between the D0(RXD) and the USB converter chip and the same for the D1(TXD) one, so your TTL level converter should be connected directly to the D0 (and D1) pins on the Nano, not through a resistor.

5. Just re-checking the schematic of the Arduino nano the built-in usb-ttl converter is always powered up, even if the usb cable is disconnected. So that may interfere if you have a (high) resistance between your level converter output and the D0(RXD) pin of the AT-Mega.

6. The normal idle state of serial TTL is high (if I am not mistaken) and the USB chip will pull the RX (D0) high through the 1K resistor, but your level converter should be able to pull it down to low level anyway (or vice versa if it's the other way around).

7. The fact that when you use your external usb/ttl converter with a PC and term emulator you get comms shows that it can be done (if I read your email correctly). What do you use for your Teensy to Arduino level converter?

Scratching my head on this one really..hihi. Let us know what you find.

73, John

Sascha Bohnet | DL5SMB
 

Hi John,

I guess i made some progress. I have a small oscilloscope for PC usage which i just dug out to visualize and check the voltage Levels - and i got some interesting results.

At first i thought the signal would be inverted, but then I read that  a negative logic is used here in which control signals have the opposite polarity. Like you wrote earlier :-)

Then next i noticed that if the uBitx is switched off, the signals goes down to 0,8 Volts if a signal is sent,
but if the uBitx is on, the voltage drops only  to about 3 Volts.

I guess this is the problem, which is adressed in your point 5, right?

To your points

1.) Noted.
2.) I am not using a notebook but a normal PC. Since the CAT connection between PC and uBitx is working, maybe there is no priority to check this first.
3.) This was the main work. I made some screenshots.
4.) I connected the lines directly tothe pins of the nano on the backsite of the raduino. This should be right i think.
5.) But that might be the problem - though what the solution might be, I am still unsure. Changing the 1k resistor between the USB chip on the nano to a higher value? I obviously don't want to cut the line.on the nano to the USB,
7.) I cant find a schematic, but I am using this converter Link


What I am still wondering about is why the level converter does not seem to work, when I invert the levels with the Loop controller software (pseudo RS232, since with the Inverted Levels a MAX232 can be controlled).
If the ubitX is off, I seem to only get the 3.3 Volts - not 5 Volts as expected.

Hmmm....

Maybe you have some ideas

vy 73

Sascha


Sascha Bohnet | DL5SMB
 

I just noticed that the pictures had been resized, i uploaded them to a hosting provider:

TTL - uBitx on
TTL - uBitx off
RS232 (inverted) - uBitx off
RS232 (inverted) - uBitx on