Initial Information

I started having a desire to build something for the ham shack and thought a 40m QRP SSB transceiver might be good project. Then deciding to apply the KISS principle [keep it simple stupid] and start with a 'preassembled board'. Selection of the BITX-40 from HF Sigs, at a cost is about $59.00 (includes shipping from India), seemed like a great choice. The BITX-40 is only in the prototype stage here. Perhaps a page on that project later. The unit now comes with a prepogrammed Arduino "mini" microcontroller and a LCD display for use as the VFO portion of the assembly. uTube videos showed this as a nice little circuit and the various chat board talk nicely about the VFO. The BITX-40 is meant to be 'hackable' by each individual allowing for experimentation.

Well, the BITX-40 project lead to me wanting to investigate the "DDS VFO concept" a little deeper. The internet is full of information and uTube videos of using an Arduino microcontroller to control an AD9850/AD9851 DDS circuit to make some very neat VFO boxes. Also the Si5351 DDS module is used (like the BITX-40 project. This kick started a desire to obtain, learn and play with the Arduino UNO and AD9850, AD9851 and Si5351 DDS generators. This then became the initial topic of this post (page). A thought of switching out the Arduino (~$17.00) with a Raspberry Pi Zero (~$5.00) and doing some additional things is floating in my thoughts (External signal generator, VFO, antenna analyzer, QRP rigs, etc.). A $12.00 savings for a small project is always very intriguing to a ham. So, I need to learn about 'Arduino' was the main initial focus (okay maybe just a strong 'want'). The 'official' Arduino site www.arduino.cc is the place read up on these. The ARRL has a book on projects for the Ham shack using the Arduino (will investigate later).

In my past experiences with building receivers, the three basic characteristics that lead to the unit's level of performance were sensitivity, sellecttivity and stability (with resetability) were the major keys. Sensitivity and sellectivity were always way easier to work around for me. The frequency stability was always the challenge to get adequate performance out of a given project. Could these DDS frequency units be the key to many of these earlier project performance issues? I see some further work in my near future.

In my defense, I want to share the blame with Bill Meara, N2CQR/M0HBR, of 'soldersmoke' fame. Bill and Pete Juliano, N6QW, have been discussing the BITX units and spiked an interst to warm up the iron. Therefore, by dividing the issue betweem them and me, it is only 33% my fault! What is a ham to do? I feel trapped again.

SARA Arduino Beginning

Introduction Arduino UNO Rev.3 or "What is an ARDUINO?"

The 'simple' answer is that an Arduino is a set of small microcontroller circuit boards (about eight of them). Most have a USB communication chip, a small amount of power supply items, four indicator LEDs and various supporting electronic components. Power connector, USB jack, reset button switch and header blocks are on most of the boards, becoming the physical interconnects. The Arduino "UNO" (the most popular Arduino which is what this page will use) has the ATmega 328 microcontroller and the Atmega16U2 chip (Atmega8U2 up to version R2) programmed as a USB-to-serial converter. This allow usage of a USB cable from the Arduino UNO board to your computer for information transfers {very easy physical attachment and handy programming {sketch} file loading}. The 'UNO' is being followed by the 'Leonardo'. These are the two most popular Arduinos and there are hundreds of 'shields' for use with these boards. Check the Arduino site (link above).

The Arduino started in 2005 and has used an 'open source' software and hardware. QST for November, 2015 (page 30) has a nice article introducing the Arduino, "Introduction to the Arduino Microcontroller" by Glen Popiel, KW5GP. For some good tutorials look at: www.arduino.cc; www.adafruit.com; & www.spark-fun.com. There is an "Arduino for Ham Radio" book at the ARRL which sounds very interesting.

The Atmega328 has a 'bootloader' preinstalled (more on this later). The system process starts in your computer using an IDE, writing C code {sketch}, compiling (makes a 'Hexfile'), and downloading that file into the UNO via a USB cable. The 'easiest' prototyping connection method is to connect a 'real world' type of interface shield to the header blocks on the UNO and use a prototying breadboard to connect things to the 'outer world'. "Shield" is the term used to define the plug-in interfacing electronics board, used by many microcontroller development systems and final project use. Some shields are shared and used on several different systems, however, YOU must be careful! See the Adafruit Shield Compatibility Guide as a starting point to study the shield compatibility issues. Another method is to connecting directly to the UNO header blocks. Another shield list is at: Shield List which tries to keep track of all the shields available.

The open "Arduino" protyping platform relies on an easy to use environment which leads to it's wide usage (both hardware and software). It is lead and manufactured by arduino.cc a company led by Massimo Banzi, CEO of Arduino. Arduino boards are able to read a variety of inputs - light on a sensor, a finger on a button, or a Twitter message - and turn them into an output - activating a motor, turning on an LED, publishing something online. You can tell your board what to do by sending a set of instructions (a 'sketch') to the microcontroller on an Arduino board. To do so you use the Arduino programming language (based on Wiring), and the Arduino Software (IDE ~ Integrated Development Environment). Most programming languges have an IDE available, some are free and some you need to purchase. An IDE is a single program with a text editor, a compiler, an assembler, and a linker all rolled into a single environment. An Arduino sketch/program is based on a C/C++ (actually it is a subset of ANSI C) and best compiled with an open-source compiler (free) avr-gcc and linked against the open-source AVR Libc. The Arduino language comes from Wiring. The Arduino environment is founded on Processing and includes modifications made by Wiring. The IDE now supports an 'online' version, so you do not need to download and install it on your computer, you can use it 'online'. Also, your work is stored 'in-the-cloud' not on your computer.

Over the years, starting about 2005, Arduino has been "the brain" supporting of thousands of projects, from everyday objects to complex scientific instruments. A worldwide community of makers - students, hobbyists, artists, programmers, and professionals - has gathered around this open-source platform, their contributions have added up to an incredible amount of accessible knowledge that can be of great help to novices (that is me!) and experts alike.

A useful book that I have been using is: "Beginning C for Arduino, Second Edition - Learn C Programming for the Arduino" by Jack Purdum,PHD [ISBN-13(pbk): 978-1-4842-0941-7 :: (electronic): 978-1-4842-0940-0]. Cost is about $25.00 to $50.00 (used to new, w/shipping), search the internet or visit a physical library. Oh, Jack is a fellow ham, W8TEE.

The Arduino Product Lineup (yep, more than one product) uses ATmega processors and different boards have different capabilities. [Checkout Adafruit's Arduino Selection Guideline]. For this discussion we will focus on the Arduino "UNO" revision 3 {$24.95 from adafruit product #50} see Adafruit product link. To start lets use "adafruit" as learning source for information. They sell most of the devices we will be discussing/working with and have proven to be a great source for information on their products. The UNO Tecnical Specification is here. There are many, many other sources than adafruit - just search Arduino on an internet search engine and start reading. I use Adafuit for many of my Raspberry Pi & Arduino prototyping projects.

It is assumed we will be using a working 'Windows' computer with an internet connection (Other computers can be used - search for specifics). We highly suggest you start with a "genuine" Arduino board. We will be discussing the "Arduino UNU rev 3" unit. Some of the cheaper clones from eBay, Amazon, etc. may not be quite on par and may cause some issues later (different processors, USB chip, etc.). Start with one "known good board" (you can go cheap later). You will need a USB data cable with 'A' and 'B' ends (like most printer style cables). A small power adapter/wallwart (center positive and 7 to 12 Vdc at about 1 A) may be used. There are "shield" (hardware plug-in boards for many types of feature add-ons) which we leave up to you. I started with a I2C Controlled + Keypad shield and a 16 x 2 LCD display {bought as a kit for $19.95 from adafruit product #772}. We will use the 'Arduino' IDE for development (their are many others you can find, see the links above).

Coax that connects things! topic divider

Go back to top ↑

 

ATmega328 ~ Used in Arduino UNO

The '328 microcontroller high level information:

  • 28 Pin DIP IC
  • Runs at 16 MHz
  • 32 KB of flash storage
  • 2 KB of RAM
  • Powered by 3 or 5 Volts
  • Requires about 0.1 Watts of power
  • Cost is about $5 per chip (if you want to play later)

What's a major difference about the microcontroller (having no operating system) versus a microcomputer (which requires an operating system, say Mac OS X or Windows or Linux) is the intial booting up process. The microcontroller is very 'barebones', and has a simple bootloader. When you plug it in and turn it on, it immediately runs the bootloader and then whatever you programmed it to do. Flash storage is where your hex file is stored. The 'flash storage' inside of the chip lasts for a really long time (20+ years). You could program your Arduino, leave it alone for decades, & come back and power it up and it would work just fine. As the cost is small, most just leave the entire Arduino inside their project. It is important to note that their are two microcontrollers on the Arduino UNO. The major one you program is the ATmega328, the otheer is a ATmega16U2 which handles some external stuff, but mostly it handles memory management.

Lets get started on learning the Arduino UNO:

We suggest that you start at adafruit with Ladyada's Learn Arduino - Lesson #0 and continue thru with lessons 1 to Lesson #3. These are basic things, but you will learn quite a bit as you go through them. Lesson #0 will step you through making sure your Arduino is working with your system.

Lesson #1 will start you with the Arduino IDE; board selection, Correct Serial Port ID; & load a sketch to the IDE, then to the Arduino.

Lesson #2 will start having you write/change a sketch [program]. Later lessons keep instructing you to control LEDs, motors, switch and other inputs, etc. A nice slow leading lesson path to lots of functionality.

Lesson #3 covers RGB LEDs and further understanding the sketch understanding. I think at this point you can start out on your own playing around. The lessons continue out through number 15 with new topics in each lesson. At the end of lesson 15, you will be 'very knowledgeable' and past the 'beginner' stage.

This path will get you started towards being knowledgeable about the Arduino UNO and writing/changing various sketches.

The IDE is like many current computer/controller environments, it uses "libraries" to extend the capability of code and makes easy 'reuse' a reality. Libraries quickly and easily extend your sketches (programs). It eliminates a lot of work when your program needs special input/output handling (the complex stuff). Generally can find a library already written to cover your requirements. You should spend some time reviewing what are in the 'standard' IDE libraries and how you can add libraries of your own (See Writing Your Library. Please make sure your libraries are stored at a different path than the IDE supplied libraries. If (when) the IDE gets updated, you can (may) loose any libraries you have added! See Arduino Library Examples for exploring what is in the various supplied libraries. You can kind of think of libraries as 'drivers' for your projects but they add strongly to what you can easily implement.

Adding libraries is an important process you need to explore and understand, as some of the ham projects require 'non-standard' libraries. Go slow and understand sample sketches and library structures as these are very important concepts to master.

Congratulations! you are moving fast. We will add here as we get deeper into the knowledge ourselves {currently February, 2017}. I suggest you then go to uTube and find the tutorials by Jeremy Blum, Tutorial #1 Getting Aquainted with Arduino. These move along quite fast so stop and think often. There are currently 15 units that start knowing near nothing and move through very advanced topics.

ATmega168/328 - Arduino Pin Mapping

The following chart shows the ATmega 328 to the Arduino UNO pin mapping as a reference.

ATmega 328 Pin Map Image

Reading the comment about the ICSP pins, brings us back to the 'no boot loader' topic. ICSP stands for "In-Circuit-Serial-Programming" which is a set of pins on a board for programming the micro chip while installed on a circuit board. On Arduino these pins have four digital control pins along with power and a ground (six pins total). The warning refers to not interfering with the programmabilty of the Arduino. Try Wikipedia for general understanding and Arduino's ISP Project for further investigation. A side note is that a programmed Arduino can work as a ISP [In-Circuit Serial Programmer] for installing a 'boot loader' for the ATmega 328 on a second Arduino. You can find the ICSP pins on many other circuit boards, say inside a modem like the WRT-54G used for HSMM networks. you get the idea (I hope). Remember those 'clone' Arduino units I mentioned earlier. I recieved one that did not have the bootloader programmed into the unit (it was DOA). Using a 'good' Arduino allowed me to install the bootload code and brought it back to a very workable unit (I saved about $6.00, but it took a few hours of reading and digging to gain the knowledge. Probably about three hours, so my real saving was reduced, as I do not work for $2.00 per hour, though the learning has greater value going forward.

You can continue searching and reading on the Arduino on you own at this point. We will leave the ATmega 328 for now and go to the AD9850 DDS for some further information.

Coax that connects things! topic divider

Go back to top ↑

 

 

AD9850 CMOS, 125 MHz DDS Synhesizer

Here is some of the basic details for the AD9850 and AD9851 DDS on the NJQRP DDS-60 daughter card. The AD9850 has no internal reference clock multiplier, so it requires a faster reference clock then the AD9851. Not having an internal multiplier means that code written for the AD9851 will not work directly on the AD9850 - the code will attempt to set registers that do not exist in the AD9850.

The daughter board contains the electronics to configure the base IC. A data sheet for the AD9850 can be found at Analog Devices (25 pages) OR at AMTEL (over 400 pages). The AD9851 datasheet is at: Analog Devices AD9851

Here is the pinout for AD9850 and AD9851 chips:(nearly the same pinout ~ Pins 5 & 6; 13 & 14; 17). Codes are not the same, so be careful to note the slight differences.

AD9850 Pin OutAD9851 Pin Out

Converting the chip to the daughter board pinouts:

D0 – D7 = Parallel programming bits
GND = Ground (obvious); Vss
CLK = Serial programming clock
Latch = Serial programming latch [FQ_UD pin on 9850]
DATA = Serial programming DATA (internally tied to D7)
RST = Reset. Generally, kept tied to GND
SQW = Square wave outputs (complementary) [Qout] Duty cycle adjustable with blue pot.
SINA = Raw unfiltered AD9850 sine output
SINB = 70 MHz LPF filtered AD9850 output.

 

The commonly available AD9850 / AD9851 modules on a small circuit board have two rows of 10 pin connections. These are NOT the same as the chip pinouts (above).

Viewed from top of circuit board with the "trimmer pot" at the top.

PinSignal   SignalPin
1 GND   Zout2 (sq) 20
2 D7   Zout1 (sq) 19
3 D6   Qout2 (sin) 18
4 D5   Qout1 (sin) 17
5 D4   GND 16
6 D3   RESET 15
7 D2   DATA 14
8 D1   FU_UD 13
9 D0   W.CLK 12
10 Vcc   Vcc 11

 

NOTE: Qout 2 is a 70 MHz low pass filtered output. There is an indication that the "DATA" is internally connected to the "D7" pin.

You will find some interesting application feature in various "application notes". Check them out: DDS Application Note files or Analog Devices App Notes. {I like the AN557: An Experimenter's Project paper on incorporating into an Amateur Radio VFO. It is at AN-557 App Note.} Want to sync up two (or more) AD9850 modules then see AN-587 App Note ~ Synchronizing Multiple AD9850/AD9851 DDS-Based Synthesizers.

These are very nice DDS modules when used properly. The Si5351 modules have only square wave outputs, but have wider frequency coverage and are a smaller (lower power) design. Search the inernet for more information (there is quite a lot available).

Coax that connects things! topic divider

Go back to top ↑

 

 

AD7C VFO

Richard Visokey, AD7C, has a nice design for a 1 Mhz to 40 MHz VFO that uses the AD9850 DDS; an Arduino Nano and a 1602 LCD Display controlled by a rotarty encoder with internal push button switch (2013-Mar-25 rev 1.0). The Arduino UNO can be substituted for the Nano and meets the hardware I have, so seemed like a great place to start. The design uses the rotary encoder to set the frequency with the push button changing the resolution (digit) that is to be changed. There is a 'MF Frequency Shift' push button for making a intermediate frequency change allowing the display to show a 'readout' frequency that compensates for an I.F. shift for a receiver. His information: AD7C VFO site with links to project files.

Front panel will have a 16 x 2 display, a rotary knob (with switch) and a push button input. Rear panel will have the VFO signal (output) and a power input jack. I use reverse power polarity protection of a fuse (1A and a reverse polarity diode). I do not like smoke when I apply reverse voltage to my projects. Reverse voltage will blow the fuse (not my electronics).

The initial UNO has the MF Frequency switch (pull low on switch push) on Analog pin A5 and the rotary push button (pull low on switch press) on A0. Power from rear panel goes to the VIN of the Arduino UNO and negative supply to GND. The 5+ of the UNO is connnected to the LCD Display and AD9850 DDS and GND from these are tied together and supplied to the rotary encoder. There is an 'internal' 25 kOhm potentimeter (display intensity) with ends to +5 and ground. The center tap goes to pin 3 on the LCD display. Six pins on the LCD display connect to the UNO. The RS (LCD4 goes to UNO D12 and E (LCD6 goes to UNO D13), these are the reset and enable signals. There are four character control wires: LCD 11, 12 13 & 14 to the UNO Digital pins D7, D6, D5 & D4 (four adjacent with reverse order). The final four connections go from the UNO to the AD9850 DDS. UNO D8 goes to AD9850 WCLK; UNO D9 to AD9850 FQUP; UNO D10 to AD9850 DATA; UNO D11 to AD9850 RST. Check your wiring twice! See the AD7C site for a nice schematic. If you desire higher than 0.3 P-P signal you will need a buffer amplifier. See DDS Buffer Amplifier. Also note that as frequency is increased the amplitude falls. Perhaps an AGC circuit would be required, I may play with his later.

As mentioned above the AD7C site has the link for downloading the project files or use AD7C Project file in a zip file. I used the "IF version" of the project files and uploaded through the Arduino IDE process. Follow the process you have been experimenting with all the tutorials and it goes pretty easy!

That was all that I required to get a very nice VFO working. Stabilty is great and it is easy to reset the frequency. I added the buffer amplifier and have fed the output into a 'classic' radio, replacing the local oscillator signal, for use with a 455 kHz IF. It works as advertised and I am sure I will continue to expand concepts around the Arduino family and the AD9850/AD9851 modules.

I want to thank AD7C and others who have done all the heavy lifting on these projects. Sure makes it simple for following and adding these tools to my play box. Now to play!

 

Fritzing

Electronic Design Automation

Fritzing is a software for designers and artists with an interest in physical computing and prototyping. To assist robust prototyping and bringing your ideas to fruition and to document an electronic project, this is a place to get started. You have a "skecth area" for working on your project, which will flow into a schematic and then into circuit board processes. This allows great project tracking.

A quick download and update from Fritzing download gets you started. Read the getting started with Fritzing. You should first build a actual circuit and then document it (Fritzing it!). Then start using the software project for modifications, rebuild and retesting. It makes it easy to show others what you have done by sharing the Fritzing files. Try learning Fritzing for further reading on getting going. New to me, so very little to offer right now. I will try to expand later as I gain knowledge here.

Coax that connects things! topic divider

Go back to top ↑

 

Arduino References

The following are some useful references for the Arduino and-or the AD9850/AD9851:

Arduino Playground Projects.

Simple Capacitance Meter from Arduino.

Arduino Tips and Tricks ~ Adafruit's Arduino Tips... good reading.

Arduino Forum ~ A plce to see and review question topics and ask your own.

Foundation Learning fo rhte Arduino ~ A good starting place on Arduino.

Webshed - Arduino & AD9850 Some simple code for testing your AD9850 with Arduino (No LCD readout)

Arduino Libraries

The following are some additional useful libraries you may wish to investigate:

LiquidCrystal_I2C - I2C Liquid Crystal Display (uses four wire for display, only 2 data pins).

I2C Main Library from GitHub - Considered better than the 'stock' library.

DHTxx Temperature & Humidity Sensors

TinyGPS for Arduino - GPS Interfacing from www.arduiniana.org

HMC5883L - Triple Axis Magnetometer

OneWire - Communication on One Wire

Main Page to 24 Libraries for Projects (like) LCD5110 Display and Keypad - See just the Rinky Dink Electronics - Libraries Page.

Timer Library - From www.github.com/JChristensen/Timer.

MorseEnDecoder - From code.google.com/p/morse-endecoder.

AS3935 Lightning Sensor - From www.github.com/SloMusti/AS3935-Arduino-Library.

++++++++++++++++

Breadboarding

Breadboarding for Beginners ~ Starting Information on using a Breadboard.

Go back to top ↑