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.

 

 

Wednesday, February 22, 2023

Icom IC-7300 with SDRplay RSPduo as panadapter - digital mode settings


 There is already a ton of information on the PTRX-7300 panadapter I got for the IC-7300 from RadioAnalog.   I have a RSPduo attached to it. (in the screenshots I had hooked up a RSP2Pro for testing)  Also there is lots of info on using the USB port on the 7300 for CAT.

I am just going to list my settings...because it was a ton of pain to figure it out from conflicting info.

SDR software - SDRuno (works with the RSPduo and their other products)

Digital applications in use - Winlink Express, Vara HFFLdigi, WSJT-X, JS8Call

System:  IC-7300, panadapter, RSPduo, Win10.

Basics:

Omni-Rig and com0com software for the various apps to connect to the other software/hardware.  Some programs need com0com, some need Omni-Rig.  Apparently the 7300 does not support RTS/DTR.

SDRuno to interface with the RSPduo and control everything.

In all cases, once you correctly point to Omni-Rig or com0com/SDRuno your app should immediately start showing the radio frequency and the 7300 as well as SDRuno should match...if not, then go back to the basics.  Do the Test Cat/ Test PTT if possible...or just try to send a message.

AUDIO:  Luckily this is the same for all apps...the Icom creates two "USB Audio CODEC" devices...one is a Microphone, and one is Speakers.  The preceding number may be different than my screen shots, but they will say (USB Audio CODEC) in the name.  Mine say (3- USB Audio CODEC)

BTW, Winlink Express was the hardest, followed closetly by FLdigi...WSJT-X was the easiest.

If you are using different SDR software...as long as it sees Omni-Rig and can create a virtual CAT port...these instructions should work for you.


Omni-Rig:  Software to interface many apps to your radio.

Install normally and point to the Com Port the Icom is using.

-NOTE: the radio has two baud rates in the Set > Connectors > CI-V section.

--1: CI-V Baud Rate = 19200

--2: CI-V USB Baud Rate = 115200

In Omni-Rig use the CI-V USB Baud Rate...in my example 115200.  Screenshot below is from my working system.


com0com: creates virtual com port pairs...allowing devices to interface with each other, if they can't use Omni-Rig.

I only needed the one default port pair.  In my case COM3 and COM11


SDRuno: Can use Omni-Rig AND create a virtual radio com port for other apps to attach to.

--1: enable RSYN1 which lets SDRuno attach to Rig1 on Omni-Rig.  Once you click that this software and the radio should match frequency.

--2: Enable &Connect the CAT (in the RX Control Settings)

-This is how my software looks.


--NOTE: In my example SDRuno creates COM11...so all the appropriate apps need to connect to COM3 (created by com0com)

-- Also it simulates a Kenwood...normally a TS-2000...but you will see it is pretty generic.


Winlink Express with VARA HF

--1: set up correct SoundCard on the main Vara HF window.

--2: In Vara HF Winlink Settings there is no TS-2000...so I chose the TS-890S and seems to work fine.  Note Com port matches com0com and the baud matches SDRuno, and I put the TS-890S in the PTT Port also.



FLdigi:

--1: Need to use FLrig. TS-2000 for the radio, Com from com0com, baud from SDRuno.  The rest of the FLrig settings don't seem to matter...but this was my best guess.

--2: In FLdigi chose flrig for rig control (checkmark box in the flrig setting)  and set up the audio.



WSJT-X:

-1: of course this is the easiest one...just choose OmniRig Rig 1 (if using RIG1 for your radio) as the radio. (the screen shot below shows far too many uses of the word Rig...)

-2: same sound card settings as all the rest.  



JS8Call:

'should' be just as easy as WSJT-X.


NOTE: In this screen shot I hadn't yet clicked "Test CAT"  So the Freq hasn't matched yet.


If I add more...they will be tacked on here.