top of page
  • Writer's pictureDan Koellen AI6XG

LCD Display for the KD1JV TriBander

In an earlier post I described the modifications I made to the KD1JV designed TriBander to make it more useful for SOTA. The modifications were successful in reducing weight, reducing receive current, optimizing jack and control positions, and providing a preferred up facing display. The modified TriBander has been used for multiple SOTA activations, its 40/20/15 meter operation matching well with a 40 meter EFHW antenna.


But there were still attributes that I did not like:

  • headphone pigtail connection

  • AF gain jumper connection

  • cryptic LED symbols for menu modes

  • lack of MHz digit(s) readout

  • inaccurate frequency readout due to inability to calibrate the DDS

  • inability to read LED display in full sun


Of these attributes, the inability to read the LED display was the most troublesome. Most of the summits I activated are in full sun so the display severely limits the ability to use the radio. The inaccurate frequency readout was also irritating to some of my chasers. With this in mind, I modified the relay board from the prior project to resolve the above listed issues. A LCD display, fully readable in full sun and with an operational dimmed backlight, now replaces the LED display. All symbols used for menu modes are now displayed as text. In addition, MHz digits are now displayed, eliminating the need for band indicators. Programmable frequency offsets, one for each band, are now included in the firmware to compensate for DDS calibration error. And the headphone jack and AF gain control are on their own board providing a more robust connection and layout. All new circuitry was implemented using surface mount devices (SMD). The latching relays and associated transistor drivers were unchanged from the previous version.



Figure 1 The LCD Version of the TriBander

It Works!

The LCD version of the TriBander has been used to activate summits. It has been a joy to operate with the display fully readable in full sun and the frequency readout more accurate. It is reassuring to have the full frequency readout to confirm the band that you are operating on. And it is convenient to have readable text when changing modes of operation.



Figure 2 Activation of W6/NS-279

The modifications required were extensive but worthwhile, I enjoy using this rig much more and I am not limited to shaded summits.


LCD Version Modifications

The modifications to the relay board are described in detail in the following sections. I strongly recommend that you review the prior version post (i.e. the LED version). The assembly and alignment of the main board remains the same and will not be repeated here. The common elements including the relays and band switching are basically the same with the description and other details not repeated. The Schematics and Gerber Files for the printed circuit board, and other applicable files, are available on GitHub.


The approach to this modification is to convert the segment and digit logic to that that would be recognized by a LCD display. A more direct approach would be modifying the firmware on the Atmel microcontroller on the main board of the TriBander. But the firmware for the microcontroller is not available (at least to me) making that an unfeasible approach. A microcontroller with more IOs than the previous version was needed to accept the digit and segment logic. This, and the ports needed to drive the LCD, drove the decision to switch to all SMDs for implementation on the same board size as the prior version.


The selection of the display itself defined the design approach. The LCD display used in my LNR mtr3b had the small size I was looking for, as well as complete readability in full sun. And the current consumption is low as well. After evaluation of the mtr3b and investigating available displays, the Newhaven NHD-C0216CZ-FSW-FBW-3V3 chip on glass LCD was chosen. This display is a small 2 x 16 character display with a white LED backlight, a serial interface and operates on 3.3 volts.


Since the TriBander main board operates on 5 volts, the LED segment and digit logic is 5 volts. Translation between 5 volts and 3.3 volts needed to occur somewhere between the TriBander main board and LCD, either on the segment and digit logic signals or between the microcontroller and the LCD. Ultimately it was decided to translate voltage levels at the input of the LED segment and digit logic and run the entire board at 3.3 volts. An advantage to this is that only a 3.3 volt regulator is required on the LCD relay board.


Figure 3 is a block diagram of the LCD relay board and its interface to the TriBander main board.



Figure 3 Block Diagram of LCD Relay Board and Interface to TriBander Main Board

Decoding LED Segments and Digits

The original display for the TriBander is a four digit seven segment LED that displays the 100 kHz, 10 kHz, 1 kHz and 100 Hz digits. When the radio is in a menu mode - such as RIT, tuning or CW speed - a corresponding symbol is displayed in the leftmost digit position.


The display is multiplexed with each digit displayed for 1 mSec as shown in figure 4.



Figure 4 Digits 1 and 2 Strobing, Digits 3 and 4 are similar

Digits are active high and act as the current source for the particular digit. The segments are active low, providing current return through 2k0 resistors on the TriBander main board. Figure 5 shows the relationship between digit 1 and one of its segments. The segment appears not to return to ground in figure 5 because the measurement was made at the 16 pin socket. The 2k0 resistors, on the main board, were dropping about 3 volts to ground due to the segment current flowing through them. With no LED display there will be no segment current flow, allowing the segment to fully return to ground. This is the situation for the LCD relay board.



Figure 5 Timing for the LED Segments and Digits

The LED digits and segments are sampled at the 16 pin socket and directly routed to the 74LVC244A which converts the 5 volt signals to 3.3 volts. The digits and segments are then detected by the PIC16F887 microcontroller for decoding.


When I decode (or encode) seven segment displays I prefer to have all segments connected to a single 8 bit wide port. The segment logic then can be handled as a single 8 bit wide byte and read as one step to the port. In this application, port c (PORTC) is the port used for the segments. The digits were read in on port d (PORTD). I use a spreadsheet to translate the segments that are active into the unique 8 bit byte for a particular port setup. This spreadsheet, available in GitHub, is for numbers 0-9, hex values a-f, blank display and the special symbols used for menu items.


Each digit is sampled every 250 uSecs, reading in the segment states. If a change in segment states is detected then the leftmost digit character is determined. The leftmost digit is an indication of the mode of the operation. The normal mode is display of the operating frequency. Other modes selected by the menu are indicated by special characters at the leftmost digit. The mode of operation is detected which determines which decoding routine will used.


Menu Item Decode

If operation is a menu mode, e.g. RIT, the segments are directly decoded for each digit and converted to a corresponding value for the LCD to display. For example, if the segments for the number 2 are detected as active then the corresponding value (0x32) is written to the LCD in the corresponding position. The value written is the location in the LCD font map for the particular character to be displayed. The mode is also determined and appropriate string text is written to the LCD to indicate the mode in easy to understand manner. Figure 6 shows the display sequence for RIT. The other menu modes have a similar display.



Figure 6 RIT Mode Showing Positive Shift, Negative Shift and Return to Zero Increment


Frequency Display

In the normal operating mode the frequency is displayed. The segments for each digit are decoded to the numerical value rather than the font map location as done with the menu modes. This is done so the frequency offset may be added to what would have been the displayed value on the LED display. After the value with offset is calculated, the resulting value for each digit is determined and is displayed in the appropriate position. The appropriate ten and single MHz digits are added to the display for the particular band that is being operated on. Figures 1 and 2 show frequency readout for 20 and 40 meters respectively.


Writing to the LCD

Many character LCDs are written to using either a four or eight bit wide command and data. The LCD used here uses a serial interface to receive eight bit commands and data. The initialization sequence and basic write function code was adapted from the manufacturer's sample code for an Arduino. The serial data is bit banged rather than using the microcontroller's internal serial interface. Functions for display clearing, go to a position and writing a text string were also developed.


The LCD displays two lines of characters as its default operation. It can also display one line of characters of double height. I use the single line mode for the display so that the font is easier for me to read. The display will revert to the two line mode if the band pushbutton switch is pressed at power up. The code may modified so that the LCD operates in two line mode, providing space for more than frequency to be displayed during normal operation. Figure 7 shows the LCD in two line mode.



Figure 7 LCD in Two Line Mode


LCD Backlight

The LCD backlight may be turned on by pushing the dim pushbutton switch. This switch cycles the LCD backlight through a sequence of 0%, 25%, 50% and 100% brightness. A separate microcontroller, PIC12LF1840, is used to control the LCD backlight intensity because using the main microcontroller (PIC16F887) resulted in bright flashes. This is because the microcontroller was performing other functions at the same time it was dimming the LCD backlight. The PIC12LF1840 controls the amount of time the backlight is on by switching a solid state relay (SSR), interrupting the backlight current. Figure 8 shows the LCD with the backlight on. I normally operate with backlight turned off for reduced receive current consumption.



Figure 8 The Backlight in Operation

Audio Gain and Headphone Jack

The previous relay board had the audio gain potentiometer mounted on the board and connected via a jumper to the AF gain 3 pin header. The headphone jack was connected via a pigtail to the headphone 2 pin header. That arrangement with connectors and pigtails was clumsy and potentially not too reliable. For this version the audio gain potentiometer was removed from the relay board. A smaller potentiometer was mounted on a piece of perfboard with a three pin female header connecting directly onto the AF gain 3 pin header. On the same perfboard, a TRS jack for the headphone was mounted and connected to a 2 pin female header. That two pin female header directly connects onto the headphone 2 pin male header. A nylon spacer, screw and nut are used to secure the perf board to the main board. There is a conveniently located mounting hole on the main board to secure the nylon spacer. The resulting board is seen on the lower left in most of the figures.


Assembly

The assembly of the main board, the kit supplied LED display board and the LCD relay board follows the same steps that were outlined in the previous LED relay board version. Refer to that post when assembling and aligning the TriBander main board and the relay board.


With the main board operational, the frequency offset for each band should be determined. Using the kit supplied LED display board, transmit in each band into a dummy load. Listen for the signal on a well calibrated receiver for the actual transmitting frequency. If the difference between the displayed frequency and the actual frequency is 100 Hz or more than an offset should be used. The offset will be the actual frequency (from the receiver) minus the displayed frequency (on the LED display board), and then divided by 100. The offset for each band should be included in the main.c code for the PIC16F887 microcontroller. For example, in my case, for a TriBander displayed frequency of 7060.0 kHz the actual frequency as monitored was 7059.9 kHz. The offset was -100 Hz, so a frequency offset of -1 (-100Hz/100) was used in the main.c code.


An important note for the LCD version is that the operating voltage of the board is 3.3 volts. When programing the microcontrollers be sure to use 3.3 volts as the target voltage. If 5 volts is used the LCD will likely be damaged.


Firmware

The code for each microcontroller is available on GitHub.


LCD Backlight Controller PIC12LF1840

The firmware for the microcontroller is fairly simple with only a config file in addition to the main program. This microcontroller receives a two bit command from the main microcontroller for dimming levels of 0%, 25%, 50% and 100%. Depending on the dimming level, the function backlight_dim(unsigned char dim) returns a one for a corresponding portion of a 180 program count cycle. This is outputted to a SSR that switches the LCD backlight current on and off.


PIC16F887 Microcontroller

The PIC16F887 microcontroller controls all remaining functions of the LCD relay board. The microcontroller is set up and looped operation using main_TQFP.c and configBits_tqfp.h files. The frequency offset for each band should be edited in main_TQFP.c


The band selection and relay drivers are the same as for the LED relay board. The band_select_TQFP files setup the ports and variables, and define the functions for band selection.


The LCD initialization, write and control functions are defined in SI_LCD_dk_TQFP files.


LED segment port assignments, decoding functions and display updating functions are defined in segment_to_LCD_TQFP files. The file segment_to_LCD_TQFP.h assigns an input for each LED segment and digit, and defines the segment 8 bit PORT value for each LED displayed character. The file segment_to_LCD_TQFP.c defines the functions that convert the segments for a digit to either the LCD character value (i.e. font map location) or to the numerical value for frequency offset calculations.




229 views0 comments

Recent Posts

See All

Comments


bottom of page