Wednesday 24 March 2010

New C version software

Finally finished a new version of the software this time using an 18F525 running at 40Mhz (10MHz crystal with HSPLL engaged). The software is now in a mixture of C and assmebler and allows FM at 19.5KHz and upped the wobbulator updates to 39000 per second.

The new software is available at http://authorityfile.co.uk/NBSC/Home/OtherStuff

Here's a few pictures of it being used in anger to map the properties of the 10.7MHz input filter of my log-detector (an SA614 RSSI output with 2x 10.7MHz cermic filters).

They're interesting in that they show the harmonics generated by the DDS-60 daughterboard. These appear to be much better than the claimed 40dB down at about 55dB down - though this is just those that fall in the 10.7MHz region.

The traces are all with 10dB per division.

0-60MHz

0-20MHz

10-12MHz

The slight sparkling on the pictures is due to the fact that the scan doesn't progress linearly but is a set of stepped frequencies. This isn't a problem but shows up noticably on a photo. However, a slower scan rate gives less "sparkly" pictures but I had to run these at 50Hz otherwise my shaky hands made the pictures blurred!

Dom

Tuesday 9 March 2010

All boxed up

After making some progress on re-writing the software in C I decided to take a break and do a bit of metal bashing. It's not perfect but at least now it powers itself and is less likely to break if I knock it over!

The innards:


The front:

Tuesday 23 February 2010

Trying it out

I've spent far too much time recently writing software for this thing and not enough time holding a soldering iron. So last night after building the step attenuator I decided to try the thing out in anger.

I started this project to help me make a Spectrum Analyser. I started this ambitious project a few months ago but soon realised that I'd need a decent sig-gen / wobbulator if I was to have a chance of setting up and testing out any of the tuned circuits and filters in this thing.

Here's a few shots of it testing out one of the first components I built for the Analyser. It's a SA614 chip setup as a RSSI meter. Basically this is a linear to logarithmic converter, it should output a nice linear signal over a 90dB range...good enough for a basic analyser! The RSSI circuits I've made use an IF of 10.7Mhz and have a couple of ceramic filters to set this up (robbed from old radios).

RSSI Circuit



The pictures are produced by using the Wobbulator function on the sig-gen. it is set to scan over 2MHz starting at 9.6 MHz. The SYNC output is fed to the scope's external trigger input and the wobbulator, via the step attenuator into the RSSI circuit's RF input. The RSSI output then goes to the scope's normal input.

First Scan - too peaky!

At first glance I was very happy with this trace - well it proves the wobbulator is useful! There is about 0.8div of "passband ripple". That equates to almost 15dB! I could measure this by switching in the the attenuators until the tallest peak ended up where the dip is. There is about 350kHz bandwidth niceley centred on 10.7MHz. Again this was easy to measure by "tuning" the wobbulator until the edges of the trace just touched the left hand side of the screen.

The circuit has two 10.7MHz filters and as can be seen from the scans these are a bit peaky I've tried messing about with the circuit to produce a nicer passband but all it's done so far is make it an odder shape...however it's now a million times easier to experiment than it is using a normal siggen and graph paper. I can tack solder components in while its running and see the changes on screen in an instant!

Here's a shot after a bit of messing about...more theory needed I think!

Trace after messing with the circuit

Step attenuator

As there is no way of changing the amplitude of the signal produced electronically I've decided to add a "step attenuator". This is basically a box of switches that allow you to switch in a bunch of circuits to reduce the signal getting out.

I'd like to be able to get down to about 0.1uV so worked out that about 150dB should do the trick. I've ended up with a circuit with the following attenuators 1db,2,2,5,10,20,20,20,40,40. Anything bigger than 40dB would probably be too difficult!

Anyway I designed up a PCB and bought a bag of switches and last night knocked the thing up. The box is roughly made up out of PCB stock. It doesn't need to be too pretty as this will all sit inside another housing when its finished, it's really just for shielding.

It seems to work as expected (after a lot of working out resistor values). Anyway here's a few pics of the thing. I really need to take it to somebody else to tell me if it is working correctly as all my test gear is pretty ropey!


I decided to use F-connectors for this as BNC connectors are starting to get a bit too expensive, the front panel connectors will still all be BNC.

Downloads

I've added a link to my other website on the left - this contains the most up to date schematics and software

D

Friday 19 February 2010

A few "design" notes

Design is probably too grand a word for it but I decided to buffer the rotary encoder inputs via a Schmidt trigger buffer. When I was using a mouse as the encoder this wasn't strictly necessary as it already had a nice well defined levels. But I decided to do this so I could try out other encoders.The two Schmidt level inputs and +v and gnd are brought out to a four pin socket to allow me to try out other encoders.

I've found an encoder off an old junk-box Sony HiFi. This isn't quite a nice as the mouse - it doesn't have as many pulses per turn and it is just some metal contacts instead of an optical arrangement. But it does have the advantage that it has a standard 1/4" shaft and a big shiny knob!

This has its own little board with a couple of capacitors and resistors to try and smooth out switching bounce/spikes. This works OK, and the Schmidt trigger inputs are happy but I need to have a proper look at the circuit as the arrangement is causing a lot of "sparking" at the contacts - this can be picked up on an AM radio a few feet away!

The other use for the other two gates in the Schmidt package are as I/O buffers for the FSK input and SYNC output.

On the FSK input this will be a front panel input and as I tend to play with a lot of vintage gear and some of the test equipment in the workshop is a bit dodgy and capable of floating quite high I decided this should be protected as well as I can manage. The FSK input has two protection diodes and a 100k "snubber" this should hopefully work up to the speeds I'm interested in (RTTY type speeds) and provide a reasonable amount of protection. If it isn't fast enough I may need to reduce the resistor.

The Sync output goes through the buffer also - this is not strictly necessary but hopefully if I do manage to connect it up to the 300V supply by accident it will blow the one penny buffer chip instead of the £5 uController!

Wednesday 17 February 2010

Making the motherboard

I've never had much experience making PCBs. So far the best I've managed at home is to etch a few hand-drawn boards, using Ferric Chloride. For this project I decided to dive in and try printing my own boards.

To do this I used KiCad to turn my schematics into board files, then printed these files onto transparencies. Then these printouts are used with special copper clad boards and an ultra-violet light source to transfer the design to the copper. The material on the copper-clad boards gets sensitised by the UV light and then this sensitised material is washed away with caustic-soda and then the exposed copper is etched away with Ferric Chloride. A good step-by-step video is available here: http://www.youtube.com/watch?v=RfelrrZyCYQ

If you watch the video the only real piece of special equipment needed is the Ultra-violet lights. This is what has always put me off in the past. Making a light box and getting the tunes and ballasts and all the stuff needed just seemed like a lot of effort. An off the shelf small light-box costs around £200. However recently whilst looking for LEDs on the Farnell website I spotted some Ultra-violet 5W luxeons (order code 167-8962). These are still expensive £20 but a hell of a lot easier to work with. I decided to get one and give it a try, plus a bottle of etch-resist developer and some Ferric Chloride crystals.

When I got home eager to give it a go I just stuck the Luxeon Star to the inside of an old computer PSU carcass and put a 10R wirewound resistor in series with it. This hold the LED about 3 1/2" (8cm)  above the workbench. I then cut out a transparency and fixed it to the PCB and exposed it...I had no idea how long to expose the board for I just put it under for about 6 minutes...

A transparency


 The board under the lightsource



The finished board




I couldn't believe how well it all worked! The details all came out even though I'd not bothered to properly ensure the transparency was in close contact with the board. The exposure and develop times were complete guesses but lucky guesses!

For this my first go I rather ambitiously decided to make a double sided board, this didn't work out too well for two reasons. On my first attempt I'd managed to not line up the two sides - in fact one was completely the wrong way round....so this first though promising board was a write off.

I tried another, this time making sure I'd got the sides both the right way round and spending a lot of time lining the sides up very carefully.

Unfortunately this worked....but not very well. The tiny holes, though lined up closely (about 1/2mm out max) were still far enough out that when drilling they got chewed up. Also in Kicad I'd used the default "pad" sizes and these were really quite small...as soon as I stated drilling the through holes they started to tear up and generally be a pain.

So back to KiCad and this time I designed a single-sided board. This was far more difficult and required more thought, the automatic routing tools were not much use and more manual messing was needed but the results are better and allowed me to better lay things out anyway. Also I made all the pads a lot bigger for easier drilling and soldering.

The final board was then etched and gave a very nice result...see below.

The finished board after "tinning"

Board detail

There was only one problem with the board - one trace around the edge didn't come out. This was not so much due to the manufacturing process but I suspect down to the fact that the protective film had lifted at the edge. I had to "botch" this track with a bit of wire and solder for about 1/2"

Anyway I feel it has worked well and on a very small budget! Also there is an added advantage...most light-boxes use a number of tubes - this means that if the transparency is not in perfect contact with the board the lines all become very blurred. However because in this process the light is a point source this is not anything like as big a deal.

On this project the board is just 4"x4" (10x10cm) however for a larger board it should be possible to just lift the lightsource a bit higher above the bench, and increase the exposure time to compensate.


Designing a motherboard

I was very impressed at how easy it had been to make a simple sig-gen with this card but now I wanted something a bit more permanent. So over the next few weeks I decided to design a "motherboard" for the card. This would hold the PIC uController and a few extra chips to provide extra functions.

I decided on the following:
  • Keypad to allow direct entry of frequencies
  • Rotary encoder (mouse wheel) input
  • 1x16 large format backlit LCD display (HD44780 compatible)
  • Analogue input with 9kHz low-pass filter for modulation input
  • 1 TTL input for FSK, QSK, serial comms
  • 1 TTL output for scope synchronisation with "wobbulator" 
  • PIC16F876A uController
  • ICSP - in circuit serial programming - to allow programming of the PIC device whilst on the board - saves on bent and broken pins
Over the next few weeks I spent a good while "designing" this...well trying bits out on breadboards then adding them in to the schemas...Here's the schemas I came up with: (click on pictures for full size)

Keypad, LCD and rotary encoder connectors
 


Modulation input and filter




Main Processor board and ICSP

After testing there are a few problems with this design - none major! 

1) The rotary encoder doesn't work when the ICSP programmer is connected - this was deliberate as I wanted to re-use the I/O pins. If you would like to build a similar board a 40-pin uController might be a better idea!
2) The mod-in filtering is pretty rubbish. This is supposed to be an anti-aliasing filter for the A-D converter, it should have a sharp cut-off at 9kHz, whereas this gives a pretty gentle cut off. However for my purposes it is fine!
3) This uses the DDS-60's internal 5V regulator to supply the power for the uController, LCD display (not backlight) and all the other bits and bobs. Whilst this shouldn't over tax the regulator a nicer (less mean) designer might add a separate 5V regulator!

Testing it out

Next up I decided to run the thing up to give it a test. This requires more than just giving it the supply voltage...you need to program the AD9851 chip for anything to happen.

I'd already had a look at the datasheet for the chip so new it should be fairly straight forward. So I plugged the thing into my Matrix Multimedia PIC prototyping system and wrote a few routines to try it out.

I do most of my PIC development in Assembler because I'm an old fart! Also if my evil plans were to work out I'd need to have the code running as quick as possible to allow me to re-program the DDS chip about 20,000 times a second...this to allow it to do FM and scanning functions.

Within a few hours I had the thing up and running in a fairly simple setup...it used an old MS mouse as a "rotary encoder" for tuning and I could make it tune from 0-60MHz though not very comfortably. Also a quick and dirty frequency display on an LCD. This was the most challenging bit of PIC programming I've done - lots of 32bit mathematics but there are lots of great resources on the internet to help!

 

With the addition of an NE602 chip and a few bits and bobs I had a nice radio that I could use as a direct conversion receiver...not the greatest radio in the world but it worked!

Assembling the daughter board

 

When I got back from my Christmas break in Scotland I found the neat little package containing the DDS-60 had been delivered. I'd opted for the "kit of parts" + chip which cost $56, as opposed to the $80+ cost of a pre-assembled kit. 

This was my first go at soldering modern SMDs and these ones are small! It took a good bit of patience and stead work but it worked first time! This was a real surprise as my hands were pretty shaky...I still had the hangover from New Year's eve!

Anyway as can be seen from the pictures I got most of the bits on straight!


The Project

I've got a nice old RF Signal Generator in my workshop - its a Logimetrics 921A which is a lovely bit of kit but it's huge, heavy and becoming increasingly unreliable. So I decided to have a go at building my own. 


In this blog I'll try and document what I've done. Firstly, in the hope that it is of use to others, secondly in the hope that I won't forget what I've done.


I looked at all manner of different options for making a signal generator, oscillator configurations, temperature controlled ovens and it all seemed very complicated! I've built a few variable oscillators for radio sets and other things but never made anything super stable. Then I stumbled across the idea of direct digital synthesis. Here a sine wave is synthesised by a chip dividing down a stable crystal clock and looking up values and sending them out to a digital to analogue converter. The results are a very stable oscillator, with nice low harmonics and a very wide tuning range.


So now all I had to do was pick a DDS platform and away I'd go! I had a look round and found the AmQRP DDS-60. This little board belts out a nice fat 4V p-p signal into a 50 ohm load and is tuneable from DC to 60MHz (though the buffers don't output much below 10kHz). Also it is tuneable in minute 0.042Hz steps! 


So I sent off for the DDS-60 kit and waited!