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