You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CM108 provides GPIO which could be used directly to pull down on the PTT rig control signal - which simplifies CM108 USB audio hardware mod for transmitter.
Typically, an Open Collector transistor is used to pull-down on the PTT pin so that GPIO3 drives high on the Transistor to activate PTT. However, by utilizing CM108 GPIO pin in an Opendrain mode, GPIO3 pin could be directly connected to the PTT rig control pin.
This simplifies hardware mode. However, please note that CM108 GPIO is only capable of 4KV ESD and safely pulling down only up to 5V signals and 8mA loads. This should be sufficient for most modern rigs, but, please check your Transceiver PTT specification.
Jason Kim., KG6KZZ
======================================================== Code Changes needed for this feature:
src/cm108.c: // to use GPIO as Opendrian mode PTT signal activation
src/cm108.h: // to use GPIO as Opendrian mode PTT signal
src/audio.h: // to add Opendrain mode capability for CM108 GPIO
activationsrc/config.c: // to add GPIO configuration option for Opendrain mode.
src/audio.h: // to add Opendrain mode capability for CM108 GPIO
conf/generic.conf: // to add Opendrain mode example for the confg file
========================================================
diff --git a/src/cm108.c b/src/cm108.c
index 189512d..10c32ba 100644
+// KG6KZZ added to support Open-Drain GPIO for PTT control without needing external OC transistor
+// KG6KZZ type = 1 means OpenDrain mode, type = 0 means PushPull mode
+int cm108_set_gpio_od_pin (char *name, int type, int num, int state)
+{
int iomask;
int iodata;
if (num < 1 || num > 8) {
text_color_set(DW_COLOR_ERROR);
dw_printf("%s CM108 GPIO number %d must be in range of 1 thru 8.\n", name, num);
return (-1);
}
if (state != 0 && state != 1) {
text_color_set(DW_COLOR_ERROR);
dw_printf("%s CM108 GPIO state %d must be 0 or 1.\n", name, state);
return (-1);
}
// KG6KZZ: to use GPIO in OpenDrian configuration for direct pulldown of PTT pin
int ptt_opendrain; /* KG6KZZ OpenDrain configuration. */
========================================================
diff --git a/conf/generic.conf b/conf/generic.conf
index 8630ed5..f6743a7 100644
--- a/conf/generic.conf
+++ b/conf/generic.conf
@@ -273,10 +273,21 @@
%W%# If using a C-Media CM108/CM119 or similar USB Audio Adapter,
%W%# you can use a GPIO pin for PTT control. This is very convenient
%W%# because a single USB connection is used for both audio and PTT.
-%W%# Example:
-%W%
+%W%#
+%R%# KG6KZZ added opendrain mode GPIO selection for PTT activation
+%R%# KG6KZZ this allows PTT pin to be wired directly to CM108 GPIO pin
+%R%#
+%W%# PTT CM108 [[#,-#,o#] [\?\hid...]]
+%W%# where [] indicate to use defaults (drive high GPIO3 to transmit)
+%W%# where [#] indicate to drive high GPIO# pin to transmit.
+%W%# where [-#] indicate drive low GPIO# pin to transmit.
+%W%# where [o#] indicate opendrain GPIO# pin to transmit.
+%W%# where [\?\hid...] indicates specific path to the USB device
+%W%#
%W%#PTT CM108
-%W%%C%#
+%W%#PTT CM108 -3
+%W%#PTT CM108 o3
+%C%
%C%# The transmitter Push to Talk (PTT) control can be wired to a serial port
%C%# with a suitable interface circuit. DON'T connect it directly!
%C%#
@@ -285,13 +296,11 @@
%C%# Both can be used for interfaces that want them driven with opposite polarity.
%C%#
%L%# COM1 can be used instead of /dev/ttyS0, COM2 for /dev/ttyS1, and so on.
-%L%#
%C%
%C%#PTT COM1 RTS
%C%#PTT COM1 RTS -DTR
%L%#PTT /dev/ttyUSB0 RTS
%C%
-%L%#
%L%# On Linux, you can also use general purpose I/O pins if
%L%# your system is configured for user access to them.
%L%# This would apply mostly to microprocessor boards, not a regular PC.
The CM108 provides GPIO which could be used directly to pull down on the PTT rig control signal - which simplifies CM108 USB audio hardware mod for transmitter.
Typically, an Open Collector transistor is used to pull-down on the PTT pin so that GPIO3 drives high on the Transistor to activate PTT. However, by utilizing CM108 GPIO pin in an Opendrain mode, GPIO3 pin could be directly connected to the PTT rig control pin.
This simplifies hardware mode. However, please note that CM108 GPIO is only capable of 4KV ESD and safely pulling down only up to 5V signals and 8mA loads. This should be sufficient for most modern rigs, but, please check your Transceiver PTT specification.
Jason Kim., KG6KZZ
========================================================
Code Changes needed for this feature:
src/cm108.c: // to use GPIO as Opendrian mode PTT signal activation
src/cm108.h: // to use GPIO as Opendrian mode PTT signal
src/audio.h: // to add Opendrain mode capability for CM108 GPIO
activationsrc/config.c: // to add GPIO configuration option for Opendrain mode.
src/audio.h: // to add Opendrain mode capability for CM108 GPIO
conf/generic.conf: // to add Opendrain mode example for the confg file
========================================================
diff --git a/src/cm108.c b/src/cm108.c
index 189512d..10c32ba 100644
+// KG6KZZ added to support Open-Drain GPIO for PTT control without needing external OC transistor
+// KG6KZZ type = 1 means OpenDrain mode, type = 0 means PushPull mode
+int cm108_set_gpio_od_pin (char *name, int type, int num, int state)
+{
+} /* end cm108_set_gpio_od_pin */
=========================================================
diff --git a/src/cm108.h b/src/cm108.h
index 2def77a..b12fdd8 100644
+extern int cm108_set_gpio_od_pin (char *name, int type, int num, int state);
========================================================
diff --git a/src/ptt.c b/src/ptt.c
index d37d821..9cb6fc7 100644
--- a/src/ptt.c
+++ b/src/ptt.c
@@ -1331,11 +1331,22 @@ void ptt_set (int ot, int chan, int ptt_signal)
#endif
========================================================
diff --git a/src/audio.h b/src/audio.h
index f112f76..93bd03b 100644
--- a/src/audio.h
+++ b/src/audio.h
@@ -290,16 +293,19 @@ struct audio_s {
========================================================
diff --git a/conf/generic.conf b/conf/generic.conf
index 8630ed5..f6743a7 100644
--- a/conf/generic.conf
+++ b/conf/generic.conf
@@ -273,10 +273,21 @@
%W%# If using a C-Media CM108/CM119 or similar USB Audio Adapter,
%W%# you can use a GPIO pin for PTT control. This is very convenient
%W%# because a single USB connection is used for both audio and PTT.
-%W%# Example:
-%W%
+%W%#
+%R%# KG6KZZ added opendrain mode GPIO selection for PTT activation
+%R%# KG6KZZ this allows PTT pin to be wired directly to CM108 GPIO pin
+%R%#
+%W%# PTT CM108 [[#,-#,o#] [\?\hid...]]
+%W%# where [] indicate to use defaults (drive high GPIO3 to transmit)
+%W%# where [#] indicate to drive high GPIO# pin to transmit.
+%W%# where [-#] indicate drive low GPIO# pin to transmit.
+%W%# where [o#] indicate opendrain GPIO# pin to transmit.
+%W%# where [\?\hid...] indicates specific path to the USB device
+%W%#
%W%#PTT CM108
-%W%%C%#
+%W%#PTT CM108 -3
+%W%#PTT CM108 o3
+%C%
%C%# The transmitter Push to Talk (PTT) control can be wired to a serial port
%C%# with a suitable interface circuit. DON'T connect it directly!
%C%#
@@ -285,13 +296,11 @@
%C%# Both can be used for interfaces that want them driven with opposite polarity.
%C%#
%L%# COM1 can be used instead of /dev/ttyS0, COM2 for /dev/ttyS1, and so on.
-%L%#
%C%
%C%#PTT COM1 RTS
%C%#PTT COM1 RTS -DTR
%L%#PTT /dev/ttyUSB0 RTS
%C%
-%L%#
%L%# On Linux, you can also use general purpose I/O pins if
%L%# your system is configured for user access to them.
%L%# This would apply mostly to microprocessor boards, not a regular PC.
==========================================================
The text was updated successfully, but these errors were encountered: