digital homebrewing - norcal qrp · 2 introduction digital homebrewing is a broad topic that...

43
1 Digital Homebrewing Bob Okas – W3CD Copyright 2004 Robert P. Okas

Upload: buingoc

Post on 03-Sep-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

1

Digital Homebrewing

Bob Okas – W3CD

Copyright 2004 Robert P. Okas

Page 2: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

2

Introduction

Digital Homebrewing is a broad topic that encompasses:

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

Page 3: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

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.

Page 4: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

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

Page 5: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

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.

Page 6: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

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.

Page 7: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

7

Embedded SystemsHardware

There are several approaches to digital hardware:

Wire WrapDead BugPC Board – Cadsoft7

Manhattan Style – visit K7QO’s Website8

No-Brew

Page 8: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

8

Embedded SystemsHardware

Wire-wrapped S-100 Single Board ComputerFront

Page 9: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

9

Embedded SystemsHardware

Wire-wrapped S-100 Single Board ComputerBack

Page 10: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

10

Embedded SystemsHardware

Printed Circuit / Dead Bug Video Display PrototypeTop

Page 11: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

11

Embedded SystemsHardware

Printed Circuit / Dead Bug Video Display PrototypeBottom

Page 12: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

12

Embedded SystemsHardware

Homebrew Printed Circuit

Page 13: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

13

Embedded SystemsHardware

AA0ZZ’s Manhattan PIC-EL Prototype9

Page 14: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

14

Embedded SystemsHardware

No-brew Hardware options:

PIC-EL board10

Micro 908 Board11

Atmel Butterfly12

Evaluation boards from Analog Devices, TI, Freescale and others

Page 15: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

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

Page 16: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

16

Embedded SystemsHardware

Micro-908

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

Page 17: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

17

Embedded SystemsHardware

AmQRP Micro-908

Page 18: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

18

Embedded SystemsHardware

Atmel Butterfly

Low Cost - $20 at DigiKey13

Self-containedBattery poweredNumerous Enthusiasts14

KD1JV “Melt Solder” projects15, 16

Page 19: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

19

Embedded SystemsHardware

Atmel Butterfly

Page 20: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

20

Embedded SystemsHardware

Homebrewing From Scratch

What if No-Brew doesn’t satisfy needs?

Page 21: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

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

Page 22: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

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

Page 23: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

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!

Page 24: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

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

Page 25: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

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

Page 26: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

26

Embedded SystemsSoftware

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

Page 27: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

27

Embedded SystemsSoftware

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

Page 28: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

28

Embedded SystemsSoftware

Assembly Language

Most chip vendors provide free toolsIntegrated development environments provide:

Context-sensitive editorsAssemblers & linkersSimulators

Page 29: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

29

Embedded SystemsSoftware

Assembly Language

MPLAB

MPLAB

Page 30: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

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

Page 31: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

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.

Page 32: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

32

Embedded SystemsSoftware

Assembly Language

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

Page 33: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

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.

Page 34: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

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

Page 35: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

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

Page 36: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

36

Embedded SystemsSoftware

CWinAVR Development Environment

Page 37: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

37

Embedded SystemsChip Programming

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

Microchip ICD 2Quick Writer

JTAGHomebrewSelf-programming processors

Page 38: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

38

Embedded SystemsChip Programming

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

Page 39: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

39

Embedded SystemsChip Programming

Homebrew DesignsPIC-EL boardKB0P’s programmer20

Numerous other designs can be found on the Web

Page 40: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

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

Page 41: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

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.

Page 42: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

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

Page 43: Digital Homebrewing - NorCal QRP · 2 Introduction Digital Homebrewing is a broad topic that encompasses: • Hardware Logic Design • Software design • Combinations of both: Embedded

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