Monday, February 22, 2016

Compiling VfoSource from QST's excellent article on DDS for Forty-9er

QST March 2016 has a terrific article on using a DDS controlled by an Arduino to be the VFO for a cheap CW transceiver known as the Forty-9er.

Download it here: http://www.arrl.org/files/file/QST%20Binaries/Mar2016/Purdum-Zia-Kidder.zip

But the instructions on compiling the code leave a few things out and I thought I'd document it here for others who might run in to problems.

  • I'm Running Arduino 1.6.7 from: https://www.arduino.cc/en/Main/Software
Opened VfoSource

Users/marksp/Downloads/Purdum-Zia-Kidder/VfoSource/VfoSource.ino:11:76: fatal error: rotary.h: No such file or directory
 #include <rotary.h>   // From Brian Low: https://github.com/brianlow/Rotary
                                                                            ^
compilation terminated.
exit status 1
Error compiling.

--

Went to Sketch - Include Library - Manage Libraries
Searched for Rotary but not found.

--
 
Now, following the instructions from the top of the source code.

Went to https://github.com/brianlow/Rotary
Clicked the "Download ZIP" button which downloaded the zip file.

Choose Sketch - include library - Add .Zip library and chose the downloaded Rotary-master.zip.

Choose Sketch - include library - Chose Include Rotary-master.

I note that the IDE now shows:

#include <Rotary.h>   # Note angle brackets around Rotary.h (I can't get this blog to include them)

rather than

#include <rotary.h>

So case is important.

Clicked the tick and the error now is:

VfoSource.ino:21:31: fatal error: LiquidCrystal_I2C.h: No such file or directory
 #include <LiquidCrystal_I2C.h>
 
--

Visit https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads

Downloaded the latest LiquidCrystal which for me is LiquidCrystal_V1.2.1.Zip

Unzip the download to LiquidCrystal. I renamed this to LiquidCrystal_I2Cqst to avoid a collision with an existing library.

Copied these files over to that directory:

LiquidCrystal_I2C.cpp
LiquidCrystal_I2C.h
I2CIO.cpp
I2CIO.h
LCD.cpp
LCD.h

Choose Sketch - include library - Add .Zip library and chose the folder LiquidCrystal_I2Cqst
  • Choose Sketch - include library - Add .Zip library and chose the folder LiquidCrystal_I2Cqst


Hit the tick and all compiles now:


Sketch uses 9,460 bytes (30%) of program storage space. Maximum is 30,720 bytes.
Global variables use 544 bytes (26%) of dynamic memory, leaving 1,504 bytes for local variables. Maximum is 2,048 bytes.

I hope this saves someone else a little frustration.

6 comments:

Unknown said...

The problem with the rotary switch error is Rotary vs rotary... Yes, case is important but in your blog you talk about the include statement... It is in fact the R in rotary that's the problem.

Econjack said...

Sorry about this. Obviously it compiled without error when we and the Tech Editor at QST compiled it, but I think the library may have been updated. Anyway, it went south someplace and I regret the error. (Yep...my fault, as I was responsible for the software. The other two guys are the EE brains.)

Jack Purdum, W8TEE

Peter Marks said...

No worries Jack, thanks for the great article and I'm sorry that my blog mangled my instructions - I've fixed it up a bit now.

73
Peter

Unknown said...

Another problem I have found is that the script has D7 (pin 10) defined as ROTARYSWITHCPIN and the schematic in QST shows the switch connected D4 (pin 7). So you can either connect the switch to D7 (pin 10) or change the script. Since I am just bread boarding I moved the wire but I will check the printed PWB when it arrives.

Unknown said...

Marxy, did you build the dds vfo board? I could use some assistance. I dont understand the schematic. J1 - it shows many pins connected, like 15 to 16, 13 to 14. In the pic on Faruukhzia's page, a pic showing the completed board does not show these connections. I would be grateful for any assistance please.

Thanks

Unknown said...

I no longer have a problem with this VFO software but I do have a question. My question is: Why don't I have a problem?

This is a serious question. I have spent weeks trying to get this software to compile and work correctly. Long story short, I finally found the right combo of IDE/VFO software/libraries to make my VFO function as it should. But, although I had all the right software components my VFO STILL would not work until, strictly by accident, I put two wires on the wrong pins. Try as I might, I cannot reconcile what actually is working with any version of the schematic I can find. Here's the deal:

As I understand the schematic the rotary encoder pins marked '+' and 'SW' should attach to pins 17 and 19 respectively on J1. These are the 4th and 3rd pins on the odd row of J1. My VFO works erratically when plugged in to these pins, so bad it isn't functional.

By accident, I plugged these two wires ('+' and 'SW") into pins 15 and 17 respectively and now the VFO works as intended. Why? Any ideas? Is there a version of the schematic I haven't found? Was the VFO board changed? Am I just being dumber than usual?