Skip to main content

February 26, 2024. A Simple Arduino SSB Transceiver Sketch.

 
Seeed Xiao RP2040 Digital LO/BFO 2/26/2024


In my email this morning was that very question concerning my providing to the sender a simple Arduino SSB Sketch. This is a landmine underfoot just waiting for me to step off the plunger.

The very way the question is stated suggests the sender is looking for a quick fix and likely lacks a rudimentary knowledge of the Arduino. Fact one there are no simple SSB sketches! 

His question is better characterized as a no-frills version to one you would find on Rodeo Drive in Beverly Hills. No Frills = one band, 16X2 LCD, no VFO memory, no S Meter, no Tune Tone or Splash Screen. The Beverly Hills version would have all of those features less the LCD but sports a 3.5 Inch Color TFT Touch screen to boot. 

That said about 80 to 90% of both sketches would have common elements. These common statements include identifying libraries, and which display type. Other statements would identify pins that would be used and various statements identifying the startup frequencies, BFO frequencies, and lest I forget which pins are the Encoder Pins. 

The Setup Section of the sketch would do just that by setting up the Si5351 (PLL and the clocks for LO and BFO) and setting the Pin Mode (which pin and whether an OUTPUT or INPUT). 

Then comes the Loop section where everything in the loop is where the actionable items are included such as has the frequency changed, have you called for a USB/LSB change or have you put the rig in a Tune Mode and things like using the 2nd VFO or changing bands?

A real learning experience similar to setting up directories on your computer to collect stuff versus loading everything as individual files on the C Drive is to keep the Loop to a minimum. Simple statements in the Loop such as Checksideband(); with a separate call program void Checksideband() {} has the change of sideband being checked without cluttering the main loop with that action. Another would be CheckTune(); to see if you placed the rig in the Tune Mode. Still another would be CheckCoffeePot(); is it still hot. 

I have not responded as yet to the email as I foresee a huge time sink (my time is limited) when he gets the sketch and then the problems start. Several years ago, I supplied a sketch for a similar request. That individual had little knowledge of Arduino and made significant changes to the supplied code. When that didn't work, he sent his code to me and literally said fix this. He got irate when I wouldn't fix it. 

My advice is to spend about $15 and get Banzi's book Getting started with Arduino and perform every little program in the book and then look to simple SSB sketches. ARRL has some publications as does W8TEE, Jack Purdum. One of my most complex, entirely built by me program was the LDMOS amp controller. All of that extensive programming started with examples in Banzi's book.




In giving about a second's worth of thought to the email perhaps the answer is in the 1st photo which took the Seeed Xiao RP2040 from the prototype board to a wired assembly. The code is minimalist and about the only thing it will do is tune the frequencies and change the sideband. The display is a 16x2 and there is a step tuning adjustment on the encoder. It is a single band 20M. 

In the same path, yesterday I received an email about limiting the tuning range to just the ham bands. In many of my sketches there is code to do that where a minimum and maximum value for the LO can be set. I typically say 2 to 30 MHz. Thus, most of my code will boot up to a specific band but can tune way above and below that band. The request came from offshore as evidently it was a legal issue in that country that you could only have ham radios that tune the ham bands. 

In my response back I showed the lines of code in the sketch and to use these two values versus what was in the code: 14002000L and 14348000L. This simply says no lower than 14.002 MHz or no higher than 14.348 Mhz. You can crank the encoder all day long, but the LO will be frequency limited. The email back to me -- I don't understand. Big clue -- he has no clue!

So there are no get Arduino quick schemes and if you abhor reading and learning, friend you are SOL!

73's
Pete N6QW

Popular posts from this blog

December 8, 2024. Why do things fail?

December 7, 2024. Pearl Harbor Day ~ a day of infamy!

December 10, Common Threads

12/4/2024. The 12GE5 Ouput Network Simulation!

December 11, 2024. We take things for granted.

2019 ~ What is the simplest homebrew SSB Transceiver that can be built?