Wednesday, December 4, 2024

Wouxun KG-UV9D Plus - full duplex settings

 Just a quick and dirty post.  A number of the Wouxun HTs are advertised as being able to be cross band repeaters.

A by-product of that is they are full duplex radios...at least in the crossband (can't confirm any other configurations)

A repeater receives a transmission and then immediately rebroadcasts it.

Most Amateur Radio repeaters repeat on the same band with a predefined frequency offset (depending on the band)

A crossband repeater receives on one band and retransmits on another band.   All the AMSAT/ARISS satellite repeaters operate in this way.   Most of them are 70CM and 2M for the two bands.

If you want to communicate on these satellites, you will transmit on the uplink frequency and receive on the downlink frequency.

The simplest setup to do this is one antenna on one radio, and a different antenna on a different radio.

A more complex way to do this is a dual band antenna (or two antennas through a duplexer) connected to a full duplex radio.


There are a few full duplex mobile radios out there...In my opinion the nicest new one is the Icom IC-9700.


There are very few full duplex HTs.  Kenwood used to have a bunch of them...but the last one they made was the TH-D72...the 74 and later are NOT full duplex.


So I picked up the KG-UB9D Plus, not for duplex, but because it could receive around 7 bands of radio frequencies...I thought that would be interesting.


Just a week or so ago Jason at the Ham Radio 2.0 YouTube channel meantioned that a different version of the Wouxun HT was full duplex.


So I looked at mine and read the specs...and sure enough my was supposed to be able to do crossband repeater work.


I will skip to the punch line, the manual is very hard to follow, and for whatever reason, you cannot word search it...so I had to dig.

I tested trying to duplex it, and it seemed to be transmitting the same time it was repeating (both signal meters were alive) but no receive audio as soon as you hit the PTT.   The speaker icon on the receive side would indicate mute.


So I had to locate whatever was causing the mute...


MENU 60 - Mute on the sub area (S-MUTE). "Setting the volume status on the sub band when the transceiver is working on the main band.

Option: OFF/RX mute/TX mute/RX and TX mute

Default: OFF"

So for all that gobbly gook...to get full duplex where you can hear the receive audio...

Hit the MENU button (on my radio it is orange)

Dial the freq knob (top next to volume) CCW to MENU 60, "S-MUTE" will  be on the display.

Hit the MENU button again, this will display the current setting...you want to see "OFF"

Sub band is which ever one is not main...seems obvious, but some radios use A or B (top or bottom freq of display) to define some functions  freq on the display...this just uses Main and Sub...much easier to understand.  (However there is still a A and B side... top is A and that is the only half that can do AM)

Mine was not set to the Default...so at some time in the programming that got swapped.

I tried to reproduce the mute function...but couldn't so I listed the rest of the settings that might affect it

MENU 43 "TYPE-SET" - TALKIE

MENU 44 "RPT-SPK" - ON

MENU 60 "S-MUTE" - OFF

Until the few hours I spent solving the duplex problem I had NEVER changed any menu entry...and about half of mine were not the defaults as listed in the manual...so maybe check them all.

Hopefully something in there helps.


Sunday, September 1, 2024

Kenwood TM-D710A GPS mod.

 Kenwood TM-D710A GPS mod.


Another copy of someone else's work...


I have the older non built in GPS D710...I had been using various external devices...but hated setting them up when using radio in a different vehicle.

In my case that different vehicle was used for 100 mile bicycle race support.  This year the bike race organizers incorporated APRS as an additional way to see where the support vehicles were currently located.   I didn't bring my external GPS, and my HT couldn't hit most of the APRS Igates...so I couldn't really participate in that...just had to use old fashioned location reports.


I started looking at the subject again, and there were no inexpensive, simple solutions to adding GPS...and most were no longer available or required out of date, and somewhat unavailable hardware.


Then I found this article.

 https://mythopoeic.org/tm-d710-internal-gps-de-nf3h/


It had all the info I needed...but I found some more references just to make sure.


Such as... https://yo3hjv.blogspot.com/2010/01/oem-gps-inside-tm-d710-front-panel.html


I used the Sparkfun GP1818  https://www.sparkfun.com/products/19166


It can take up to 5v VCC, so no regulator is required to step down to 3.3v

The serial output is 3.3v so I inserted the signal on the output side of R47.  Intially I had a 1k resistor from the GPS TX output to that point after R47...but wasn't getting a signal, then realized the output was only 3.3v without a resistor.


I recommend finding the service manual for the radio to locate the 5V power source and R47.


I have a microscope for soldering, so it wasn't a big deal...but R47 is tiny and requries much care to solder to...I was using tiny 30ga or so wire and that was big next to R47.  My tiny (I thought) solder tip was the entire size of R47...and I have done quite a bit of pin by pin SMD soldering with that same tip...


I didn't have to modify the case at all...just double stick taped the module to the back case right next to the 'speaker' output.


Good luck.

Arduino Teensy 4.1 MIDI Step Sequencer

 I had been working on a Teensy based Synthesizer project, but the one I was designing was too complex to manage the code. Luckily a friend of mine was also working on one, so I am using his.

But now, how do you play it, well you can plug a keyboard in and play it that way, or you can program a sequence in to a keyboard sequencer etc.

But I was sure there was a project for a small stand alone sequencer I could build.


And there was.  Simple DIY Electronic Music Projects has a ton of projects...including an Arduino based Step Sequencer.

I knew this was a terrific starting point.

Two areas for improvement...the MIDI channel was hard coded in, so if for whatever reason you changed your mind, you had to reprogram it.

Second the BPM rate was fixed...again, no way to change it without reprogrammming.

So I started with the base code and added my own... He (Kevin the author) wrote some well annotated code, so it was simple to add my code.

I added three things.

I added the ability to select a MIDI channel, I added the BPM rate selection...and I added a display so you could see your settings AND see the 'beat' as it went across the 8 notes.


I will list the parts of code that I added and explain them, then the whole code at the end.

First, display.

For the display I already had an Adafruit 8x16 matrix display on their LED Backpack.

I needed to be able to drive it and change the font...both were a bit of a challenge for me.

I edited both Adafruit_LEDBackpack.h and Adafruit_I2C.h from "&Wire" to "&Wire2" because I am using SCL2/SDA2 for I2C

#include <Adafruit_GFX.h>

#include "Adafruit_LEDBackpack.h" 

#include <Fonts/Picopixel.h>

Adafruit_8x16matrix matrix = Adafruit_8x16matrix();

 First two are needed to drive the hardware, third one changes the font to a smaller one (so everything fits on screen)

Fourth line defines the matrix as a display device (vs a tft or something else)


Next the code to assign the MIDI channel

int midiChannel;

int midird;

float bpmmath;

The first line I changed...the default code sets a fixed midi channel there.

next I needed some variables to track the midi setting and bpm setting


Now some setup to allow the user to set the midi channel during boot up (from my friend who made the synth)

unsigned long start_millis;  // use this variable to take a snapshot of

                             //    the current number of milliseconds

                             //    since the Teensy last booted


#define HOW_LONG_TO_WAIT_IN_MILLISECONDS  5000  // use this constant to specify how long

                                                //    you want to look/wait for something

                                                //    at startup: this defines 5-seconds

Next bit of code is added to voice setup so during the first 5 sec after boot you can select the midi channel.

 void setup() {

 //added code to drive matrix LED and the midi channel select code  

  matrix.begin(0x70);  // pass in the address.  default for led backplane

 Wire2.begin(); //in order to use SCL2/SDA2 you need Wire2 and need to change the Adafruit libraries listed above 

  // next section allows a delay for user to set midi channel using MIDI/BPM pot

  start_millis = millis();   // take a snapshot of the current number of

                              //    milliseconds since the Teensy booted

  while ((millis() - start_millis) < HOW_LONG_TO_WAIT_IN_MILLISECONDS)

   {

      // whatever you put here will be done repeatedly

      //    until your defined time in milliseconds expires

  midird = analogRead(A14); //reads pot for midi...later same pot used for BPM

  midiChannel = map(midird, 0, 1023, 1, 16); //map() converts the analog pot to 16 choices

  delay(50);

  matrix.setFont(&Picopixel); //make font smaller

  matrix.setTextSize(1);

  matrix.setTextWrap(true);  // we dont want text to wrap so it scrolls nicely

  matrix.setTextColor(LED_ON);

  matrix.setRotation(1); //if hookup wires are on left then 1...if on right then 3

    matrix.clear();

    matrix.setCursor(1,5);

    matrix.print("M ");

    matrix.print(midiChannel);

    matrix.writeDisplay();

    delay(50);

 }


All the rest of the code is in the void loop

Next on the list (as we go down the code)...I had a problem with the synth sending midi messages back through the usbMIDI and eventually locking up the synth...this can be disabled on the synth, but it made more sense to simply stop the controller from receiving the return info (that it doesn't need or want to operate)


void loop() {

   while (usbMIDI.read()) {

}

It just reads and discards or ignore inbound messages (I am not sure exactly which)...either way it solved the problem.

Now the additional code to read the input and set the delay for the appropriate BPM (beats per minute)

  //so I modified code to allow a pot to give the delay instead of fixed...it is set to run 1000ms to 150ms delay

  int bpmread  = analogRead(A14); 

  int bpm = map(bpmread, 2, 1015, 1000, 150);

  float bpmmath = 1.0 / (bpm / 1000.0) * 60.0; //probably a better way to do this, but it is what I came up with

  int bpmshow = bpmmath; //gives us a BPM vs a delay to display

 delay(bpm); // this is a code change from fixed delay to adjustable

   //this dispays bpm on matrix display

  matrix.setFont(&Picopixel); //sets the smaller font

  matrix.setTextSize(1);

  matrix.setTextWrap(true);  // we dont want text to wrap so it scrolls nicely

  matrix.setTextColor(LED_ON);

  matrix.setRotation(1);

    matrix.clear();

    matrix.setCursor(3,5);

    matrix.print(bpmshow);


And finally some code to flash an appropriate LED when a note in the sequence is played (1-8)

//tracks where in the sequence it is for use on display later in the code...

  int x = (((playingNote + 1) * 2) - 2); //so the first note (A0) lights the first led etc

  int y = 7;  //I didn't need to put this here...but it made sense to keep it all in one place

 matrix.drawPixel(x, y, LED_ON);  //uses variables from above to plot a dot at the current step position

  matrix.writeDisplay();  // this writes ALL the above info to the matrix LED display

 }

 Thats all the modifications...the wiring should be straight forward...but I will summarize here (again on my Teensy4.1)

A0-A7   -10k pots for the notes in the sequence

A14       -10k pot for MIDI/BPM adjustment

TX1/RX1  -(if you add a actual 5pin DIN MIDI port)

SCL2/SDA2  -for I2C to drive LED display

The 10k pots have 3.3v on one side, GND on the other side and the center pin goes to the A0-7,A14 pins for input.  DO NOT USE 5V.

On my pots I have GND on the 'left' (viewed from the top) pin or the pin you turn counter clockwise toward...

...3.3v is on the 'right' pin or the pin you turn clockwise toward.   

This way CCW is down and CW is up.

I am using the USB port to power it, and pull 5v off for a MIDI connector and the LED matrix display.