< async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"">

Friday, October 2, 2015

Simple arduino sketch and pcb to quickly test an Si570 oscillator/vfo/PROGRAMMABLE XO

ADVERTISEMENT
Si570 home brew pcb for testing
Si570 is a small usefull oscillator module from Silab (data sheet). It is a very small smd component with 5mmX7mm dimension. I recently procured a CMOS module for experimentation and amateur radio use. The device has 8 small pads of which 5 is really needed (in cmos version) to build a successful vfo circuit. It is used in popular BITX (from Farhan) and in Softrock style sdr radios as frequency generator.

Wiring


Pin 4 is connected via 0.1uf to output, pin 3 to ground, pin 7&8 to arduino for control (PIN7 is SDA and goes to A4 pin on a promini operating at 3.3v, and PIN8 is CLK and goes to A5 pin of the arduino). Pin6 is connected to vcc (3.3volt)

Si570 operates on 3.3 volt  so it is important to use a 3.3 volt power  regulator and a level shifter if used with a 5v arduino!

To make things easy and to avoid level shifter etc, i used  a inexpensive arduino promini (atmega328) running at 3.3volt (8MHZ).

PCB fab

There are different ways to work with smd for home construction. In my case i used a small piece of copper clad board (5mm thick, single sided) and made a 6mmX7mm square hole on it and drew the pattern as shown below. A simpler way to (electro) etch the board was using a salt water solution (saturated) and it worked well! ( as i dont have the ferric chloride and the mess linked to it)

Etching a simple pcb for Si570
After that the Si570 is placed in the cut hole and soldered to the board. This allows easy removal of the Si570 for later use and easy soldering with an ordinary set up.

Si570 board with the chip in place and necessary connections

Then i placed some headers for the connection, ie SDA, CLK, VCC and GND and connected them to a promini (atmega328). Arduino uses I2C to communicate with the Si570 and I2C pins on atmega328 are A4 and A5 (analogue pins).This pins may be slightly different on mega and other arduino variants so take care of it!! ( and remember a level shifter 5v to 3.3 and a 3.3 volt ldo if using a uno or other arduinos at 5v)

Connections to arduino (A4 and A5) and the board behind can be ignored as i have a tft on it (not used in this article)
The programming of promini needs a small usb adapter (TTL Serial board based on the CP2102 chip, is readily available on eBay)

Programming the promini module from usb to serial adaptor

Test sketch for Si570 (simplified)


Here is the source code for the testing. It is easier to download it from github (here) and unzip and open the ino file. Related libraries are also included in the same folder

Source Code


/*
*  A lean version of the Si570 sketch to test an si570 
*  Wiring details on http://blog.riyas.org
* 
* Modified from Radiono - The Minima's Main Arduino Sketch (from : http://github.com/afarhan/radiono )
* Copyright (C) 2013 Ashar Farhan
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define __ASSERT_USE_STDERR
#include <assert.h>
/*
* Wire is only used from the Si570 module but we need to list it here so that
* the Arduino environment knows we need it.
*/
#include <Wire.h>
#include <avr/io.h>
#include "Si570.h"
#include "debug.h"
#define SI570_I2C_ADDRESS 0x55
Si570 *vfo;
int count = 0;
char b[20], c[20], printBuff[32];
void setup() {
    // Initialize the Serial port so that we can use it for debugging
    Serial.begin(115200);
    Serial.println("Initialising!");
    // The library automatically reads the factory calibration settings of your Si570
    // but it needs to know for what frequency it was calibrated for.
    // Looks like most HAM Si570 are calibrated for 56.320 Mhz.
    // If yours was calibrated for another frequency, you need to change that here
    vfo = new Si570(SI570_I2C_ADDRESS, 56320000);
    if (vfo->status == SI570_ERROR) {
        // The Si570 is unreachable. Show an error for 3 seconds and continue.
        Serial.println("Si570 comm error");
        delay(3000);
    }
    // This will print some debugging info to the serial console.
    vfo->debugSi570();
    //set the initial frequency
    vfo->setFrequency(26150000L);//start frequency at 26MHZ!
}
void loop(){
    //vfo->setFrequency(14497000l);//fixed signal
    //Below will sweep slowly arounf 144.97MHZ
    for (int foff = 1; foff < 1000; foff++) {
        vfo->setFrequency(14497000l+foff*10);
        delay(100);
    }
}

Results


The given sketch will start the vfo at 2meter band around 144.97MHZ and slowly moves there and can be detected easily on a handy or on an sdr receiver (figure below).

Si570 output sweep
Thanks for reading, 73s and good luck with your projects



No comments:

Post a Comment