Digital QRP BreadBoard      

BreadBoard

(column #2)


 

HC908 Schematic

 

HC908 Sketch

 

HC908 Photo

 

Scaling Voltmeter Source code

 

BreadBoard photo #1

 

BreadBoard photo #4

 

Enclosure

 

Block Diagram

 


Back to 
Digital Homebrewing Home Page

 


HC908 Daughtercard
and our first software application: The Scaling Voltmeter

In the previous installment of this section, we overviewed the concept and goals of the BreadBoard project. This time we’re going to get into the details of the first hardware and software blocks – the microcontroller “heart” of the system, some I/O in the form of a keyboard and LCD, and an analog input port that will serve us in the first BreadBoard application a simple scaling voltmeter.

Background
For those tuning into this BreadBoard project for the first time, here’s a brief recap of what’s happening. The Digital QRP BreadBoard is an evolving homebrew project being designed and presented in this column, serving as a general purpose QRP accessory that can be used on the operating bench and in the radio shack in a variety of ways. Approximately 6" x 9" x 1.5" in size, this project contains a number of peripherals that QRPers find useful in applications around the shack – an LCD, shaft encoder, DDS chip, audio amplifier, RS-232C serial port, general purpose I/O buffers, and a daughterboard expansion port all provide convenient design flexibility. 

You'll be able to download new software from this website and reprogram your Digital BreadBoard, allowing it to serve as a memory keyer, an audio filter, a keyboard-driven data terminal, a controller for your HF rig, a frequency counter, and more.  Sharp readers will glean that we'll even be able to make an inexpensive portable PSK31 controller with the DSP daughterboard to be introduced in a near-future installment of the Digital BreadBoard project.

The Digital QRP BreadBoard is being offered as a kit. See reference at the end of this segment for ordering details.

The Microcontroller
We selected the popular Motorola 68HC908AB32 microcontroller as the heart of the BreadBoard project. It was necessary to select such a CISC (complex instruction set controller) instead of a low-end RISC (reduced instruction set controller) like those in the Microchip PIC family. The software already being designed to control the many peripheral chips and I/O functions would be present great programming challenges in a RISC device because of inherent program memory and register memory addressing restrictions. The 'HC908 is the Motorola equivalent of the popular 8051-class of processors from Intel, SST, and others offering plentiful I/O capabilities, unrestricted addressing and high clock speeds. 

 

Another deciding factor in the selection process was the massive amount of I/O pins available for controlling all the hardware peripherals in the system – the LCD, DDS, pushbuttons, LEDs, 7-segment displays, keyboard, keypad, serial port, et al. Eight separate I/O ports provide up to 51 general purpose input and output pins. Many of these pins are software configurable to serve as analog interfaces, contain integrated pull-up resistors, and couplings to the interrupt structure of the processor. We’ll truly be able to work wonders in interfacing the HC908 to all the devices we want to control.

Working in conjunction with the physical I/O pins, the HC908 has some internal macro functions that greatly ease the programmer’s job. The microcontroller has built-in modules for asynchronous  communications providing an RS-232 serial port, timer modules for frequency counting and timing, programmable interrupt timing for precise interval control, an 8-bit/8-channel A-to-D converter, a keyboard interrupt module, and a watchdog timer.  This microcontroller is really quite amazing and is perfect for use on our BreadBoard.

Plentiful memory is a must for a CISC microcontroller being used in a large application such as ours. Our HC908 has 32 kilobytes of flash memory that will hold the software program itself. There is 1 kilobyte of RAM space available for data variables and other time-changing data. The controller also has built-in EEPROM (electrically erasable programmable read only memory) that will be used to store user-set configuration, calibration and custom string data that needs to be used every time the BreadBoard is turned on.

From a software perspective, the HC908 supports an enhanced version of the Motorola HC05 programming model. It has 16 addressing modes (direct, indirect, indexed, etc.), a 16-bit index register and stack pointer, and extensive loop controls (e.g., BRCLR n). It supports memory-to-memory data transfers and can perform fast 8x8 bit multiplication and 16/8 division. These last two capabilities will prove quite valuable when it comes time to scale input values and calculate SWR, power, and filter coefficients. Finally, the microcontroller’s hardware and software architecture is optimized for controller applications and for C-language support as we’ll see downstream when the Metrowerks “Code Warrior” development tool is presented.

The HC908 Daughtercard
As shown in the HC908 Daughtercard schematic, this module is a "self-contained microcontroller board" with onboard voltage regulation, clock/oscillator components, RS-232C serial port and Reset components. Board connectors are 0.1"-spaced dual-row pin header sockets, allowing board to be plugged into mating pin headers on the Digital QRP Breadboard base board, or on any other project base board!.

Although not yet mentioned, sharp readers would probably suspected a potential problem with our selection of the 68HC908AB32 microcontroller. A device having so many pins (specifically 64) would be required to be packaged as a PQFP surface mount device – a plastic quad flat pack. But not to worry! There is a plan …

To enable homebrewers to start building right away, we’ve created a 2” x 2” pc board for the surface mount HC908 microcontroller.

 Also contained on this daughtercard are the components required for clock generation, a MAX-232 chip for serial communications, a voltage regulator and a RESET pushbutton. All I/O pins of the HC908 are brought out to edge connectors that permit this daughtercard to be plugged into mating pin headers on a prototype base board containing all other components. Once the design has solidified and stabilized in the coming months, the microcontroller daughtercard can be unplugged and transferred to the pc version of the base board.

A sketch of the HC908 Daughtercard is shown in Figure 5 and a photo of it is shown in Figure 6.  The 64-pin PQFP device is soldered in the center of the card’s top side and its many I/O pins are connected by top-side traces to two 34-position sockets located on either side of the card. These long sockets will plug into mating pin headers located on the base board, as illustrated.

A small pushbutton is also provided on the top side of the daughtercard. This normally-open momentary contact switch serves as a manual RESET for the system.

A 2-position pin header and LED are mounted in the lower corner of the card’s top side, serving to configure and indicate the boot loader feature. (More on this feature in the Programming section.)

The bottom side of the Daughtercard contains the surface mount components required for clock generation on the microcontroller – a crystal, two capacitors and a resistor. Also located on the bottom side are the LM78L05 3-terminal voltage regulator and associated filter caps, and the components used for serial interface – the MAX-232 level translator for the RS-232 communications port and the five electrolytic capacitors used for charge pump operation.

Creating a daughtercard in this manner for the microcontroller proved to be a very enabling decision. Besides being able to transfer the card from the prototype base board to the final pcb base board, one could easily use the HC908 Daughtercard for other applications. There is lots of capability in this little 2”-square standalone card – just supply 9-12Vdc and a serial comm line from your PC and you’ll be able to download and burn new programs into your HC908 microcontroller.

Getting Software into the HC908
One of the prime goals for this project was to have the BreadBoard be easily and inexpensively reprogrammable, even after built and used long-term by the homebrewer. Of course the unit has ample onboard flash memory, simplifying the board design and making for a non-volatile project.  (That is, the microcontroller retains its program memory even when power is removed.) 

Insert file” daughtercardPic.gif”

 

Insert file” sketch.gif”

 
But getting the software program into the device is sometimes a concern for microcontroller homebrew enthusiasts due to the expense of the "programmer". Oftentimes it's necessary to purchase a $100-or-more programming board from the manufacturer that will allow you to burn your custom software into the controller's flash memory.  In many cases one is able to homebrew this programmer (as in the case of the PIC devices), however this is yet another project that must be done before getting to the fun part of experimenting with your intended project.

However the good news is that our 68HC908AB32 device has the ability to be in-circuit programmed, which means that a conventional +5V power supply and proper timing is all that's required in order to burn a new program into its flash memory ... even while on the target pcb of your project! We've developed a special boot loader program that allows you to download the binary image of your program over the built-in RS232 serial data port connected to your PC. All you need to do is develop a program with the (free) software development tools on your PC, download it to the BreadBoard and bingo, you'll be running your new and improved program.  In this way you'll be able to take advantage of newer software programs that we'll be providing for download on this website, or you can develop your own customized versions of the programs.  Pretty cool, eh?

When it is time for you to get a new software program into your HC908, connect your PC’s serial port to the daughtercard, install the jumper on the Boot Loader pin header and then press the RESET pushbutton to reset the processor. The daughtercard’s LED will illuminate, indicating that the boot loader software is running. You’ll next transfer the binary file of your new software from your PC using a communications program like HyperTerminal (standard in the Windows Accessory folder). Once the software is downloaded to the HC908 controller, the boot loader proceeds to burn the software into the controller’s flash memory. When successfully completed, the daughtercard’s LED is turned off and the new program be run. (More detailed instructions for this boot load operation are supplied in the kit manual and on this column’s companion website.)

Our First Program: The Scaling Voltmeter
If you’re intending on building up the Digital QRP BreadBoard and experimenting along with us in this journey, the first thing you’ll need to do is order the HC908 Daughtercard. It comes assembled, tested and pre-programmed with the boot loader program, and with the first software application for our BreadBoard – the Scaling Voltmeter program.

The Scaling Voltmeter software program is designed to read an analog input port, scale the value to reflect the actual voltage, and display that voltage reading on the LCD. A standard IBM-compatible PC keyboard is used by the operator to input the scaling factor and to command the readings to be started. The program bay be used to read the relative power by connecting the analog input pin through a suitable interface circuit to the RF output of a transmitter. Refer to the diagram below for an example application.

The voltmeter program is constructed by designing some common libraries of routines for: LCD output, keyboard input,  analog input, system initialization, and for the math that performs the scaling. These routines are “glued together” in the mainline of the program that executes when power is applied to the system. The liberally-commented source code for this software program is posted on our companion website and is available for individual scrutiny. The website also goes into much greater description on the software construct and operation, thus providing an instructional tutorial, of sorts.

Gathering parts for the building up the first BreadBoard project is very simple. The HC908 Daughtercard is available from the NJQRP Club. The IBM-compatible keyboard can be borrowed from your main PC, or you could obtain a surplus mini-keyboard like the Dauphin unit pictured in Figure 4. (We've collected a number of these keyboards and will be offering them as part of the Kit when it's made available later this year.) The LCD can be any standard 2-or-4-line display sporting the popular Hitatchi 44780 controller chip. (Digi-Key and Jameco have several applicable displays.) Just ensure the connecting pins match the functions shown on the BreadBoard schematic diagram. Then all you need to do it get a few diodes, caps and resistors for the analog interface, melt some solder to hold it all together and apply a 12V dc power supply. If all is wired properly, you’ll see a welcome message displayed on the LCD and you’ll be in business!

Next Time
Next time
in these pages we’ll be adding some exciting frequency synthesis capability to the BreadBoard, leveraging the DDS VFO project described in the first section. Everybody loves a VFO … well, we’re shortly going to have a real flexible one to use as a frequency generator, a local oscillator, a test source, and more. Join in with us and stay tuned for some real fun coming this way!

Acknowledgements

Special thanks go to Craig Behrens, NM4T, who has been a collaborator, an enabler and a major cheerleader for the Digital QRP Breadboard project. His encouragement and contribution has been  a decisive factor in bringing this project to the QRP community.

Notes

1)       HC908 Daughtercard – assembled, tested, with manual, pre-programmed with the software in this column. Send $25 check or Money Order to “George Heron, N2APB”, 2419 Feather Mae Ct, Forest Hill, MD  21050. (DX orders add $5 extra please.) PayPal payment also accepted, send to n2apb@amsat.org .   The Digital QRP Breadboard kit is being provided by the volunteer efforts of NJQRP Club. Parts procurement, manual publication, order processing and sorting/shipping operations are being handled by the club’s “kitting team”: AA3UR, WA3OWT, KE3S, NU3Y and N2CX – thanks guys! 


Page last modified: May 20, 2002

Copyright 2002 G. Heron, N2APB

  n2apb@amsat.org