Skip to main content

August 11, 2024. Using the Arduino Uno to make the CW Transmitter work.

Today I want to focus a bit on the Arduino code that will operate the transmitter. We will have to start by traveling back and looking at the code that operates the MC1496 Direct Conversion Receiver (DCR). 


Arduino Uno for the CW Transceiver.

The true story is that I did not start out to build a DCR. The real truth is that I was headed toward a SSB Transceiver that would utilize the MC1496 devices in many critical parts of the transceiver. (Product Detector, Balanced Modulator, Transmit Mixer, Receive Mixer)

I had a bag of old MC1496's in the 14 Pin DIP package and the goal was to test those for the SSB transceiver, custom selecting the best ones. It was jury rig time and for the code I just hacked some Arduino code I had that would work (with a lot of nulled lines).

So, we all know how things happen -- the DCR worked well beyond my expectations and so did the code. Soon an article evolved, and the rest is history. 

My 1st task is to clean up the code so that only those lines involved with the DCR are kept and from there modified to work with the transmitter.

One key element I include with all of my code is a little program I wrote that produces a pulsed 10 second, 988 Hz tone that could be used for tuning purposes. This will beat whistling into the microphone or shouting "Ola" over and over.

This timed action is already in the DCR code as it was not removed but simply nulled out. This function will be modified so that when a momentary Push Button (key) is engaged a 2 second timing cycle starts that causes an output pin to go HIGH for the timing duration. This same action cause CLK2 to be enabled for the timing duration where CLK2 = CLK0 - 600 (the offset). With the Key Up (Receive) the Pin Goes LOW and CLK2 is disabled. As long as you key (at about 13 -15 wpm) the timing cycle will not break. If you stop keying > 2 seconds back to receive. You may have to play with the value delay(2000) to suit your keying speed.

Below is the enabling code for the Transmitter LO. The example shows CLK1, it is changed in the code to CLK2

//Turn ON:     si5351.clock_enable(SI5351_CLK1, 1);
//Turn OFF:   si5351.clock_enable(SI5351_CLK1, 0);

When a 1 appears after the CLK number then it is ON and when a 0 appears it is off.

The output pin when High triggers a small Reed Relay using a BS7000 driver, whose contacts are connected to 12VDC. The 12VDC feeds the Diode switch (TR) and provides a source to the Bias circuitry on the IRF510.

The Momentary switch has diode isolation to two other circuits, one of which is the PNP Keying transistor (2N2905) and the other is a semi muting switch on the audio amp. This gives us sidetone. SW3 is the Key on Pin 6 and Pins 9, 10, are timed outputs. CLK2 is enabled with the 600 Hz offset during the timing cycle.
 
  void checkCWMode(){
      
 
 
      buttonState = digitalRead(SW3); // creates a 2 second hold in
       if(buttonState != lastButtonState){
        if(buttonState == LOW){
          
         lcd.setCursor(10,1);  
         lcd.print(" XMIT ");
        
        delay(12);
        
        digitalWrite(9,HIGH);
        digitalWrite(10,HIGH);      
        si5351.clock_enable(SI5351_CLK2,1); //Turn CLK2 ON
        si5351.set_freq(rx1-600 , SI5351_PLL_FIXED, SI5351_CLK2); //The transmit frequency is offset by 600 HZ
         delay(2000); //2second delay
         
          
        }
       else{
          
        lcd.setCursor(10,1);
        lcd.print("    ");
        digitalWrite(9,LOW);
        digitalWrite(10,LOW);     
        si5351.clock_enable(SI5351_CLK2,0); //Turn CLK2 OFF
        lcd.setCursor(10,1);
        lcd.print(hertz);
    
        
    
       }
          delay(10);
    
    }

    }

The Block Diagram.






For those Blog readers not in California, Willie Brown was Mayor of San Francisco and Jerry Brown was twice Governor of the state of California. Jerry Brown's most notable other fame is that he is a member of an elite club along with George Lucas and JD Souther -- they all dated Linda Ronstadt! Past 70, it is really hard to keep the Brown's straight.

One blog reader suggested using the IRF510 Final in Class E based on its high efficiency --more watts to the antenna and less heat.

TYGNYBNT

73's
Pete N6QW

Popular posts from this blog

Sept 6, 2024. Time for courtesy and civility.

Sept 9, 2024. Single Conversion versus Dual Conversion.

Sept 5, 2024. Up Periscope!

Sept 7, 2024. Those 20kHz wide Hi Fi SSB Signals

September 8, 2024. CQ Contest CQ Contest this is XV9_

Sept 10, 2024. When a 50 DB over S9 Signal is not enough Fire in the Wire

August 17, 2024. What would you do?