Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that...

Preview:

Citation preview

1

Digital Homebrewing

Bob Okas – W3CD

Copyright 2004 Robert P. Okas

2

Introduction

Digital Homebrewing is a broad topic that encompasses:

• Hardware Logic Design• Software design• Combinations of both: Embedded Systems

3

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.

4

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

5

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.

6

Embedded SystemsHardware

Let’s start with the hardware.

Embedded systems obviously require some sort of platform.

The application dictates the size and method of construction.

7

Embedded SystemsHardware

There are several approaches to digital hardware:

Wire WrapDead BugPC Board – Cadsoft7

Manhattan Style – visit K7QO’s Website8

No-Brew

8

Embedded SystemsHardware

Wire-wrapped S-100 Single Board ComputerFront

9

Embedded SystemsHardware

Wire-wrapped S-100 Single Board ComputerBack

10

Embedded SystemsHardware

Printed Circuit / Dead Bug Video Display PrototypeTop

11

Embedded SystemsHardware

Printed Circuit / Dead Bug Video Display PrototypeBottom

12

Embedded SystemsHardware

Homebrew Printed Circuit

13

Embedded SystemsHardware

AA0ZZ’s Manhattan PIC-EL Prototype9

14

Embedded SystemsHardware

No-brew Hardware options:

PIC-EL board10

Micro 908 Board11

Atmel Butterfly12

Evaluation boards from Analog Devices, TI, Freescale and others

15

Embedded SystemsHardware

PIC-EL Board

Unfortunately, no longer availableFull hardware documentation on the Web10

Elmer 160 Course is an excellent tutorial on PIC programming

16

Embedded SystemsHardware

Micro-908

Powerful, self-contained processorAdapts easily to your base boardExcellent support by AmQRP11

17

Embedded SystemsHardware

AmQRP Micro-908

18

Embedded SystemsHardware

Atmel Butterfly

Low Cost - $20 at DigiKey13

Self-containedBattery poweredNumerous Enthusiasts14

KD1JV “Melt Solder” projects15, 16

19

Embedded SystemsHardware

Atmel Butterfly

20

Embedded SystemsHardware

Homebrewing From Scratch

What if No-Brew doesn’t satisfy needs?

21

Embedded SystemsHardware

Homebrewing From Scratch

Time for a homebrew project!1 Identify requirements2 Evaluate suitable processors3 Evaluate software development tools4 Repeat steps 1, 2 & 3 until satisfied

22

Embedded SystemsHardware

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

23

Embedded SystemsHardware

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!

24

Embedded SystemsHardware

Homebrewing From Scratch

Consider the Microchip PIC processors:InexpensiveAvailable in DIP packageVarious clock speedsVarious Flash memory sizes, limited RAMRISC Architecture yields high processing speedCurrent Consumption as low as 13 uALimited I/O pins, but numerous features like USARTs, A/D converters & TimersFree Development Software17

25

Embedded SystemsHardware

Homebrewing From Scratch

Consider the Atmel processors:InexpensiveAvailable in DIP packageVarious clock speedsLarge program Flash memory and RAMRISC Architecture yields high processing speedLow power consumptionNumerous features like USARTs, A/D converters & TimersFree Development Software18

26

Embedded SystemsSoftware

Once the processor is selected, it’s time to start writing code.

27

Embedded SystemsSoftware

There are two basic options:Assembly LanguageHigh Level Language - C

28

Embedded SystemsSoftware

Assembly Language

Most chip vendors provide free toolsIntegrated development environments provide:

Context-sensitive editorsAssemblers & linkersSimulators

29

Embedded SystemsSoftware

Assembly Language

MPLAB

MPLAB

30

Embedded SystemsSoftware

Assembly Language

Context-sensitive editors:Provide a convenient way to type in your programHighlight labels, variables, instructions and comments using various colorsHelp you avoid common mistakes

31

Embedded SystemsSoftware

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.

32

Embedded SystemsSoftware

Assembly Language

Simulators provide:A way to test your program without using actual hardwareA way to simulate hardware inputs

33

Embedded SystemsSoftware

CWhy 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.

34

Embedded SystemsSoftware

CPros and Cons:

It’s easy to port programs between chipsC is not supported on some processors.Commercial development packages cost $$$$.Development suites offer similar features as assembly language:

EditorsProgram Build toolsSimulators / Debuggers

35

Embedded SystemsSoftware

CThere 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

36

Embedded SystemsSoftware

CWinAVR Development Environment

37

Embedded SystemsChip Programming

Several options exist for programming the processorCommercial programmers: $150 - $200

Microchip ICD 2Quick Writer

JTAGHomebrewSelf-programming processors

38

Embedded SystemsChip Programming

JTAG can be used for programming and debuggingCommercial units are expensiveThe Web has plenty of homebrew designs

39

Embedded SystemsChip Programming

Homebrew DesignsPIC-EL boardKB0P’s programmer20

Numerous other designs can be found on the Web

40

Embedded SystemsChip Programming

Self-programming processors come with built-in loader softwareA serial cable is all that’s usually required

AmQRP HC-908Atmel Butterfly

Use the supplied software to download the code and store it in the chip

41

Embedded SystemsSummary

Powerful, highly integrated microcontrollers don’t require support logic.Hardware options are numerous:

Homebrew construction using various techniquesClub KitsLow cost evaluation modules

There are numerous no-cost software development packages available:

Chip vendors provide free assembly language toolsFree C language development tools.

42

Embedded SystemsSummary

Hardware design is easyOnly a few chips at most are requiredMany examples of projects on the WebCopy or adapt existing an existing designUse your favorite construction method

Software development is easyOnline tutorials like Elmer160 help you get startedCopy or adapt existing software21

Many low cost device programmers are available

43

References1 http://www.io.com/~n5fc/keyer.html2 http://www.amqrp.org/projects/cwdecod/cwdecod.htm3 http://www.sdrforum.org/4 http://www.amqrp.org/kits/NCKeyer/5 http://smallwonderlabs.com/swl_frq.htm6 http://www.amqrp.org/elmer160/board/index.html7 http://www.cadsoft.de/8 http://www.qsl.net/k7qo/manhattan.pdf9 http://home.comcast.net/~aa0zz/10 http://www.amqrp.org/elmer160/board/index.html11 http://www.njqrp.org/hc908/index.html12 http://www.atmel.com/dyn/products/tools_card.asp?tool_id=314613 http://dkc3.digikey.com/PDF/T043/0300.pdf14 http://www.avrfreaks.net/15 http://www.qsl.net/kd1jv/bfydds.HTM16 http://www.qsl.net/kd1jv/digiswr.HTM17 Google “MPLAB IDE” for latest version18 http://www.atmel.com/dyn/products/tools_card.asp?tool_id=272519 http://winavr.sourceforge.net/20 http://www.qsl.net/kb0p/pic.html21 http://home.earthlink.net/~vintage2

Recommended