Saturday, 1 August 2015

Two Receivers

Two receivers are being prototyped on the bench here at m0xpd. Interestingly, they sit close to opposite ends of the spectrum. Not the frequency spectrum - but what might be called the spectrum of sophistication...

At one end is a re-work of a Software-Defined Radio...

The original Acorn is a simple SDR, designed by g0nqe and available from Kanga UK. It uses only through-hole components, which differentiates it from many other SDR systems and makes it attractive to novice builders who shy away from surface mount components - for perfectly good reasons.

I've re-worked the Acorn for Kanga, to provide the "Acorn II" prototype seen above. It retains the "though-hole" philosophy and improves the connectors on the board. Support for an on-board crystal is retained but the main upgrade is the provision of an external clock input. You can see both the (plug in) crystal and the external clock inputs on this picture.

The external input liberates the Acorn II to tune anywhere, given an appropriate source - such as that conveniently provided by my Si5351 board...

In the picture above, the Acorn II is powering an Arduino UNO (through the red and black wires), which is hosting a Kanga/m0xpd Si5351 shield.

The shield is generating a 28.6 MHz clock (applied through the green and black wires), to place the SDR in the middle of the 40m voice band - I was listening to David, g3sqa, chatting on 7,160 after calling "CQ WAB" at the time the photo was taken...

Notice that I hadn't changed the LO setting on WinRad to reflect this tuning!

At the moment I have the two "amplified" output channels of the Si5351 shield set to two frequencies appropriate for 40m use - one at 28.6 MHz (as above) for voice and the other at 28.08 MHz for CW. Given a few more moments spare time, I'll add a rotary encoder to allow changes of the LO setting - but you all know how life is too short, etc etc.

The Acorn II also inherits from the original Acorn an on-board input band-pass filter. The Acorn II will be delivered with components to build this filter for 40m. The external clock input allows the radio to tune other bands - but the radio should use an input filter appropriate to these bands. Such filters have to be constructed off-board and there are routing jumpers to steer the signal to external filters as required.

The Acorn II will soon be available from Kanga UK, along with code to set up the Kanga/m0xpd Si5351 shield to generate LO signals.

I mentioned at the top of the post that there were TWO receivers on the bench at present...

At the lower-tech end of the spectrum is a Theremin Regenerative Receiver I'm putting together for a little event later in the year (watch this space)...

Here's a rear view, which shows more of the giblets...

The Theremin gag is a reference to the "charming" consequences of hand capacitance that you get with these old-time toys. I'd nearly forgotten about all that stuff since playing with sensible, isochronous oscillators, like the AD9850 and the Si5351.

It is nice to have both ends of the "sophistication" spectrum on the go at the same time. Nice - but it does rather squeeze available time for other projects.

...-.- de m0xpd

Saturday, 25 July 2015

Patriotic Display

My TenTec Patriot is usable but user-hostile without a display. Fortunately, adding a display is the work of moments...

I haven't had many moments to spare since getting back home from the USA, but I found the few required recently and so - as you see above - the Patriot can now tell me what it is up to.

Adding the display is easy, as the heavy lifting is done for you - if you are content to attach a 20*4 LCD alphanumeric display over the standard ("Hitachi") interface. The interface is already accommodated in both hardware and the factory code. There is even a (poor) description of what to do in the user manual and a (much better) description in the comments within the factory code.

Here is a blow-by-blow account of how to do it, with some pictures to make it clearer for those who are not so familiar with these things.

Here is the relevant extract from wa4cdm's code ...

As you see, you need power and six lines to the display.

Here is the wiring you must arrange at the display end...

The LCD will have the usual 14 pins of the "Hitachi" interface plus two more for the LED backlight. Only four lines of the eight-bit data bus are used - the rest are left unconnected.

A simple trimmer potentiometer is used to set a bias voltage which makes the display readable. The comments in the code specify this as 10k - but the value isn't critical - I used 1k, because I had one at hand. Adjust this to get best results on the display. Too far one way and you'll see solid "bricks", too far the other and you'll see nothing.

You will need to run eight wires to the inside of the Patriot case - and you'll have to take the case top off to do this (remove the four screws at the side plus the nut and washer on the antenna socket). I had a scrap of ten-way ribbon cable about a foot long to hand, so I used that. I left all ten ways in place - perhaps I'll add some more push buttons or something in future with the extra two wires.

At the "Patriot" end of the wires you'll need to terminate on a 1*6 male 0.1 inch header strip and a 1*2 strip (or individual pins).

The relevant connection points - which are female headers -  are seen on this annotated section of the board layout...

and on this photo of the same area (the relevant connections are identified by the red boxes)...

Pass your cable through the rectangular aperture in the back panel (of the case top) and plug into the relevant connections, as shown below...

then reassemble your case.

Assuming your wiring is all correct, the display will work with the "factory" code - with no modifications required to the software at all - the factory software is already sending all the configuration commands and data (thanks to Stan, AK0B, for pointing out that the original version of this post didn't say anything about this important dimension).

The Patriot is a whole lot more user-friendly with a display.

Makes you wonder why it didn't come with a display (obviously the price of the case would increase dramatically) and why the instructions for adding one are presented in a manner clearly visible to those who already know how to go about doing it for themselves, but somewhat obscured to newcomers.

Funny old world.

...-.- de m0xpd

Saturday, 18 July 2015

Prototyping with Small Outline Transistors

A recent circuit idea I've been fooling with required a complementary pair of MOSFETs. I'm tripping over the familiar n-channel devices, but p-channel MOSFETs don't seem to breed in the m0xpd junk box. Accordingly, I had to spend some of my hard-earned money...

The easiest (close-to) complementary pair I could source (from traders on the familiar auction site - cheaper than going to a major component supplier, once the minimum order quantity and shipping is factored in) was the 2N7002 and the BSS83. They cost pennies and arrived in the blink of an eye. The only problem was that they are in SOT-23 packages, making prototyping a rather different proposition to something in a leaded package like a TO92.

As regular readers will know, I like to use solderless breadboards for breadboarding (what else). I needed a method of working with the SOT-23 transistor in a prototyping context.

Here's my solution. I'm sure it isn't original - but it has worked well for me, so it might be worth sharing...

The SOT-23 package has three pins on a 0.89 mm pitch. This is close enough to a 1mm pitch to ba able to fit on three adjacent "lands" of a SOIC ("Small Outline Integrated Circuit")  PCB footprint. Such a footprint will be found on adapters, which can be used to "convert" a SOIC to a dual-in-line format and which can be had very cheaply from on-line retailers.

Here is a SOT-23 transistor, placed on a 16 pin SOIC to DIL adapter...

In the photo above left, you can see the the lands are too short to allow convenient access to the pins on both sides of the SOT package. In the photo above right, you can see that the SOT-23 device doesn't quite bridge the gap between the two rows of lands for the IC (although one of my guys at work has succeeded in soldering the device in place in this position, creating solder bridges between the transistor pins and the nearest lands).

I found an 8-pin SOIC - DIL adapter, in which the lands are rather longer...

The transistor's pins are accessible on one row of the smaller PCB's long pads/lands. You can also clearly see the mismatch between the SOIC pitch and the SOT-23 pitch - not enough to cause a problem over only three pins.

So, I made up a single 8-pin "device", carrying a pair of complementary MOSFETs...

The transistors - too small for me to hold - are now easy to use in the solderless breadboard.

Here's the finished "device" in use in the prototyping exercise...

You can see how small it is in contrast to the neighbouring TO92 (a voltage regulator).

Now the prototyping is done it is time to use the circuit - but that's another story.

...-.- de m0xpd

Saturday, 11 July 2015

Displaying Variety

Having seen my adventures with the new display for the little Occam's Dirk rig, Dennis, g6ybc, from Kanga sent me a sample of a Nokia display rated for 5V operation.

I tried a hook up direct to the Arduino - running the "Occam's Dirk" code - and, sure enough, the display starts up as expected...

Notice there is no 3v3 connection for power and no logic level change. There are also no resistors etc. I did run the display in the new interface board (i.e. on 3v3 supply and logic), where it also behaved perfectly.

The only difference is the function of the backlight...

On the original display, the "Light" line has to be pulled to ground to cause the backlight to illuminate. On this new unit, the same line, which is labelled "BL", has to be pulled up to light the backlight diodes.

Here you can see I've hooked up the "BL" line to 3v3 on the Arduino...

When supplied by 3v3, the backlight draws 20mA and the diodes light up normally. If you try to power the backlight from 5V, it drawas over 60mA and (to my mind) the lights are too bright. If you wanted to run the entire display off 5V, I'd recommend a series resistor on the BL line.

The photo above doesn't show the backlight too well, as the illumination is dominated by the camera flash. Here's another photo with the flash off, proving that the display backlight really is doing its stuff (at least as well as these displays ever are backlit)...

I've no idea if this device is any different than any other Nokia 5110 type display and where the claim for 5V compatible operation arises from.

All I KNOW is that it worked when I tested it (see photos above) and it survived at least for twelve hours when I left it on overnight. Beyond that, I've no more information.

These displays, which are marked with the claimed supply voltage range on the rear silkscreen...

are available from Kanga (and, do doubt, elsewhere) and would save a good deal of trouble in logic level conversion.

Fortunately, having already made my little interface board, I don't have to wonder if the claim that the display will survive 5V is correct - others can make the test for me!

...-.- de m0xpd

Saturday, 4 July 2015

New User Interface

Having sorted out the software to allow my "Occam's Dirk" rig to use the Nokia 5110 display, I decided to rationalize the hardware. I made a new user interface board...

This board, almost exactly the same size as the 20*4 LCD display it replaces, also accommodates the rotary encoder and pair of push buttons that allows the user to interact with the radio for tuning and navigation of the simple "menu" system. That's "job done" - because it will allow the entire shebang to be packaged up as a small system, ready for portable operation, which was my goal.

The "rotary encoder and push buttons" combo used to be provided by one of my plug-in tuning modules, so the new board is actually a combination of a quintuple version of the level converter and a tuning module

After my last post, Tony, g4wif, reminded me how many people run these "Nokia" displays directly from 5V, with either no level conversion or with simplified interfaces (such as resistors). In truth, I have no first hand knowledge of how dire the consequences of 5V operation of these displays would be (in terms of reduction of life of the device, which some writers claim). However, for the price of the level converter, I prefer to do it right.

My level converter follows my previous recipe - only this time I exploited the greater space available to use 2N7000s in TO-92 packages, rather than the original, surface-mount BS138s, as this substitution both simplified the board design and saved pennies.

Here's the schematic...

The board design is produced as as two-layer - but I always intend to implement the top (red) layer with wire links, as my "back-yard PCB fab" only produces single layer boards...

Here's the copper side of the populated board - notice I used some surface mount resistors (down at bottom right) for convenience...

The component side of the board has little of visual interest when the display is unplugged...

You can't even see that I hadn't any through-hole tactile switches in the junk box - so had to improvise with SMD devices... 

I soldered single core wire links between the holes seen on Cu side and then soldered the switches to these wires on the component side. I think I got away with it; the wheeze has worked both mechanically and electrically.

Before you run away with the impression that everything in the garden is smelling of roses, let's remember the downsides we've already confronted (the congestion in the code and in the I/O pins) and acknowledge another downside...

The new display is small - that's the point. But it also displays fewer characters than the 20*4 display it has displaced.  It can display 6 lines of 12 characters - 72 in total. On paper, that is more than a 16*4 LCD. But to make a useful, readable display, I'm using rather less than that. So this little Nokia is something of a step down in visual richness than the larger LCDs. "There ain't no such thing as free lunch", or so we are told.

To deal with this reduction in available characters, my software re-formatted the display slightly. For a start, I didn't bother displaying the Mode - as the Occam's Dirk rig is CW only. The remaining display (in normal operating format) appears as seen below...

I have moved from displaying the frequency in MHz (with attendant formatting problems associated with the decimal point) to working directly in Hz.  I'm sure this has contributed to the speed and smoothness of the display and I will think about retro-fitting this to the code for all the other Occam's Rigs, the Parallel Rig and the VFOs.

Also, the particular digit being indexed by the rotary encoder at any time - thereby controlling the tuning speed - is indicated by the cursor seen below the numeral "7" in the image above. This moves left or right when the respective buttons are pressed, according to a variable in the code called "dfindex" (explaining why I've labelled it with this name in the photo). The active digit used to be indicated by a blinking digit in the LCD - I prefer this underline "cursor" approach on the new Nokia display - it is easier on the eye. It also makes a space between the frequency and the row of information below (you couldn't usefully display much information in this row, so using it as a movable cursor helps the overall look of the display).

The rest of the screen will be familiar to anybody who has used any of the previous pieces of software. For example, the banner line showing "Occam's Dirk" in the image above is used to display the Menu structure in Menu Mode and the space between this banner line and the frequency display line is used to display variables such as RiT.

With the introduction of the new board, this really is a neat little package now - a stack of shields, a short stack of filters and the new user interface. Trouble is - as ever - it is so much fun as a working rig here on the bench that I just don't seem to be able to get round to that last step of putting it in a box!

...-.- de m0xpd

Sunday, 28 June 2015

Nokia 5110 Display

I have been playing with a little monochrome LCD display, of the sort used in the original Nokia 3110 and 5110 phones...

I was interested to see if this kind of display technology would be of any use for the "Occam's Dirk" rig, when packaged up for mobile applications.

It was the overall size of the 20*4 alphanumeric display I had used before that was tempting me to consider an alternative - not the sense that I needed to display any more information - quite the opposite, in fact. This diminutive unit seems just the thing.

Unfortunately, there were two obvious disadvantages to confront - and one surprise! We'll deal with the obvious disadvantages first...

The old alpha LCD unit interfaced to the Arduino via I2C, which has no "cost" on the pin allocation, since the I2C interface is already used (in the Occam's Dirk rig) to talk to the Si5351 RF generator. Switching to the new Nokia LCD requires four or five pins - PROBLEM!

What's more, the little Nokia display talks in 3v3 logic language, whereas the Arduino UNO is running with 5V logic, so interface requires a level converter on these four or five pins. Not exactly a problem, but at least an inconvenience.

Some people use the 4050 as a level converter - but I decided to press into service one of my Octuple level converter plug-in modules to experiment with the screen.

I looked around on the internet and soon found the Adafruit Nokia library, which calls upon Adafruit's GFX graphics library (with which I was already familiar after having played with a color TFT screen).

I played around with the screen under the "pcdtest" example which Adafruit supply with the library and verified that all was working FB.

Unfortunately, when I tried to include the libraries with the Occam's Dirk program, the resulting code was too large to load onto the little microcontroller, so I decided to abandon the easy library approach and tried instead to use a bit-banging solution, borrowing from code found at Sparkfun and on the Arduino site.

After a while, I had the code ported to the new smaller display format and working well...

The display is fast compared to the ponderous old 'Hitachi' LCD device on the far side of the I2C-to-parallel module that piggybacks on the LCD.

Unfortunately, there was cost in porting the code - I had to lose the automated CQ calls in order to generate enough memory space to fit everything in. Still - this is a luxury I can do without.

The test set-up for development (on a breadboard) is seen here...

I did the coded development on a spare UNO and just had a tuning plug-in connected (so I could drive the user interface).

Once ported over to the Occam's Dirk rig itself, the whole system is now pretty small - ready to be packaged in a small "trail-friendly" enclosure...

For reference (mine as much as yours!) here's the allocation of the I/O resources on the Occam's Dirk rig, with the new Nokia display...

0 (Comms)
1 (Comms)
2 RotEncoder
3 RotEncoder
4 leftButton
5 rightButton
6 ditPin
7 dahPin
8 str8Pin
9 sideTonePin
10 RxMute
11 SCLK (Display)
12 SDIN (Display)
13 TxKey
A0 RESET (Display)
A1 DC (Display)
A2 SCE (Display)
A3 RotEncSwPin
A4 I2C
A5 I2C

I ran the display successfully with its reset line connected (via level conversion) to the Arduino reset but, since I had already been forced to abandon the automated CQ calls in software, I decided I may as well use the I/O line that was assigned to the switch that used to trigger them for an explicit software-controlled reset function for the display. If ever I reinstate the automated calls (or need an I/O line for another purpose) I can go back to the hardware reset.

Once I have had opportunity to tidy up the code (and if there is any interest) I might be persuaded to release a copy of this new version of the software. Certainly, my initial impression is that the cost of the pin-count congestion and the code congestion might even be worth it - the display looks and responds very nicely.

...-.- de m0xpd

Sunday, 14 June 2015

Patriot Games

I came home from Dayton to be presented with a TenTec Patriot, all thanks to my friend and benefactor, g6ybc...

The Patriot is a QRP CW and sideband rig for 40 and 20 metres, built on the ChipKit UNO 32 platform which, although it is based on a Microchip PIC processor, is approached through a Development Environment compatible with that of the Arduino. This makes the system more accessible for amateur programmers and - obviously - has some significant links to the work I've been doing with my Occam's Microcontroller project.

The Patriot is a development of TenTec's earlier "Rebel" CW rig. Both the Rebel and the Patriot are genuine Open-Source projects; both the hardware schematic and the code are published on-line and there are active user groups supporting these products. Indeed, without the user group, it is difficult to see that the product would be viable...

The Patriot is delivered with just a simple printed user guide - no connectors or accessories of any kind. Fortunately, all the connectors are pretty standard, as seen on the photo of the front and rear panels below...

Regular readers will know that microphones are about as rare as rocking horse poo here at m0xpd, so finding a mic for the new rig was always going to be a problem. Harder still was the 8-pin plug it is connected with (a TenTec standard, apparently). Sideband operation would have to wait - I would try CW first.

The rig has the usual stereo (tip-ring-sleeve) 3.5mm jack socket for a paddle input but the code supplied with the Patriot (as delivered) only supports a straight key or external keyer.

I was disappointed to measure that the power output on CW was only around 1.5 Watts, despite the 5 Watt claim in the specification. Ever since getting back to the UK, the bands have been in pretty poor shape and I have been dogged by QRM - so I wasn't too surprised to find it difficult to make an initial contact with this 1.5 W. But I WAS able to connect with other rigs of similar power - so, obviously, something was wrong...

On investigation, I found that something was, indeed, very wrong. The code as delivered appeared to have completely ignored the CW offset, such that when I was tuned to a station calling CQ, my reply was so far off as to be inaudible to the far-end station. The only way to get the situation close-to workable was to have the RiT control at maximum offset (full clockwise on 40, full anticlockwise on 20, I think it was - I can't now remember!). Even this didn't quite get to a "zero beat" - but, at least, I could make some contacts.

I decided to look into the code, so I downloaded the development environment, MPIDE, delighting at how compact it was compared to the ludicrously long downloads we are now being offered from the various offshoots of Arduino.

The IDE is familiar to anybody who has played with an Arduino before - so I quickly made modification to the band limits to make sure I didn't offend the terms of my license...

I also confirmed that there was indeed no attempt at sorting the CW offset and wrote a modification to include it. It took me an age to get this modification to work (because of another "blooper" in the code, which took me a while to spot), but eventually I had the CW offset sorted to my satisfaction.

These code changes are programmed into the rig through the USB connection on the rear panel, seen in the photo above.

Despite the terrible band conditions, I've now been able to have QSOs on 20 and 40, best of which was to Bandi, ha5aek, in Budapest.

The Yahoo users group, who I've now joined, seem to have spotted the CW offset issue and (no doubt) have a fix for it in their code.

After a few days' wait, a bag of three 8-pin plugs (technically they are line sockets, but we all know what we're talking about) arrived from Jan and Sandra of The Norfolk CB Shack...

No affiliation - other than the pleasure of trading with people who will send me three plugs for pretty much the same price everybody else seems to be asking for just one.

I was soon able to knock together a little microphone with a junk-box electret insert and a tactile switch...

A whistle into the mic causes the rig to put out a measured 4 Watts on 40m (although I haven't made any adjustments to the little "Mic Level In" preset on the side of the case).

Again, the bands haven't been collaborating since the arrival of the microphone - but I did manage a quick exchange with Sergey, ra1any, in St Petersburg on twenty metres yesterday. He gave me 5 and 5.

There's a lot more to be done, of which the priorities must be to hook up some kind of frequency display, to implement a keyer and to get the power on CW up to closer to the full gallon. But my first impressions of this little rig are positive enough.

Hardly surprising - they are preaching to the converted!

...-.- de m0xpd