You are on page 1of 43

Digital

Homebrewing
Bob Okas – W3CD

Copyright 2004 Robert P. Okas 1


Introduction

„ Digital Homebrewing is a broad topic that


encompasses:

• Hardware Logic Design


• Software design
• Combinations of both: Embedded Systems

2
Introduction

„ Pure hardware design uses only logic to get the


job done. For example a CMOS keyer1.

„ Pure software design assumes a general


purpose platform and an operating system, such
as a PC running Windows or Linux. Keyboards
and mice let you know you’re using a computer.

3
Introduction

„ PC software can be considered digital


homebrewing.

„ WD6CNF’s CW decoder program.2

„ Digipan, MixW, etc. are all homebrewed.

„ Software Defined Radio uses a PC platform for


many functions.3

4
Introduction

„ Embedded systems are usually task-specific and you


don’t interact with the processor like you would with a
PC.

„ Examples of embedded systems are NorCal keyer4,


Small Wonder Labs Freq-Mite5 , PIC-EL6 or the
microcontroller in modern rigs.

„ Today, we’ll focus is on homebrewing embedded


systems.

5
Embedded Systems
Hardware
„ Let’s start with the hardware.

„ Embedded systems obviously require some sort


of platform.

„ The application dictates the size and method of


construction.

6
Embedded Systems
Hardware

„ There are several approaches to digital


hardware:
 Wire Wrap

 Dead Bug

 PC Board – Cadsoft7

 Manhattan Style – visit K7QO’s Website8

 No-Brew

7
Embedded Systems
Hardware
Wire-wrapped S-100 Single Board Computer
Front

8
Embedded Systems
Hardware
Wire-wrapped S-100 Single Board Computer
Back

9
Embedded Systems
Hardware
Printed Circuit / Dead Bug Video Display Prototype
Top

10
Embedded Systems
Hardware
Printed Circuit / Dead Bug Video Display Prototype
Bottom

11
Embedded Systems
Hardware
Homebrew Printed Circuit

12
Embedded Systems
Hardware
AA0ZZ’s Manhattan PIC-EL Prototype9

13
Embedded Systems
Hardware

„ No-brew Hardware options:

‹ PIC-EL board10
‹ Micro 908 Board11

‹ Atmel Butterfly12

‹ Evaluation boards from Analog Devices, TI,


Freescale and others

14
Embedded Systems
Hardware

„ PIC-EL Board

‹ Unfortunately, no longer available


‹ Full hardware documentation on the Web10

‹ Elmer 160 Course is an excellent tutorial on PIC


programming

15
Embedded Systems
Hardware

„ Micro-908

‹ Powerful, self-contained processor


‹ Adapts easily to your base board

‹ Excellent support by AmQRP11

16
Embedded Systems
Hardware
AmQRP Micro-908

17
Embedded Systems
Hardware

„ Atmel Butterfly

‹ Low Cost - $20 at DigiKey13


‹ Self-contained

‹ Battery powered

‹ Numerous Enthusiasts14

‹ KD1JV “Melt Solder” projects15, 16

18
Embedded Systems
Hardware
Atmel Butterfly

19
Embedded Systems
Hardware
Homebrewing From Scratch

„ What if No-Brew doesn’t satisfy needs?

20
Embedded Systems
Hardware
Homebrewing From Scratch

„ Time for a homebrew project!


‹1 Identify requirements
‹ 2 Evaluate suitable processors

‹ 3 Evaluate software development tools

‹ 4 Repeat steps 1, 2 & 3 until satisfied

21
Embedded Systems
Hardware
Homebrewing From Scratch
„ Choosing a Processor
„ Many Factors determine the best choice:
‹ Cost
‹ Package
‹ Processing Speed
‹ Memory Type and Size
‹ Power Consumption
‹ I/O pins & Features
‹ Software Development Environment
22
Embedded Systems
Hardware
Homebrewing From Scratch
„ Cost – less that $10
„ Package – DIP or Surface Mount
„ Speed – Fast enough to do the job
„ Memory – Flash for the program, RAM for the variables
„ Power Consumption – The lower, the better
„ I/O pins & Features – Depends on application
„ Software Development Environment – Free is best!

23
Embedded Systems
Hardware
Homebrewing From Scratch
„ Consider the Microchip PIC processors:
‹ Inexpensive

‹ Available in DIP package

‹ Various clock speeds

‹ Various Flash memory sizes, limited RAM

‹ RISC Architecture yields high processing speed

‹ Current Consumption as low as 13 uA

‹ Limited I/O pins, but numerous features like USARTs, A/D


converters & Timers
‹ Free Development Software17

24
Embedded Systems
Hardware
Homebrewing From Scratch
„ Consider the Atmel processors:
‹ Inexpensive

‹ Available in DIP package

‹ Various clock speeds

‹ Large program Flash memory and RAM

‹ RISC Architecture yields high processing speed

‹ Low power consumption

‹ Numerous features like USARTs, A/D converters & Timers

‹ Free Development Software18

25
Embedded Systems
Software

„ Once the processor is selected, it’s time to start


writing code.

26
Embedded Systems
Software

„ There are two basic options:


‹ Assembly Language

‹ High Level Language - C

27
Embedded Systems
Software
Assembly Language

„ Most chip vendors provide free tools


„ Integrated development environments provide:
‹ Context-sensitive editors

‹ Assemblers & linkers

‹ Simulators

28
Embedded Systems
Software
Assembly Language
MPLAB

M
P
L
A
B

29
Embedded Systems
Software
Assembly Language
„ Context-sensitive editors:
‹ Provide a convenient way to type in your program
‹ Highlight labels, variables, instructions and comments
using various colors
‹ Help you avoid common mistakes

30
Embedded Systems
Software
Assembly Language
„ Assemblers:
‹ Convert your source program into opcodes the
processor understands. They work on individual
source files.

„ Linkers:
‹ Combine the outputs from the assembler and resolve
references to labels (jump and call instruction targets)
and any library functions.
‹ Produce the final binary program for the processor.

31
Embedded Systems
Software
Assembly Language
„ Simulators provide:
‹ A way to test your program without using actual
hardware
‹ A way to simulate hardware inputs

32
Embedded Systems
Software
C
„ Why use a High Level Language?
‹ It allows you to be efficient. A few lines of C replace
several lines of assembly.
‹ You don’t lose control of the hardware.

‹ You can easily port your program to another


processor.

33
Embedded Systems
Software
C
„ Pros and Cons:
‹ It’s easy to port programs between chips
‹ C is not supported on some processors.
‹ Commercial development packages cost $$$$.
‹ Development suites offer similar features as assembly
language:
 Editors

 Program Build tools

 Simulators / Debuggers

34
Embedded Systems
Software
C
„ There are alternatives to commercial packages.
‹ Just as homebrew software enthusiasts developed
Linux, there are folks who develop microcontroller
development tools.
‹ The good news is they’re free!
‹ WinAVR19 is one example

35
Embedded Systems
Software
C
WinAVR Development Environment

36
Embedded Systems
Chip Programming
„ Several options exist for programming the processor
„ Commercial programmers: $150 - $200
‹ Microchip ICD 2

‹ Quick Writer

„ JTAG
„ Homebrew
„ Self-programming processors

37
Embedded Systems
Chip Programming

„ JTAG can be used for programming and debugging


„ Commercial units are expensive
„ The Web has plenty of homebrew designs

38
Embedded Systems
Chip Programming

„ Homebrew Designs
‹ PIC-EL board
‹ KB0P’s programmer20
‹ Numerous other designs can be found on the Web

39
Embedded Systems
Chip Programming

„ Self-programming processors come with built-in


loader software
„ A serial cable is all that’s usually required
‹ AmQRP HC-908
‹ Atmel Butterfly
„ Use the supplied software to download the code and
store it in the chip

40
Embedded Systems
Summary
„ Powerful, highly integrated microcontrollers don’t require
support logic.
„ Hardware options are numerous:
‹ Homebrew construction using various techniques
‹ Club Kits
‹ Low cost evaluation modules

„ There are numerous no-cost software development packages


available:
‹ Chip vendors provide free assembly language tools
‹ Free C language development tools.

41
Embedded Systems
Summary
„ Hardware design is easy
‹ Only a few chips at most are required

‹ Many examples of projects on the Web

‹ Copy or adapt existing an existing design

‹ Use your favorite construction method

„ Software development is easy


‹ Online tutorials like Elmer160 help you get started
‹ Copy or adapt existing software21
‹ Many low cost device programmers are available

42
References
„ 1 http://www.io.com/~n5fc/keyer.html
„ 2 http://www.amqrp.org/projects/cwdecod/cwdecod.htm
„ 3 http://www.sdrforum.org/
„ 4 http://www.amqrp.org/kits/NCKeyer/
„ 5 http://smallwonderlabs.com/swl_frq.htm
„ 6 http://www.amqrp.org/elmer160/board/index.html
„ 7 http://www.cadsoft.de/
„ 8 http://www.qsl.net/k7qo/manhattan.pdf
„ 9 http://home.comcast.net/~aa0zz/
„ 10 http://www.amqrp.org/elmer160/board/index.html
„ 11 http://www.njqrp.org/hc908/index.html
„ 12 http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3146
„ 13 http://dkc3.digikey.com/PDF/T043/0300.pdf
„ 14 http://www.avrfreaks.net/
„ 15 http://www.qsl.net/kd1jv/bfydds.HTM
„ 16 http://www.qsl.net/kd1jv/digiswr.HTM
„ 17 Google “MPLAB IDE” for latest version
„ 18 http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725
„ 19 http://winavr.sourceforge.net/
„ 20 http://www.qsl.net/kb0p/pic.html
„ 21 http://home.earthlink.net/~vintage2

43

You might also like